stardis-solver

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

commit b13a0a9ca268f8188d80245f912165eab480f19f
parent 59875a4601038f6157b953573ce852edeb2218a4
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 16 Jan 2024 09:17:49 +0100

Correction of external flux calculation on 2D scenes

For radiative paths, 2D scenes are treated as 3D scenes with an
infinite Z dimension. For external flux calculation, the trajectory
direction must therefore be in 3D, whereas until now it was partially
treated as a 2D direction. This commit corrects this problem.

Diffstat:
Msrc/sdis_heat_path_boundary_Xd_handle_external_net_flux.h | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sdis_heat_path_boundary_Xd_handle_external_net_flux.h b/src/sdis_heat_path_boundary_Xd_handle_external_net_flux.h @@ -340,7 +340,7 @@ XD(compute_incident_diffuse_flux) double wi[3] = {0}; /* Incident direction (outward the surface). Always 3D */ double vec[DIM] = {0}; /* Temporary variable */ - dX(minus)(wi, dir); + d3_minus(wi, dir); /* Always in 3D */ /* Find the following surface along the direction of propagation */ XD(trace_ray)(scn, pos, dir, INF, &hit, &hit); @@ -367,7 +367,7 @@ XD(compute_incident_diffuse_flux) /* Sample rebound direction */ if(frag.side == SDIS_BACK) dX(minus)(N, N); /* Revert normal if necessary */ sample_brdf(&brdf, rng, wi, N, &brdf_sample); - dX(set)(dir, brdf_sample.dir); + d3_set(dir, brdf_sample.dir); /* Always in 3D */ /* Calculate the direct contribution if the rebound is specular */ if(brdf_sample.cpnt == BRDF_SPECULAR) {