htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

commit 29b9570811dba1531756346b501338f73dc608e6
parent 9c6c4fe6b1d0547e9c30c6bf655363dc5413577c
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 29 Jun 2021 15:38:49 +0200

Update the output of the htrdr-combustion command

In flux computation, print the radiative flux in addition of the
radiative flux density.

Diffstat:
Msrc/combustion/htrdr_combustion_draw_map.c | 9+++++++++
Msrc/core/htrdr_rectangle.c | 12++++++++++++
Msrc/core/htrdr_rectangle.h | 5+++++
3 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/combustion/htrdr_combustion_draw_map.c b/src/combustion/htrdr_combustion_draw_map.c @@ -300,10 +300,19 @@ combustion_draw_map(struct htrdr_combustion* cmd) path_time.E, path_time.SE); if(cmd->output_type == HTRDR_COMBUSTION_ARGS_OUTPUT_FLUX_MAP) { + double map_size[2]; + double area; + htrdr_accum_get_estimation(&flux_acc, &flux); htrdr_log(cmd->htrdr, "Radiative flux density (in W/m^2): %g +/- %g\n", flux.E, flux.SE); + + htrdr_rectangle_get_size(cmd->flux_map, map_size); + area = map_size[0] * map_size[1]; + htrdr_log(cmd->htrdr, + "Radiative flux (in W): %g +/- %g\n", + flux.E*area, flux.SE*area); } exit: diff --git a/src/core/htrdr_rectangle.c b/src/core/htrdr_rectangle.c @@ -19,6 +19,7 @@ #include "core/htrdr_log.h" #include "core/htrdr_rectangle.h" +#include <rsys/double2.h> #include <rsys/double3.h> #include <rsys/double33.h> #include <rsys/mem_allocator.h> @@ -30,6 +31,8 @@ struct htrdr_rectangle { double axis_y[3]; double normal[3]; + double size[2]; + double local2world[12]; /* Rectangle to world transformation matrix */ double world2local[12]; /* World to rectangle transformation matrix */ @@ -121,6 +124,8 @@ htrdr_rectangle_create d3_set(rect->normal, z); d3_set(rect->position, pos); + d2_set(rect->size, sz); + exit: *out_rect = rect; return res; @@ -198,3 +203,10 @@ htrdr_rectangle_get_transform_inverse d3_set(transform_inverse+9, rect->world2local+9); return transform_inverse; } + +void +htrdr_rectangle_get_size(const struct htrdr_rectangle* rect, double size[2]) +{ + ASSERT(rect && size); + d2_set(size, rect->size); +} diff --git a/src/core/htrdr_rectangle.h b/src/core/htrdr_rectangle.h @@ -70,6 +70,11 @@ htrdr_rectangle_get_transform_inverse (const struct htrdr_rectangle* rect, double transform_inverse[12]); +HTRDR_CORE_API void +htrdr_rectangle_get_size + (const struct htrdr_rectangle* rect, + double size[2]); + END_DECLS #endif /* HTRDR_RECTANGLE_H */