stardis-solver

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

commit 38de701861bd9b5cbd3194a517ac06d401cdba6d
parent a416c8f3dcdb207500148d87f28335d8f75f4ca3
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 31 May 2024 08:31:18 +0200

Correction of volumic power calculation in WoS

Commit a416c8f removed the dimensional genericity of the function that
handles volumic power when sampling a conductive path with the WoS
algorithm. But this shouldn't be the case. The calculation of volumic
power is indeed dimension-dependent.

Diffstat:
Msrc/sdis_heat_path_conductive_wos_Xd.h | 54+++++++++++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/src/sdis_heat_path_conductive_wos_Xd.h b/src/sdis_heat_path_conductive_wos_Xd.h @@ -29,32 +29,6 @@ #define SDIS_HEAT_PATH_CONDUCTIVE_WOS_XD_H static res_T -handle_volumic_power_wos - (struct sdis_scene* scn, - const struct solid_props* props, - const double distance, /* [m/fp_to_meter] */ - double* power_term, - struct temperature* T) -{ - double dst = distance * scn->fp_to_meter; /* [m] */ - double term = 0; - res_T res = RES_OK; - ASSERT(scn && props && distance >= 0 && power_term && T); - - if(props->power == SDIS_VOLUMIC_POWER_NONE) goto exit; - - /* No displacement => no power density */ - if(distance == 0) goto exit; - - term = dst*dst / (2*DIM*props->lambda); - T->value += props->power * term; - -exit: - *power_term = term; - return res; -} - -static res_T update_green_path (struct green_path_handle* green_path, struct rwalk* rwalk, @@ -214,6 +188,32 @@ error: goto exit; } +static res_T +XD(handle_volumic_power_wos) + (struct sdis_scene* scn, + const struct solid_props* props, + const double distance, /* [m/fp_to_meter] */ + double* power_term, + struct temperature* T) +{ + double dst = distance * scn->fp_to_meter; /* [m] */ + double term = 0; + res_T res = RES_OK; + ASSERT(scn && props && distance >= 0 && power_term && T); + + if(props->power == SDIS_VOLUMIC_POWER_NONE) goto exit; + + /* No displacement => no power density */ + if(distance == 0) goto exit; + + term = dst*dst / (2*DIM*props->lambda); + T->value += props->power * term; + +exit: + *power_term = term; + return res; +} + #if DIM == 2 static INLINE enum sdis_side compute_hit_side_2d @@ -635,7 +635,7 @@ XD(conductive_path_wos) if(res != RES_OK) goto error; /* Add the volumic power density */ - res = handle_volumic_power_wos(scn, &props, dst, &power_term, T); + res = XD(handle_volumic_power_wos)(scn, &props, dst, &power_term, T); if(res != RES_OK) goto error; REGISTER_HEAT_VERTEX;