commit 1a71eea1aa4c6c93010e31d2fbbe259b282c3aac
parent 5882730c72ace80ba1035d237fd0b1e1d67c2e89
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 22 Mar 2024 16:17:22 +0100
WoS algorithm update with known temperature
Check that the temperature is known at the start of each diffusion step
to ensure that a probe in a solid with a known temperature stops
instantaneously before any diffusion. Previously, it could take a
diffusion step and thus reach a boundary and switch to boundary
temperature.
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/sdis_heat_path_conductive_wos_Xd.h b/src/sdis_heat_path_conductive_wos_Xd.h
@@ -550,6 +550,13 @@ XD(conductive_path_wos)
for(;;) {
double dst = 0; /* [m/fp_to_meter] */
+ /* The temperature is known */
+ if(props.temperature >= 0) {
+ T->value += props.temperature;
+ T->done = 1;
+ break;
+ }
+
/* Find the next position of the conductive path */
res = XD(sample_next_position)(scn, rwalk, rng, &dst);
if(res != RES_OK) goto error;
@@ -581,13 +588,6 @@ XD(conductive_path_wos)
res = check_solid_constant_properties(scn->dev, green, wos, &props_ref, &props);
if(res != RES_OK) goto error;
- /* The temperature is known, the path has reached a limit condition */
- if(props.temperature >= 0) {
- T->value += props.temperature;
- T->done = 1;
- break;
- }
-
++ndiffusion_steps; /* For debug */
}