ValoMC icon indicating copy to clipboard operation
ValoMC copied to clipboard

non-scattering medium to scattering medium transition

Open akipulkkinen opened this issue 5 years ago • 1 comments

MC2D.hpp & MC3D.hpp: The bug only affects situations where there are non-scattering and scattering medium.

Transmission test from non-scattering medium to scattering medium (if statement following comment "Test transmission from vacuum -> scattering media") should most likely be shifted down after comment "Upgrade remaining photon propagation lenght in case it is transmitted to different mus domain".

Otherwise the first test will draw a finite value for 'prop' and the latter test will change it to zero. In the next loop over 'while(1){}' variable 'ds' will end being zero and photon position will not get updated. 'WhichFace' will have changed values of photon structure under assumption that the photon will actually propagate. This will end up screwing up tracking of the photon and will end up in tears.

akipulkkinen avatar Apr 01 '20 08:04 akipulkkinen

Similarly, there doesn't seem to be any checks to prevent divisions by zero when calculating the propagation length in case there's a mus=0 medium somewhere.

tlunttil avatar Apr 01 '20 16:04 tlunttil