htrdr

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

commit b497db12a4d14bdfe988a537aeea64214a1936a8
parent d2f33cb9189309d81fd866db8e3b25b25d637b03
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 21 Nov 2022 17:02:09 +0100

htrdr-planeto: fix calculation of lw radiance

Return 0 when there is no absorption

Diffstat:
Msrc/planeto/htrdr_planeto_compute_radiance.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/planeto/htrdr_planeto_compute_radiance.c b/src/planeto/htrdr_planeto_compute_radiance.c @@ -681,8 +681,8 @@ planeto_compute_radiance_lw sample_event(cmd, args, RNATM_RADCOEF_Kext, pos, dir, &hit_from, &evt); - /* No collision on surface or in volume. Stop the path */ - if(DISTANCE_NONE(evt.distance)) break; + /* No event on surface or in volume. Stop the path */ + if(DISTANCE_NONE(evt.distance)) return 0; /* Compute the event position */ next_pos[0] = pos[0] + dir[0] * evt.distance; @@ -694,7 +694,8 @@ planeto_compute_radiance_lw double refl; /* Surface reflectivity */ surface_bounce(cmd, args, &evt, next_pos, dir, sc_dir, &refl); - /* Russian roulette wrt surface reflectivity */ + /* Check the absorption of the surface with a Russian roulette against + * the reflectivity of the surface */ if(ssp_rng_canonical(args->rng) >= refl) break; /* Save current intersected surface to avoid self-intersection when