stardis-solver

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

commit 70b07c7af2c43a8b6f051b9c6028bd29bcd857e7
parent 57106c46c0aaca430a7970e6f6be27f38b568279
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri,  6 Apr 2018 14:51:08 +0200

Add support of volumetric power to the solid medium

Diffstat:
Msrc/sdis.h | 4+++-
Msrc/sdis_solve_Xd.h | 9+++++++++
2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/sdis.h b/src/sdis.h @@ -129,11 +129,13 @@ struct sdis_solid_shader { sdis_medium_getter_T delta_solid; sdis_medium_getter_T delta_boundary; + sdis_medium_getter_T volumic_power; /* May be NULL <=> no volumic power */ + /* Initial/limit condition. A temperature < 0 means that the temperature is * unknown for the submitted random walk vertex. */ sdis_medium_getter_T temperature; }; -#define SDIS_SOLID_SHADER_NULL__ {NULL, NULL, NULL, NULL, NULL, NULL} +#define SDIS_SOLID_SHADER_NULL__ {NULL, NULL, NULL, NULL, NULL, NULL, NULL} static const struct sdis_solid_shader SDIS_SOLID_SHADER_NULL = SDIS_SOLID_SHADER_NULL__; diff --git a/src/sdis_solve_Xd.h b/src/sdis_solve_Xd.h @@ -602,6 +602,7 @@ XD(solid_temperature) double cp; /* Calorific capacity */ double tau, mu; double tmp; + double power; float delta, delta_solid; /* Random walk numerical parameter */ float range[2]; float dir0[DIM], dir1[DIM]; @@ -659,6 +660,14 @@ XD(solid_temperature) return RES_OK; } + /* Add the volumic power density to the measured temperature */ + power = solid_get_volumic_power(mdm, &rwalk->vtx); + if(power > 0) { + const double delta_in_meter = delta * fp_to_meter; + tmp = power * delta_in_meter * delta_in_meter / (2.0 * DIM * lambda); + T->value += tmp; + } + /* Define if the random walk hits something along dir0 */ rwalk->hit = hit0.distance > delta ? SXD_HIT_NULL : hit0;