commit f2a44642c1228bd6c2cb7e1c29962ca9f4302729
parent b54ef34b63b031d0953ecd0f3b37c9df573d88b2
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 15 Jul 2024 15:23:19 +0200
Correction of Dirichlet boundary condition definition
No reference temperature was defined on a surface oriented towards a
fluid and on which a Dirichlet boundary condition was imposed (keywords
T_BOUNDARY_FOR_SOLID[_PROG]). Stardis therefore notified an error and
rejected radiative trajectories reaching such interfaces without a
reference temperature.
In this commit, these interfaces now have a reference temperature that
is set to the imposed surface temperature. The reference temperature
range has also been updated to take account of these "new" temperatures.
Note that this is only a temporary correction, which has the merit of
not requiring an update of the file format, and thus leaving Stardis
compatible with existing input files. But in fact, this reference
temperature should be defined by its own value, different from that
imposed for a specific Dirichlet condition. In this way, the user could
define a reference temperature that would make sense independently of
the current configuration, as he or she might wish to do, for example,
when evaluating a green function.
Diffstat:
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/stardis-intface.c b/src/stardis-intface.c
@@ -560,8 +560,12 @@ create_intface
fluid_side_shader->emissivity = interface_get_emissivity;
interface_props->emissivity = 1;
ASSERT(SDIS_TEMPERATURE_IS_KNOWN(intface->d.t_boundary->imposed_temperature));
- interface_props->imposed_temperature
- = intface->d.t_boundary->imposed_temperature;
+ interface_props->imposed_temperature = intface->d.t_boundary->imposed_temperature;
+ /* Temporarily set the reference temperature to the set temperature.
+ * TODO use a different reference temperature when the file format is
+ * updated to allow explicit definition by the user. */
+ fluid_side_shader->reference_temperature = interface_get_ref_temperature;
+ interface_props->ref_temperature = intface->d.t_boundary->imposed_temperature;
break;
case DESC_BOUND_T_FOR_SOLID_PROG:
if(sdis_medium_get_type(def_medium) != SDIS_SOLID) {
@@ -592,6 +596,10 @@ create_intface
interface_props->get_emissivity = emissivity_1;
interface_props->get_temp = intface->d.t_boundary_prog->temperature;
interface_props->prog_data = intface->d.t_boundary_prog->prog_data;
+ /* Temporarily set the reference temperature to the set temperature.
+ * TODO use a different reference temperature when the file format is
+ * updated to allow explicit definition by the user. */
+ fluid_side_shader->reference_temperature = intface_prog_get_temp;
break;
case DESC_BOUND_F_FOR_SOLID:
if(sdis_medium_get_type(def_medium) != SDIS_SOLID) {
diff --git a/src/stardis-parsing.c b/src/stardis-parsing.c
@@ -1079,6 +1079,12 @@ process_t
goto end;
}
+ /* Temporarily use the set temperature as a reference temperature.
+ * TODO use a different reference temperature when the file format is updated
+ * to allow explicit definition by the user. */
+ stardis->t_range[0] = MMIN(stardis->t_range[0], t_boundary->imposed_temperature);
+ stardis->t_range[1] = MMAX(stardis->t_range[1], t_boundary->imposed_temperature);
+
ASSERT(sz <= UINT_MAX);
ERR(read_sides_and_files(stardis, 1, (unsigned)sz, pwordexp, &idx));