stardis-solver

Solve coupled heat transfers
git clone git://git.meso-star.fr/stardis-solver.git
Log | Files | Refs | README | LICENSE

commit 4d764d4ab93fc99e69f2404380dc0cf0da3555ff
parent 7d51c9f3691f97b5e266b7358b36abeea470f29a
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 27 Oct 2021 16:59:11 +0200

Separate the reference temperatures from the limit conditions

As a consequence, we add a reference ambient radiative temperature used
to linearise the radiative transfer when the sampled path reaches the
infinity.

Diffstat:
Msrc/sdis.h | 17+++++++++++++----
Msrc/sdis_Xd_begin.h | 5+----
Msrc/sdis_green.c | 5++++-
Msrc/sdis_heat_path_boundary_Xd_solid_fluid_picard1.h | 18+++++++++---------
Msrc/sdis_heat_path_radiative_Xd.h | 6+++---
Msrc/sdis_realisation.c | 6++----
Msrc/sdis_realisation_Xd.h | 16+++++-----------
Msrc/sdis_scene.c | 15++++++++-------
Msrc/sdis_scene_Xd.h | 4++--
Msrc/sdis_scene_c.h | 4++--
Msrc/test_sdis_conducto_radiative.c | 4++--
Msrc/test_sdis_conducto_radiative_2d.c | 4++--
Msrc/test_sdis_scene.c | 24+++++++++++++++---------
Msrc/test_sdis_solve_boundary_flux.c | 8+++++---
Msrc/test_sdis_solve_camera.c | 12+++++++++---
Msrc/test_sdis_solve_probe.c | 12++++++++----
Msrc/test_sdis_unstationary_atm.c | 8+++++---
Msrc/test_sdis_utils.c | 6++++--
18 files changed, 99 insertions(+), 75 deletions(-)

diff --git a/src/sdis.h b/src/sdis.h @@ -360,6 +360,15 @@ typedef void double pos[], /* Output list of vertex coordinates */ void* ctx); +struct sdis_ambient_radiative_temperature { + double temperature; /* In Kelvin */ + double reference; /* Used to linearise the radiative transfert */ +}; +#define SDIS_AMBIENT_RADIATIVE_TEMPERATURE_NULL__ {-1, -1} +static const struct sdis_ambient_radiative_temperature +SDIS_AMBIENT_RADIATIVE_TEMPERATURE_NULL = + SDIS_AMBIENT_RADIATIVE_TEMPERATURE_NULL__; + struct sdis_scene_create_args { /* Functors to retrieve the geometric description */ sdis_get_primitive_indices_T get_indices; @@ -372,7 +381,7 @@ struct sdis_scene_create_args { size_t nprimitives; /* #primitives, i.e. #segments or #triangles */ size_t nvertices; /* #vertices */ double fp_to_meter; /* Scale factor used to convert 1.0 in 1 meter */ - double trad; /* Ambiant radiative temperature */ + struct sdis_ambient_radiative_temperature trad; /* Ambient radiative temp */ double tmax; /* Max temperature used to linearize the radiative temperature */ }; @@ -384,7 +393,7 @@ struct sdis_scene_create_args { 0, /* #primitives */ \ 0, /* #vertices */ \ 1.0, /* #Floating point to meter scale factor */ \ - -1.0, /* Ambient radiative temperature */ \ + SDIS_AMBIENT_RADIATIVE_TEMPERATURE_NULL__,/* Ambient radiative temperature */\ -1.0, /* Maximum temperature */ \ } static const struct sdis_scene_create_args SDIS_SCENE_CREATE_ARGS_DEFAULT = @@ -829,14 +838,14 @@ sdis_scene_set_fp_to_meter SDIS_API res_T sdis_scene_get_ambient_radiative_temperature (const struct sdis_scene* scn, - double* trad); + struct sdis_ambient_radiative_temperature* trad); /* Set scene's ambient radiative temperature. If set negative, any sample * ending in ambient radiative temperature will fail */ SDIS_API res_T sdis_scene_set_ambient_radiative_temperature (struct sdis_scene* scn, - const double trad); + const struct sdis_ambient_radiative_temperature* trad); /* Get scene's maximum temperature */ SDIS_API res_T diff --git a/src/sdis_Xd_begin.h b/src/sdis_Xd_begin.h @@ -25,17 +25,14 @@ struct sdis_heat_path; struct rwalk_context { struct green_path_handle* green_path; struct sdis_heat_path* heat_path; - double Tarad; /* Ambient radiative temperature */ - double That; /* Upper bound temperature */ + /* That is the upper bound temperature */ double That2; /* That^2 */ double That3; /* That^3 */ }; #define RWALK_CONTEXT_NULL__ { \ NULL, /* Green path */ \ NULL, /* Heat path */ \ - 0, /* Ambient radiative temperature */ \ - 0, /* Temperature upper bound */ \ 0, /* (Temperature upper bound)^2 */ \ 0 /* (Temperature upper bound)^3 */ \ } diff --git a/src/sdis_green.c b/src/sdis_green.c @@ -387,6 +387,8 @@ green_function_solve_path const size_t ipath, double* weight) { + struct sdis_ambient_radiative_temperature trad = + SDIS_AMBIENT_RADIATIVE_TEMPERATURE_NULL; const struct power_term* power_terms = NULL; const struct flux_term* flux_terms = NULL; const struct green_path* path = NULL; @@ -443,7 +445,8 @@ green_function_solve_path break; case SDIS_GREEN_PATH_END_RADIATIVE: SDIS(green_function_get_scene(green, &scn)); - SDIS(scene_get_ambient_radiative_temperature(scn, &end_temperature)); + SDIS(scene_get_ambient_radiative_temperature(scn, &trad)); + end_temperature = trad.temperature; if(end_temperature < 0) { /* Cannot be negative if used */ res = RES_BAD_ARG; goto error; diff --git a/src/sdis_heat_path_boundary_Xd_solid_fluid_picard1.h b/src/sdis_heat_path_boundary_Xd_solid_fluid_picard1.h @@ -49,11 +49,11 @@ XD(check_Tref) func_name, Tref, SPLITX(pos)); return RES_BAD_OP_IRRECOVERABLE; } - if(Tref > scn->maximum_temperature) { + if(Tref > scn->tmax) { log_err(scn->dev, "%s: invalid maximum temperature `%gK'. The reference temperature `%gK'" "at the position `"STR_VECX"' is greater than this temperature.\n", - func_name, scn->maximum_temperature, Tref, SPLITX(pos)); + func_name, scn->tmax, Tref, SPLITX(pos)); return RES_BAD_OP_IRRECOVERABLE; } #undef STR_VECX @@ -74,7 +74,12 @@ XD(rwalk_get_Tref) ASSERT(rwalk && T && out_Tref); if(T->done) { - Tref = T->value; + /* The path reaches a limit condition, i.e. it goes to the infinity and + * fetches the ambient radiative temperature. We do not use the limit + * conditions as the reference temperature to make the sampled paths + * independant of them. */ + ASSERT(T->value == scn->trad.temperature); + Tref = scn->trad.reference; } else { struct sdis_interface_fragment frag; struct sdis_interface* interf = NULL; @@ -89,12 +94,7 @@ XD(rwalk_get_Tref) XD(setup_interface_fragment) (&frag, &rwalk->vtx, &rwalk->hit, rwalk->hit_side); - /* If the boundary temperature is known, use it as the reference - * temperature. */ - Tref = interface_side_get_temperature(interf, &frag); - if(Tref < 0) { - Tref = interface_side_get_reference_temperature(interf, &frag); - } + Tref = interface_side_get_reference_temperature(interf, &frag); } res = XD(check_Tref)(scn, rwalk->vtx.P, Tref, FUNC_NAME); diff --git a/src/sdis_heat_path_radiative_Xd.h b/src/sdis_heat_path_radiative_Xd.h @@ -74,8 +74,8 @@ XD(trace_radiative_path) #endif if(SXD_HIT_NONE(&rwalk->hit)) { /* Fetch the ambient radiative temperature */ rwalk->hit_side = SDIS_SIDE_NULL__; - if(ctx->Tarad >= 0) { - T->value += ctx->Tarad; + if(scn->trad.temperature >= 0) { + T->value += scn->trad.temperature; T->done = 1; if(ctx->green_path) { @@ -104,7 +104,7 @@ XD(trace_radiative_path) "such temperature, one has to setup a valid ambient radiative " "temperature, i.e. it must be greater or equal to 0.\n", FUNC_NAME, - ctx->Tarad, + scn->trad.temperature, SPLIT3(rwalk->vtx.P)); res = RES_BAD_OP; goto error; diff --git a/src/sdis_realisation.c b/src/sdis_realisation.c @@ -47,10 +47,8 @@ ray_realisation_3d rwalk.mdm = medium; ctx.heat_path = heat_path; - ctx.Tarad = scn->ambient_radiative_temperature; - ctx.That = scn->maximum_temperature; - ctx.That2 = ctx.That * ctx.That; - ctx.That3 = ctx.That * ctx.That2; + ctx.That2 = scn->tmax * scn->tmax; + ctx.That3 = scn->tmax * ctx.That2; f3_set_d3(dir, direction); diff --git a/src/sdis_realisation_Xd.h b/src/sdis_realisation_Xd.h @@ -181,10 +181,8 @@ XD(probe_realisation) ctx.green_path = green_path; ctx.heat_path = heat_path; - ctx.Tarad = scn->ambient_radiative_temperature; - ctx.That = scn->maximum_temperature; - ctx.That2 = ctx.That * ctx.That; - ctx.That3 = ctx.That * ctx.That2; + ctx.That2 = scn->tmax * scn->tmax; + ctx.That3 = scn->tmax * ctx.That2; res = XD(compute_temperature)(scn, &ctx, &rwalk, rng, &T); if(res != RES_OK) goto error; @@ -258,10 +256,8 @@ XD(boundary_realisation) ctx.green_path = green_path; ctx.heat_path = heat_path; - ctx.Tarad = scn->ambient_radiative_temperature; - ctx.That = scn->maximum_temperature; - ctx.That2 = ctx.That * ctx.That; - ctx.That3 = ctx.That * ctx.That2; + ctx.That2 = scn->tmax * scn->tmax; + ctx.That3 = scn->tmax * ctx.That2; res = XD(compute_temperature)(scn, &ctx, &rwalk, rng, &T); if(res != RES_OK) goto error; @@ -300,7 +296,7 @@ XD(boundary_flux_realisation) #endif double P[SDIS_XD_DIMENSION]; float N[SDIS_XD_DIMENSION]; - const double That = scn->maximum_temperature; + const double That = scn->tmax; const double That2 = That * That; const double That3 = That * That2; const enum sdis_side fluid_side = @@ -337,8 +333,6 @@ XD(boundary_flux_realisation) rwalk.mdm = (Mdm); \ rwalk.hit.prim = prim; \ SET_PARAM(rwalk.hit, st); \ - ctx.Tarad = scn->ambient_radiative_temperature; \ - ctx.That = That; \ ctx.That2 = That2; \ ctx.That3 = That3; \ dX(set)(rwalk.vtx.P, P); \ diff --git a/src/sdis_scene.c b/src/sdis_scene.c @@ -201,20 +201,20 @@ sdis_scene_set_fp_to_meter res_T sdis_scene_get_ambient_radiative_temperature (const struct sdis_scene* scn, - double* trad) + struct sdis_ambient_radiative_temperature* trad) { if(!scn || !trad) return RES_BAD_ARG; - *trad = scn->ambient_radiative_temperature; + *trad = scn->trad; return RES_OK; } res_T sdis_scene_set_ambient_radiative_temperature (struct sdis_scene* scn, - const double trad) + const struct sdis_ambient_radiative_temperature* trad) { if(!scn) return RES_BAD_ARG; - scn->ambient_radiative_temperature = trad; + scn->trad = *trad; return RES_OK; } @@ -222,7 +222,7 @@ res_T sdis_scene_get_maximum_temperature(const struct sdis_scene* scn, double* tmax) { if(!scn || !tmax) return RES_BAD_ARG; - *tmax = scn->maximum_temperature; + *tmax = scn->tmax; return RES_OK; } @@ -230,7 +230,7 @@ res_T sdis_scene_set_maximum_temperature(struct sdis_scene* scn, const double tmax) { if(!scn || tmax < 0) return RES_BAD_ARG; - scn->maximum_temperature = tmax; + scn->tmax = tmax; return RES_OK; } @@ -468,7 +468,8 @@ scene_compute_hash(const struct sdis_scene* scn, hash256_T hash) } else { S3D(scene_view_primitives_count(scn->s3d_view, &nprims)); } - WRITE(&scn->maximum_temperature, 1); + WRITE(&scn->trad.reference, 1); + WRITE(&scn->tmax, 1); WRITE(&scn->fp_to_meter, 1); FOR_EACH(iprim, 0, nprims) { struct sdis_interface* interf = NULL; diff --git a/src/sdis_scene_Xd.h b/src/sdis_scene_Xd.h @@ -912,8 +912,8 @@ XD(scene_create) SDIS(device_ref_get(dev)); scn->dev = dev; scn->fp_to_meter = args->fp_to_meter; - scn->ambient_radiative_temperature = args->trad; - scn->maximum_temperature = args->tmax; + scn->trad = args->trad; + scn->tmax = args->tmax; scn->outer_enclosure_id = UINT_MAX; darray_interf_init(dev->allocator, &scn->interfaces); darray_medium_init(dev->allocator, &scn->media); diff --git a/src/sdis_scene_c.h b/src/sdis_scene_c.h @@ -209,8 +209,8 @@ struct sdis_scene { unsigned outer_enclosure_id; double fp_to_meter; - double ambient_radiative_temperature; /* In Kelvin */ - double maximum_temperature; /* In Kelvin */ + struct sdis_ambient_radiative_temperature trad; + double tmax; /* Maximum temperature of the system (In Kelvin) */ ref_T ref; struct sdis_device* dev; diff --git a/src/test_sdis_conducto_radiative.c b/src/test_sdis_conducto_radiative.c @@ -372,7 +372,7 @@ main(int argc, char** argv) interf.convection_coef = 0; interf.emissivity = 1; interf.specular_fraction = 1; - interf.Tref = -1; + interf.Tref = T0; create_interface(dev, fluid, solid2, &interf, interfaces+3); /* Create the interface with a limit condition of T1 Kelvin */ @@ -380,7 +380,7 @@ main(int argc, char** argv) interf.convection_coef = 0; interf.emissivity = 1; interf.specular_fraction = 1; - interf.Tref = -1; + interf.Tref = T1; create_interface(dev, fluid, solid2, &interf, interfaces+4); /* Setup the per primitive interface of the solid medium */ diff --git a/src/test_sdis_conducto_radiative_2d.c b/src/test_sdis_conducto_radiative_2d.c @@ -371,7 +371,7 @@ main(int argc, char** argv) interf.front.temperature = T0; interf.front.emissivity = 1; interf.front.specular_fraction = 1; - interf.front.reference_temperature = -1; /* Should not be fetched */ + interf.front.reference_temperature = T0; create_interface(dev, fluid, solid2, &interf, interfaces+3); /* Create the interface with a limit condition of T1 Kelvin */ @@ -379,7 +379,7 @@ main(int argc, char** argv) interf.front.temperature = T1; interf.front.emissivity = 1; interf.front.specular_fraction = 1; - interf.front.reference_temperature = -1; /* Should not be fetched */ + interf.front.reference_temperature = T1; create_interface(dev, fluid, solid2, &interf, interfaces+4); /* Setup the per primitive interface of the solid medium */ diff --git a/src/test_sdis_scene.c b/src/test_sdis_scene.c @@ -258,6 +258,8 @@ test_scene_2d(struct sdis_device* dev, struct sdis_interface* interf) double duplicated_vertices[] = { 0, 0, 0, 0 }; struct sdis_scene* scn = NULL; struct sdis_scene_create_args scn_args = SDIS_SCENE_CREATE_ARGS_DEFAULT; + struct sdis_ambient_radiative_temperature trad = + SDIS_AMBIENT_RADIATIVE_TEMPERATURE_NULL; double lower[2], upper[2]; double u0, u1, u2, pos[2], pos1[2]; double dst, fp, t; @@ -353,15 +355,19 @@ test_scene_2d(struct sdis_device* dev, struct sdis_interface* interf) BA(sdis_scene_get_ambient_radiative_temperature(NULL, NULL)); BA(sdis_scene_get_ambient_radiative_temperature(scn, NULL)); - BA(sdis_scene_get_ambient_radiative_temperature(NULL, &t)); - OK(sdis_scene_get_ambient_radiative_temperature(scn, &t)); - CHK(t == SDIS_SCENE_CREATE_ARGS_DEFAULT.trad); - - t = 100; - BA(sdis_scene_set_ambient_radiative_temperature(NULL, t)); - OK(sdis_scene_set_ambient_radiative_temperature(scn, t)); - OK(sdis_scene_get_ambient_radiative_temperature(scn, &t)); - CHK(t == 100); + BA(sdis_scene_get_ambient_radiative_temperature(NULL, &trad)); + OK(sdis_scene_get_ambient_radiative_temperature(scn, &trad)); + CHK(trad.temperature == SDIS_SCENE_CREATE_ARGS_DEFAULT.trad.temperature); + CHK(trad.reference == SDIS_SCENE_CREATE_ARGS_DEFAULT.trad.reference); + + trad.temperature = 100; + trad.reference = 110; + BA(sdis_scene_set_ambient_radiative_temperature(NULL, &trad)); + OK(sdis_scene_set_ambient_radiative_temperature(scn, &trad)); + trad = SDIS_AMBIENT_RADIATIVE_TEMPERATURE_NULL; + OK(sdis_scene_get_ambient_radiative_temperature(scn, &trad)); + CHK(trad.temperature == 100); + CHK(trad.reference == 110); BA(sdis_scene_get_maximum_temperature(NULL, NULL)); BA(sdis_scene_get_maximum_temperature(scn, NULL)); diff --git a/src/test_sdis_solve_boundary_flux.c b/src/test_sdis_solve_boundary_flux.c @@ -299,7 +299,7 @@ main(int argc, char** argv) interf_props->hc = H; interf_props->temperature = Tb; interf_props->emissivity = EPSILON; - interf_props->reference_temperature = -1; /* Should not be fetched */ + interf_props->reference_temperature = Tb; interf_shader.back.emissivity = interface_get_emissivity; interf_shader.back.reference_temperature = interface_get_reference_temperature; OK(sdis_interface_create @@ -345,7 +345,8 @@ main(int argc, char** argv) scn_args.get_position = box_get_position; scn_args.nprimitives = box_ntriangles; scn_args.nvertices = box_nvertices; - scn_args.trad = Trad; + scn_args.trad.temperature = Trad; + scn_args.trad.reference = Trad; scn_args.tmax = MMAX(MMAX(Tf, Trad), Tb); scn_args.context = box_interfaces; OK(sdis_scene_create(dev, &scn_args, &box_scn)); @@ -356,7 +357,8 @@ main(int argc, char** argv) scn_args.get_position = square_get_position; scn_args.nprimitives = square_nsegments; scn_args.nvertices = square_nvertices; - scn_args.trad = Trad; + scn_args.trad.temperature = Trad; + scn_args.trad.reference = Trad; scn_args.tmax = MMAX(MMAX(Tf, Trad), Tb); scn_args.context = square_interfaces; OK(sdis_scene_2d_create(dev, &scn_args, &square_scn)); diff --git a/src/test_sdis_solve_camera.c b/src/test_sdis_solve_camera.c @@ -557,6 +557,8 @@ main(int argc, char** argv) struct sdis_scene* scn = NULL; struct sdis_scene_create_args scn_args = SDIS_SCENE_CREATE_ARGS_DEFAULT; struct sdis_solve_camera_args solve_args = SDIS_SOLVE_CAMERA_ARGS_DEFAULT; + struct sdis_ambient_radiative_temperature trad = + SDIS_AMBIENT_RADIATIVE_TEMPERATURE_NULL; struct ssp_rng* rng_state = NULL; struct fluid fluid_param = FLUID_NULL; struct solid solid_param = SOLID_NULL; @@ -630,7 +632,8 @@ main(int argc, char** argv) scn_args.get_position = geometry_get_position; scn_args.nprimitives = ntris; scn_args.nvertices = npos; - scn_args.trad = 300; + scn_args.trad.temperature = 300; + scn_args.trad.reference = 300; scn_args.tmax = 350; scn_args.context = &geom; OK(sdis_scene_create(dev, &scn_args, &scn)); @@ -666,9 +669,12 @@ main(int argc, char** argv) solve_args.cam = NULL; BA(sdis_solve_camera(scn, &solve_args, &buf)); solve_args.cam = cam; - OK(sdis_scene_set_ambient_radiative_temperature(scn, -1)); + OK(sdis_scene_get_ambient_radiative_temperature(scn, &trad)); + trad.temperature = -1; + OK(sdis_scene_set_ambient_radiative_temperature(scn, &trad)); BA(sdis_solve_camera(scn, &solve_args, &buf)); - OK(sdis_scene_set_ambient_radiative_temperature(scn, 300)); + trad.temperature = 300; + OK(sdis_scene_set_ambient_radiative_temperature(scn, &trad)); solve_args.time_range[0] = solve_args.time_range[1] = -1; BA(sdis_solve_camera(scn, &solve_args, &buf)); solve_args.time_range[0] = 1; diff --git a/src/test_sdis_solve_probe.c b/src/test_sdis_solve_probe.c @@ -276,6 +276,8 @@ main(int argc, char** argv) struct sdis_solid_shader solid_shader = DUMMY_SOLID_SHADER; struct sdis_interface_shader interface_shader = SDIS_INTERFACE_SHADER_NULL; struct sdis_solve_probe_args solve_args = SDIS_SOLVE_PROBE_ARGS_DEFAULT; + struct sdis_ambient_radiative_temperature trad = + SDIS_AMBIENT_RADIATIVE_TEMPERATURE_NULL; struct dump_path_context dump_ctx = DUMP_PATH_CONTEXT_NULL; struct context ctx; struct fluid* fluid_param; @@ -548,11 +550,12 @@ main(int argc, char** argv) /* Green and ambient radiative temperature */ solve_args.nrealisations = N; - OK(sdis_scene_set_ambient_radiative_temperature(scn, 300)); - OK(sdis_scene_set_maximum_temperature(scn, 600)); + trad.temperature = trad.reference = 300; + OK(sdis_scene_set_ambient_radiative_temperature(scn, &trad)); + OK(sdis_scene_set_maximum_temperature(scn, 300)); interface_param->epsilon = 1; - interface_param->reference_temperature = 500; + interface_param->reference_temperature = 300; OK(sdis_solve_probe(scn, &solve_args, &estimator)); OK(sdis_solve_probe_green_function(scn, &solve_args, &green)); @@ -565,7 +568,8 @@ main(int argc, char** argv) OK(sdis_estimator_ref_put(estimator2)); /* Check same green used at different ambient radiative temperature */ - OK(sdis_scene_set_ambient_radiative_temperature(scn, 600)); + trad.temperature = 600; + OK(sdis_scene_set_ambient_radiative_temperature(scn, &trad)); OK(sdis_scene_set_maximum_temperature(scn, 600)); OK(sdis_solve_probe(scn, &solve_args, &estimator)); diff --git a/src/test_sdis_unstationary_atm.c b/src/test_sdis_unstationary_atm.c @@ -781,7 +781,7 @@ main(int argc, char** argv) interf_props.temperature = TG; interf_props.h = HG; interf_props.emissivity = 1; - interf_props.Tref = UNKNOWN_TEMPERATURE; + interf_props.Tref = TG; create_interface(dev, fluid, dummy_solid, &interf_props, &interf_TG); /* Create the TA interface */ @@ -847,7 +847,8 @@ main(int argc, char** argv) scn_args.nprimitives = model3d_ntriangles; scn_args.nvertices = model3d_nvertices; scn_args.context = model3d_interfaces; - scn_args.trad = TR; + scn_args.trad.temperature = TR; + scn_args.trad.reference = TR; scn_args.tmax = MMAX(T0_FLUID, T0_SOLID); scn_args.tmax = MMAX(scn_args.tmax, TA); scn_args.tmax = MMAX(scn_args.tmax, TG); @@ -861,7 +862,8 @@ main(int argc, char** argv) scn_args.nprimitives = model2d_nsegments; scn_args.nvertices = model2d_nvertices; scn_args.context = model2d_interfaces; - scn_args.trad = TR; + scn_args.trad.temperature = TR; + scn_args.trad.reference = TR; scn_args.tmax = MMAX(T0_FLUID, T0_SOLID); scn_args.tmax = MMAX(scn_args.tmax, TA); scn_args.tmax = MMAX(scn_args.tmax, TG); diff --git a/src/test_sdis_utils.c b/src/test_sdis_utils.c @@ -125,6 +125,7 @@ solve_green_path(struct sdis_green_path* path, void* ctx) BA(sdis_green_path_get_limit_point(NULL, &pt)); BA(sdis_green_path_get_limit_point(path, NULL)); if(end_type == SDIS_GREEN_PATH_END_RADIATIVE) { + struct sdis_ambient_radiative_temperature trad; struct sdis_green_function* green; struct sdis_scene* scn; BO(sdis_green_path_get_limit_point(path, &pt)); @@ -140,8 +141,9 @@ solve_green_path(struct sdis_green_path* path, void* ctx) BA(sdis_scene_get_ambient_radiative_temperature(NULL, NULL)); BA(sdis_scene_get_ambient_radiative_temperature(scn, NULL)); - BA(sdis_scene_get_ambient_radiative_temperature(NULL, &temp)); - OK(sdis_scene_get_ambient_radiative_temperature(scn, &temp)); + BA(sdis_scene_get_ambient_radiative_temperature(NULL, &trad)); + OK(sdis_scene_get_ambient_radiative_temperature(scn, &trad)); + temp = trad.temperature; } else { OK(sdis_green_path_get_limit_point(path, &pt)); switch(pt.type) {