stardis-solver

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

commit e33ffebd98dfefa3fb8dc55c9e212a482f4ee444
parent 5a3e87cdccf7a0284dfe93b2b6ce2eb63d4d374c
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 29 Mar 2024 08:53:19 +0100

Checking the green function in unsteady WoS tests

Add an argument to the verification function to define whether the
estimation is performed directly by Monte Carlo or by relying on the
estimation of the green function.

Diffstat:
Msrc/test_sdis_unsteady_analytic_profile.c | 19+++++++++++++++----
Msrc/test_sdis_unsteady_analytic_profile_2d.c | 18++++++++++++++----
2 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/src/test_sdis_unsteady_analytic_profile.c b/src/test_sdis_unsteady_analytic_profile.c @@ -246,7 +246,8 @@ check_probe (struct sdis_scene* scn, const enum sdis_diffusion_algorithm diff_algo, const double pos[3], - const double time) /* [s] */ + const double time, /* [s] */ + const int green) { struct sdis_solve_probe_args args = SDIS_SOLVE_PROBE_ARGS_DEFAULT; struct sdis_mc T = SDIS_MC_NULL; @@ -261,7 +262,16 @@ check_probe args.time_range[1] = time; args.diff_algo = diff_algo; - OK(sdis_solve_probe(scn, &args, &estimator)); + if(!green) { + OK(sdis_solve_probe(scn, &args, &estimator)); + } else { + struct sdis_green_function* greenfn = NULL; + + OK(sdis_solve_probe_green_function(scn, &args, &greenfn)); + OK(sdis_green_function_solve(greenfn, &estimator)); + OK(sdis_green_function_ref_put(greenfn)); + } + OK(sdis_estimator_get_temperature(estimator, &T)); ref = temperature(pos, time); @@ -301,8 +311,9 @@ main(int argc, char** argv) interf = create_interface(sdis, solid, dummy); scn = create_scene(sdis, super_shape, interf); - check_probe(scn, SDIS_DIFFUSION_DELTA_SPHERE, pos, time); - check_probe(scn, SDIS_DIFFUSION_WOS, pos, time); + check_probe(scn, SDIS_DIFFUSION_DELTA_SPHERE, pos, time, 0/*green*/); + check_probe(scn, SDIS_DIFFUSION_WOS, pos, time, 0/*green*/); + check_probe(scn, SDIS_DIFFUSION_WOS, pos, time, 1/*green*/); OK(s3dut_mesh_ref_put(super_shape)); OK(sdis_device_ref_put(sdis)); diff --git a/src/test_sdis_unsteady_analytic_profile_2d.c b/src/test_sdis_unsteady_analytic_profile_2d.c @@ -267,7 +267,8 @@ check_probe (struct sdis_scene* scn, const enum sdis_diffusion_algorithm diff_algo, const double pos[2], - const double time) /* [s] */ + const double time, /* [s] */ + const int green) { struct sdis_solve_probe_args args = SDIS_SOLVE_PROBE_ARGS_DEFAULT; struct sdis_mc T = SDIS_MC_NULL; @@ -281,7 +282,15 @@ check_probe args.time_range[1] = time; args.diff_algo = diff_algo; - OK(sdis_solve_probe(scn, &args, &estimator)); + if(!green) { + OK(sdis_solve_probe(scn, &args, &estimator)); + } else { + struct sdis_green_function* greenfn = NULL; + + OK(sdis_solve_probe_green_function(scn, &args, &greenfn)); + OK(sdis_green_function_solve(greenfn, &estimator)); + OK(sdis_green_function_ref_put(greenfn)); + } OK(sdis_estimator_get_temperature(estimator, &T)); ref = temperature(pos, time); @@ -319,8 +328,9 @@ main(int argc, char** argv) interf = create_interface(sdis, solid, dummy); scn = create_scene(sdis, &sshape, interf); - check_probe(scn, SDIS_DIFFUSION_DELTA_SPHERE, pos, time); - check_probe(scn, SDIS_DIFFUSION_WOS, pos, time); + check_probe(scn, SDIS_DIFFUSION_DELTA_SPHERE, pos, time, 0/*green*/); + check_probe(scn, SDIS_DIFFUSION_WOS, pos, time, 0/*green*/); + check_probe(scn, SDIS_DIFFUSION_WOS, pos, time, 1/*green*/); release_super_shape(&sshape); OK(sdis_device_ref_put(sdis));