stardis-solver

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

commit 3dd4bb56d312b0bddc33b12f3a40d6a0208d0ee4
parent 9f3224bd2504cb28c3d6ca5affc1e0bd8d56489f
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 18 Nov 2021 11:37:35 +0100

Fix the invocation of handle_volumic_power

Correctly set the picard_order input parameter used to check that no
volumic power is set with the picardN algorithm.

Diffstat:
Msrc/sdis_Xd_begin.h | 13+++++++++++--
Msrc/sdis_heat_path_conductive_Xd.h | 7++++---
2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/sdis_Xd_begin.h b/src/sdis_Xd_begin.h @@ -36,8 +36,9 @@ struct rwalk_context { /* Maximum branchings i.e. the maximum number of times * XD(compute_temperature) can be called. It controls the number of - * ramifications of the heat path and currently corresponds to the Picard - * order used to estimate the radiative temperature. */ + * ramifications of the heat path and currently is correlated to the Picard + * order used to estimate the radiative temperature. max_branchings == + * picard_order-1 */ size_t max_branchings; /* Number of heat path branchings */ @@ -57,11 +58,19 @@ struct rwalk_context { } static const struct rwalk_context RWALK_CONTEXT_NULL = RWALK_CONTEXT_NULL__; +static INLINE size_t +get_picard_order(const struct rwalk_context* ctx) +{ + ASSERT(ctx); + return ctx->max_branchings + 1; +} + #endif /* SDIS_XD_BEGIN_H */ #ifdef SDIS_XD_BEGIN_H__ #error "This header is already included without its associated sdis_Xd_end.h file." #endif + #define SDIS_XD_BEGIN_H__ /* Check prerequisite */ diff --git a/src/sdis_heat_path_conductive_Xd.h b/src/sdis_heat_path_conductive_Xd.h @@ -210,8 +210,8 @@ struct XD(handle_volumic_power_args) { double power; /* Volumic power */ double lambda; /* Conductivity */ - float delta_solid; /* Maximum length of a diffusive step */ - float delta; /* Length of the current diffusive step */ + float delta_solid; /* Challenged length of a diffusive step */ + float delta; /* Current length of the current diffusive step */ size_t picard_order; }; @@ -234,7 +234,7 @@ XD(check_handle_volumic_power_args) && args->lambda >= 0 && args->delta_solid > 0 && args->delta >= 0 - && args->delta_solid >= args->delta + && args->delta_solid >= 0 && args->picard_order > 0; } @@ -441,6 +441,7 @@ XD(conductive_path) handle_volpow_args.lambda = lambda; handle_volpow_args.delta_solid = delta_solid; handle_volpow_args.delta = delta; + handle_volpow_args.picard_order = get_picard_order(ctx); res = XD(handle_volumic_power)(scn, &handle_volpow_args, &power_term, T); if(res != RES_OK) goto error;