stardis-solver

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

commit 56a82a822457a819360922255c8b55ac543eee1d
parent 6e24ccd2685a5784bb6990d4689c307311c0fa5e
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 26 Oct 2021 16:52:44 +0200

Fix the green function eval in picard1

Reset the green path limit condition when the sampled radiative path is
rejected.

Diffstat:
Msrc/sdis_green.c | 9+++++++++
Msrc/sdis_green.h | 4++++
Msrc/sdis_heat_path_boundary_Xd_solid_fluid_picard1.h | 28++++++++++++++++++++--------
3 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/src/sdis_green.c b/src/sdis_green.c @@ -1541,6 +1541,15 @@ green_path_set_limit_radiative } res_T +green_path_reset_limit(struct green_path_handle* handle) +{ + ASSERT(handle); + handle->path->elapsed_time = -INF; + handle->path->end_type = SDIS_GREEN_PATH_END_TYPES_COUNT__; + return RES_OK; +} + +res_T green_path_add_power_term (struct green_path_handle* handle, struct sdis_medium* mdm, diff --git a/src/sdis_green.h b/src/sdis_green.h @@ -87,6 +87,10 @@ green_path_set_limit_radiative const double elapsed_time); extern LOCAL_SYM res_T +green_path_reset_limit + (struct green_path_handle* handle); + +extern LOCAL_SYM res_T green_path_add_power_term (struct green_path_handle* path, struct sdis_medium* mdm, diff --git a/src/sdis_heat_path_boundary_Xd_solid_fluid_picard1.h b/src/sdis_heat_path_boundary_Xd_solid_fluid_picard1.h @@ -288,15 +288,27 @@ XD(solid_fluid_boundary_picard1_path) *rwalk = rwalk_s; *T = T_s; break; - } else if(ctx->heat_path) { - /* Null-collision: the sampled path is rejected. Add a break into the - * heat path geometry and restart it from the current position */ - res = heat_path_add_break(ctx->heat_path); - if(res != RES_OK) goto error; - res = register_heat_vertex - (ctx->heat_path, &rwalk->vtx, T->value, current_vertex_type); - if(res != RES_OK) goto error; + /* Null collision: the sampled path is rejected. */ + } else { + + if(ctx->green_path) { + /* The limit condition of the green path could be set by the rejected + * sampled radiative path. Reset this limit condition. */ + green_path_reset_limit(ctx->green_path); + } + + if(ctx->heat_path) { + /* Add a break into the heat path geometry and restart it from the + * current position. The sampled radiative path becomes a branch of the + * current sampled path */ + res = heat_path_add_break(ctx->heat_path); + if(res != RES_OK) goto error; + + res = register_heat_vertex + (ctx->heat_path, &rwalk->vtx, T->value, current_vertex_type); + if(res != RES_OK) goto error; + } } /* Null-collision, looping at the beginning */