Alternative Random Ray Volume Estimators (#3060)

Co-authored-by: Olek <45364492+yardasol@users.noreply.github.com>
This commit is contained in:
John Tramm 2024-08-23 11:56:26 -05:00 committed by GitHub
parent 86fc40a645
commit 5bc04b5d78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 2517 additions and 727 deletions

View file

@ -411,7 +411,7 @@ which when partially simplified becomes:
Note that there are now four (seemingly identical) volume terms in this equation.
.. _methods-volume-dilemma:
.. _methods_random_ray_vol:
~~~~~~~~~~~~~~
Volume Dilemma
@ -440,9 +440,11 @@ features stochastic variables (the sums over random ray lengths and angular
fluxes) in both the numerator and denominator, making it a stochastic ratio
estimator, which is inherently biased. In practice, usage of the naive estimator
does result in a biased, but "consistent" estimator (i.e., it is biased, but
the bias tends towards zero as the sample size increases). Experimentally, the
right answer can be obtained with this estimator, though a very fine ray density
is required to eliminate the bias.
the bias tends towards zero as the sample size increases). Empirically, this
bias tends to effect eigenvalue calculations much more significantly than in
fixed source simulations. Experimentally, the right answer can be obtained with
this estimator, though for eigenvalue simulations a very fine ray density is
required to eliminate the bias.
How might we solve the biased ratio estimator problem? While there is no obvious
way to alter the numerator term (which arises from the characteristic
@ -463,17 +465,17 @@ replace the actual tracklength that was accumulated inside that FSR each
iteration with the expected value.
If we know the analytical volumes, then those can be used to directly compute
the expected value of the tracklength in each cell. However, as the analytical
volumes are not typically known in OpenMC due to the usage of user-defined
constructive solid geometry, we need to source this quantity from elsewhere. An
obvious choice is to simply accumulate the total tracklength through each FSR
across all iterations (batches) and to use that sum to compute the expected
average length per iteration, as:
the expected value of the tracklength in each cell, :math:`L_{avg}`. However, as
the analytical volumes are not typically known in OpenMC due to the usage of
user-defined constructive solid geometry, we need to source this quantity from
elsewhere. An obvious choice is to simply accumulate the total tracklength
through each FSR across all iterations (batches) and to use that sum to compute
the expected average length per iteration, as:
.. math::
:label: sim_estimator
:label: L_avg
\sum\limits^{}_{i} \ell_i \approx \frac{\sum\limits^{B}_{b}\sum\limits^{N_i}_{r} \ell_{b,r} }{B}
\sum\limits^{}_{i} \ell_i \approx L_{avg} = \frac{\sum\limits^{B}_{b}\sum\limits^{N_i}_{r=1} \ell_{b,r} }{B}
where :math:`b` is a single batch in :math:`B` total batches simulated so far.
@ -486,7 +488,7 @@ averaged" estimator is therefore:
.. math::
:label: phi_sim
\phi_{i,g}^{simulation} = \frac{Q_{i,g} }{\Sigma_{t,i,g}} + \frac{\sum\limits_{r=1}^{N_i} \Delta \psi_{r,g}}{\Sigma_{t,i,g} \frac{\sum\limits^{B}_{b}\sum\limits^{N_i}_{r} \ell_{b,r} }{B}}
\phi_{i,g}^{simulation} = \frac{Q_{i,g} }{\Sigma_{t,i,g}} + \frac{\sum\limits_{r=1}^{N_i} \Delta \psi_{r,g}}{\Sigma_{t,i,g} L_{avg}}
In practical terms, the "simulation averaged" estimator is virtually
indistinguishable numerically from use of the true analytical volume to estimate
@ -500,17 +502,81 @@ in which case the denominator served as a normalization term for the numerator
integral in Equation :eq:`integral`. Essentially, we have now used a different
term for the volume in the numerator as compared to the normalizing volume in
the denominator. The inevitable mismatch (due to noise) between these two
quantities results in a significant increase in variance. Notably, the same
problem occurs if using a tracklength estimate based on the analytical volume,
as again the numerator integral and the normalizing denominator integral no
longer match on a per-iteration basis.
quantities results in a significant increase in variance, and can even result in
the generation of negative fluxes. Notably, the same problem occurs if using a
tracklength estimate based on the analytical volume, as again the numerator
integral and the normalizing denominator integral no longer match on a
per-iteration basis.
In practice, the simulation averaged method does completely remove the bias,
though at the cost of a notable increase in variance. Empirical testing reveals
that on most problems, the simulation averaged estimator does win out overall in
numerical performance, as a much coarser quadrature can be used resulting in
faster runtimes overall. Thus, OpenMC uses the simulation averaged estimator in
its random ray mode.
In practice, the simulation averaged method does completely remove the bias seen
when using the naive estimator, though at the cost of a notable increase in
variance. Empirical testing reveals that on most eigenvalue problems, the
simulation averaged estimator does win out overall in numerical performance, as
a much coarser quadrature can be used resulting in faster runtimes overall.
Thus, OpenMC uses the simulation averaged estimator as default in its random ray
mode for eigenvalue solves.
OpenMC also features a "hybrid" volume estimator that uses the naive estimator
for all regions containing an external (fixed) source term. For all other
source regions, the "simulation averaged" estimator is used. This typically achieves
a best of both worlds result, with the benefits of the low bias simulation averaged
estimator in most regions, while preventing instability and/or large biases in regions
with external source terms via use of the naive estimator. In general, it is
recommended to use the "hybrid" estimator, which is the default method used
in OpenMC. If instability is encountered despite high ray densities, then
the naive estimator may be preferable.
A table that summarizes the pros and cons, as well as recommendations for
different use cases, is given in the :ref:`volume
estimators<usersguide_vol_estimators>` section of the user guide.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
What Happens When a Source Region is Missed?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Given the stochastic nature of random ray, when low ray densities are used it is
common for small source regions to occasionally not be hit by any rays in a
particular power iteration :math:`n`. This naturally collapses the flux estimate
in that cell for the iteration from Equation :eq:`phi_naive` to:
.. math::
:label: phi_missed_one
\phi_{i,g,n}^{missed} = \frac{Q_{i,g,n} }{\Sigma_{t,i,g}}
as the streaming operator has gone to zero. While this is obviously innacurate
as it ignores transport, for most problems where the region is only occasionally
missed this estimator does not tend to introduce any significant bias.
However, in cases where the total cross section in the region is very small
(e.g., a void-like material) and where a strong external fixed source has been
placed, then this treatment causes major issues. In this pathological case, the
lack of transport forces the entirety of the fixed source to effectively be
contained and collided within the cell, which for a low cross section region is
highly unphysical. The net effect is that a very high estimate of the flux
(often orders of magnitude higher than is expected) is generated that iteration,
which cannot be washed out even with hundreds or thousands of iterations. Thus,
huge biases are often seen in spatial tallies containing void-like regions with
external sources unless a high enough ray density is used such that all source
regions are always hit each iteration. This is particularly problematic as
external sources placed in void-like regions are very common in many types of
fixed source analysis.
For regions where external sources are present, to eliminate this bias it is
therefore preferable to simply use the previous iteration's estimate of the flux
in that cell, as:
.. math::
:label: phi_missed_two
\phi_{i,g,n}^{missed} = \phi_{i,g,n-1} .
When linear sources are present, the flux moments from the previous iteration
are used in the same manner. While this introduces some small degree of
correlation to the simulation, for miss rates on the order of a few percent the
correlations are trivial and the bias is eliminated. Thus, in OpenMC the
previous iteration's scalar flux estimate is applied to cells that are missed
where there is an external source term present within the cell.
~~~~~~~~~~~~~~~
Power Iteration
@ -563,15 +629,15 @@ total spatial- and energy-integrated fission rate :math:`F^{n-1}` in iteration
Notably, the volume term :math:`V_i` appears in the eigenvalue update equation.
The same logic applies to the treatment of this term as was discussed earlier.
In OpenMC, we use the "simulation averaged" volume derived from summing over all
ray tracklength contributions to a FSR over all iterations and dividing by the
total integration tracklength to date. Thus, Equation :eq:`fission_source`
becomes:
In OpenMC, we use the "simulation averaged" volume (Equation :eq:`L_avg`)
derived from summing over all ray tracklength contributions to a FSR over all
iterations and dividing by the total integration tracklength to date. Thus,
Equation :eq:`fission_source` becomes:
.. math::
:label: fission_source_volumed
F^n = \sum\limits^{M}_{i} \left( \frac{\sum\limits^{B}_{b}\sum\limits^{N_i}_{r} \ell_{b,r} }{B} \sum\limits^{G}_{g} \nu \Sigma_f(i, g) \phi^{n}(g) \right)
F^n = \sum\limits^{M}_{i} \left( L_{avg} \sum\limits^{G}_{g} \nu \Sigma_f(i, g) \phi^{n}(g) \right)
and a similar substitution can be made to update Equation
:eq:`fission_source_prev` . In OpenMC, the most up-to-date version of the volume
@ -965,7 +1031,7 @@ The Shannon entropy is then computed normally as
where :math:`N` is the number of FSRs. FSRs with no fission source (or,
occassionally, negative fission source, :ref:`due to the volume estimator
problem <methods-volume-dilemma>`) are skipped to avoid taking an undefined
problem <methods_random_ray_vol>`) are skipped to avoid taking an undefined
logarithm in :eq:`shannon-entropy-random-ray`.
.. _usersguide_fixed_source_methods:

View file

@ -535,6 +535,64 @@ points of 1.0e-2 and 1.0e1.
# Add fixed source and ray sampling source to settings file
settings.source = [neutron_source]
.. _usersguide_vol_estimators:
-----------------------------
Alternative Volume Estimators
-----------------------------
As discussed in the random ray theory section on :ref:`volume estimators
<methods_random_ray_vol>`, there are several possible derivations for the scalar
flux estimate. These options deal with different ways of treating the
accumulation over ray lengths crossing each FSR (a quantity directly
proportional to volume), which can be computed using several methods. The
following methods are currently available in OpenMC:
.. list-table:: Comparison of Estimators
:header-rows: 1
:widths: 10 30 30 30
* - Estimator
- Description
- Pros
- Cons
* - ``simulation_averaged``
- Accumulates total active ray lengths in each FSR over all iterations,
improving the estimate of the volume in each cell each iteration.
- * Virtually unbiased after several iterations
* Asymptotically approaches the true analytical volume
* Typically most efficient in terms of speed vs. accuracy
- * Higher variance
* Can lead to negative fluxes and numerical instability in pathological
cases
* - ``naive``
- Treats the volume as composed only of the active ray length through each
FSR per iteration, being a biased but numerically consistent ratio
estimator.
- * Low variance
* Unlikely to result in negative fluxes
* Recommended in cases where the simulation averaged estimator is
unstable
- * Biased estimator
* Requires more rays or longer active ray length to mitigate bias
* - ``hybrid`` (default)
- Applies the naive estimator to all cells that contain an external (fixed)
source contribution. Applies the simulation averaged estimator to all
other cells.
- * High accuracy/low bias of the simulation averaged estimator in most
cells
* Stability of the naive estimator in cells with fixed sources
- * Can lead to slightly negative fluxes in cells where the simulation
averaged estimator is used
These estimators can be selected by setting the ``volume_estimator`` field in the
:attr:`openmc.Settings.random_ray` dictionary. For example, to use the naive
estimator, the following code would be used:
::
settings.random_ray['volume_estimator'] = 'naive'
---------------------------------------
Putting it All Together: Example Inputs
---------------------------------------

View file

@ -342,6 +342,7 @@ enum class RunMode {
enum class SolverType { MONTE_CARLO, RANDOM_RAY };
enum class RandomRayVolumeEstimator { NAIVE, SIMULATION_AVERAGED, HYBRID };
enum class RandomRaySourceShape { FLAT, LINEAR, LINEAR_XY };
//==============================================================================

View file

@ -1,6 +1,7 @@
#ifndef OPENMC_RANDOM_RAY_FLAT_SOURCE_DOMAIN_H
#define OPENMC_RANDOM_RAY_FLAT_SOURCE_DOMAIN_H
#include "openmc/constants.h"
#include "openmc/openmp_interface.h"
#include "openmc/position.h"
#include "openmc/source.h"
@ -99,7 +100,8 @@ public:
double compute_k_eff(double k_eff_old) const;
virtual void normalize_scalar_flux_and_volumes(
double total_active_distance_per_iteration);
virtual int64_t add_source_to_scalar_flux();
int64_t add_source_to_scalar_flux();
virtual void batch_reset();
void convert_source_regions_to_tallies();
void reset_tally_volumes();
@ -117,6 +119,10 @@ public:
// Static Data members
static bool volume_normalized_flux_tallies_;
//----------------------------------------------------------------------------
// Static data members
static RandomRayVolumeEstimator volume_estimator_;
//----------------------------------------------------------------------------
// Public Data members
@ -132,7 +138,6 @@ public:
// 1D arrays representing values for all source regions
vector<OpenMPMutex> lock_;
vector<int> was_hit_;
vector<double> volume_;
vector<double> volume_t_;
vector<int> position_recorded_;
@ -140,10 +145,11 @@ public:
// 2D arrays stored in 1D representing values for all source regions x energy
// groups
vector<float> scalar_flux_old_;
vector<float> scalar_flux_new_;
vector<double> scalar_flux_old_;
vector<double> scalar_flux_new_;
vector<float> source_;
vector<float> external_source_;
vector<bool> external_source_present_;
protected:
//----------------------------------------------------------------------------
@ -155,6 +161,10 @@ protected:
const vector<int32_t>& instances);
void apply_external_source_to_cell_and_children(int32_t i_cell,
Discrete* discrete, double strength_factor, int32_t target_material_id);
virtual void set_flux_to_flux_plus_source(
int64_t idx, double volume, int material, int g);
void set_flux_to_source(int64_t idx);
virtual void set_flux_to_old_flux(int64_t idx);
//----------------------------------------------------------------------------
// Private data members
@ -178,6 +188,7 @@ protected:
// 1D arrays representing values for all source regions
vector<int> material_;
vector<double> volume_naive_;
// 2D arrays stored in 1D representing values for all source regions x energy
// groups

View file

@ -28,7 +28,7 @@ public:
double compute_k_eff(double k_eff_old) const;
void normalize_scalar_flux_and_volumes(
double total_active_distance_per_iteration) override;
int64_t add_source_to_scalar_flux() override;
void batch_reset() override;
void convert_source_regions_to_tallies();
void reset_tally_volumes();
@ -54,6 +54,13 @@ public:
vector<MomentMatrix> mom_matrix_;
vector<MomentMatrix> mom_matrix_t_;
protected:
//----------------------------------------------------------------------------
// Methods
void set_flux_to_flux_plus_source(
int64_t idx, double volume, int material, int g) override;
void set_flux_to_old_flux(int64_t idx) override;
}; // class LinearSourceDomain
} // namespace openmc

View file

@ -43,6 +43,8 @@ public:
// Public data members
vector<float> angular_flux_;
bool ray_trace_only_ {false}; // If true, only perform geometry operations
private:
//----------------------------------------------------------------------------
// Private data members

View file

@ -19,6 +19,7 @@ public:
//----------------------------------------------------------------------------
// Methods
void compute_segment_correction_factors();
void simulate();
void reduce_simulation_statistics();
void output_simulation_results() const;

View file

@ -155,6 +155,10 @@ class Settings:
:ray_source:
Starting ray distribution (must be uniform in space and angle) as
specified by a :class:`openmc.SourceBase` object.
:volume_estimator:
Choice of volume estimator for the random ray solver. Options are
'naive', 'simulation_averaged', or 'hybrid'.
The default is 'hybrid'.
:source_shape:
Assumed shape of the source distribution within each source
region. Options are 'flat' (default), 'linear', or 'linear_xy'.
@ -1091,6 +1095,10 @@ class Settings:
random_ray[key], 0.0, True)
elif key == 'ray_source':
cv.check_type('random ray source', random_ray[key], SourceBase)
elif key == 'volume_estimator':
cv.check_value('volume estimator', random_ray[key],
('naive', 'simulation_averaged',
'hybrid'))
elif key == 'source_shape':
cv.check_value('source shape', random_ray[key],
('flat', 'linear', 'linear_xy'))
@ -1889,6 +1897,8 @@ class Settings:
elif child.tag == 'source':
source = SourceBase.from_xml_element(child)
self.random_ray['ray_source'] = source
elif child.tag == 'volume_estimator':
self.random_ray['volume_estimator'] = child.text
elif child.tag == 'source_shape':
self.random_ray['source_shape'] = child.text
elif child.tag == 'volume_normalized_flux_tallies':

View file

@ -24,6 +24,8 @@ namespace openmc {
//==============================================================================
// Static Variable Declarations
RandomRayVolumeEstimator FlatSourceDomain::volume_estimator_ {
RandomRayVolumeEstimator::HYBRID};
bool FlatSourceDomain::volume_normalized_flux_tallies_ {false};
FlatSourceDomain::FlatSourceDomain() : negroups_(data::mg.num_energy_groups_)
@ -49,13 +51,13 @@ FlatSourceDomain::FlatSourceDomain() : negroups_(data::mg.num_energy_groups_)
position_.resize(n_source_regions_);
volume_.assign(n_source_regions_, 0.0);
volume_t_.assign(n_source_regions_, 0.0);
was_hit_.assign(n_source_regions_, 0);
volume_naive_.assign(n_source_regions_, 0.0);
// Initialize element-wise arrays
scalar_flux_new_.assign(n_source_elements_, 0.0);
scalar_flux_final_.assign(n_source_elements_, 0.0);
source_.resize(n_source_elements_);
external_source_.assign(n_source_elements_, 0.0);
tally_task_.resize(n_source_elements_);
volume_task_.resize(n_source_regions_);
@ -64,7 +66,10 @@ FlatSourceDomain::FlatSourceDomain() : negroups_(data::mg.num_energy_groups_)
scalar_flux_old_.assign(n_source_elements_, 1.0);
} else {
// If in fixed source mode, set starting flux to guess of zero
// and initialize external source arrays
scalar_flux_old_.assign(n_source_elements_, 0.0);
external_source_.assign(n_source_elements_, 0.0);
external_source_present_.assign(n_source_regions_, false);
}
// Initialize material array
@ -109,9 +114,8 @@ void FlatSourceDomain::batch_reset()
{
// Reset scalar fluxes, iteration volume tallies, and region hit flags to
// zero
parallel_fill<float>(scalar_flux_new_, 0.0f);
parallel_fill<double>(scalar_flux_new_, 0.0);
parallel_fill<double>(volume_, 0.0);
parallel_fill<int>(was_hit_, 0);
}
void FlatSourceDomain::accumulate_iteration_flux()
@ -142,14 +146,14 @@ void FlatSourceDomain::update_neutron_source(double k_eff)
int material = material_[sr];
for (int e_out = 0; e_out < negroups_; e_out++) {
float sigma_t = data::mg.macro_xs_[material].get_xs(
double sigma_t = data::mg.macro_xs_[material].get_xs(
MgxsType::TOTAL, e_out, nullptr, nullptr, nullptr, t, a);
float scatter_source = 0.0f;
double scatter_source = 0.0f;
for (int e_in = 0; e_in < negroups_; e_in++) {
float scalar_flux = scalar_flux_old_[sr * negroups_ + e_in];
double scalar_flux = scalar_flux_old_[sr * negroups_ + e_in];
float sigma_s = data::mg.macro_xs_[material].get_xs(
double sigma_s = data::mg.macro_xs_[material].get_xs(
MgxsType::NU_SCATTER, e_in, &e_out, nullptr, nullptr, t, a);
scatter_source += sigma_s * scalar_flux;
}
@ -164,15 +168,15 @@ void FlatSourceDomain::update_neutron_source(double k_eff)
int material = material_[sr];
for (int e_out = 0; e_out < negroups_; e_out++) {
float sigma_t = data::mg.macro_xs_[material].get_xs(
double sigma_t = data::mg.macro_xs_[material].get_xs(
MgxsType::TOTAL, e_out, nullptr, nullptr, nullptr, t, a);
float fission_source = 0.0f;
double fission_source = 0.0f;
for (int e_in = 0; e_in < negroups_; e_in++) {
float scalar_flux = scalar_flux_old_[sr * negroups_ + e_in];
float nu_sigma_f = data::mg.macro_xs_[material].get_xs(
double scalar_flux = scalar_flux_old_[sr * negroups_ + e_in];
double nu_sigma_f = data::mg.macro_xs_[material].get_xs(
MgxsType::NU_FISSION, e_in, nullptr, nullptr, nullptr, t, a);
float chi = data::mg.macro_xs_[material].get_xs(
double chi = data::mg.macro_xs_[material].get_xs(
MgxsType::CHI_PROMPT, e_in, &e_out, nullptr, nullptr, t, a);
fission_source += nu_sigma_f * scalar_flux * chi;
}
@ -196,7 +200,7 @@ void FlatSourceDomain::update_neutron_source(double k_eff)
void FlatSourceDomain::normalize_scalar_flux_and_volumes(
double total_active_distance_per_iteration)
{
float normalization_factor = 1.0 / total_active_distance_per_iteration;
double normalization_factor = 1.0 / total_active_distance_per_iteration;
double volume_normalization_factor =
1.0 / (total_active_distance_per_iteration * simulation::current_batch);
@ -211,58 +215,114 @@ void FlatSourceDomain::normalize_scalar_flux_and_volumes(
#pragma omp parallel for
for (int64_t sr = 0; sr < n_source_regions_; sr++) {
volume_t_[sr] += volume_[sr];
volume_naive_[sr] = volume_[sr] * normalization_factor;
volume_[sr] = volume_t_[sr] * volume_normalization_factor;
}
}
void FlatSourceDomain::set_flux_to_flux_plus_source(
int64_t idx, double volume, int material, int g)
{
// Temperature and angle indices, if using multiple temperature
// data sets and/or anisotropic data sets.
// TODO: Currently assumes we are only using single temp/single
// angle data.
const int t = 0;
const int a = 0;
double sigma_t = data::mg.macro_xs_[material].get_xs(
MgxsType::TOTAL, g, nullptr, nullptr, nullptr, t, a);
scalar_flux_new_[idx] /= (sigma_t * volume);
scalar_flux_new_[idx] += source_[idx];
}
void FlatSourceDomain::set_flux_to_old_flux(int64_t idx)
{
scalar_flux_new_[idx] = scalar_flux_old_[idx];
}
void FlatSourceDomain::set_flux_to_source(int64_t idx)
{
scalar_flux_new_[idx] = source_[idx];
}
// Combine transport flux contributions and flat source contributions from the
// previous iteration to generate this iteration's estimate of scalar flux.
int64_t FlatSourceDomain::add_source_to_scalar_flux()
{
int64_t n_hits = 0;
// Temperature and angle indices, if using multiple temperature
// data sets and/or anisotropic data sets.
// TODO: Currently assumes we are only using single temp/single
// angle data.
const int t = 0;
const int a = 0;
#pragma omp parallel for reduction(+ : n_hits)
for (int sr = 0; sr < n_source_regions_; sr++) {
// Check if this cell was hit this iteration
int was_cell_hit = was_hit_[sr];
if (was_cell_hit) {
double volume_simulation_avg = volume_[sr];
double volume_iteration = volume_naive_[sr];
// Increment the number of hits if cell was hit this iteration
if (volume_iteration) {
n_hits++;
}
double volume = volume_[sr];
// Check if an external source is present in this source region
bool external_source_present =
external_source_present_.size() && external_source_present_[sr];
// The volume treatment depends on the volume estimator type
// and whether or not an external source is present in the cell.
double volume;
switch (volume_estimator_) {
case RandomRayVolumeEstimator::NAIVE:
volume = volume_iteration;
break;
case RandomRayVolumeEstimator::SIMULATION_AVERAGED:
volume = volume_simulation_avg;
break;
case RandomRayVolumeEstimator::HYBRID:
if (external_source_present) {
volume = volume_iteration;
} else {
volume = volume_simulation_avg;
}
break;
default:
fatal_error("Invalid volume estimator type");
}
int material = material_[sr];
for (int g = 0; g < negroups_; g++) {
int64_t idx = (sr * negroups_) + g;
// There are three scenarios we need to consider:
if (was_cell_hit) {
if (volume_iteration > 0.0) {
// 1. If the FSR was hit this iteration, then the new flux is equal to
// the flat source from the previous iteration plus the contributions
// from rays passing through the source region (computed during the
// transport sweep)
float sigma_t = data::mg.macro_xs_[material].get_xs(
MgxsType::TOTAL, g, nullptr, nullptr, nullptr, t, a);
scalar_flux_new_[idx] /= (sigma_t * volume);
scalar_flux_new_[idx] += source_[idx];
} else if (volume > 0.0) {
set_flux_to_flux_plus_source(idx, volume, material, g);
} else if (volume_simulation_avg > 0.0) {
// 2. If the FSR was not hit this iteration, but has been hit some
// previous iteration, then we simply set the new scalar flux to be
// equal to the contribution from the flat source alone.
scalar_flux_new_[idx] = source_[idx];
} else {
// If the FSR was not hit this iteration, and it has never been hit in
// any iteration (i.e., volume is zero), then we want to set this to 0
// to avoid dividing anything by a zero volume.
scalar_flux_new_[idx] = 0.0f;
// previous iteration, then we need to make a choice about what
// to do. Naively we will usually want to set the flux to be equal
// to the reduced source. However, in fixed source problems where
// there is a strong external source present in the cell, and where
// the cell has a very low cross section, this approximation will
// cause a huge upward bias in the flux estimate of the cell (in these
// conditions, the flux estimate can be orders of magnitude too large).
// Thus, to avoid this bias, if any external source is present
// in the cell we will use the previous iteration's flux estimate. This
// injects a small degree of correlation into the simulation, but this
// is going to be trivial when the miss rate is a few percent or less.
if (external_source_present) {
set_flux_to_old_flux(idx);
} else {
set_flux_to_source(idx);
}
}
// If the FSR was not hit this iteration, and it has never been hit in
// any iteration (i.e., volume is zero), then we want to set this to 0
// to avoid dividing anything by a zero volume. This happens implicitly
// given that the new scalar flux arrays are set to zero each iteration.
}
}
@ -482,7 +542,8 @@ void FlatSourceDomain::reset_tally_volumes()
// reported scalar fluxes are in units per source neutron. This allows for
// direct comparison of reported tallies to Monte Carlo flux results.
// This factor needs to be computed at each iteration, as it is based on the
// volume estimate of each FSR, which improves over the course of the simulation
// volume estimate of each FSR, which improves over the course of the
// simulation
double FlatSourceDomain::compute_fixed_source_normalization_factor() const
{
// If we are not in fixed source mode, then there are no external sources
@ -505,7 +566,7 @@ double FlatSourceDomain::compute_fixed_source_normalization_factor() const
// angle data.
const int t = 0;
const int a = 0;
float sigma_t = data::mg.macro_xs_[material].get_xs(
double sigma_t = data::mg.macro_xs_[material].get_xs(
MgxsType::TOTAL, e, nullptr, nullptr, nullptr, t, a);
simulation_external_source_strength +=
external_source_[sr * negroups_ + e] * sigma_t * volume;
@ -559,12 +620,13 @@ void FlatSourceDomain::random_ray_tally()
for (int sr = 0; sr < n_source_regions_; sr++) {
// The fsr.volume_ is the unitless fractional simulation averaged volume
// (i.e., it is the FSR's fraction of the overall simulation volume). The
// simulation_volume_ is the total 3D physical volume in cm^3 of the entire
// global simulation domain (as defined by the ray source box). Thus, the
// FSR's true 3D spatial volume in cm^3 is found by multiplying its fraction
// of the total volume by the total volume. Not important in eigenvalue
// solves, but useful in fixed source solves for returning the flux shape
// with a magnitude that makes sense relative to the fixed source strength.
// simulation_volume_ is the total 3D physical volume in cm^3 of the
// entire global simulation domain (as defined by the ray source box).
// Thus, the FSR's true 3D spatial volume in cm^3 is found by multiplying
// its fraction of the total volume by the total volume. Not important in
// eigenvalue solves, but useful in fixed source solves for returning the
// flux shape with a magnitude that makes sense relative to the fixed
// source strength.
double volume = volume_[sr] * simulation_volume_;
double material = material_[sr];
@ -741,11 +803,8 @@ void FlatSourceDomain::all_reduce_replicated_source_regions()
MPI_Allreduce(MPI_IN_PLACE, volume_.data(), n_source_regions_, MPI_DOUBLE,
MPI_SUM, mpi::intracomm);
MPI_Allreduce(MPI_IN_PLACE, was_hit_.data(), n_source_regions_, MPI_INT,
MPI_SUM, mpi::intracomm);
MPI_Allreduce(MPI_IN_PLACE, scalar_flux_new_.data(), n_source_elements_,
MPI_FLOAT, MPI_SUM, mpi::intracomm);
MPI_DOUBLE, MPI_SUM, mpi::intracomm);
simulation::time_bank_sendrecv.stop();
#endif
@ -913,6 +972,8 @@ void FlatSourceDomain::output_to_vtk() const
void FlatSourceDomain::apply_external_source_to_source_region(
Discrete* discrete, double strength_factor, int64_t source_region)
{
external_source_present_[source_region] = true;
const auto& discrete_energies = discrete->x();
const auto& discrete_probs = discrete->prob();
@ -968,14 +1029,10 @@ void FlatSourceDomain::apply_external_source_to_cell_and_children(
void FlatSourceDomain::count_external_source_regions()
{
n_external_source_regions_ = 0;
#pragma omp parallel for reduction(+ : n_external_source_regions_)
for (int sr = 0; sr < n_source_regions_; sr++) {
float total = 0.f;
for (int e = 0; e < negroups_; e++) {
int64_t se = sr * negroups_ + e;
total += external_source_[se];
}
if (total != 0.f) {
if (external_source_present_[sr]) {
n_external_source_regions_++;
}
}
@ -1029,7 +1086,7 @@ void FlatSourceDomain::convert_external_sources()
for (int sr = 0; sr < n_source_regions_; sr++) {
int material = material_[sr];
for (int e = 0; e < negroups_; e++) {
float sigma_t = data::mg.macro_xs_[material].get_xs(
double sigma_t = data::mg.macro_xs_[material].get_xs(
MgxsType::TOTAL, e, nullptr, nullptr, nullptr, t, a);
external_source_[sr * negroups_ + e] /= sigma_t;
}

View file

@ -70,25 +70,25 @@ void LinearSourceDomain::update_neutron_source(double k_eff)
MomentMatrix invM = mom_matrix_[sr].inverse();
for (int e_out = 0; e_out < negroups_; e_out++) {
float sigma_t = data::mg.macro_xs_[material].get_xs(
double sigma_t = data::mg.macro_xs_[material].get_xs(
MgxsType::TOTAL, e_out, nullptr, nullptr, nullptr, t, a);
float scatter_flat = 0.0f;
float fission_flat = 0.0f;
double scatter_flat = 0.0f;
double fission_flat = 0.0f;
MomentArray scatter_linear = {0.0, 0.0, 0.0};
MomentArray fission_linear = {0.0, 0.0, 0.0};
for (int e_in = 0; e_in < negroups_; e_in++) {
// Handles for the flat and linear components of the flux
float flux_flat = scalar_flux_old_[sr * negroups_ + e_in];
double flux_flat = scalar_flux_old_[sr * negroups_ + e_in];
MomentArray flux_linear = flux_moments_old_[sr * negroups_ + e_in];
// Handles for cross sections
float sigma_s = data::mg.macro_xs_[material].get_xs(
double sigma_s = data::mg.macro_xs_[material].get_xs(
MgxsType::NU_SCATTER, e_in, &e_out, nullptr, nullptr, t, a);
float nu_sigma_f = data::mg.macro_xs_[material].get_xs(
double nu_sigma_f = data::mg.macro_xs_[material].get_xs(
MgxsType::NU_FISSION, e_in, nullptr, nullptr, nullptr, t, a);
float chi = data::mg.macro_xs_[material].get_xs(
double chi = data::mg.macro_xs_[material].get_xs(
MgxsType::CHI_PROMPT, e_in, &e_out, nullptr, nullptr, t, a);
// Compute source terms for flat and linear components of the flux
@ -103,7 +103,10 @@ void LinearSourceDomain::update_neutron_source(double k_eff)
(scatter_flat + fission_flat * inverse_k_eff) / sigma_t;
// Compute the linear source terms
if (simulation::current_batch > 2) {
// In the first 10 iterations when the centroids and spatial moments
// are not well known, we will leave the source gradients as zero
// so as to avoid causing any numerical instability.
if (simulation::current_batch > 10) {
source_gradients_[sr * negroups_ + e_out] =
invM * ((scatter_linear + fission_linear * inverse_k_eff) / sigma_t);
}
@ -124,7 +127,7 @@ void LinearSourceDomain::update_neutron_source(double k_eff)
void LinearSourceDomain::normalize_scalar_flux_and_volumes(
double total_active_distance_per_iteration)
{
float normalization_factor = 1.0 / total_active_distance_per_iteration;
double normalization_factor = 1.0 / total_active_distance_per_iteration;
double volume_normalization_factor =
1.0 / (total_active_distance_per_iteration * simulation::current_batch);
@ -142,6 +145,7 @@ void LinearSourceDomain::normalize_scalar_flux_and_volumes(
centroid_t_[sr] += centroid_iteration_[sr];
mom_matrix_t_[sr] += mom_matrix_[sr];
volume_t_[sr] += volume_[sr];
volume_naive_[sr] = volume_[sr] * normalization_factor;
volume_[sr] = volume_t_[sr] * volume_normalization_factor;
if (volume_t_[sr] > 0.0) {
double inv_volume = 1.0 / volume_t_[sr];
@ -153,56 +157,18 @@ void LinearSourceDomain::normalize_scalar_flux_and_volumes(
}
}
int64_t LinearSourceDomain::add_source_to_scalar_flux()
void LinearSourceDomain::set_flux_to_flux_plus_source(
int64_t idx, double volume, int material, int g)
{
int64_t n_hits = 0;
scalar_flux_new_[idx] /= volume;
scalar_flux_new_[idx] += source_[idx];
flux_moments_new_[idx] *= (1.0 / volume);
}
// Temperature and angle indices, if using multiple temperature
// data sets and/or anisotropic data sets.
// TODO: Currently assumes we are only using single temp/single
// angle data.
const int t = 0;
const int a = 0;
#pragma omp parallel for reduction(+ : n_hits)
for (int sr = 0; sr < n_source_regions_; sr++) {
double volume = volume_[sr];
int material = material_[sr];
// Check if this cell was hit this iteration
int was_cell_hit = was_hit_[sr];
if (was_cell_hit) {
n_hits++;
}
for (int g = 0; g < negroups_; g++) {
int64_t idx = (sr * negroups_) + g;
// There are three scenarios we need to consider:
if (was_cell_hit) {
// 1. If the FSR was hit this iteration, then the new flux is equal to
// the flat source from the previous iteration plus the contributions
// from rays passing through the source region (computed during the
// transport sweep)
scalar_flux_new_[idx] /= volume;
scalar_flux_new_[idx] += source_[idx];
flux_moments_new_[idx] *= (1.0 / volume);
} else if (volume > 0.0) {
// 2. If the FSR was not hit this iteration, but has been hit some
// previous iteration, then we simply set the new scalar flux to be
// equal to the contribution from the flat source alone.
scalar_flux_new_[idx] = source_[idx];
} else {
// If the FSR was not hit this iteration, and it has never been hit in
// any iteration (i.e., volume is zero), then we want to set this to 0
// to avoid dividing anything by a zero volume.
scalar_flux_new_[idx] = 0.0f;
flux_moments_new_[idx] *= 0.0;
}
}
}
return n_hits;
void LinearSourceDomain::set_flux_to_old_flux(int64_t idx)
{
scalar_flux_new_[idx] = scalar_flux_old_[idx];
flux_moments_new_[idx] = flux_moments_old_[idx];
}
void LinearSourceDomain::flux_swap()
@ -254,7 +220,7 @@ void LinearSourceDomain::all_reduce_replicated_source_regions()
double LinearSourceDomain::evaluate_flux_at_point(
Position r, int64_t sr, int g) const
{
float phi_flat = FlatSourceDomain::evaluate_flux_at_point(r, sr, g);
double phi_flat = FlatSourceDomain::evaluate_flux_at_point(r, sr, g);
Position local_r = r - centroid_[sr];
MomentArray phi_linear = flux_moments_t_[sr * negroups_ + g];

View file

@ -348,12 +348,6 @@ void RandomRay::attenuate_flux_flat_source(double distance, bool is_active)
domain_->scalar_flux_new_[source_element + g] += delta_psi_[g];
}
// If the source region hasn't been hit yet this iteration,
// indicate that it now has
if (domain_->was_hit_[source_region] == 0) {
domain_->was_hit_[source_region] = 1;
}
// Accomulate volume (ray distance) into this iteration's estimate
// of the source region's volume
domain_->volume_[source_region] += distance;
@ -505,12 +499,6 @@ void RandomRay::attenuate_flux_linear_source(double distance, bool is_active)
moment_matrix_estimate *= distance;
domain->mom_matrix_[source_region] += moment_matrix_estimate;
// If the source region hasn't been hit yet this iteration,
// indicate that it now has
if (domain_->was_hit_[source_region] == 0) {
domain_->was_hit_[source_region] = 1;
}
// Tally valid position inside the source region (e.g., midpoint of
// the ray) if not done already
if (!domain_->position_recorded_[source_region]) {

View file

@ -383,7 +383,7 @@ void RandomRaySimulation::instability_check(
"Very high FSR miss rate detected ({:.3f}%). Instability may occur. "
"Increase ray density by adding more rays and/or active distance.",
percent_missed));
} else if (percent_missed > 0.01) {
} else if (percent_missed > 1.0) {
warning(
fmt::format("Elevated FSR miss rate detected ({:.3f}%). Increasing "
"ray density by adding more rays and/or active "
@ -432,6 +432,22 @@ void RandomRaySimulation::print_results_random_ray(
fmt::print(" Avg per Iteration = {:.4e}\n",
total_integrations / settings::n_batches);
std::string estimator;
switch (domain_->volume_estimator_) {
case RandomRayVolumeEstimator::SIMULATION_AVERAGED:
estimator = "Simulation Averaged";
break;
case RandomRayVolumeEstimator::NAIVE:
estimator = "Naive";
break;
case RandomRayVolumeEstimator::HYBRID:
estimator = "Hybrid";
break;
default:
fatal_error("Invalid volume estimator type");
}
fmt::print(" Volume Estimator Type = {}\n", estimator);
header("Timing Statistics", 4);
show_time("Total time for initialization", time_initialize.elapsed());
show_time("Reading cross sections", time_read_xs.elapsed(), 1);

View file

@ -269,6 +269,20 @@ void get_run_parameters(pugi::xml_node node_base)
} else {
fatal_error("Specify random ray source in settings XML");
}
if (check_for_node(random_ray_node, "volume_estimator")) {
std::string temp_str =
get_node_value(random_ray_node, "volume_estimator", true, true);
if (temp_str == "simulation_averaged") {
FlatSourceDomain::volume_estimator_ =
RandomRayVolumeEstimator::SIMULATION_AVERAGED;
} else if (temp_str == "naive") {
FlatSourceDomain::volume_estimator_ = RandomRayVolumeEstimator::NAIVE;
} else if (temp_str == "hybrid") {
FlatSourceDomain::volume_estimator_ = RandomRayVolumeEstimator::HYBRID;
} else {
fatal_error("Unrecognized volume estimator: " + temp_str);
}
}
if (check_for_node(random_ray_node, "source_shape")) {
std::string temp_str =
get_node_value(random_ray_node, "source_shape", true, true);

View file

@ -1,9 +1,9 @@
tally 1:
-5.745886E+02
9.758367E+04
5.934460E-01
7.058894E-02
tally 2:
2.971927E-02
1.827222E-04
3.206214E-02
2.063370E-04
tally 3:
1.978393E-03
7.951531E-07
2.096411E-03
8.804924E-07

View file

@ -1,9 +1,9 @@
tally 1:
-5.745886E+02
9.758367E+04
5.934460E-01
7.058894E-02
tally 2:
2.971927E-02
1.827222E-04
3.206214E-02
2.063370E-04
tally 3:
1.978393E-03
7.951531E-07
2.096411E-03
8.804924E-07

View file

@ -1,9 +1,9 @@
tally 1:
-5.745886E+02
9.758367E+04
5.934460E-01
7.058894E-02
tally 2:
2.971927E-02
1.827222E-04
3.206214E-02
2.063370E-04
tally 3:
1.978393E-03
7.951531E-07
2.096411E-03
8.804924E-07

View file

@ -192,8 +192,8 @@
<settings>
<run_mode>fixed source</run_mode>
<particles>90</particles>
<batches>10</batches>
<inactive>5</inactive>
<batches>40</batches>
<inactive>20</inactive>
<source particle="neutron" strength="3.14" type="independent">
<energy type="discrete">
<parameters>100.0 1.0</parameters>

View file

@ -1,9 +1,9 @@
tally 1:
-5.745718E+02
9.757661E+04
2.339084E+00
2.747299E-01
tally 2:
3.074428E-02
1.952251E-04
1.090051E-01
6.073265E-04
tally 3:
1.980876E-03
7.970502E-07
7.300117E-03
2.715425E-06

View file

@ -192,8 +192,8 @@
<settings>
<run_mode>fixed source</run_mode>
<particles>90</particles>
<batches>10</batches>
<inactive>5</inactive>
<batches>40</batches>
<inactive>20</inactive>
<source particle="neutron" strength="3.14" type="independent">
<energy type="discrete">
<parameters>100.0 1.0</parameters>

View file

@ -1,9 +1,9 @@
tally 1:
-5.745810E+02
9.758220E+04
2.335701E+00
2.742860E-01
tally 2:
3.022777E-02
1.884091E-04
1.081600E-01
5.980902E-04
tally 3:
1.980651E-03
7.968779E-07
7.295015E-03
2.711589E-06

View file

@ -23,5 +23,7 @@ def test_random_ray_fixed_source_linear(shape):
openmc.reset_auto_ids()
model = random_ray_three_region_cube()
model.settings.random_ray['source_shape'] = shape
harness = MGXSTestHarness('statepoint.10.h5', model)
model.settings.inactive = 20
model.settings.batches = 40
harness = MGXSTestHarness('statepoint.40.h5', model)
harness.main()

View file

@ -1,9 +1,9 @@
tally 1:
-6.614590E+04
1.283943E+09
6.840321E+01
9.376316E+02
tally 2:
4.612657E+02
4.402080E+04
4.976182E+02
4.970407E+04
tally 3:
2.248302E+01
1.026884E+02
2.382441E+01
1.137148E+02

View file

@ -1,9 +1,9 @@
tally 1:
-5.745886E+02
9.758367E+04
5.934460E-01
7.058894E-02
tally 2:
2.971927E-02
1.827222E-04
3.206214E-02
2.063370E-04
tally 3:
1.978393E-03
7.951531E-07
2.096411E-03
8.804924E-07

View file

@ -1,168 +1,168 @@
tally 1:
1.582116E+02
1.005480E+03
1.591301E+02
1.016825E+03
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.897563E+01
1.396228E+02
5.916980E+01
1.404518E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.038901E+01
1.667203E+01
2.036992E+01
1.662864E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.465551E+01
2.438101E+01
2.464728E+01
2.434669E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.260230E+01
1.110141E+02
5.260923E+01
1.109616E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.438906E+01
3.579643E+02
9.443775E+01
3.580658E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.698287E+01
1.314208E+02
5.708323E+01
1.318058E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.002152E+02
1.608182E+03
2.004495E+02
1.610586E+03
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
7.374897E+01
2.181176E+02
7.321594E+01
2.147152E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.636086E+01
2.787512E+01
2.573858E+01
2.655227E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
3.000395E+01
3.611990E+01
2.944079E+01
3.474938E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.824715E+01
1.360847E+02
5.758548E+01
1.328297E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.621963E+01
3.714397E+02
9.536577E+01
3.644652E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.954480E+01
1.436984E+02
5.824884E+01
1.368347E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.067903E+02
4.585529E+02
1.257560E+01
6.364831E+00
3.060650E+01
3.770132E+01
4.983480E+01
9.972910E+01
2.349541E+00
2.217300E-01
5.718312E+00
1.313392E+00
1.965462E+01
1.548888E+01
2.011494E-01
1.622334E-03
4.895573E-01
9.609705E-03
2.318671E+01
2.155841E+01
2.445032E-01
2.397352E-03
5.950720E-01
1.420043E-02
5.322867E+01
1.136138E+02
1.968847E-01
1.554358E-03
4.791838E-01
9.207284E-03
1.191175E+02
5.692803E+02
5.806982E-02
1.354810E-04
1.436897E-01
8.295235E-04
8.022963E+01
2.589171E+02
3.465139E-01
4.882327E-03
9.638109E-01
3.777193E-02
1.555305E+02
9.711601E+02
1.073356E+02
4.630895E+02
1.263975E+01
6.427678E+00
3.076263E+01
3.807359E+01
4.995302E+01
1.001379E+02
2.355060E+00
2.226283E-01
5.731746E+00
1.318712E+00
1.959843E+01
1.538887E+01
2.005479E-01
1.611455E-03
4.880935E-01
9.545263E-03
2.315398E+01
2.148264E+01
2.441408E-01
2.388612E-03
5.941898E-01
1.414866E-02
5.319555E+01
1.134034E+02
1.967517E-01
1.551313E-03
4.788601E-01
9.189243E-03
1.192041E+02
5.698491E+02
5.811654E-02
1.356369E-04
1.438053E-01
8.304781E-04
8.044764E+01
2.602455E+02
3.474828E-01
4.908567E-03
9.665057E-01
3.797493E-02
1.561720E+02
9.788256E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.836421E+01
1.367538E+02
5.840869E+01
1.368656E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.042089E+01
1.673401E+01
2.029506E+01
1.650985E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.477708E+01
2.463124E+01
2.467632E+01
2.440891E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.317851E+01
1.134205E+02
5.301033E+01
1.126277E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.634473E+01
3.724422E+02
9.608414E+01
3.702737E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.879813E+01
1.396454E+02
5.881578E+01
1.396463E+02
0.000000E+00
0.000000E+00
0.000000E+00

View file

@ -1,168 +1,168 @@
tally 1:
1.573422E+02
9.945961E+02
1.583461E+02
1.007023E+03
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.868035E+01
1.382578E+02
5.891511E+01
1.392800E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.028997E+01
1.651549E+01
2.028333E+01
1.649217E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.453137E+01
2.414255E+01
2.453681E+01
2.413486E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.232506E+01
1.098683E+02
5.235799E+01
1.099237E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.385720E+01
3.539613E+02
9.394382E+01
3.543494E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.664229E+01
1.298333E+02
5.676269E+01
1.303097E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.001324E+02
1.606858E+03
2.007853E+02
1.616208E+03
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
7.358736E+01
2.171786E+02
7.319692E+01
2.146291E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.625416E+01
2.765491E+01
2.566725E+01
2.640687E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.987675E+01
3.582038E+01
2.934697E+01
3.453012E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.797311E+01
1.348247E+02
5.737202E+01
1.318574E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.573509E+01
3.677339E+02
9.495251E+01
3.613355E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.926615E+01
1.423707E+02
5.799236E+01
1.356172E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.060513E+02
4.521166E+02
1.247077E+01
6.257701E+00
3.035137E+01
3.706675E+01
4.962504E+01
9.887387E+01
2.338861E+00
2.196709E-01
5.692320E+00
1.301195E+00
1.957564E+01
1.536441E+01
2.003053E-01
1.608650E-03
4.875030E-01
9.528647E-03
2.309275E+01
2.138375E+01
2.434816E-01
2.377213E-03
5.925856E-01
1.408114E-02
5.300741E+01
1.126617E+02
1.960322E-01
1.540737E-03
4.771089E-01
9.126597E-03
1.184809E+02
5.630856E+02
5.774249E-02
1.339082E-04
1.428798E-01
8.198938E-04
7.971031E+01
2.554943E+02
3.441954E-01
4.814135E-03
9.573621E-01
3.724437E-02
1.549617E+02
9.639834E+02
1.066411E+02
4.570264E+02
1.254011E+01
6.325603E+00
3.052011E+01
3.746896E+01
4.977289E+01
9.940494E+01
2.345784E+00
2.208432E-01
5.709169E+00
1.308139E+00
1.953078E+01
1.528285E+01
1.998229E-01
1.599785E-03
4.863290E-01
9.476135E-03
2.307190E+01
2.133049E+01
2.432475E-01
2.371063E-03
5.920158E-01
1.404471E-02
5.299849E+01
1.125570E+02
1.959909E-01
1.539183E-03
4.770085E-01
9.117394E-03
1.186130E+02
5.641029E+02
5.781214E-02
1.341752E-04
1.430521E-01
8.215282E-04
7.995712E+01
2.570085E+02
3.452925E-01
4.844032E-03
9.604136E-01
3.747567E-02
1.556790E+02
9.726171E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.808547E+01
1.354629E+02
5.816710E+01
1.357523E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.029953E+01
1.654123E+01
2.018475E+01
1.633543E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.462331E+01
2.433425E+01
2.453470E+01
2.413604E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.283851E+01
1.120036E+02
5.269366E+01
1.113096E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.572799E+01
3.677288E+02
9.550190E+01
3.658245E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
5.842566E+01
1.378719E+02
5.846305E+01
1.379618E+02
0.000000E+00
0.000000E+00
0.000000E+00

View file

@ -1,36 +1,36 @@
k-combined:
8.400322E-01 8.023350E-03
8.400321E-01 8.023358E-03
tally 1:
5.086560E+00
5.180937E+00
5.086559E+00
5.180935E+00
1.885166E+00
7.115505E-01
4.588117E+00
4.214785E+00
2.860401E+00
1.639329E+00
7.115503E-01
4.588116E+00
4.214784E+00
2.860400E+00
1.639328E+00
4.245221E-01
3.610930E-02
3.610929E-02
1.033202E+00
2.138892E-01
1.692631E+00
5.793967E-01
5.793966E-01
5.445818E-02
5.996625E-04
1.325403E-01
3.552030E-03
2.372249E+00
2.372248E+00
1.146944E+00
7.808143E-02
1.242279E-03
7.808142E-02
1.242278E-03
1.900346E-01
7.358492E-03
7.134949E+00
7.358490E-03
7.134948E+00
1.034824E+01
8.272648E-02
1.391872E-03
2.013422E-01
8.244790E-03
8.272647E-02
1.391871E-03
2.013421E-01
8.244788E-03
2.043539E+01
8.389902E+01
3.099367E-02
@ -40,23 +40,23 @@ tally 1:
1.313212E+01
3.449537E+01
1.764293E-01
6.225587E-03
4.907293E-01
4.816401E-02
7.567717E+00
6.225586E-03
4.907292E-01
4.816400E-02
7.567715E+00
1.145439E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
3.383194E+00
2.290469E+00
2.290468E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.819673E+00
6.726159E-01
1.819672E+00
6.726158E-01
0.000000E+00
0.000000E+00
0.000000E+00
@ -67,7 +67,7 @@ tally 1:
0.000000E+00
0.000000E+00
0.000000E+00
7.453759E+00
7.453758E+00
1.128171E+01
0.000000E+00
0.000000E+00
@ -85,12 +85,12 @@ tally 1:
0.000000E+00
0.000000E+00
0.000000E+00
4.601917E+00
4.242626E+00
4.601916E+00
4.242624E+00
1.719723E+00
5.923467E-01
4.185463E+00
3.508696E+00
5.923465E-01
4.185462E+00
3.508695E+00
2.730305E+00
1.494324E+00
4.108214E-01
@ -98,67 +98,67 @@ tally 1:
9.998572E-01
2.004436E-01
1.660852E+00
5.570433E-01
5.570432E-01
5.428709E-02
5.947848E-04
1.321239E-01
3.523137E-03
2.306069E+00
1.082856E+00
7.697032E-02
1.206037E-03
1.873304E-01
7.143816E-03
1.082855E+00
7.697031E-02
1.206036E-03
1.873303E-01
7.143815E-03
7.075194E+00
1.017519E+01
8.322052E-02
1.408295E-03
1.408294E-03
2.025446E-01
8.342072E-03
8.342070E-03
2.094832E+01
8.816716E+01
8.816715E+01
3.234739E-02
2.101889E-04
8.004135E-02
1.286945E-03
1.357413E+01
3.685984E+01
3.685983E+01
1.861680E-01
6.934828E-03
6.934827E-03
5.178169E-01
5.365103E-02
5.072150E+00
5.151431E+00
1.916644E+00
7.358713E-01
4.664727E+00
4.358847E+00
2.859465E+00
5.365102E-02
5.072149E+00
5.151429E+00
1.916643E+00
7.358710E-01
4.664726E+00
4.358845E+00
2.859464E+00
1.638250E+00
4.332944E-01
3.763171E-02
3.763170E-02
1.054552E+00
2.229070E-01
1.693008E+00
5.796672E-01
5.796671E-01
5.561096E-02
6.247543E-04
1.353459E-01
3.700658E-03
2.368860E+00
1.143296E+00
7.951820E-02
7.951819E-02
1.286690E-03
1.935314E-01
7.621558E-03
7.119587E+00
7.621556E-03
7.119586E+00
1.030023E+01
8.428176E-02
1.442932E-03
2.051275E-01
8.547244E-03
8.428175E-02
1.442931E-03
2.051274E-01
8.547243E-03
2.046758E+01
8.418768E+01
8.418767E+01
3.181946E-02
2.034766E-04
7.873502E-02
@ -166,6 +166,6 @@ tally 1:
1.325834E+01
3.515919E+01
1.832838E-01
6.720556E-03
6.720555E-03
5.097947E-01
5.199331E-02

View file

@ -74,8 +74,8 @@
<settings>
<run_mode>eigenvalue</run_mode>
<particles>100</particles>
<batches>10</batches>
<inactive>5</inactive>
<batches>40</batches>
<inactive>20</inactive>
<energy_mode>multi-group</energy_mode>
<random_ray>
<distance_active>100.0</distance_active>

View file

@ -1,171 +1,171 @@
k-combined:
8.273022E-01 1.347623E-02
1.095967E+00 1.543581E-02
tally 1:
5.004109E+00
5.022655E+00
1.844047E+00
6.833376E-01
4.488042E+00
4.047669E+00
2.824818E+00
1.599927E+00
4.182704E-01
3.509796E-02
1.017987E+00
2.078987E-01
1.676761E+00
5.682729E-01
5.385624E-02
5.857594E-04
1.310753E-01
3.469677E-03
2.353602E+00
1.127695E+00
7.721312E-02
1.212202E-03
1.879213E-01
7.180339E-03
7.082957E+00
1.019023E+01
8.203580E-02
1.366996E-03
1.996612E-01
8.097436E-03
2.034293E+01
8.321967E+01
3.099116E-02
1.933713E-04
7.668546E-02
1.183975E-03
1.311478E+01
3.442575E+01
1.778200E-01
6.347187E-03
4.945973E-01
4.910476E-02
7.576546E+00
1.148094E+01
2.548108E+01
3.269093E+01
9.271804E+00
4.327275E+00
2.256572E+01
2.563210E+01
1.816107E+01
1.653421E+01
2.659203E+00
3.544951E-01
6.471969E+00
2.099810E+00
1.364193E+01
9.308675E+00
4.362828E-01
9.521133E-03
1.061825E+00
5.639730E-02
1.746102E+01
1.524680E+01
5.733016E-01
1.643671E-02
1.395301E+00
9.736091E-02
4.539598E+01
1.030472E+02
5.263055E-01
1.385088E-02
1.280938E+00
8.204609E-02
9.945736E+01
4.946716E+02
1.505228E-01
1.133424E-03
3.724582E-01
6.939732E-03
5.324914E+01
1.418809E+02
7.219589E-01
2.614875E-02
2.008092E+00
2.022988E-01
4.188246E+01
8.843468E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
3.386885E+00
2.295318E+00
2.224363E+01
2.481131E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.823720E+00
6.769694E-01
1.436097E+01
1.031496E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.703042E+00
1.494228E+00
1.901248E+01
1.807657E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
7.465612E+00
1.132769E+01
4.559337E+01
1.039424E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.820337E+01
6.657534E+01
8.802992E+01
3.874925E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.127686E+01
2.549122E+01
4.506602E+01
1.016497E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
4.561053E+00
4.169936E+00
1.674166E+00
5.624648E-01
4.074585E+00
3.331694E+00
2.723008E+00
1.487311E+00
4.059013E-01
3.307772E-02
9.878827E-01
1.959320E-01
1.663524E+00
5.584734E-01
5.399658E-02
5.877094E-04
1.314169E-01
3.481227E-03
2.310994E+00
1.086435E+00
7.627297E-02
1.181877E-03
1.856331E-01
7.000707E-03
7.100201E+00
1.023633E+01
8.285591E-02
1.393520E-03
2.016572E-01
8.254554E-03
2.119292E+01
9.022917E+01
3.281214E-02
2.163583E-04
8.119135E-02
1.324719E-03
1.380975E+01
3.815787E+01
1.919186E-01
7.384267E-03
5.338118E-01
5.712809E-02
5.024478E+00
5.056216E+00
1.888826E+00
7.148091E-01
4.597025E+00
4.234087E+00
2.839930E+00
1.616473E+00
4.294394E-01
3.697612E-02
1.045170E+00
2.190237E-01
1.688196E+00
5.765397E-01
5.539650E-02
6.200086E-04
1.348240E-01
3.672547E-03
2.361633E+00
1.136540E+00
7.901052E-02
1.270359E-03
1.922958E-01
7.524822E-03
7.100780E+00
1.024481E+01
8.389610E-02
1.429594E-03
2.041888E-01
8.468240E-03
2.049187E+01
8.438141E+01
3.195576E-02
2.052140E-04
7.907229E-02
1.256485E-03
1.327412E+01
3.524466E+01
1.850084E-01
6.847675E-03
5.145915E-01
5.297677E-02
2.207833E+01
2.455068E+01
8.139772E+00
3.337974E+00
1.981058E+01
1.977210E+01
1.710407E+01
1.466648E+01
2.542287E+00
3.240467E-01
6.187418E+00
1.919453E+00
1.342690E+01
9.017908E+00
4.362263E-01
9.518695E-03
1.061688E+00
5.638286E-02
1.713924E+01
1.469065E+01
5.714028E-01
1.632839E-02
1.390680E+00
9.671931E-02
4.539193E+01
1.030326E+02
5.345253E-01
1.428719E-02
1.300944E+00
8.463057E-02
1.013270E+02
5.134168E+02
1.555517E-01
1.210145E-03
3.849017E-01
7.409480E-03
5.377836E+01
1.446537E+02
7.374053E-01
2.722908E-02
2.051056E+00
2.106567E-01
2.522726E+01
3.202007E+01
9.366659E+00
4.412278E+00
2.279657E+01
2.613561E+01
1.803368E+01
1.629756E+01
2.696490E+00
3.643066E-01
6.562716E+00
2.157928E+00
1.357447E+01
9.216150E+00
4.437305E-01
9.847287E-03
1.079951E+00
5.832923E-02
1.735848E+01
1.506775E+01
5.825173E-01
1.696803E-02
1.417731E+00
1.005081E-01
4.519297E+01
1.021280E+02
5.357712E-01
1.435322E-02
1.303976E+00
8.502167E-02
9.934508E+01
4.935314E+02
1.538761E-01
1.184229E-03
3.807556E-01
7.250804E-03
5.335839E+01
1.424221E+02
7.404823E-01
2.747396E-02
2.059614E+00
2.125512E-01

View file

@ -74,8 +74,8 @@
<settings>
<run_mode>eigenvalue</run_mode>
<particles>100</particles>
<batches>10</batches>
<inactive>5</inactive>
<batches>40</batches>
<inactive>20</inactive>
<energy_mode>multi-group</energy_mode>
<random_ray>
<distance_active>100.0</distance_active>

View file

@ -1,171 +1,171 @@
k-combined:
8.368882E-01 8.107070E-03
1.104727E+00 1.593303E-02
tally 1:
5.072700E+00
5.152684E+00
1.876680E+00
7.051697E-01
4.567463E+00
4.176989E+00
2.858196E+00
1.636775E+00
4.239946E-01
3.601884E-02
1.031918E+00
2.133534E-01
1.692006E+00
5.789664E-01
5.442292E-02
5.988675E-04
1.324545E-01
3.547321E-03
2.371801E+00
1.146513E+00
7.804414E-02
1.241074E-03
1.899438E-01
7.351359E-03
7.134037E+00
1.034554E+01
8.269855E-02
1.390936E-03
2.012742E-01
8.239245E-03
2.043174E+01
8.386878E+01
3.098171E-02
1.929186E-04
7.666208E-02
1.181203E-03
1.312800E+01
3.447362E+01
1.763141E-01
6.217438E-03
4.904088E-01
4.810096E-02
7.608165E+00
1.157716E+01
2.566934E+01
3.317503E+01
9.417202E+00
4.465518E+00
2.291958E+01
2.645097E+01
1.823903E+01
1.667438E+01
2.679931E+00
3.600420E-01
6.522415E+00
2.132667E+00
1.365623E+01
9.327448E+00
4.370682E-01
9.554968E-03
1.063736E+00
5.659772E-02
1.750634E+01
1.532609E+01
5.762870E-01
1.660889E-02
1.402567E+00
9.838082E-02
4.543609E+01
1.032286E+02
5.271287E-01
1.389456E-02
1.282941E+00
8.230483E-02
9.881678E+01
4.882586E+02
1.487616E-01
1.106634E-03
3.681003E-01
6.775702E-03
5.260781E+01
1.384126E+02
7.018594E-01
2.464953E-02
1.952187E+00
1.907001E-01
4.184779E+01
8.826530E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
3.392187E+00
2.302667E+00
2.226932E+01
2.486554E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.821339E+00
6.737984E-01
1.441107E+01
1.038682E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.695742E+00
1.483104E+00
1.909194E+01
1.822767E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
7.457904E+00
1.129343E+01
4.579319E+01
1.048559E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.824331E+01
6.687165E+01
8.833276E+01
3.901410E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.138096E+01
2.591161E+01
4.528911E+01
1.025740E+02
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
4.582534E+00
4.206969E+00
1.707129E+00
5.837143E-01
4.154811E+00
3.457563E+00
2.727459E+00
1.491183E+00
4.100516E-01
3.371280E-02
9.979836E-01
1.996938E-01
1.660765E+00
5.570066E-01
5.425719E-02
5.941503E-04
1.320511E-01
3.519379E-03
2.306630E+00
1.083425E+00
7.695103E-02
1.205473E-03
1.872834E-01
7.140475E-03
7.077631E+00
1.018246E+01
8.321109E-02
1.408010E-03
2.025216E-01
8.340388E-03
2.094896E+01
8.817186E+01
3.233088E-02
2.099749E-04
8.000050E-02
1.285635E-03
1.356905E+01
3.683229E+01
1.859858E-01
6.921278E-03
5.173102E-01
5.354619E-02
5.056029E+00
5.118575E+00
1.910007E+00
7.308066E-01
4.648575E+00
4.328846E+00
2.856363E+00
1.634636E+00
4.328679E-01
3.755784E-02
1.053514E+00
2.224694E-01
1.692444E+00
5.793158E-01
5.559366E-02
6.243434E-04
1.353038E-01
3.698224E-03
2.368251E+00
1.142832E+00
7.949453E-02
1.285913E-03
1.934738E-01
7.616955E-03
7.118354E+00
1.029753E+01
8.426801E-02
1.442436E-03
2.050940E-01
8.544309E-03
2.046889E+01
8.419814E+01
3.182500E-02
2.035334E-04
7.874874E-02
1.246195E-03
1.326056E+01
3.517079E+01
1.833225E-01
6.723237E-03
5.099023E-01
5.201406E-02
2.218278E+01
2.477434E+01
8.203467E+00
3.389915E+00
1.996560E+01
2.007976E+01
1.714818E+01
1.473927E+01
2.551034E+00
3.262450E-01
6.208707E+00
1.932474E+00
1.343470E+01
9.027502E+00
4.363259E-01
9.522121E-03
1.061930E+00
5.640315E-02
1.717034E+01
1.474381E+01
5.729720E-01
1.641841E-02
1.394499E+00
9.725251E-02
4.542715E+01
1.031896E+02
5.348128E-01
1.430232E-02
1.301643E+00
8.472019E-02
1.009076E+02
5.091264E+02
1.543547E-01
1.191320E-03
3.819398E-01
7.294216E-03
5.342751E+01
1.427427E+02
7.255554E-01
2.633014E-02
2.018096E+00
2.037021E-01
2.540053E+01
3.247261E+01
9.483956E+00
4.526477E+00
2.308205E+01
2.681205E+01
1.812760E+01
1.646855E+01
2.717374E+00
3.700301E-01
6.613545E+00
2.191830E+00
1.362672E+01
9.286907E+00
4.458292E-01
9.940508E-03
1.085059E+00
5.888142E-02
1.744511E+01
1.521876E+01
5.866632E-01
1.721091E-02
1.427821E+00
1.019468E-01
4.538426E+01
1.029941E+02
5.385934E-01
1.450495E-02
1.310845E+00
8.592045E-02
9.921424E+01
4.921945E+02
1.532444E-01
1.174272E-03
3.791926E-01
7.189835E-03
5.301633E+01
1.405571E+02
7.285745E-01
2.655093E-02
2.026493E+00
2.054102E-01

View file

@ -22,5 +22,7 @@ def test_random_ray_source(shape):
openmc.reset_auto_ids()
model = random_ray_lattice()
model.settings.random_ray['source_shape'] = shape
harness = MGXSTestHarness('statepoint.10.h5', model)
model.settings.inactive = 20
model.settings.batches = 40
harness = MGXSTestHarness('statepoint.40.h5', model)
harness.main()

View file

@ -0,0 +1,245 @@
<?xml version='1.0' encoding='utf-8'?>
<model>
<materials>
<cross_sections>mgxs.h5</cross_sections>
<material id="1" name="source">
<density units="macro" value="1.0"/>
<macroscopic name="source"/>
</material>
<material id="2" name="void">
<density units="macro" value="1.0"/>
<macroscopic name="void"/>
</material>
<material id="3" name="absorber">
<density units="macro" value="1.0"/>
<macroscopic name="absorber"/>
</material>
</materials>
<geometry>
<cell id="1" material="1" name="infinite source region" universe="1"/>
<cell id="2" material="2" name="infinite void region" universe="2"/>
<cell id="3" material="3" name="infinite absorber region" universe="3"/>
<cell fill="4" id="4" universe="5"/>
<cell fill="5" id="5" name="full domain" region="1 -2 3 -4 5 -6" universe="6"/>
<lattice id="4">
<pitch>2.5 2.5 2.5</pitch>
<dimension>12 12 12</dimension>
<lower_left>0.0 0.0 0.0</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 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 </universes>
</lattice>
<surface boundary="reflective" coeffs="0.0" id="1" type="x-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="2" type="x-plane"/>
<surface boundary="reflective" coeffs="0.0" id="3" type="y-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="4" type="y-plane"/>
<surface boundary="reflective" coeffs="0.0" id="5" type="z-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="6" type="z-plane"/>
</geometry>
<settings>
<run_mode>fixed source</run_mode>
<particles>90</particles>
<batches>10</batches>
<inactive>5</inactive>
<source particle="neutron" strength="3.14" type="independent">
<energy type="discrete">
<parameters>100.0 1.0</parameters>
</energy>
<constraints>
<domain_type>universe</domain_type>
<domain_ids>1</domain_ids>
</constraints>
</source>
<energy_mode>multi-group</energy_mode>
<random_ray>
<distance_active>500.0</distance_active>
<distance_inactive>100.0</distance_inactive>
<source particle="neutron" strength="1.0" type="independent">
<space type="box">
<parameters>0.0 0.0 0.0 30.0 30.0 30.0</parameters>
</space>
</source>
<volume_normalized_flux_tallies>True</volume_normalized_flux_tallies>
<volume_estimator>hybrid</volume_estimator>
</random_ray>
</settings>
<tallies>
<filter id="3" type="material">
<bins>1</bins>
</filter>
<filter id="2" type="material">
<bins>2</bins>
</filter>
<filter id="1" type="material">
<bins>3</bins>
</filter>
<tally id="3" name="Source Tally">
<filters>3</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="2" name="Void Tally">
<filters>2</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="1" name="Absorber Tally">
<filters>1</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
</tallies>
</model>

View file

@ -0,0 +1,9 @@
tally 1:
5.934460E-01
7.058894E-02
tally 2:
3.206214E-02
2.063370E-04
tally 3:
2.096411E-03
8.804924E-07

View file

@ -0,0 +1,245 @@
<?xml version='1.0' encoding='utf-8'?>
<model>
<materials>
<cross_sections>mgxs.h5</cross_sections>
<material id="1" name="source">
<density units="macro" value="1.0"/>
<macroscopic name="source"/>
</material>
<material id="2" name="void">
<density units="macro" value="1.0"/>
<macroscopic name="void"/>
</material>
<material id="3" name="absorber">
<density units="macro" value="1.0"/>
<macroscopic name="absorber"/>
</material>
</materials>
<geometry>
<cell id="1" material="1" name="infinite source region" universe="1"/>
<cell id="2" material="2" name="infinite void region" universe="2"/>
<cell id="3" material="3" name="infinite absorber region" universe="3"/>
<cell fill="4" id="4" universe="5"/>
<cell fill="5" id="5" name="full domain" region="1 -2 3 -4 5 -6" universe="6"/>
<lattice id="4">
<pitch>2.5 2.5 2.5</pitch>
<dimension>12 12 12</dimension>
<lower_left>0.0 0.0 0.0</lower_left>
<universes>
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2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 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 </universes>
</lattice>
<surface boundary="reflective" coeffs="0.0" id="1" type="x-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="2" type="x-plane"/>
<surface boundary="reflective" coeffs="0.0" id="3" type="y-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="4" type="y-plane"/>
<surface boundary="reflective" coeffs="0.0" id="5" type="z-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="6" type="z-plane"/>
</geometry>
<settings>
<run_mode>fixed source</run_mode>
<particles>90</particles>
<batches>10</batches>
<inactive>5</inactive>
<source particle="neutron" strength="3.14" type="independent">
<energy type="discrete">
<parameters>100.0 1.0</parameters>
</energy>
<constraints>
<domain_type>universe</domain_type>
<domain_ids>1</domain_ids>
</constraints>
</source>
<energy_mode>multi-group</energy_mode>
<random_ray>
<distance_active>500.0</distance_active>
<distance_inactive>100.0</distance_inactive>
<source particle="neutron" strength="1.0" type="independent">
<space type="box">
<parameters>0.0 0.0 0.0 30.0 30.0 30.0</parameters>
</space>
</source>
<volume_normalized_flux_tallies>True</volume_normalized_flux_tallies>
<volume_estimator>naive</volume_estimator>
</random_ray>
</settings>
<tallies>
<filter id="3" type="material">
<bins>1</bins>
</filter>
<filter id="2" type="material">
<bins>2</bins>
</filter>
<filter id="1" type="material">
<bins>3</bins>
</filter>
<tally id="3" name="Source Tally">
<filters>3</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="2" name="Void Tally">
<filters>2</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="1" name="Absorber Tally">
<filters>1</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
</tallies>
</model>

View file

@ -0,0 +1,9 @@
tally 1:
5.935538E-01
7.061433E-02
tally 2:
3.263210E-02
2.134164E-04
tally 3:
2.107977E-03
8.905227E-07

View file

@ -0,0 +1,245 @@
<?xml version='1.0' encoding='utf-8'?>
<model>
<materials>
<cross_sections>mgxs.h5</cross_sections>
<material id="1" name="source">
<density units="macro" value="1.0"/>
<macroscopic name="source"/>
</material>
<material id="2" name="void">
<density units="macro" value="1.0"/>
<macroscopic name="void"/>
</material>
<material id="3" name="absorber">
<density units="macro" value="1.0"/>
<macroscopic name="absorber"/>
</material>
</materials>
<geometry>
<cell id="1" material="1" name="infinite source region" universe="1"/>
<cell id="2" material="2" name="infinite void region" universe="2"/>
<cell id="3" material="3" name="infinite absorber region" universe="3"/>
<cell fill="4" id="4" universe="5"/>
<cell fill="5" id="5" name="full domain" region="1 -2 3 -4 5 -6" universe="6"/>
<lattice id="4">
<pitch>2.5 2.5 2.5</pitch>
<dimension>12 12 12</dimension>
<lower_left>0.0 0.0 0.0</lower_left>
<universes>
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3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 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 </universes>
</lattice>
<surface boundary="reflective" coeffs="0.0" id="1" type="x-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="2" type="x-plane"/>
<surface boundary="reflective" coeffs="0.0" id="3" type="y-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="4" type="y-plane"/>
<surface boundary="reflective" coeffs="0.0" id="5" type="z-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="6" type="z-plane"/>
</geometry>
<settings>
<run_mode>fixed source</run_mode>
<particles>90</particles>
<batches>10</batches>
<inactive>5</inactive>
<source particle="neutron" strength="3.14" type="independent">
<energy type="discrete">
<parameters>100.0 1.0</parameters>
</energy>
<constraints>
<domain_type>universe</domain_type>
<domain_ids>1</domain_ids>
</constraints>
</source>
<energy_mode>multi-group</energy_mode>
<random_ray>
<distance_active>500.0</distance_active>
<distance_inactive>100.0</distance_inactive>
<source particle="neutron" strength="1.0" type="independent">
<space type="box">
<parameters>0.0 0.0 0.0 30.0 30.0 30.0</parameters>
</space>
</source>
<volume_normalized_flux_tallies>True</volume_normalized_flux_tallies>
<volume_estimator>simulation_averaged</volume_estimator>
</random_ray>
</settings>
<tallies>
<filter id="3" type="material">
<bins>1</bins>
</filter>
<filter id="2" type="material">
<bins>2</bins>
</filter>
<filter id="1" type="material">
<bins>3</bins>
</filter>
<tally id="3" name="Source Tally">
<filters>3</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="2" name="Void Tally">
<filters>2</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="1" name="Absorber Tally">
<filters>1</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
</tallies>
</model>

View file

@ -0,0 +1,9 @@
tally 1:
-5.745886E+02
9.758367E+04
tally 2:
2.971927E-02
1.827222E-04
tally 3:
1.978393E-03
7.951531E-07

View file

@ -0,0 +1,30 @@
import os
import openmc
from openmc.utility_funcs import change_directory
from openmc.examples import random_ray_three_region_cube
import pytest
from tests.testing_harness import TolerantPyAPITestHarness
class MGXSTestHarness(TolerantPyAPITestHarness):
def _cleanup(self):
super()._cleanup()
f = 'mgxs.h5'
if os.path.exists(f):
os.remove(f)
@pytest.mark.parametrize("estimator", ["hybrid",
"simulation_averaged",
"naive"
])
def test_random_ray_volume_estimator(estimator):
with change_directory(estimator):
openmc.reset_auto_ids()
model = random_ray_three_region_cube()
model.settings.random_ray['volume_estimator'] = estimator
harness = MGXSTestHarness('statepoint.10.h5', model)
harness.main()

View file

@ -0,0 +1,246 @@
<?xml version='1.0' encoding='utf-8'?>
<model>
<materials>
<cross_sections>mgxs.h5</cross_sections>
<material id="1" name="source">
<density units="macro" value="1.0"/>
<macroscopic name="source"/>
</material>
<material id="2" name="void">
<density units="macro" value="1.0"/>
<macroscopic name="void"/>
</material>
<material id="3" name="absorber">
<density units="macro" value="1.0"/>
<macroscopic name="absorber"/>
</material>
</materials>
<geometry>
<cell id="1" material="1" name="infinite source region" universe="1"/>
<cell id="2" material="2" name="infinite void region" universe="2"/>
<cell id="3" material="3" name="infinite absorber region" universe="3"/>
<cell fill="4" id="4" universe="5"/>
<cell fill="5" id="5" name="full domain" region="1 -2 3 -4 5 -6" universe="6"/>
<lattice id="4">
<pitch>2.5 2.5 2.5</pitch>
<dimension>12 12 12</dimension>
<lower_left>0.0 0.0 0.0</lower_left>
<universes>
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2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 2 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 </universes>
</lattice>
<surface boundary="reflective" coeffs="0.0" id="1" type="x-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="2" type="x-plane"/>
<surface boundary="reflective" coeffs="0.0" id="3" type="y-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="4" type="y-plane"/>
<surface boundary="reflective" coeffs="0.0" id="5" type="z-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="6" type="z-plane"/>
</geometry>
<settings>
<run_mode>fixed source</run_mode>
<particles>90</particles>
<batches>40</batches>
<inactive>20</inactive>
<source particle="neutron" strength="3.14" type="independent">
<energy type="discrete">
<parameters>100.0 1.0</parameters>
</energy>
<constraints>
<domain_type>universe</domain_type>
<domain_ids>1</domain_ids>
</constraints>
</source>
<energy_mode>multi-group</energy_mode>
<random_ray>
<distance_active>500.0</distance_active>
<distance_inactive>100.0</distance_inactive>
<source particle="neutron" strength="1.0" type="independent">
<space type="box">
<parameters>0.0 0.0 0.0 30.0 30.0 30.0</parameters>
</space>
</source>
<volume_normalized_flux_tallies>True</volume_normalized_flux_tallies>
<source_shape>linear</source_shape>
<volume_estimator>hybrid</volume_estimator>
</random_ray>
</settings>
<tallies>
<filter id="3" type="material">
<bins>1</bins>
</filter>
<filter id="2" type="material">
<bins>2</bins>
</filter>
<filter id="1" type="material">
<bins>3</bins>
</filter>
<tally id="3" name="Source Tally">
<filters>3</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="2" name="Void Tally">
<filters>2</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="1" name="Absorber Tally">
<filters>1</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
</tallies>
</model>

View file

@ -0,0 +1,9 @@
tally 1:
2.339084E+00
2.747299E-01
tally 2:
1.090051E-01
6.073265E-04
tally 3:
7.300117E-03
2.715425E-06

View file

@ -0,0 +1,246 @@
<?xml version='1.0' encoding='utf-8'?>
<model>
<materials>
<cross_sections>mgxs.h5</cross_sections>
<material id="1" name="source">
<density units="macro" value="1.0"/>
<macroscopic name="source"/>
</material>
<material id="2" name="void">
<density units="macro" value="1.0"/>
<macroscopic name="void"/>
</material>
<material id="3" name="absorber">
<density units="macro" value="1.0"/>
<macroscopic name="absorber"/>
</material>
</materials>
<geometry>
<cell id="1" material="1" name="infinite source region" universe="1"/>
<cell id="2" material="2" name="infinite void region" universe="2"/>
<cell id="3" material="3" name="infinite absorber region" universe="3"/>
<cell fill="4" id="4" universe="5"/>
<cell fill="5" id="5" name="full domain" region="1 -2 3 -4 5 -6" universe="6"/>
<lattice id="4">
<pitch>2.5 2.5 2.5</pitch>
<dimension>12 12 12</dimension>
<lower_left>0.0 0.0 0.0</lower_left>
<universes>
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3
1 1 2 2 2 2 2 2 2 2 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 3
2 2 2 2 2 2 2 2 2 2 3 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2 2 2 2 2 2 2 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 </universes>
</lattice>
<surface boundary="reflective" coeffs="0.0" id="1" type="x-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="2" type="x-plane"/>
<surface boundary="reflective" coeffs="0.0" id="3" type="y-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="4" type="y-plane"/>
<surface boundary="reflective" coeffs="0.0" id="5" type="z-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="6" type="z-plane"/>
</geometry>
<settings>
<run_mode>fixed source</run_mode>
<particles>90</particles>
<batches>40</batches>
<inactive>20</inactive>
<source particle="neutron" strength="3.14" type="independent">
<energy type="discrete">
<parameters>100.0 1.0</parameters>
</energy>
<constraints>
<domain_type>universe</domain_type>
<domain_ids>1</domain_ids>
</constraints>
</source>
<energy_mode>multi-group</energy_mode>
<random_ray>
<distance_active>500.0</distance_active>
<distance_inactive>100.0</distance_inactive>
<source particle="neutron" strength="1.0" type="independent">
<space type="box">
<parameters>0.0 0.0 0.0 30.0 30.0 30.0</parameters>
</space>
</source>
<volume_normalized_flux_tallies>True</volume_normalized_flux_tallies>
<source_shape>linear</source_shape>
<volume_estimator>naive</volume_estimator>
</random_ray>
</settings>
<tallies>
<filter id="3" type="material">
<bins>1</bins>
</filter>
<filter id="2" type="material">
<bins>2</bins>
</filter>
<filter id="1" type="material">
<bins>3</bins>
</filter>
<tally id="3" name="Source Tally">
<filters>3</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="2" name="Void Tally">
<filters>2</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="1" name="Absorber Tally">
<filters>1</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
</tallies>
</model>

View file

@ -0,0 +1,9 @@
tally 1:
2.339575E+00
2.748441E-01
tally 2:
1.086360E-01
6.030557E-04
tally 3:
7.298937E-03
2.741185E-06

View file

@ -0,0 +1,246 @@
<?xml version='1.0' encoding='utf-8'?>
<model>
<materials>
<cross_sections>mgxs.h5</cross_sections>
<material id="1" name="source">
<density units="macro" value="1.0"/>
<macroscopic name="source"/>
</material>
<material id="2" name="void">
<density units="macro" value="1.0"/>
<macroscopic name="void"/>
</material>
<material id="3" name="absorber">
<density units="macro" value="1.0"/>
<macroscopic name="absorber"/>
</material>
</materials>
<geometry>
<cell id="1" material="1" name="infinite source region" universe="1"/>
<cell id="2" material="2" name="infinite void region" universe="2"/>
<cell id="3" material="3" name="infinite absorber region" universe="3"/>
<cell fill="4" id="4" universe="5"/>
<cell fill="5" id="5" name="full domain" region="1 -2 3 -4 5 -6" universe="6"/>
<lattice id="4">
<pitch>2.5 2.5 2.5</pitch>
<dimension>12 12 12</dimension>
<lower_left>0.0 0.0 0.0</lower_left>
<universes>
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
2 2 2 2 2 2 2 2 2 2 3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 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 </universes>
</lattice>
<surface boundary="reflective" coeffs="0.0" id="1" type="x-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="2" type="x-plane"/>
<surface boundary="reflective" coeffs="0.0" id="3" type="y-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="4" type="y-plane"/>
<surface boundary="reflective" coeffs="0.0" id="5" type="z-plane"/>
<surface boundary="vacuum" coeffs="30.0" id="6" type="z-plane"/>
</geometry>
<settings>
<run_mode>fixed source</run_mode>
<particles>90</particles>
<batches>40</batches>
<inactive>20</inactive>
<source particle="neutron" strength="3.14" type="independent">
<energy type="discrete">
<parameters>100.0 1.0</parameters>
</energy>
<constraints>
<domain_type>universe</domain_type>
<domain_ids>1</domain_ids>
</constraints>
</source>
<energy_mode>multi-group</energy_mode>
<random_ray>
<distance_active>500.0</distance_active>
<distance_inactive>100.0</distance_inactive>
<source particle="neutron" strength="1.0" type="independent">
<space type="box">
<parameters>0.0 0.0 0.0 30.0 30.0 30.0</parameters>
</space>
</source>
<volume_normalized_flux_tallies>True</volume_normalized_flux_tallies>
<source_shape>linear</source_shape>
<volume_estimator>simulation_averaged</volume_estimator>
</random_ray>
</settings>
<tallies>
<filter id="3" type="material">
<bins>1</bins>
</filter>
<filter id="2" type="material">
<bins>2</bins>
</filter>
<filter id="1" type="material">
<bins>3</bins>
</filter>
<tally id="3" name="Source Tally">
<filters>3</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="2" name="Void Tally">
<filters>2</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="1" name="Absorber Tally">
<filters>1</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
</tallies>
</model>

View file

@ -0,0 +1,9 @@
tally 1:
2.670874E+02
4.432876E+05
tally 2:
1.117459E-01
6.497788E-04
tally 3:
7.563753E-03
2.947210E-06

View file

@ -0,0 +1,32 @@
import os
import openmc
from openmc.utility_funcs import change_directory
from openmc.examples import random_ray_three_region_cube
import pytest
from tests.testing_harness import TolerantPyAPITestHarness
class MGXSTestHarness(TolerantPyAPITestHarness):
def _cleanup(self):
super()._cleanup()
f = 'mgxs.h5'
if os.path.exists(f):
os.remove(f)
@pytest.mark.parametrize("estimator", ["hybrid",
"simulation_averaged",
"naive"
])
def test_random_ray_volume_estimator_linear(estimator):
with change_directory(estimator):
openmc.reset_auto_ids()
model = random_ray_three_region_cube()
model.settings.random_ray['source_shape'] = 'linear'
model.settings.random_ray['volume_estimator'] = estimator
model.settings.inactive = 20
model.settings.batches = 40
harness = MGXSTestHarness('statepoint.40.h5', model)
harness.main()