stardis

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

commit 54ec11d2d217c865c3537964ef1def2ffcc8d563
parent ad9c3229096cb3d789b9915ea53b203a8ac104f5
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed,  5 Apr 2023 10:55:18 +0200

Print the power of solids

Print the power of the solids that have a volumic power. This is useful
when you want to verify that the overall power is indeed the one
found when evaluating the output flux on the system boundaries.

Diffstat:
Msrc/stardis-app.c | 8++++++++
Msrc/stardis-solid.c | 2+-
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/stardis-app.c b/src/stardis-app.c @@ -81,6 +81,7 @@ check_delta_and_create_solid /* Due to previous errors, senc3d_scn can be unavailable */ unsigned e, ecount = 0; const unsigned desc_id = solid->desc_id; + double solid_volume = 0; /* The enclosures where created using description ids */ ERR(senc3d_scene_get_enclosure_count_by_medium(stardis->senc3d_scn, @@ -96,6 +97,7 @@ check_delta_and_create_solid ERR(senc3d_scene_get_enclosure_by_medium(stardis->senc3d_scn, desc_id, e, &enc)); ERR(senc3d_enclosure_get_header(enc, &header)); + solid_volume += header.volume; if(header.is_infinite) { /* External solid, volume is negative and no delta walk expected */ external = 1; @@ -136,6 +138,12 @@ check_delta_and_create_solid solid->delta, delta_range[0]); } } + /* Print power */ + if(solid->vpower != SDIS_VOLUMIC_POWER_NONE) { + logger_print(stardis->logger, LOG_OUTPUT, + "Power of the Solid '%s': %g W\n", + str_cget(&solid->name), solid_volume * solid->vpower); + } } } } diff --git a/src/stardis-solid.c b/src/stardis-solid.c @@ -173,7 +173,7 @@ init_solid(struct mem_allocator* allocator, struct solid** dst) (*dst)->delta = 1; (*dst)->tinit = -1; (*dst)->imposed_temperature = -1; - (*dst)->vpower = 0; + (*dst)->vpower = SDIS_VOLUMIC_POWER_NONE; (*dst)->t0 = 0; (*dst)->is_outside = 0; (*dst)->is_green = 0;