Random Ray Void Accuracy Fix (#3316)

This commit is contained in:
John Tramm 2025-02-24 09:49:51 -06:00 committed by GitHub
parent a2a5c2af19
commit 53066768de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 10 additions and 12 deletions

View file

@ -187,8 +187,7 @@ void FlatSourceDomain::normalize_scalar_flux_and_volumes(
source_regions_.volume_naive(sr) =
source_regions_.volume(sr) * normalization_factor;
source_regions_.volume_sq(sr) =
(source_regions_.volume_sq_t(sr) / source_regions_.volume_t(sr)) *
volume_normalization_factor;
source_regions_.volume_sq_t(sr) / source_regions_.volume_t(sr);
source_regions_.volume(sr) =
source_regions_.volume_t(sr) * volume_normalization_factor;
}
@ -463,12 +462,11 @@ void FlatSourceDomain::convert_source_regions_to_tallies()
auto filter_weight = filter_iter.weight_;
// Loop over scores
for (auto score_index = 0; score_index < tally.scores_.size();
score_index++) {
auto score_bin = tally.scores_[score_index];
for (int score = 0; score < tally.scores_.size(); score++) {
auto score_bin = tally.scores_[score];
// If a valid tally, filter, and score combination has been found,
// then add it to the list of tally tasks for this source element.
TallyTask task(i_tally, filter_index, score_index, score_bin);
TallyTask task(i_tally, filter_index, score, score_bin);
source_regions_.tally_task(sr, g).push_back(task);
// Also add this task to the list of volume tasks for this source

View file

@ -127,8 +127,7 @@ void LinearSourceDomain::normalize_scalar_flux_and_volumes(
source_regions_.volume(sr) =
source_regions_.volume_t(sr) * volume_normalization_factor;
source_regions_.volume_sq(sr) =
(source_regions_.volume_sq_t(sr) / source_regions_.volume_t(sr)) *
volume_normalization_factor;
source_regions_.volume_sq_t(sr) / source_regions_.volume_t(sr);
if (source_regions_.volume_t(sr) > 0.0) {
double inv_volume = 1.0 / source_regions_.volume_t(sr);
source_regions_.centroid(sr) = source_regions_.centroid_t(sr);

View file

@ -703,6 +703,7 @@ void RandomRay::attenuate_flux_linear_source_void(
// source region. The centroid and spatial momements estimates are scaled by
// the ray segment length as part of length averaging of the estimates.
domain_->source_regions_.volume(sr) += distance;
domain_->source_regions_.volume_sq(sr) += distance_2;
domain_->source_regions_.centroid_iteration(sr) += midpoint * distance;
moment_matrix_estimate *= distance;
domain_->source_regions_.mom_matrix(sr) += moment_matrix_estimate;

View file

@ -1,6 +1,6 @@
tally 1:
1.760401E+00
1.554914E-01
2.354630E+00
2.777456E-01
tally 2:
1.056204E-01
5.741779E-04

View file

@ -1,6 +1,6 @@
tally 1:
1.762592E+00
1.558698E-01
2.356821E+00
2.782548E-01
tally 2:
1.082935E-01
6.029854E-04