Ray tracing volume calculation and geometry testing #3645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Cost of the current volume fraction calculation via the rejection estimator principally depends on (and inversely proportional to) the target region volume fraction of the bounding box, therefore it provides troubles with computation of small volume fractions. In this PR, it is implemented an alternate estimator based on combination of the Hit-and-Run algorithm [1] and the ray tracing which uniformly covers entire location-direction model domain. The efficiency of this algorithm less depends on the volume fraction and it requires running geometry routines similarly to the neutral particle transport case. That all allow to pursue several goals:
The switch between both the schemes is provided.
By the way, this PR also:
max_iterationsparameter what partially fixes Volume calculation enhancements #1702;vol_calcregression test input which was became explicit after the volume estimator's change;Usage example
It is considered below a simple test model of spheres within spheres containing 7 cells which$20 \times 20 \times 20$ cm bounding box's volume fractions are in range from 5.23e-1 to 5.23e-10.
The standard hitting volume calculation requires either pass
estimator_type = 'hit'or default empty:It provides the following output:
Ray tracing volume calculation requires definition of
estimator_type = 'ray'argument:It provides the following result which has almost the same running cost as the previous one:
In this example, the computational gain is obtained on almost all cells but there is no general rule about higher ray tracing efficiency, it depends on configuration and shape of model.
Further works
If needed, this implementation can be relatively easily extended onto the following functionality:
Also, as a quite natural way for volume and areas calculation development could be some unification of the mode
RunMode::VOLUMEwithRunMode::FIXED_SOURCEandRunMode::EIGENVALUEfor usingFilterand, maybe,Tallyclasses. For example, it could automatically to provide fixing #2367 and #114.References
Checklist