Skip to content

Commit b939f90

Browse files
authored
Stabilize Adjoint Source (#3476)
1 parent 25d64c9 commit b939f90

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

src/random_ray/flat_source_domain.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,30 @@ void FlatSourceDomain::set_adjoint_sources(const vector<double>& forward_flux)
12421242
}
12431243
}
12441244

1245+
// "Small" source regions in OpenMC are defined as those that are hit by
1246+
// MIN_HITS_PER_BATCH rays or fewer each batch. These regions typically have
1247+
// very small volumes combined with a low aspect ratio, and are often
1248+
// generated when applying a source region mesh that clips the edge of a
1249+
// curved surface. As perhaps only a few rays will visit these regions over
1250+
// the entire forward simulation, the forward flux estimates are extremely
1251+
// noisy and unreliable. In some cases, the noise may make the forward fluxes
1252+
// extremely low, leading to unphysically large adjoint source terms,
1253+
// resulting in weight windows that aggressively try to drive particles
1254+
// towards these regions. To fix this, we simply filter out any "small" source
1255+
// regions from consideration. If a source region is "small", we
1256+
// set its adjoint source to zero. This adds negligible bias to the adjoint
1257+
// flux solution, as the true total adjoint source contribution from small
1258+
// regions is likely to be negligible.
1259+
#pragma omp parallel for
1260+
for (int64_t sr = 0; sr < n_source_regions(); sr++) {
1261+
if (source_regions_.is_small(sr)) {
1262+
for (int g = 0; g < negroups_; g++) {
1263+
source_regions_.external_source(sr, g) = 0.0;
1264+
}
1265+
source_regions_.external_source_present(sr) = 0;
1266+
}
1267+
}
1268+
12451269
// Divide the fixed source term by sigma t (to save time when applying each
12461270
// iteration)
12471271
#pragma omp parallel for

0 commit comments

Comments
 (0)