stardis

Perform coupled heat transfer calculations
git clone git://git.meso-star.fr/stardis.git
Log | Files | Refs | README | LICENSE

commit 64cf7053f23e63ef25582df7ac25b6a6df58b1b1
parent 146bac35b2feb390d6879e62f4799696187047b1
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Thu, 29 Feb 2024 15:42:17 +0100

Add the -i option

It deactivates internal radiative exchanges while external radiative
exchanges are still processed, so setting emissivity to zero was
inappropriate.

In fact, it's more of a hack based on our detailed knowledge of how the
solver works. In particular, the solver provides no option of disabling
internal radiative exchange. But setting Tmax to 0 sets their
probability to 0, whereas this parameter is used nowhere except in
radiative exchanges. This makes it possible to deactivate internal
radiative exchange without side effects. In any case, it seems that the
solver should propose a less divinatory way of disabling them.

Diffstat:
Mdoc/stardis.1.in | 6+++++-
Msrc/stardis-app.c | 13++++++++++++-
Msrc/stardis-app.h | 1+
Msrc/stardis-args.c | 8++++++--
Msrc/stardis-args.h.in | 1+
5 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/doc/stardis.1.in b/doc/stardis.1.in @@ -20,7 +20,7 @@ .Nd statistical solving of coupled thermal systems .Sh SYNOPSIS .Nm -.Op Fl eghv +.Op Fl eghiv .Op Fl D Ar path_type , Ns Ar files_name_prefix .Op Fl d Ar file_base_name .Op Fl F Pa surface Ns Op , Ns Ar time Ns Op , Ns Ar time @@ -186,6 +186,10 @@ and cannot be used in conjunction with option .Fl D . .It Fl h Output short help and exit. +.It Fl i +Disable internal radiative exchanges. +External radiative exchanges are still processed, i.e. the external +source. .It Fl L Pa interface_probes Defines a set of interface probes for which .Nm diff --git a/src/stardis-app.c b/src/stardis-app.c @@ -279,6 +279,7 @@ stardis_init stardis->next_medium_id = 0; stardis->undefined_medium_behind_boundary_id = SENC3D_UNSPECIFIED_MEDIUM; stardis->verbose = args->verbose; + stardis->disable_intrad = args->disable_intrad; darray_media_ptr_init(stardis->allocator, &stardis->media); /* Init the external source */ @@ -510,9 +511,19 @@ stardis_init scn_args.fp_to_meter = stardis->scale_factor; scn_args.trad.temperature = stardis->trad; scn_args.trad.reference = stardis->trad_ref; - d2_set(scn_args.t_range, stardis->t_range); + scn_args.t_range[0] = stardis->t_range[0]; + scn_args.t_range[1] = stardis->t_range[1]; scn_args.source = stardis->extsrc.sdis_src; scn_args.context = &create_context; + + /* Setting Tmax to 0 is a way of setting the radiative coefficient to 0, and + * thus setting the probability of evolving in a radiative random walk to + * zero. */ + if(stardis->disable_intrad) { + scn_args.t_range[0] = 0; + scn_args.t_range[1] = 0; + } + res = sdis_scene_create(stardis->dev, &scn_args, &stardis->sdis_scn); if(res != RES_OK) { logger_print(stardis->logger, LOG_ERROR, diff --git a/src/stardis-app.h b/src/stardis-app.h @@ -243,6 +243,7 @@ struct stardis { struct darray_probe_boundary probe_boundary_list; struct extern_source extsrc; + int disable_intrad; /* Disable internal radiative exchanges */ }; unsigned diff --git a/src/stardis-args.c b/src/stardis-args.c @@ -428,7 +428,7 @@ void usage(FILE* stream) { #define PRINT(Msg) fprintf(stream, Msg) - PRINT("stardis [-eghv] [-D path_type,files_name_prefix] [-d file_base_name]\n"); + PRINT("stardis [-eghiv] [-D path_type,files_name_prefix] [-d file_base_name]\n"); PRINT(" [-F surface[,time[,time]]] [-G green_bin[,green_ascii]]\n"); PRINT(" [-L interface_probes] [-m medium_name[,time[,time]]]\n"); PRINT(" [-n samples_count] [-o picard_order]\n"); @@ -495,7 +495,7 @@ parse_args { int opt = 0, n_used = 0, o_used = 0; size_t len = 0; - const char option_list[] = "c:d:D:eF:gG:hL:m:M:n:o:p:P:R:s:S:t:vV:x:X:"; + const char option_list[] = "c:d:D:eF:gG:hiL:m:M:n:o:p:P:R:s:S:t:vV:x:X:"; char buf[128]; struct str keep; char** line = NULL; @@ -624,6 +624,10 @@ parse_args args->mode |= MODE_DUMP_HELP; break; + case 'i': + args->disable_intrad = 1; + break; + case 'L': if(args->mode & EXCLUSIVE_MODES) { logger_print(args->logger, LOG_ERROR, diff --git a/src/stardis-args.h.in b/src/stardis-args.h.in @@ -142,6 +142,7 @@ struct args { int mode; enum dump_path_type dump_paths; int verbose; + int disable_intrad; /* Disable internal radiative exchanges */ struct darray_probe_boundary probe_boundary_list; };