commit 7eb855ee9a8e06429f6f7398db1b1e18eb49f6e8
parent 9e45b17703efad437e4228b18ffeaeb60100860b
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 10 Feb 2022 10:13:02 +0100
Fix the convective random walk when the max h is 0
The upper limit hc can be 0 if h is uniformly 0. In this case, the
result is the initial condition and the random walk had to be stopped
when it was not. This commit fixes this bug.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/sdis_heat_path_convective_Xd.h b/src/sdis_heat_path_convective_Xd.h
@@ -281,7 +281,9 @@ XD(convective_path)
rwalk->vtx.time = props_ref.t0;
res = XD(handle_known_fluid_temperature)(scn, ctx, rwalk, T);
if(res != RES_OK) goto error;
- if(!T->done) {
+ if(T->done) {
+ goto exit; /* Stop the random walk */
+ } else {
log_err(scn->dev, "%s: undefined initial condition.", FUNC_NAME);
res = RES_BAD_OP;
goto error;