From c94f2b4f88c8b8f391db9332a74708189161b3df Mon Sep 17 00:00:00 2001 From: yardasol Date: Sat, 27 Dec 2025 21:57:16 -0600 Subject: [PATCH 01/64] add necessary settings and unit tests - add `timestep_parameters` dictionary and `kinetic_simulation` switch to settings.py - add `bd_order` and `time_derivative_method` to `random_ray` dictionary in settings.py - add `density_timeseries` to material.py - add corresponding variables and machinery in the C++ core - add unit tests --- include/openmc/constants.h | 7 +- include/openmc/material.h | 4 + include/openmc/random_ray/bd_utilities.h | 67 +++++ include/openmc/random_ray/random_ray.h | 7 + include/openmc/settings.h | 10 + include/openmc/xsdata.h | 3 + openmc/examples.py | 322 ++++++++++++++++++--- openmc/material.py | 48 ++- openmc/settings.py | 106 ++++++- openmc/statepoint.py | 69 ++++- src/material.cpp | 57 ++++ src/random_ray/random_ray.cpp | 4 + src/settings.cpp | 67 +++++ tests/cpp_unit_tests/CMakeLists.txt | 1 + tests/cpp_unit_tests/test_bd_utilities.cpp | 53 ++++ tests/unit_tests/test_material.py | 11 +- tests/unit_tests/test_settings.py | 23 +- 17 files changed, 806 insertions(+), 53 deletions(-) create mode 100644 include/openmc/random_ray/bd_utilities.h create mode 100644 tests/cpp_unit_tests/test_bd_utilities.cpp diff --git a/include/openmc/constants.h b/include/openmc/constants.h index bba260c3a4b..7bdb5070b30 100644 --- a/include/openmc/constants.h +++ b/include/openmc/constants.h @@ -285,6 +285,7 @@ enum class MgxsType { PROMPT_NU_FISSION, DELAYED_NU_FISSION, NU_FISSION, + CHI, CHI_PROMPT, CHI_DELAYED }; @@ -326,7 +327,10 @@ enum TallyScore { SCORE_PULSE_HEIGHT = -17, // pulse-height SCORE_IFP_TIME_NUM = -18, // IFP lifetime numerator SCORE_IFP_BETA_NUM = -19, // IFP delayed fraction numerator - SCORE_IFP_DENOM = -20 // IFP common denominator + SCORE_IFP_DENOM = -20, // IFP common denominator + SCORE_PRECURSORS = -21 // delyaed neutron precursor concentration + // + }; // Global tally parameters @@ -366,6 +370,7 @@ enum class SolverType { MONTE_CARLO, RANDOM_RAY }; enum class RandomRayVolumeEstimator { NAIVE, SIMULATION_AVERAGED, HYBRID }; enum class RandomRaySourceShape { FLAT, LINEAR, LINEAR_XY }; enum class RandomRaySampleMethod { PRNG, HALTON }; +enum class RandomRayTimeMethod { ISOTROPIC, PROPOGATION }; //============================================================================== // Geometry Constants diff --git a/include/openmc/material.h b/include/openmc/material.h index e36946c71b6..eeb490058ec 100644 --- a/include/openmc/material.h +++ b/include/openmc/material.h @@ -204,6 +204,10 @@ class Material { unique_ptr ttb_; + // Time dependent data + vector + density_timeseries_; //!< Total atom density timeseries in [atom/b-cm] + private: //---------------------------------------------------------------------------- // Private methods diff --git a/include/openmc/random_ray/bd_utilities.h b/include/openmc/random_ray/bd_utilities.h new file mode 100644 index 00000000000..bca7acc432d --- /dev/null +++ b/include/openmc/random_ray/bd_utilities.h @@ -0,0 +1,67 @@ +#ifndef OPENMC_RANDOM_RAY_BD_UTILITIES_H +#define OPENMC_RANDOM_RAY_BD_UTILITIES_H + +#include +#include +#include + +#include "openmc/error.h" +#include "openmc/vector.h" + +namespace openmc { + +//---------------------------------------------------------------------------- +// Helper Variables +// Coefficients come from Table 3 in Fornberg (1988) +// DOI: 10.1090/S0025-5718-1988-0935077-0 +// Note that the signs are flipped compared to the citation, as the author was +// formulating weights for a forward difference +const std::map> bd_coefficients_first_order_ = { + {1, {1.0, -1.0}}, {2, {1.5, -2.0, 0.5}}, + {3, {1.833333333333333, -3.0, 1.5, -0.333333333333333}}, + {4, {2.083333333333333, -4.0, 3.0, -1.333333333333333, 0.25}}, + {5, {2.283333333333333, -5.0, 5.0, -3.333333333333333, 1.25, -0.2}}, + {6, {2.45, -6.0, 7.5, -6.666666666666667, 3.75, -1.2, 0.166666666666667}}}; + +// Coefficients come from Table 3 in Fornberg (1988) +// DOI: 10.1090/S0025-5718-1988-0935077-0 +const std::map> bd_coefficients_second_order_ = { + {1, {1.0, -2.0, 1.0}}, {2, {2.0, -5.0, 4, -1}}, + {3, {2.916666666666667, -8.666666666666667, 9.5, -4.666666666666667, + 0.916666666666667}}, + {4, {3.75, -12.833333333333333, 17.833333333333333, -13.0, 5.083333333333333, + -0.833333333333333}}, + {5, {4.511111111111111, -17.4, 29.25, -28.222222222222222, 16.5, -5.4, + 0.761111111111111}}, + {6, {5.211111111111111, -22.3, 43.95, -52.722222222222222, 41.0, -20.1, + 5.661111111111111, -0.7}}}; + +// Take RHS derivative to solve for the current timestep +template +T rhs_backwards_difference( + std::deque& bd_vector, int bd_order, double dt, int derivative_order = 1) +{ + vector bd_coeffs; + int n_bd_terms; + double time_factor; + if (derivative_order == 1) { + bd_coeffs = bd_coefficients_first_order_.at(bd_order); + time_factor = 1 / dt; + n_bd_terms = bd_order; + } else if (derivative_order == 2) { + bd_coeffs = bd_coefficients_second_order_.at(bd_order); + n_bd_terms = bd_order + 1; + time_factor = 1 / (dt * dt); + } else { + fatal_error("Only first or second order bd derivatives are allowed."); + } + T rhs_bd = 0.0; + for (int i = 0; i < n_bd_terms; i++) + rhs_bd += bd_coeffs[i + 1] * bd_vector[i]; + rhs_bd *= time_factor; + return rhs_bd; +} + +} // namespace openmc + +#endif // OPENMC_RANDOM_RAY_BD_UTILITIES_H diff --git a/include/openmc/random_ray/random_ray.h b/include/openmc/random_ray/random_ray.h index 40c67ef9549..784c37997e0 100644 --- a/include/openmc/random_ray/random_ray.h +++ b/include/openmc/random_ray/random_ray.h @@ -50,6 +50,13 @@ class RandomRay : public Particle { static RandomRaySourceShape source_shape_; // Flag for linear source static RandomRaySampleMethod sample_method_; // Flag for sampling method + // Kinetic simulation variables + static int bd_order_; // Order of backwards difference approximation for + // time-derivatives + static RandomRayTimeMethod + time_method_; // Method for resolving angular flux time derivative term for + // flux propogation + //---------------------------------------------------------------------------- // Public data members vector angular_flux_; diff --git a/include/openmc/settings.h b/include/openmc/settings.h index b369c99fef8..4a6bb70d915 100644 --- a/include/openmc/settings.h +++ b/include/openmc/settings.h @@ -71,6 +71,8 @@ extern "C" bool entropy_on; //!< calculate Shannon entropy? extern "C" bool event_based; //!< use event-based mode (instead of history-based) extern bool ifp_on; //!< Use IFP for kinetics parameters? +extern bool kinetic_simulation; //!< Flag determining if the simulation is + //!< kinetic or static extern bool legendre_to_tabular; //!< convert Legendre distributions to tabular? extern bool material_cell_offsets; //!< create material cells offsets? extern "C" bool output_summary; //!< write summary.h5? @@ -198,6 +200,14 @@ extern "C" int verbosity; //!< How verbose to make output extern double weight_cutoff; //!< Weight cutoff for Russian roulette extern double weight_survive; //!< Survival weight after Russian roulette +// Timestep variables for kinetic simulation +extern int n_timesteps; //!< number of timesteps +extern double dt; //!< fixed timestep size +extern int current_timestep; //!< current timestep index +extern bool + is_initial_condition; //!< if eigenvalue/fixed source sim is an initial + // condition for a time-dependent simulation + } // namespace settings //============================================================================== diff --git a/include/openmc/xsdata.h b/include/openmc/xsdata.h index feafde68dd3..134f738fa08 100644 --- a/include/openmc/xsdata.h +++ b/include/openmc/xsdata.h @@ -83,6 +83,9 @@ class XsData { // delayed_nu_fission has the following dimensions: // [angle][delayed group][incoming group] xt::xtensor delayed_nu_fission; + // chi has the following dimensions: + // [angle][incoming group][outgoing group] + xt::xtensor chi; // chi_prompt has the following dimensions: // [angle][incoming group][outgoing group] xt::xtensor chi_prompt; diff --git a/openmc/examples.py b/openmc/examples.py index 01dd9d01f97..097d7c99715 100644 --- a/openmc/examples.py +++ b/openmc/examples.py @@ -4,7 +4,8 @@ import openmc - +C5G7_N_DG = 8 +PINCELL_PITCH = 1.26 def pwr_pin_cell() -> openmc.Model: """Create a PWR pin-cell model. @@ -655,31 +656,46 @@ def slab_mg(num_regions=1, mat_names=None, mgxslib_name='2g.h5') -> openmc.Model return model +def _generate_c5g7_materials(time_dependent) -> openmc.Materials: + """Generate materials utilizing multi-group cross sections based on the + the C5G7 Benchmark. -def random_ray_lattice() -> openmc.Model: - """Create a 2x2 PWR pincell asymmetrical lattic eexample. - - This model is a 2x2 reflective lattice of fuel pins with one of the lattice - locations having just moderator instead of a fuel pin. It uses 7 group - cross section data. + Parameters + ---------- + time_dependent : bool + Flag to generate cross sections for a time-dependent model or not. Returns ------- - model : openmc.Model - A PWR 2x2 lattice model - + materials : openmc.Materials + Materials object containing UO2 and water materials. + + Data Sources + ------------ + Prompt and delated fission cross sections, prompt and delayed fission + spectra, decay constants, delayed neutron fractions, and velocity data come + from: + Hou et al., "OECD/NEA benchmark for time-dependnet neutron + transport calculations without homogeniztaion" + DOI: 10.1016/j.nucengdes.2017.02.008 + + All other cross section data are from: + Lewis et al., "Benchmark specification for determinisitc 2D/3D MOX fuel + assembly transport calculations without spatial homogenization" """ - model = openmc.Model() - - ########################################################################### - # Create MGXS data for the problem - # Instantiate the energy group data group_edges = [1e-5, 0.0635, 10.0, 1.0e2, 1.0e3, 0.5e6, 1.0e6, 20.0e6] groups = openmc.mgxs.EnergyGroups(group_edges) + # Number of delayed groups for a time-dependent simulation + # Delayed cross section values + # come from Hou et al., "OECD/NEA benchmark for time-dependnet neutron + # transport calculations without homogeniztaion" + # DOI: 10.1016/j.nucengdes.2017.02.008 + n_dg = C5G7_N_DG if time_dependent else 0 + # Instantiate the 7-group (C5G7) cross section data - uo2_xsdata = openmc.XSdata('UO2', groups) + uo2_xsdata = openmc.XSdata('UO2', groups, num_delayed_groups=n_dg) uo2_xsdata.order = 0 uo2_xsdata.set_total( [0.1779492, 0.3298048, 0.4803882, 0.5543674, 0.3118013, 0.3951678, @@ -704,13 +720,68 @@ def random_ray_lattice() -> openmc.Model: uo2_xsdata.set_fission([7.21206e-03, 8.19301e-04, 6.45320e-03, 1.85648e-02, 1.78084e-02, 8.30348e-02, 2.16004e-01]) - uo2_xsdata.set_nu_fission([2.005998e-02, 2.027303e-03, 1.570599e-02, - 4.518301e-02, 4.334208e-02, 2.020901e-01, - 5.257105e-01]) + nu_fission = np.array([2.005998e-02, 2.027303e-03, 1.570599e-02, + 4.518301e-02, 4.334208e-02, 2.020901e-01, + 5.257105e-01]) + uo2_xsdata.set_nu_fission(nu_fission) uo2_xsdata.set_chi([5.8791e-01, 4.1176e-01, 3.3906e-04, 1.1761e-07, 0.0000e+00, 0.0000e+00, 0.0000e+00]) - h2o_xsdata = openmc.XSdata('LWTR', groups) + # Delayed and prompt cross sections for time-dependent simulation + if time_dependent: + + # Table A2 in Hou et. al + beta = np.array([[2.13333e-04, 2.13333e-04, 2.13333e-04, 2.13333e-04, 2.13333e-04, 2.13333e-04, 2.13333e-04], + [1.04514e-03, 1.04514e-03, 1.04514e-03, 1.04514e-03, + 1.04514e-03, 1.04514e-03, 1.04514e-03], + [6.03969e-04, 6.03969e-04, 6.03969e-04, 6.03969e-04, + 6.03969e-04, 6.03969e-04, 6.03969e-04], + [1.33963e-03, 1.33963e-03, 1.33963e-03, 1.33963e-03, + 1.33963e-03, 1.33963e-03, 1.33963e-03], + [2.29386e-03, 2.29386e-03, 2.29386e-03, 2.29386e-03, + 2.29386e-03, 2.29386e-03, 2.29386e-03], + [7.05174e-04, 7.05174e-04, 7.05174e-04, 7.05174e-04, + 7.05174e-04, 7.05174e-04, 7.05174e-04], + [6.00381e-04, 6.00381e-04, 6.00381e-04, 6.00381e-04, + 6.00381e-04, 6.00381e-04, 6.00381e-04], + [2.07736e-04, 2.07736e-04, 2.07736e-04, 2.07736e-04, 2.07736e-04, 2.07736e-04, 2.07736e-04]]) + # the actual tot is 7.009223e-03 + beta_tot = 7.00922e-03 + + # Table A2 in Hou et. al + uo2_xsdata.set_decay_rate([1.247e-02, 2.829e-02, 4.252e-02, + 1.330e-01, 2.925e-01, 6.665e-01, + 1.635e+00, 3.555e+00]) + # Derived from manipulating eq. B-3 in Hou et al. + # chi_prompt = (chi - np.sum(chi_delayed * beta, 0)) / (1 - beta_tot) + uo2_xsdata.set_chi_prompt([5.91741e-01, 4.07977e-01, 2.91169e-04, + 1.18440e-07, 0.00000e+00, 0.00000e+00, + 0.00000e+00]) + # Table A3 in Hou et al. + chi_delayed = np.array([[0.00075, 0.98512, 0.01413, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00], + [0.03049, 0.96907, 0.00044, 0.0000e+00, + 0.0000e+00, 0.0000e+00, 0.0000e+00], + [0.00457, 0.97401, 0.02142, 0.0000e+00, + 0.0000e+00, 0.0000e+00, 0.0000e+00], + [0.02002, 0.97271, 0.00727, 0.0000e+00, + 0.0000e+00, 0.0000e+00, 0.0000e+00], + [0.05601, 0.93818, 0.00581, 0.0000e+00, + 0.0000e+00, 0.0000e+00, 0.0000e+00], + [0.06098, 0.93444, 0.00458, 0.0000e+00, + 0.0000e+00, 0.0000e+00, 0.0000e+00], + [0.10635, 0.88298, 0.01067, 0.0000e+00, + 0.0000e+00, 0.0000e+00, 0.0000e+00], + [0.09346, 0.9026, 0.00394, 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00]]) + uo2_xsdata.set_chi_delayed(chi_delayed) + # Table A4 in Hou et al. + velocities = np.array([2.23466e+09, 5.07347e+08, 3.86595e+07, + 5.13931e+06, 1.67734e+06, 7.28603e+05, 2.92902e+05]) + uo2_xsdata.set_inverse_velocity(1 / velocities) + # We need to set these so XsData::fission_matrix_beta_from_hdf5 is set + uo2_xsdata.set_prompt_nu_fission((1 - beta_tot) * nu_fission) + uo2_xsdata.set_delayed_nu_fission(beta * nu_fission) + + h2o_xsdata = openmc.XSdata('LWTR', groups, num_delayed_groups=n_dg) h2o_xsdata.order = 0 h2o_xsdata.set_total([0.15920605, 0.412969593, 0.59030986, 0.58435, 0.718, 1.2544497, 2.650379]) @@ -733,7 +804,13 @@ def random_ray_lattice() -> openmc.Model: scatter_matrix = np.rollaxis(scatter_matrix, 0, 3) h2o_xsdata.set_scatter_matrix(scatter_matrix) - mg_cross_sections = openmc.MGXSLibrary(groups) + if time_dependent: + # Table A4 in Hou et al. + velocities = np.array([2.23517E+09, 4.98880E+08, 3.84974E+07, + 5.12639E+06, 1.67542E+06, 7.26031E+05, 2.81629E+05]) + h2o_xsdata.set_inverse_velocity(1 / velocities) + + mg_cross_sections = openmc.MGXSLibrary(groups, num_delayed_groups=n_dg) mg_cross_sections.add_xsdatas([uo2_xsdata, h2o_xsdata]) mg_cross_sections.export_to_hdf5('mgxs.h5') @@ -745,21 +822,39 @@ def random_ray_lattice() -> openmc.Model: uo2.set_density('macro', 1.0) uo2.add_macroscopic('UO2') + if time_dependent: + densities = np.linspace(1, 0.95, 100) + else: + densities = None + water = openmc.Material(name='Water') - water.set_density('macro', 1.0) + water.set_density('macro', 1.0, densities) water.add_macroscopic('LWTR') # Instantiate a Materials collection and export to XML materials = openmc.Materials([uo2, water]) materials.cross_sections = "mgxs.h5" + return materials - ########################################################################### - # Define problem geometry +def _generate_random_ray_pin_cell(uo2, water) -> openmc.Universe: + """Create a random ray pin cell universe. Helper function for + random_ray_pin_cell() and random_ray_lattice() - ######################################## - # Define an unbounded pincell universe + Parameters + ---------- + uo2 : openmc.Material + UO2 material + water : openmc.Material + Water material - pitch = 1.26 + Returns + ------- + pincell : openmc.Universe + Universe containing an unbounded pin cell + + """ + ######################################## + # Define an unbounded pin cell universe # Create a surface for the fuel outer radius fuel_or = openmc.ZCylinder(r=0.54, name='Fuel OR') @@ -781,7 +876,7 @@ def random_ray_lattice() -> openmc.Model: moderator_c = openmc.Cell( fill=water, region=+outer_ring_b, name='moderator outer c') - # Create pincell universe + # Create pin cell universe pincell_base = openmc.Universe() # Register Cells with Universe @@ -801,22 +896,156 @@ def random_ray_lattice() -> openmc.Model: for i in range(8): azimuthal_cell = openmc.Cell(name=f'azimuthal_cell_{i}') azimuthal_cell.fill = pincell_base - azimuthal_cell.region = +azimuthal_planes[i] & -azimuthal_planes[(i+1) % 8] + azimuthal_cell.region = + \ + azimuthal_planes[i] & -azimuthal_planes[(i+1) % 8] azimuthal_cells.append(azimuthal_cell) # Create a geometry with the azimuthal universes pincell = openmc.Universe(cells=azimuthal_cells, name='pincell') + return pincell + +def random_ray_pin_cell(time_dependent=False) -> openmc.Model: + """Create a PWR pin cell example using C5G7 cross section data. + cross section data. + + Parameters + ---------- + time_dependent : bool + Flag to generate a time-dependent model or not. + + Returns + ------- + model : openmc.Model + A PWR pin cell model + + """ + model = openmc.Model() + + ########################################################################### + # Create Materials for the problem + materials = _generate_c5g7_materials(time_dependent) + uo2 = materials[0] + water = materials[1] + + ########################################################################### + # Define problem geometry + pincell = _generate_random_ray_pin_cell(uo2, water) + + ######################################## + # Define cell containing lattice and other stuff + box = openmc.model.RectangularPrism( + PINCELL_PITCH, PINCELL_PITCH, boundary_type='reflective') + + pincell = openmc.Cell(fill=pincell, region=-box, name='pincell') + + # Create a geometry with the top-level cell + geometry = openmc.Geometry([pincell]) + + ########################################################################### + # Define problem settings + + # Instantiate a Settings object, set all runtime parameters, and export to XML + settings = openmc.Settings() + settings.energy_mode = "multi-group" + settings.batches = 400 + settings.inactive = 200 + settings.particles = 100 + + # Create an initial uniform spatial source distribution over fissionable zones + lower_left = (-PINCELL_PITCH / 2, -PINCELL_PITCH / 2, -1) + upper_right = (PINCELL_PITCH / 2, PINCELL_PITCH / 2, 1) + uniform_dist = openmc.stats.Box(lower_left, upper_right) + rr_source = openmc.IndependentSource(space=uniform_dist) + + settings.random_ray['distance_active'] = 100.0 + settings.random_ray['distance_inactive'] = 20.0 + settings.random_ray['ray_source'] = rr_source + settings.random_ray['volume_normalized_flux_tallies'] = True + if time_dependent: + settings.run_mode = "time dependent" + settings.time_dependent = { + "dt": 0.01, + "n_timesteps": 20, + "timestep_units": "s", + } + + ########################################################################### + # Define tallies + # Now use the mesh filter in a tally and indicate what scores are desired + tally = openmc.Tally(name="Pin tally") + tally.scores = ['flux', 'fission', 'nu-fission'] + tally.estimator = 'analog' + + # Instantiate a Tallies collection and export to XML + tallies = openmc.Tallies([tally]) + + if time_dependent: + delay_filter = openmc.DelayedGroupFilter(np.arange(1, C5G7_N_DG+1, 1)) + tally = openmc.Tally(name="Delayed tally") + tally.filters = [delay_filter] + tally.scores += ['precursors'] + tallies.append(tally) + + ########################################################################### + # Exporting to OpenMC model + ########################################################################### + + model.geometry = geometry + model.materials = materials + model.settings = settings + model.tallies = tallies + return model + +def random_ray_lattice(time_dependent=False) -> openmc.Model: + """Create a 2x2 PWR pin cell asymmetrical lattice example. + + This model is a 2x2 reflective lattice of fuel pins with one of the lattice + locations having just moderator instead of a fuel pin. It uses C5G7 + cross section data. + + Parameters + ---------- + time_dependent : bool + Flag to generate a time-dependent model or not. + + Returns + ------- + model : openmc.Model + A PWR 2x2 lattice model + + """ + model = openmc.Model() + + ########################################################################### + # Create Materials for the problem + materials = _generate_c5g7_materials(time_dependent) + uo2 = materials[0] + water = materials[1] + + ########################################################################### + # Define problem geometry + pincell = _generate_random_ray_pin_cell(uo2, water) + ######################################## # Define a moderator lattice universe - moderator_infinite = openmc.Cell(fill=water, name='moderator infinite') + moderator_infinite = openmc.Cell(name='moderator infinite') + if time_dependent: + water_reflector = water.clone() + water_reflector.name='Water Reflector' + water_reflector.set_density('macro', 1.0) + materials.append(water_reflector) + moderator_infinite.fill = water_reflector + else: + moderator_infinite.fill = water + mu = openmc.Universe() mu.add_cells([moderator_infinite]) lattice = openmc.RectLattice() - lattice.lower_left = [-pitch/2.0, -pitch/2.0] - lattice.pitch = [pitch/10.0, pitch/10.0] + lattice.lower_left = [-PINCELL_PITCH/2.0, -PINCELL_PITCH/2.0] + lattice.pitch = [PINCELL_PITCH/10.0, PINCELL_PITCH/10.0] lattice.universes = np.full((10, 10), mu) mod_lattice_cell = openmc.Cell(fill=lattice) @@ -828,8 +1057,8 @@ def random_ray_lattice() -> openmc.Model: ######################################## # Define 2x2 outer lattice lattice2x2 = openmc.RectLattice() - lattice2x2.lower_left = (-pitch, -pitch) - lattice2x2.pitch = (pitch, pitch) + lattice2x2.lower_left = (-PINCELL_PITCH, -PINCELL_PITCH) + lattice2x2.pitch = (PINCELL_PITCH, PINCELL_PITCH) lattice2x2.universes = [ [pincell, pincell], [pincell, mod_lattice_uni] @@ -838,7 +1067,7 @@ def random_ray_lattice() -> openmc.Model: ######################################## # Define cell containing lattice and other stuff box = openmc.model.RectangularPrism( - pitch*2, pitch*2, boundary_type='reflective') + PINCELL_PITCH*2, PINCELL_PITCH*2, boundary_type='reflective') assembly = openmc.Cell(fill=lattice2x2, region=-box, name='assembly') @@ -856,8 +1085,8 @@ def random_ray_lattice() -> openmc.Model: settings.particles = 100 # Create an initial uniform spatial source distribution over fissionable zones - lower_left = (-pitch, -pitch, -1) - upper_right = (pitch, pitch, 1) + lower_left = (-PINCELL_PITCH, -PINCELL_PITCH, -1) + upper_right = (PINCELL_PITCH, PINCELL_PITCH, 1) uniform_dist = openmc.stats.Box(lower_left, upper_right) rr_source = openmc.IndependentSource(space=uniform_dist) @@ -865,6 +1094,13 @@ def random_ray_lattice() -> openmc.Model: settings.random_ray['distance_inactive'] = 20.0 settings.random_ray['ray_source'] = rr_source settings.random_ray['volume_normalized_flux_tallies'] = True + if time_dependent: + settings.run_mode = "time dependent" + settings.time_dependent = { + "dt": 0.01, + "n_timesteps": 2, + "timestep_units": "s", + } ########################################################################### # Define tallies @@ -872,8 +1108,8 @@ def random_ray_lattice() -> openmc.Model: # Create a mesh that will be used for tallying mesh = openmc.RegularMesh() mesh.dimension = (2, 2) - mesh.lower_left = (-pitch, -pitch) - mesh.upper_right = (pitch, pitch) + mesh.lower_left = (-PINCELL_PITCH, -PINCELL_PITCH) + mesh.upper_right = (PINCELL_PITCH, PINCELL_PITCH) # Create a mesh filter that can be used in a tally mesh_filter = openmc.MeshFilter(mesh) @@ -891,6 +1127,13 @@ def random_ray_lattice() -> openmc.Model: # Instantiate a Tallies collection and export to XML tallies = openmc.Tallies([tally]) + if time_dependent: + delay_filter = openmc.DelayedGroupFilter(np.arange(1, C5G7_N_DG+1, 1)) + tally = openmc.Tally(name="Mesh delayed tally") + tally.filters = [mesh_filter, delay_filter] + tally.scores += ['precursors'] + tallies.append(tally) + ########################################################################### # Exporting to OpenMC model ########################################################################### @@ -901,7 +1144,6 @@ def random_ray_lattice() -> openmc.Model: model.tallies = tallies return model - def random_ray_three_region_cube() -> openmc.Model: """Create a three region cube model. diff --git a/openmc/material.py b/openmc/material.py index 735a0574326..c483401adbc 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -89,6 +89,12 @@ class Material(IDManagerMixin): Temperature of the material in Kelvin. density : float Density of the material (units defined separately) + density_timeseries : list of float + Density timeseries of the material for time-dependent simulations. Units + assumed to be the same as `density_units`. Must be have size equal to + :attr:`openmc.Settings.time_dependent['n_timesteps']`. + + .. versionadded:: 0.16.0 density_units : str Units used for `density`. Can be one of 'g/cm3', 'g/cc', 'kg/m3', 'atom/b-cm', 'atom/cm3', 'sum', or 'macro'. The 'macro' unit only @@ -137,6 +143,7 @@ def __init__( name: str = "", temperature: float | None = None, density: float | None = None, + density_timeseries: list[float] | None = None, density_units: str = "sum", depletable: bool | None = False, volume: float | None = None, @@ -148,6 +155,7 @@ def __init__( self.name = name self.temperature = temperature self._density = None + self._density_timeseries = None self._density_units = density_units self._depletable = depletable self._paths = None @@ -185,6 +193,11 @@ def __repr__(self) -> str: string += '{: <16}=\t{}'.format('\tDensity', self._density) string += f' [{self._density_units}]\n' + if self._density_timeseries is not None: + string += '{: <16}\n'.format('\tDensity Timeseries') + dens_ts_string = " ".join(str(x) for x in self._density_timeseries) + string += '{: <16}\n'.format(dens_ts_string) + string += '{: <16}=\t{} [cm^3]\n'.format('\tVolume', self._volume) string += '{: <16}=\t{}\n'.format('\tDepletable', self._depletable) @@ -235,6 +248,10 @@ def temperature(self, temperature: Real | None): def density(self) -> float | None: return self._density + @property + def density_timeseries(self) -> list[str] | None: + return self._density_timeseries + @property def density_units(self) -> str: return self._density_units @@ -447,6 +464,7 @@ def from_hdf5(cls, group: h5py.Group) -> Material: material.add_s_alpha_beta(name) # Set the Material's density to atom/b-cm as used by OpenMC + # TODO: Add support for density_timeseries material.set_density(density=density, units='atom/b-cm') if 'nuclides' in group: @@ -523,6 +541,7 @@ def openmc_natabund(Z): else: material.add_element(elemname, frac) + # TODO: add support for density_timeseries material.set_density('g/cm3', nc_mat.getDensity()) material._ncrystal_cfg = NCrystal.normaliseCfg(cfg) @@ -547,7 +566,8 @@ def add_volume_information(self, volume_calc): else: raise ValueError(f'No volume information found for material ID={self.id}.') - def set_density(self, units: str, density: float | None = None): + def set_density(self, units: str, density: float | None = None, + density_timeseries: list[float] | None = None): """Set the density of the material Parameters @@ -557,7 +577,11 @@ def set_density(self, units: str, density: float | None = None): density : float, optional Value of the density. Must be specified unless units is given as 'sum'. + density_timeseries : list of float, optional + Timeseries of density. Can only be specified if units are not given + as 'sum'. + .. versionadded:: 0.16.0 """ cv.check_value('density units', units, DENSITY_UNITS) @@ -568,6 +592,10 @@ def set_density(self, units: str, density: float | None = None): msg = 'Density "{}" for Material ID="{}" is ignored ' \ 'because the unit is "sum"'.format(density, self.id) warnings.warn(msg) + if density_timeseries is not None: + msg = 'Density timeseries cannot be used when ' \ + 'using "sum" density units.' + raise ValueError(msg) else: if density is None: msg = 'Unable to set the density for Material ID="{}" ' \ @@ -578,6 +606,12 @@ def set_density(self, units: str, density: float | None = None): cv.check_type(f'the density for Material ID="{self.id}"', density, Real) self._density = density + if density_timeseries is not None: + cv.check_type(f'the density timeseries for Material ID="{self.id}"', + density_timeseries, Iterable, Real) + self._density_timeseries = density_timeseries + else: + self._density_timeseries = None def add_nuclide(self, nuclide: str, percent: float, percent_type: str = 'ao'): """Add a nuclide to the material @@ -1588,6 +1622,10 @@ def to_xml_element( if self._density_units != 'sum': subelement.set("value", str(self._density)) subelement.set("units", self._density_units) + if self._density_timeseries is not None: + timeseries_text = " ".join(str(x) for x in self._density_timeseries) + subelement.set("value_timeseries", timeseries_text) + else: raise ValueError(f'Density has not been set for material {self.id}!') @@ -1615,6 +1653,7 @@ def to_xml_element( return element + # TODO: add support for density_timeseries @classmethod def mix_materials(cls, materials, fracs: Iterable[float], percent_type: str = 'ao', **kwargs) -> Material: @@ -1771,7 +1810,12 @@ def from_xml_element(cls, elem: ET.Element) -> Material: mat.set_density(units) else: value = float(get_text(density, 'value')) - mat.set_density(units, value) + text = get_text(density, 'value_timeseries') + if text is not None: + density_timeseries = [float(x) for x in text.split()] + else: + density_timeseries = None + mat.set_density(units, value, density_timeseries) # Check for isotropic scattering nuclides isotropic = get_elem_list(elem, "isotropic", str) diff --git a/openmc/settings.py b/openmc/settings.py index 76e191c5e02..03111f87628 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -26,7 +26,6 @@ class RunMode(Enum): VOLUME = 'volume' PARTICLE_RESTART = 'particle restart' - _RES_SCAT_METHODS = {'dbrc', 'rvs'} @@ -125,6 +124,8 @@ class Settings: type are 'variance', 'std_dev', and 'rel_err'. The threshold value should be a float indicating the variance, standard deviation, or relative error used. + kinetic_simulation : bool + Flag for whether or not to run a kinetic simulation log_grid_bins : int Number of bins for logarithmic energy grid search material_cell_offsets : bool @@ -224,6 +225,15 @@ class Settings: stabilization, which may be desirable as stronger diagonal stabilization also tends to dampen the convergence rate of the solver, thus requiring more iterations to converge. + Additional options are available when running a kinetic simulation: + + :bd_order: + Indicates the integer order of backwards difference approximation used to + numerically compute time derivatives. + :time_derivative_method: + Method for resolving :math:`\\frac{\\partial}{\\partial t} + \\psi_{r,g}(s,t)` in the time-dependent charactersitic equation. + Options are 'isotropic' (default), or 'propogation'. .. versionadded:: 0.15.0 resonance_scattering : dict @@ -308,6 +318,18 @@ class Settings: sections be loaded at all temperatures within the range. 'multipole' is a boolean indicating whether or not the windowed multipole method should be used to evaluate resolved resonance cross sections. + timestep_parameters : dict + Time step parameters for kinetic simulations. Acceptable keys are: + :dt: + Fixed timestep size. + :n_timesteps: + Numeber of timesteps. + :timestep_units: + `ms`,`s`, `min`. Units for timesteps. `ms` means miliseconds, `s` + means seconds, `min` means minutes. + + .. versionadded:: 0.16 + trace : tuple or list Show detailed information about a single particle, indicated by three integers: the batch number, generation number, and particle number @@ -377,6 +399,8 @@ def __init__(self, **kwargs): self._max_write_lost_particles = None self._particles = None self._keff_trigger = None + self._kinetic_simulation = None + self._timestep_parameters = {} # Energy mode subelement self._energy_mode = None @@ -586,6 +610,39 @@ def keff_trigger(self, keff_trigger: dict): self._keff_trigger = keff_trigger + @property + def kinetic_simulation(self) -> bool: + return self._kinetic_simulation + + @kinetic_simulation.setter + def kinetic_simulation(self, value: bool): + cv.check_type('kinetic simulation', value, bool) + self._kinetic_simulation = value + + @property + def timestep_parameters(self) -> dict: + return self._timestep_parameters + + @timestep_parameters.setter + def timestep_parameters(self, timestep_parameters: dict): + if not isinstance(timestep_parameters, Mapping): + raise ValueError(f'Unable to set timestep_parameters from "{timestep_parameters}" ' + 'which is not a dict.') + for key, value in timestep_parameters.items(): + if key == 'dt': + cv.check_type('dt', value, Real) + cv.check_greater_than('dt', value, 0) + elif key == 'n_timesteps': + cv.check_type('n_timesteps', value, Integral) + cv.check_greater_than('n_timesteps', value, 0) + elif key == 'timestep_units': + cv.check_value( + 'timestep units', value, ('ms', 's', 'min')) + else: + raise ValueError(f'Unable to set time dependent to "{key}" which is ' + 'unsupported by OpenMC') + self._timestep_parameters = timestep_parameters + @property def energy_mode(self) -> str: return self._energy_mode @@ -1006,7 +1063,7 @@ def temperature(self, temperature: dict): cv.check_type('temperature', T, Real) self._temperature = temperature - + @property def trace(self) -> Iterable: return self._trace @@ -1345,6 +1402,14 @@ def random_ray(self, random_ray: dict): cv.check_type('diagonal stabilization rho', value, Real) cv.check_greater_than('diagonal stabilization rho', value, 0.0, True) + elif self.run_mode == 'time dependent': + if key == 'bd_order': + cv.check_type('BD order', value, Integer) + cv.check_greater_than('BD order', value, 0) + cv.check_less_than('BD order', value, 7) + elif key == 'time_derivative method': + cv.check_value('time derivative method', value, + ('isotropic', 'propogation')) else: raise ValueError(f'Unable to set random ray to "{key}" which is ' 'unsupported by OpenMC') @@ -1431,6 +1496,18 @@ def _create_keff_trigger_subelement(self, root): subelement = ET.SubElement(element, key) subelement.text = str(value).lower() + def _create_kinetic_simulation_subelement(self, root): + if self._kinetic_simulation is not None: + elem = ET.SubElement(root, "kinetic_simulation") + elem.text = str(self._kinetic_simulation).lower() + + def _create_timestep_parameters_subelement(self, root): + if self._timestep_parameters: + element = ET.SubElement(root, "timestep_parameters") + for key, value in self._timestep_parameters.items(): + subelement = ET.SubElement(element, key) + subelement.text = str(value) + def _create_energy_mode_subelement(self, root): if self._energy_mode is not None: element = ET.SubElement(root, "energy_mode") @@ -1972,6 +2049,23 @@ def _keff_trigger_from_xml_element(self, root): threshold = float(get_text(elem, 'threshold')) self.keff_trigger = {'type': trigger, 'threshold': threshold} + def _kinetic_simulation_from_xml_element(self, root): + text = get_text(root, 'kinetic_simulation') + if text is not None: + self.kinetic_simulation = text in ('true', '1') + + def _timestep_parameters_from_xml_element(self, root): + elem = root.find('timestep_parameters') + if elem is not None: + self.timestep_parameters = {} + for child in elem: + if child.tag == 'n_timesteps': + self.timestep_parameters[child.tag] = int(child.text) + elif child.tag == 'timestep_units': + self.timestep_parameters['timestep_units'] = child.text + elif child.tag == 'dt': + self.timestep_parameters['dt'] = float(child.text) + def _source_from_xml_element(self, root, meshes=None): for elem in root.findall('source'): src = SourceBase.from_xml_element(elem, meshes) @@ -2360,6 +2454,10 @@ def _random_ray_from_xml_element(self, root, meshes=None): domains.append(domain) self.random_ray['source_region_meshes'].append( (mesh, domains)) + elif child.tag == 'bd_order': + self.random_ray['bd_order'] = int(child.text) + elif child.tag == 'time_derivative_method': + self.random_ray['time_derivative_method'] = child.text def _use_decay_photons_from_xml_element(self, root): text = get_text(root, 'use_decay_photons') @@ -2396,6 +2494,8 @@ def to_xml_element(self, mesh_memo=None): self._create_max_write_lost_particles_subelement(element) self._create_generations_per_batch_subelement(element) self._create_keff_trigger_subelement(element) + self._create_kinetic_simulation_subelement(element) + self._create_timestep_parameters_subelement(element) self._create_source_subelement(element, mesh_memo) self._create_output_subelement(element) self._create_statepoint_subelement(element) @@ -2509,6 +2609,8 @@ def from_xml_element(cls, elem, meshes=None): settings._max_write_lost_particles_from_xml_element(elem) settings._generations_per_batch_from_xml_element(elem) settings._keff_trigger_from_xml_element(elem) + settings._kinetic_simulation_from_xml_element(elem) + settings._timestep_parameters_from_xml_element(elem) settings._source_from_xml_element(elem, meshes) settings._volume_calcs_from_xml_element(elem) settings._output_from_xml_element(elem) diff --git a/openmc/statepoint.py b/openmc/statepoint.py index a10ec3a839d..fa7ed350369 100644 --- a/openmc/statepoint.py +++ b/openmc/statepoint.py @@ -57,6 +57,10 @@ class StatePoint: Number of batches simulated date_and_time : datetime.datetime Date and time at which statepoint was written + energy_mode : str + 'continuous-energy', 'multi-group' + + .. versionadded:: 0.16.0 entropy : numpy.ndarray Shannon entropy of fission source at each batch filters : dict @@ -85,6 +89,14 @@ class StatePoint: .. versionadded:: 0.13.1 meshes : dict Dictionary whose keys are mesh IDs and whose values are MeshBase objects + n_energy_groups : int + Number of energy groups used in a multi-group simulation. + + .. versionadded:: 0.16.0 + n_delay_groups : int + Number of delay groups used in a multi-group simulation. + + .. versionadded:: 0.16.0 n_batches : int Number of batches n_inactive : int @@ -97,6 +109,14 @@ class StatePoint: Working directory for simulation photon_transport : bool Indicate whether photon transport is active + random_ray : dict + Dictionary whose keys are the following strings used to describing + various random ray metrics. These include simulation settings (e.g. + 'source_shape', 'volume_estimator', 'volume_normalized_flux_tallies', + etc.) and performance metrics (e.g. 'avg_miss_rate', + 'n_source_regions', 'n_integrations', etc.) + + .. versionadded:: 0.16.0 run_mode : str Simulation run mode, e.g. 'eigenvalue' runtime : dict @@ -106,6 +126,10 @@ class StatePoint: Pseudorandom number generator seed stride : int Number of random numbers allocated for each particle history + solver_type : str + 'monte carlo', 'random ray' + + .. versionadded:: 0.16.0 source : numpy.ndarray of compound datatype Array of source sites. The compound datatype has fields 'r', 'u', 'E', 'wgt', 'delayed_group', 'surf_id', and 'particle', corresponding to @@ -210,9 +234,13 @@ def date_and_time(self): s = self._f.attrs['date_and_time'].decode() return datetime.strptime(s, '%Y-%m-%d %H:%M:%S') + @property + def energy_mode(self): + return self._f['energy_mode'][()].decode() + @property def entropy(self): - if self.run_mode == 'eigenvalue': + if self.run_mode == 'eigenvalue' or self.run_mode == 'time dependent': return self._f['entropy'][()] else: return None @@ -233,7 +261,7 @@ def filters(self): @property def generations_per_batch(self): - if self.run_mode == 'eigenvalue': + if self.run_mode == 'eigenvalue' or self.run_mode == 'time dependent': return self._f['generations_per_batch'][()] else: return None @@ -275,7 +303,7 @@ def k_generation(self): @property def keff(self): - if self.run_mode == 'eigenvalue': + if self.run_mode == 'eigenvalue' or self.run_mode == 'time dependent': return ufloat(*self._f['k_combined'][()]) else: return None @@ -323,13 +351,27 @@ def meshes(self): return self._meshes + @property + def n_energy_groups(self): + if self.energy_mode == 'multi-group': + return self._f['n_energy_groups'][()] + else: + return None + + @property + def n_delay_groups(self): + if self.energy_mode == 'multi-group': + return self._f['n_delay_groups'][()] + else: + return None + @property def n_batches(self): return self._f['n_batches'][()] @property def n_inactive(self): - if self.run_mode == 'eigenvalue': + if self.run_mode == 'eigenvalue' or self.run_mode == 'time dependent': return self._f['n_inactive'][()] else: return None @@ -350,6 +392,21 @@ def path(self): def photon_transport(self): return self._f.attrs['photon_transport'] > 0 + @property + def random_ray(self): + if self.solver_type == 'random ray': + rr = {} + for name, dataset in self._f['random_ray'].items(): + data = dataset[()] + if type(data) == np.bytes_: + data = data.decode() + if name in ['adjoint', 'volume_normalized_flux_tallies']: + data = data > 0 + rr[name] = data + return rr + else: + return None + @property def run_mode(self): return self._f['run_mode'][()].decode() @@ -367,6 +424,10 @@ def seed(self): def stride(self): return self._f['stride'][()] + @property + def solver_type(self): + return self._f['solver_type'][()].decode() + @property def source(self): return self._f['source_bank'][()] if self.source_present else None diff --git a/src/material.cpp b/src/material.cpp index 54caa38409a..1e848f3f731 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -77,6 +77,32 @@ Material::Material(pugi::xml_node node) std::string units; if (density_node) { units = get_node_value(density_node, "units"); + if (settings::kinetic_simulation) { + if (check_for_node(density_node, "value_timeseries")) { + if (units == "sum") { + fatal_error("Use of density_timeseries is incompatible with 'sum'" + "density unit"); + } else { + density_timeseries_ = + get_node_array(density_node, "value_timeseries"); + if (density_timeseries_.size() >= settings::n_timesteps) { + warning(fmt::format( + "Material {} has a density_timeseries (size={}) longer than " + "n_timesteps ({}). Only the first {} entries of the density " + "timeseries " + "will be simulated.", + this->id(), density_timeseries_.size(), settings::n_timesteps, + settings::n_timesteps)); + } else { + fatal_error( + fmt::format("Material {} has a density_timeseries (size={}) " + "shorter than n_timesteps ({}). Not all " + "time steps can be simulated. Aborting.", + this->id(), density_timeseries_.size(), settings::n_timesteps)); + } + } + } + } if (units == "sum") { sum_density = true; } else if (units == "macro") { @@ -92,18 +118,44 @@ Material::Material(pugi::xml_node node) std::to_string(id_) + "."); } + double scale_factor; if (units == "g/cc" || units == "g/cm3") { density_ = -val; + scale_factor = 1.0; } else if (units == "kg/m3") { density_ = -1.0e-3 * val; + scale_factor = -1.0e-3; } else if (units == "atom/b-cm") { density_ = val; + scale_factor = 1.0; } else if (units == "atom/cc" || units == "atom/cm3") { density_ = 1.0e-24 * val; + scale_factor = 1.0e-24; } else { fatal_error("Unknown units '" + units + "' specified on material " + std::to_string(id_) + "."); } + // Scale density_timeseries_ to the same units as density_ + if (density_timeseries_.size() > 0) { + for (double& p : density_timeseries_) + p *= scale_factor; + + // Check that all elements are the same sign. + vector zero_vector; + for (int i = 0; i < density_timeseries_.size(); i++) { + zero_vector.push_back(i); + } + if (!(density_timeseries_ >= zero_vector || + density_timeseries_ <= zero_vector)) { + fatal_error( + "Cannot mix atom and weight percents for density timeseries " + "in material " + + std::to_string(id_)); + } else if ((density_timeseries_ >= zero_vector && density_ <= 0) || + (density_timeseries_ <= zero_vector && density_ >= 0)) { + fatal_error("density_timeseries_ must be same type as density_"); + } + } } } else { fatal_error("Must specify element in material " + @@ -371,6 +423,8 @@ Material& Material::clone() mat->ncrystal_mat_ = ncrystal_mat_.clone(); mat->atom_density_ = atom_density_; mat->density_ = density_; + if (settings::kinetic_simulation) + mat->density_timeseries_ = density_timeseries_; mat->density_gpcc_ = density_gpcc_; mat->volume_ = volume_; mat->fissionable() = fissionable_; @@ -449,6 +503,9 @@ void Material::normalize_density() } sum_percent = 1.0 / sum_percent; density_ = -density_ * N_AVOGADRO / MASS_NEUTRON * sum_percent; + + for (double& p : density_timeseries_) + p = -p * N_AVOGADRO / MASS_NEUTRON * sum_percent; } // Calculate nuclide atom densities diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index c19d136a4a2..96d4fcac508 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -239,6 +239,10 @@ unique_ptr RandomRay::ray_source_; RandomRaySourceShape RandomRay::source_shape_ {RandomRaySourceShape::FLAT}; RandomRaySampleMethod RandomRay::sample_method_ {RandomRaySampleMethod::PRNG}; +// Kinetic simulation variables +int RandomRay::bd_order_ {3}; // order 3 BD balances accuracy with speed nicely +RandomRayTimeMethod RandomRay::time_method_ {RandomRayTimeMethod::ISOTROPIC}; + RandomRay::RandomRay() : angular_flux_(data::mg.num_energy_groups_), delta_psi_(data::mg.num_energy_groups_), diff --git a/src/settings.cpp b/src/settings.cpp index 5b472468fc4..ee493b78135 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -56,6 +56,7 @@ bool delayed_photon_scaling {true}; bool entropy_on {false}; bool event_based {false}; bool ifp_on {false}; +bool kinetic_simulation {false}; bool legendre_to_tabular {true}; bool material_cell_offsets {true}; bool output_summary {true}; @@ -149,6 +150,12 @@ int verbosity {-1}; double weight_cutoff {0.25}; double weight_survive {1.0}; +// Timestep variables for kinetic simulation +int n_timesteps; +double dt; +int current_timestep; +bool is_initial_condition {false}; + } // namespace settings //============================================================================== @@ -254,6 +261,42 @@ void get_run_parameters(pugi::xml_node node_base) } } + // Kinetic variables + if (check_for_node(node_base, "kinetic_simulation")) { + kinetic_simulation = get_node_value_bool(node_base, "kinetic_simulation"); + } + + // Get timestep parameters for kinetic simulations + if (kinetic_simulation) { + xml_node ts_node = node_base.child("timestep_parameters"); + if (check_for_node(ts_node, "n_timesteps")) { + n_timesteps = std::stoi(get_node_value(ts_node, "n_timesteps")); + } else { + fatal_error("Specify number of timesteps in settings XML"); + } + if (check_for_node(ts_node, "timestep_units")) { + std::string units = get_node_value(ts_node, "timestep_units"); + if (check_for_node(ts_node, "dt")) { + dt = std::stod(get_node_value(ts_node, "dt")); + double factor_to_seconds; + if (units == "ms") { + factor_to_seconds = 1e-3; + } else if (units == "s") { + factor_to_seconds = 1.0; + } else if (units == "min") { + factor_to_seconds = 1 / 60; + } else { + fatal_error("Invalid timestep unit, " + units); + } + dt *= factor_to_seconds; + } else { + fatal_error("Specify dt in settings XML"); + } + } else { + fatal_error("Specify timestep units in settings XML"); + } + } + // Random ray variables if (solver_type == SolverType::RANDOM_RAY) { xml_node random_ray_node = node_base.child("random_ray"); @@ -363,6 +406,30 @@ void get_run_parameters(pugi::xml_node node_base) "between 0 and 1"); } } + if (kinetic_simulation) { + if (check_for_node(random_ray_node, "bd_order")) { + static int n = std::stod(get_node_value(random_ray_node, "bd_order")); + if (n < 1 || n > 6) { + fatal_error("Specified BD order of " + std::to_string(n) + + ". BD order must be between 1 and 6"); + } else { + RandomRay::bd_order_ = n; + } + } else { + fatal_error("Specify BD approximation order in settings XML"); + } + if (check_for_node(random_ray_node, "time_derivative_method")) { + std::string temp_str = + get_node_value(random_ray_node, "time_derivative_method", true, true); + if (temp_str == "isotropic") { + RandomRay::time_method_ = RandomRayTimeMethod::ISOTROPIC; + } else if (temp_str == "propogation") { + RandomRay::time_method_ = RandomRayTimeMethod::PROPOGATION; + } else { + fatal_error("Unrecognized time derivative method: " + temp_str); + } + } + } } } diff --git a/tests/cpp_unit_tests/CMakeLists.txt b/tests/cpp_unit_tests/CMakeLists.txt index 5f87db9eac2..661b30f6cb6 100644 --- a/tests/cpp_unit_tests/CMakeLists.txt +++ b/tests/cpp_unit_tests/CMakeLists.txt @@ -1,4 +1,5 @@ set(TEST_NAMES + test_bd_utilities test_distribution test_file_utils test_tally diff --git a/tests/cpp_unit_tests/test_bd_utilities.cpp b/tests/cpp_unit_tests/test_bd_utilities.cpp new file mode 100644 index 00000000000..4d51fbd2068 --- /dev/null +++ b/tests/cpp_unit_tests/test_bd_utilities.cpp @@ -0,0 +1,53 @@ +#include "openmc/random_ray/bd_utilities.h" +#include "openmc/random_ray/random_ray_simulation.h" +#include "openmc/vector.h" +#include +#include + +#include +#include +#include + +using namespace openmc; + +TEST_CASE("Test rhs_backwards_difference") +{ + vector> ref_rhs_bd_first_order {{-68.59, -36.1}, + {-108.02, -56.0}, {-134.66666666666663, -69.33333333333331}, + {-154.66666666666666, -79.33333333333331}, + {-170.66666666666666, -87.33333333333331}, {-184.0, -94.0}}; + + vector> ref_rhs_bd_second_order { + {-788.5999999999999, -397.9999999999999}, {-1588.0, -797.9999999999999}, + {-2321.3333333333344, -1164.6666666666667}, {-2988.0, -1497.9999999999989}, + {-3596.88888888889, -1802.4444444444416}, + {-4156.888888888892, -2082.444444444443}}; + + int vector_size = 2; + double dt = 0.1; + // Two functions t^2 and t^3 across x = 2, 1.9, 1.8, 1.7, 1.6, 1.5, 1.4, 1.3 + vector> test_bd_vector { + {6.859, 5.832, 4.913, 4.096, 3.375, 2.744, 2.197}, + {3.61, 3.24, 2.89, 2.56, 2.25, 1.96, 1.69}}; + vector test_rhs_bd {0.0, 0.0}; + for (int i = 0; i < 6; i++) { + int o = i + 1; + double d0 = rhs_backwards_difference(test_bd_vector[0], o, dt); + double d1 = rhs_backwards_difference(test_bd_vector[1], o, dt); + test_rhs_bd[0] = d0; + test_rhs_bd[1] = d1; + REQUIRE_THAT( + test_rhs_bd, Catch::Matchers::Approx(ref_rhs_bd_first_order[i])); + } + for (int i = 0; i < 6; i++) { + int o = i + 1; + double rhs_d0 = + rhs_backwards_difference(test_bd_vector[0], o, dt, 2); + double rhs_d1 = + rhs_backwards_difference(test_bd_vector[1], o, dt, 2); + test_rhs_bd[0] = rhs_d0; + test_rhs_bd[1] = rhs_d1; + REQUIRE_THAT( + test_rhs_bd, Catch::Matchers::Approx(ref_rhs_bd_second_order[i])); + } +} diff --git a/tests/unit_tests/test_material.py b/tests/unit_tests/test_material.py index 764c98d41ae..e3f1167149f 100644 --- a/tests/unit_tests/test_material.py +++ b/tests/unit_tests/test_material.py @@ -252,6 +252,8 @@ def test_density(): m.set_density(unit, 1.0) with pytest.raises(ValueError): m.set_density('g/litre', 1.0) + with pytest.raises(ValueError): + m.set_density('sum', 1.0, [1,1,1]) def test_salphabeta(): @@ -499,14 +501,18 @@ def test_from_xml(run_in_tmpdir): m2.set_density('kg/m3', 10.0) m3 = openmc.Material(3) m3.add_nuclide('N14', 0.02) + m4 = openmc.Material(4) + m4.add_nuclide('C12', 1.0) + m4.set_density('g/cc', 12, [12, 14, 14, 14, 12]) + - mats = openmc.Materials([m1, m2, m3]) + mats = openmc.Materials([m1, m2, m3, m4]) mats.cross_sections = 'fake_path.xml' mats.export_to_xml() # Regenerate materials from XML mats = openmc.Materials.from_xml() - assert len(mats) == 3 + assert len(mats) == 4 m1 = mats[0] assert m1.id == 1 assert m1.name == 'water' @@ -519,6 +525,7 @@ def test_from_xml(run_in_tmpdir): assert m2.density == 10.0 assert m2.density_units == 'kg/m3' assert mats[2].density_units == 'sum' + assert np.all(m4.density_timeseries == [12, 14, 14, 14, 12]) def test_mix_materials(): diff --git a/tests/unit_tests/test_settings.py b/tests/unit_tests/test_settings.py index fe618fd2d65..9c0107566db 100644 --- a/tests/unit_tests/test_settings.py +++ b/tests/unit_tests/test_settings.py @@ -1,8 +1,9 @@ +import pytest import openmc import openmc.stats - -def test_export_to_xml(run_in_tmpdir): +@pytest.mark.parametrize("kinetic_simulation", [True, False]) +def test_export_to_xml(run_in_tmpdir, kinetic_simulation): s = openmc.Settings(run_mode='fixed source', batches=1000, seed=17) s.generations_per_batch = 10 s.inactive = 100 @@ -10,6 +11,13 @@ def test_export_to_xml(run_in_tmpdir): s.max_lost_particles = 5 s.rel_max_lost_particles = 1e-4 s.keff_trigger = {'type': 'std_dev', 'threshold': 0.001} + s.kinetic_simulation = kinetic_simulation + if kinetic_simulation: + s.timestep_parameters = { + 'dt': 0.1, + 'n_timesteps': 41, + 'timestep_units': 's', + } s.energy_mode = 'continuous-energy' s.max_order = 5 s.max_tracks = 1234 @@ -77,6 +85,9 @@ def test_export_to_xml(run_in_tmpdir): 'adjoint': False, 'sample_method': 'halton' } + if kinetic_simulation: + s.random_ray['bd_order'] = 3 + s.random_ray['time_derivative_method'] = 'propogation' s.max_particle_events = 100 s.max_secondaries = 1_000_000 s.source_rejection_fraction = 0.01 @@ -95,6 +106,11 @@ def test_export_to_xml(run_in_tmpdir): assert s.max_lost_particles == 5 assert s.rel_max_lost_particles == 1e-4 assert s.keff_trigger == {'type': 'std_dev', 'threshold': 0.001} + assert s.kinetic_simulation == kinetic_simulation + if kinetic_simulation: + assert s.timestep_parameters['dt'] == 0.1 + assert s.timestep_parameters['n_timesteps'] == 41 + assert s.timestep_parameters['timestep_units'] == 's' assert s.energy_mode == 'continuous-energy' assert s.max_order == 5 assert s.max_tracks == 1234 @@ -169,6 +185,9 @@ def test_export_to_xml(run_in_tmpdir): assert s.random_ray['volume_normalized_flux_tallies'] assert not s.random_ray['adjoint'] assert s.random_ray['sample_method'] == 'halton' + if kinetic_simulation: + assert s.random_ray['bd_order'] == 3 + assert s.random_ray['time_derivative_method'] == 'propogation' assert s.max_secondaries == 1_000_000 assert s.source_rejection_fraction == 0.01 assert s.free_gas_threshold == 800.0 From bd89b27bf35ab5103cdb3150461bd11a19a0fed5 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sat, 27 Dec 2025 22:48:11 -0600 Subject: [PATCH 02/64] preliminary machinery to process chi (total neutron energy spectrum) --- src/mgxs.cpp | 39 ++++++++++++++++++++++++- src/random_ray/flat_source_domain.cpp | 3 +- src/xsdata.cpp | 42 ++++++++++++++++++++++----- 3 files changed, 74 insertions(+), 10 deletions(-) diff --git a/src/mgxs.cpp b/src/mgxs.cpp index a2c479f2156..e02dbbddc9f 100644 --- a/src/mgxs.cpp +++ b/src/mgxs.cpp @@ -434,31 +434,38 @@ double Mgxs::get_xs(MgxsType xstype, int gin, const int* gout, const double* mu, { XsData* xs_t = &xs[t]; double val; + std::string mgxs_type; switch (xstype) { case MgxsType::TOTAL: val = xs_t->total(a, gin); + mgxs_type = "total"; break; case MgxsType::NU_FISSION: val = fissionable ? xs_t->nu_fission(a, gin) : 0.; + mgxs_type = "nu-fission"; break; case MgxsType::ABSORPTION: val = xs_t->absorption(a, gin); - ; + mgxs_type = "absorption"; break; case MgxsType::FISSION: val = fissionable ? xs_t->fission(a, gin) : 0.; + mgxs_type = "fission"; break; case MgxsType::KAPPA_FISSION: val = fissionable ? xs_t->kappa_fission(a, gin) : 0.; + mgxs_type = "kappa-fission"; break; case MgxsType::NU_SCATTER: case MgxsType::SCATTER: case MgxsType::NU_SCATTER_FMU: case MgxsType::SCATTER_FMU: val = xs_t->scatter[a]->get_xs(xstype, gin, gout, mu); + mgxs_type = "scatter_data"; break; case MgxsType::PROMPT_NU_FISSION: val = fissionable ? xs_t->prompt_nu_fission(a, gin) : 0.; + mgxs_type = "prompt-nu-fission"; break; case MgxsType::DELAYED_NU_FISSION: if (fissionable) { @@ -473,6 +480,23 @@ double Mgxs::get_xs(MgxsType xstype, int gin, const int* gout, const double* mu, } else { val = 0.; } + mgxs_type = "delayed-nu-fission"; + break; + case MgxsType::CHI: + if (fissionable) { + if (gout != nullptr) { + val = xs_t->chi(a, gin, *gout); + } else { + // provide an outgoing group-wise sum + val = 0.; + for (int g = 0; g < xs_t->chi.shape()[2]; g++) { + val += xs_t->chi(a, gin, g); + } + } + } else { + val = 0.; + } + mgxs_type = "chi"; break; case MgxsType::CHI_PROMPT: if (fissionable) { @@ -488,6 +512,7 @@ double Mgxs::get_xs(MgxsType xstype, int gin, const int* gout, const double* mu, } else { val = 0.; } + mgxs_type = "chi-prompt"; break; case MgxsType::CHI_DELAYED: if (fissionable) { @@ -515,9 +540,11 @@ double Mgxs::get_xs(MgxsType xstype, int gin, const int* gout, const double* mu, } else { val = 0.; } + mgxs_type = "chi-delayed"; break; case MgxsType::INVERSE_VELOCITY: val = xs_t->inverse_velocity(a, gin); + mgxs_type = "inverse-velocity"; break; case MgxsType::DECAY_RATE: if (dg != nullptr) { @@ -525,10 +552,20 @@ double Mgxs::get_xs(MgxsType xstype, int gin, const int* gout, const double* mu, } else { val = xs_t->decay_rate(a, 0); } + mgxs_type = "decay-rate"; break; default: val = 0.; } + // TODO: need to add more robust handling of zero-values cross sections that + // produce NANs on normalization + if (val != val) { + warning( + fmt::format("The {} cross section for this material has a nan present " + "(possibly due to a division by zero). Setting to zero...", + mgxs_type)); + val = 0; + } return val; } diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index ec14795dd2d..a9c551b64f6 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -1143,8 +1143,7 @@ void FlatSourceDomain::flatten_xs() m.get_xs(MgxsType::FISSION, g_out, NULL, NULL, NULL, t, a); sigma_f_.push_back(sigma_f); - double chi = - m.get_xs(MgxsType::CHI_PROMPT, g_out, &g_out, NULL, NULL, t, a); + double chi = m.get_xs(MgxsType::CHI, g_out, &g_out, NULL, NULL, t, a); if (!std::isfinite(chi)) { // MGXS interface may return NaN in some cases, such as when material // is fissionable but has very small sigma_f. diff --git a/src/xsdata.cpp b/src/xsdata.cpp index 1929f51e6fa..5ce320b6400 100644 --- a/src/xsdata.cpp +++ b/src/xsdata.cpp @@ -56,8 +56,9 @@ XsData::XsData(bool fissionable, AngleDistributionType scatter_format, // allocate delayed_nu_fission; [temperature][angle][delay group][in group] delayed_nu_fission = xt::zeros(shape); - // chi_prompt; [temperature][angle][in group][out group] + // chi and chi_prompt; [temperature][angle][in group][out group] shape = {n_ang, n_g_, n_g_}; + chi = xt::zeros(shape); chi_prompt = xt::zeros(shape); // chi_delayed; [temperature][angle][delay group][in group][out group] @@ -133,8 +134,13 @@ void XsData::fission_vector_beta_from_hdf5( // Normalize chi by summing over the outgoing groups for each incoming angle temp_chi /= xt::view(xt::sum(temp_chi, {1}), xt::all(), xt::newaxis()); + // Store chi in chi + chi = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::all()); + // Now every incoming group in prompt_chi and delayed_chi is the normalized // chi we just made + // TODO: This is incorrect!! This makes chi_prompt and chi_delayed identical + // to chi. chi_prompt = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::all()); chi_delayed = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::newaxis(), xt::all()); @@ -176,25 +182,37 @@ void XsData::fission_vector_beta_from_hdf5( void XsData::fission_vector_no_beta_from_hdf5(hid_t xsdata_grp, size_t n_ang) { - // Data is provided separately as prompt + delayed nu-fission and chi + // If chi is included in the dataset, we should store it! + if (object_exists(xsdata_grp, "chi")) { + xt::xtensor temp_chi({n_ang, n_g_}, 0.); + read_nd_vector(xsdata_grp, "chi", temp_chi, true); + // Normalize chi by summing over the outgoing groups for each incoming angle + temp_chi /= xt::view(xt::sum(temp_chi, {1}), xt::all(), xt::newaxis()); + // Now every incoming group in self.chi is the normalized chi we just made + chi = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::all()); + } + // Data is provided separately as prompt + delayed nu-fission and chi // Get chi-prompt xt::xtensor temp_chi_p({n_ang, n_g_}, 0.); read_nd_vector(xsdata_grp, "chi-prompt", temp_chi_p, true); - // Normalize chi by summing over the outgoing groups for each incoming angle + // Normalize chi-prompt by summing over the outgoing groups for each incoming + // angle temp_chi_p /= xt::view(xt::sum(temp_chi_p, {1}), xt::all(), xt::newaxis()); // Get chi-delayed xt::xtensor temp_chi_d({n_ang, n_dg_, n_g_}, 0.); read_nd_vector(xsdata_grp, "chi-delayed", temp_chi_d, true); - // Normalize chi by summing over the outgoing groups for each incoming angle + // Normalize chi-delayed by summing over the outgoing groups for each incoming + // angle temp_chi_d /= xt::view(xt::sum(temp_chi_d, {2}), xt::all(), xt::all(), xt::newaxis()); // Now assign the prompt and delayed chis by replicating for each incoming // group + // chi_prompt = xt::view(temp_chi_p, xt::all(), xt::newaxis(), xt::all()); chi_delayed = xt::view(temp_chi_d, xt::all(), xt::all(), xt::newaxis(), xt::all()); @@ -204,6 +222,7 @@ void XsData::fission_vector_no_beta_from_hdf5(hid_t xsdata_grp, size_t n_ang) read_nd_vector(xsdata_grp, "delayed-nu-fission", delayed_nu_fission, true); } +// TODO: Add machinery to read chi void XsData::fission_vector_no_delayed_from_hdf5(hid_t xsdata_grp, size_t n_ang) { // No beta is provided and there is no prompt/delay distinction. @@ -217,6 +236,7 @@ void XsData::fission_vector_no_delayed_from_hdf5(hid_t xsdata_grp, size_t n_ang) temp_chi /= xt::view(xt::sum(temp_chi, {1}), xt::all(), xt::newaxis()); // Now every incoming group in self.chi is the normalized chi we just made + chi = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::all()); chi_prompt = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::all()); // Get nu-fission directly @@ -225,6 +245,7 @@ void XsData::fission_vector_no_delayed_from_hdf5(hid_t xsdata_grp, size_t n_ang) //============================================================================== +// TODO: Add machinery to read chi void XsData::fission_matrix_beta_from_hdf5( hid_t xsdata_grp, size_t n_ang, bool is_isotropic) { @@ -303,6 +324,7 @@ void XsData::fission_matrix_beta_from_hdf5( xt::sum(chi_delayed, {3}), xt::all(), xt::all(), xt::all(), xt::newaxis()); } +// TODO: Add machinery to read chi void XsData::fission_matrix_no_beta_from_hdf5(hid_t xsdata_grp, size_t n_ang) { // Data is provided separately as prompt + delayed nu-fission and chi @@ -326,12 +348,13 @@ void XsData::fission_matrix_no_beta_from_hdf5(hid_t xsdata_grp, size_t n_ang) // delayed_nu_fission is the sum over outgoing groups delayed_nu_fission = xt::sum(temp_matrix_d, {3}); - // chi_prompt is this matrix but normalized over outgoing groups, which we - // have already stored in prompt_nu_fission + // chi_delayed is this matrix but normalized over outgoing groups, which we + // have already stored in delayed_nu_fission chi_delayed = temp_matrix_d / xt::view(delayed_nu_fission, xt::all(), xt::all(), xt::all(), xt::newaxis()); } +// TODO: Add machinery to read chi void XsData::fission_matrix_no_delayed_from_hdf5(hid_t xsdata_grp, size_t n_ang) { // No beta is provided and there is no prompt/delay distinction. @@ -525,6 +548,10 @@ void XsData::combine( kappa_fission += scalar * that->kappa_fission; fission += scalar * that->fission; delayed_nu_fission += scalar * that->delayed_nu_fission; + // This may throw an error in some cases. Need a check for if + // chi exists! + chi += scalar * that->chi; + chi_prompt += scalar * xt::view(xt::sum(that->prompt_nu_fission, {1}), xt::all(), xt::newaxis(), xt::newaxis()) * @@ -537,8 +564,9 @@ void XsData::combine( decay_rate += scalar * that->decay_rate; } - // Ensure the chi_prompt and chi_delayed are normalized to 1 for each + // Ensure chi, chi_prompt, and chi_delayed are normalized to 1 for each // azimuthal angle and delayed group (for chi_delayed) + chi /= xt::view(xt::sum(chi, {2}), xt::all(), xt::all(), xt::newaxis()); chi_prompt /= xt::view(xt::sum(chi_prompt, {2}), xt::all(), xt::all(), xt::newaxis()); chi_delayed /= xt::view( From 9cb7b3fd8bf44018a83eb38ecd8ba2393363d132 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 28 Dec 2025 01:33:40 -0600 Subject: [PATCH 03/64] timer, flat source, and source region additions --- .../openmc/random_ray/flat_source_domain.h | 59 ++ include/openmc/random_ray/source_region.h | 613 ++++++++++++++- include/openmc/timer.h | 5 + src/random_ray/flat_source_domain.cpp | 743 +++++++++++++++++- src/random_ray/source_region.cpp | 206 ++++- src/timer.cpp | 11 + 6 files changed, 1595 insertions(+), 42 deletions(-) diff --git a/include/openmc/random_ray/flat_source_domain.h b/include/openmc/random_ray/flat_source_domain.h index 4df4e5d8d32..7fced43a5bd 100644 --- a/include/openmc/random_ray/flat_source_domain.h +++ b/include/openmc/random_ray/flat_source_domain.h @@ -39,6 +39,7 @@ class FlatSourceDomain { void reset_tally_volumes(); void random_ray_tally(); virtual void accumulate_iteration_flux(); + void accumulate_iteration_source(); void output_to_vtk() const; void convert_external_sources(); void count_external_source_regions(); @@ -49,6 +50,7 @@ class FlatSourceDomain { void flatten_xs(); void transpose_scattering_matrix(); void serialize_final_fluxes(vector& flux); + void serialize_final_sources(vector& source); void apply_meshes(); void apply_mesh_to_cell_instances(int32_t i_cell, int32_t mesh_idx, int target_material_id, const vector& instances, @@ -72,6 +74,37 @@ class FlatSourceDomain { int64_t lookup_mesh_bin(int64_t sr, Position r) const; int lookup_mesh_idx(int64_t sr) const; + //---------------------------------------------------------------------------- + // Methods for kinetic simulations + virtual void update_single_neutron_source_td(SourceRegionHandle& srh); + void compute_single_neutron_source_time_derivative(SourceRegionHandle& srh); + void compute_single_scalar_flux_time_derivative_2(SourceRegionHandle& srh); + virtual void update_all_neutron_sources_td(); + + void compute_single_delayed_fission_source(SourceRegionHandle& srh); + void compute_single_precursors(SourceRegionHandle& srh); + void compute_all_precursors(); + + void serialize_final_td_fluxes(vector& flux_td); + void serialize_final_td_sources(vector& source_td); + void serialize_final_precursors(vector& precursors); + void serialize_final_delayed_fission_source( + vector& delayed_fission_source); + + void flux_td_swap(); + void precursors_swap(); + void accumulate_iteration_quantities(); + void normalize_final_quantities(); + void propagate_final_quantities(); + void store_time_step_quantities(bool increment_not_initialize = true); + void compute_rhs_bd_quantities(); + void update_material_density(int i); + + int64_t n_delay_elements() const + { + return source_regions_.n_source_regions() * ndgroups_; + } + //---------------------------------------------------------------------------- // Static Data members static bool volume_normalized_flux_tallies_; @@ -149,6 +182,31 @@ class FlatSourceDomain { // technique. bool is_transport_stabilization_needed_ {false}; + //--------------------------------------------------------------------------- + // Public Data Members for kinetic simulations + + // 2D arrays stored in 1D representing values for all materials x + // delay_groups + vector lambda_; + + // 3D arrays stored in 1D representing values for all materials x energy + // groups x delay groups + vector nu_d_sigma_f_; + vector chi_d_; + + // 2D arrays stored in 1D representing values for all materials x energy + // groups + vector nu_p_sigma_f_; + vector chi_p_; + vector inverse_vbar_; + + // Time-dependent cross section arrays for use with material density + // timeseries + vector sigma_t_td_; + vector nu_sigma_f_td_; + vector sigma_f_td_; + vector sigma_s_td_; + protected: //---------------------------------------------------------------------------- // Methods @@ -165,6 +223,7 @@ class FlatSourceDomain { //---------------------------------------------------------------------------- // Private data members int negroups_; // Number of energy groups in simulation + int ndgroups_; // Number of delay groups in simulation double simulation_volume_; // Total physical volume of the simulation domain, as diff --git a/include/openmc/random_ray/source_region.h b/include/openmc/random_ray/source_region.h index 0f5a747fff8..90c6975627a 100644 --- a/include/openmc/random_ray/source_region.h +++ b/include/openmc/random_ray/source_region.h @@ -1,6 +1,8 @@ #ifndef OPENMC_RANDOM_RAY_SOURCE_REGION_H #define OPENMC_RANDOM_RAY_SOURCE_REGION_H +#include + #include "openmc/openmp_interface.h" #include "openmc/position.h" #include "openmc/random_ray/moment_matrix.h" @@ -141,6 +143,7 @@ class SourceRegionHandle { //---------------------------------------------------------------------------- // Public Data members int negroups_; + int ndgroups_; bool is_numerical_fp_artifact_ {false}; bool is_linear_ {false}; @@ -175,8 +178,9 @@ class SourceRegionHandle { // Energy group-wise 1D arrays double* scalar_flux_old_; double* scalar_flux_new_; - float* source_; - float* external_source_; + double* source_; + double* source_final_; + double* external_source_; double* scalar_flux_final_; MomentArray* source_gradients_; @@ -189,6 +193,47 @@ class SourceRegionHandle { // associated with it, necessitating the use of a jagged array. vector* tally_task_; + //--------------------------------------------------------------------------- + // Public Data Members for kinetic simulations + + // Energy group-wise 1D time-dependent arrays + double* scalar_flux_td_old_; + double* scalar_flux_td_new_; + double* scalar_flux_td_final_; + + double* source_td_; + double* source_td_final_; + + // Energy group-wise 1D time-derivative arrays + double* source_time_derivative_; + double* scalar_flux_time_derivative_2_; + + // Delay group-wise 1D arrays + double* delayed_fission_source_; + double* precursors_old_; + double* precursors_new_; + double* precursors_final_; + + // Energy group-wise 2D BD arrays (g x time step) + std::deque* scalar_flux_bd_; + std::deque* precursors_bd_; + + // Delay group-wise 2D BD arrays (dg x time step) + std::deque* source_bd_; + + // Energy group-wise 1D RHS BD arrays + double* scalar_flux_rhs_bd_; + double* source_rhs_bd_; + double* scalar_flux_rhs_bd_2_; + + // Delay group-wise 1D RHS BD arrays + double* precursors_rhs_bd_; + + // 2D array representing values for all delay groups x tally + // tasks. Each group may have a different number of tally tasks + // associated with it, necessitating the use of a jagged array. + vector* tally_delay_task_; + //---------------------------------------------------------------------------- // Public Accessors @@ -271,11 +316,14 @@ class SourceRegionHandle { double& scalar_flux_final(int g) { return scalar_flux_final_[g]; } const double scalar_flux_final(int g) const { return scalar_flux_final_[g]; } - float& source(int g) { return source_[g]; } - const float source(int g) const { return source_[g]; } + double& source(int g) { return source_[g]; } + const double source(int g) const { return source_[g]; } + + double& source_final(int g) { return source_final_[g]; } + const double source_final(int g) const { return source_final_[g]; } - float& external_source(int g) { return external_source_[g]; } - const float external_source(int g) const { return external_source_[g]; } + double& external_source(int g) { return external_source_[g]; } + const double external_source(int g) const { return external_source_[g]; } MomentArray& source_gradients(int g) { return source_gradients_[g]; } const MomentArray source_gradients(int g) const @@ -301,13 +349,111 @@ class SourceRegionHandle { vector& tally_task(int g) { return tally_task_[g]; } const vector& tally_task(int g) const { return tally_task_[g]; } + //--------------------------------------------------------------------------- + // Public Accessors for kinetic simulations + double& scalar_flux_td_old(int g) { return scalar_flux_td_old_[g]; } + const double scalar_flux_td_old(int g) const + { + return scalar_flux_td_old_[g]; + } + + double& scalar_flux_td_new(int g) { return scalar_flux_td_new_[g]; } + const double scalar_flux_td_new(int g) const + { + return scalar_flux_td_new_[g]; + } + + double& scalar_flux_td_final(int g) { return scalar_flux_td_final_[g]; } + const double scalar_flux_td_final(int g) const + { + return scalar_flux_td_final_[g]; + } + + double& source_td(int g) { return source_td_[g]; } + const double source_td(int g) const { return source_td_[g]; } + + double& source_td_final(int g) { return source_td_final_[g]; } + const double source_td_final(int g) const { return source_td_final_[g]; } + + double& source_time_derivative(int g) { return source_time_derivative_[g]; } + const double source_time_derivative(int g) const + { + return source_time_derivative_[g]; + } + + double& scalar_flux_time_derivative_2(int g) + { + return scalar_flux_time_derivative_2_[g]; + } + const double scalar_flux_time_derivative_2(int g) const + { + return scalar_flux_time_derivative_2_[g]; + } + + double& delayed_fission_source(int dg) { return delayed_fission_source_[dg]; } + const double delayed_fission_source(int dg) const + { + return delayed_fission_source_[dg]; + } + + double& precursors_old(int dg) { return precursors_old_[dg]; } + const double precursors_old(int dg) const { return precursors_old_[dg]; } + + double& precursors_new(int dg) { return precursors_new_[dg]; } + const double precursors_new(int dg) const { return precursors_new_[dg]; } + + double& precursors_final(int dg) { return precursors_final_[dg]; } + const double precursors_final(int dg) const { return precursors_final_[dg]; } + + std::deque& scalar_flux_bd(int g) { return scalar_flux_bd_[g]; } + const std::deque& scalar_flux_bd(int g) const + { + return scalar_flux_bd_[g]; + } + + std::deque& precursors_bd(int dg) { return precursors_bd_[dg]; } + const std::deque& precursors_bd(int dg) const + { + return precursors_bd_[dg]; + } + + std::deque& source_bd(int g) { return source_bd_[g]; } + const std::deque& source_bd(int g) const { return source_bd_[g]; } + + double& scalar_flux_rhs_bd(int g) { return scalar_flux_rhs_bd_[g]; } + const double scalar_flux_rhs_bd(int g) const + { + return scalar_flux_rhs_bd_[g]; + } + + double& source_rhs_bd(int g) { return source_rhs_bd_[g]; } + const double source_rhs_bd(int g) const { return source_rhs_bd_[g]; } + + double& scalar_flux_rhs_bd_2(int g) { return scalar_flux_rhs_bd_2_[g]; } + const double scalar_flux_rhs_bd_2(int g) const + { + return scalar_flux_rhs_bd_2_[g]; + } + + double& precursors_rhs_bd(int dg) { return precursors_rhs_bd_[dg]; } + const double precursors_rhs_bd(int dg) const + { + return precursors_rhs_bd_[dg]; + } + + vector& tally_delay_task(int dg) { return tally_delay_task_[dg]; } + const vector& tally_delay_task(int dg) const + { + return tally_delay_task_[dg]; + } + }; // class SourceRegionHandle class SourceRegion { public: //---------------------------------------------------------------------------- // Constructors - SourceRegion(int negroups, bool is_linear); + SourceRegion(int negroups, int ndgroups, bool is_linear); SourceRegion() = default; //---------------------------------------------------------------------------- @@ -357,12 +503,14 @@ class SourceRegion { scalar_flux_old_; //!< The scalar flux from the previous iteration vector scalar_flux_new_; //!< The scalar flux from the current iteration - vector + vector source_; //!< The total source term (fission + scattering + external) - vector external_source_; //!< The external source term + vector external_source_; //!< The external source term vector scalar_flux_final_; //!< The scalar flux accumulated over all //!< active iterations (used for plotting, - //!< or computing adjoint sources) + //!< computing adjoint sources, or + //!< computing an initial condition for a + //!< kinetic simulation) vector source_gradients_; //!< The linear source gradients vector @@ -378,14 +526,100 @@ class SourceRegion { // tasks. Each group may have a different number of tally tasks // associated with it, necessitating the use of a jagged array. vector> tally_task_; + + //---------------------------------------------------------------------------- + // Public Data Members for kinetic simulations + + // Energy group-wise 1D time-dependent arrrays + vector source_final_; //!< The total source accumulated over all + //!< active iterations (used for SDP) + vector scalar_flux_td_old_; //!< The time-dependent scalar flux from + //!< the previous iteration + vector scalar_flux_td_new_; //!< The time-dependent scalar flux from + //!< the current iteration + vector + scalar_flux_td_final_; //!< The time-dependent scalar flux accumulated over + //!< all active iterations (used as the initial + //!< condition for the next timestep) + + vector + source_td_; //!< The total time-dependent source term (prompt + //!< prompt fission + scattering + delayed emission) + vector + source_td_final_; //!< The total time-dependent source accumulated over all + //!< active iterations (used for SDP) + + // Energy group-wise 1D derivative arrays + vector source_time_derivative_; //!< The time derivative of the + //!< source (used for SDP) + vector scalar_flux_time_derivative_2_; //!< The 2nd order time + //!< derivative of the scalar + //!< flux (used for SDP) + // Delay group-wise 1D arrays + vector delayed_fission_source_; //!< The delayed fission source binned + //!< by delay group + vector precursors_old_; //!< The precursor density from the previous + //!< iteration. + vector + precursors_new_; //!< The precursor density for the current iteration + vector + precursors_final_; //!< The precursor density accumulated over all + //!< active iterations (used for computing + //!< the time derivative of precursor population) + + // Energy group-wise 2D BD arrays (g x time step) + vector> + scalar_flux_bd_; //!< The final scalar flux in each energy group from a + //!< finite number of previous time steps (used for + //!< computing the first order (and second order, for SDP) + //!< scalar flux time derivative) + vector> + precursors_bd_; //!< The final scalar flux in each energy group from a + //!< finite number of previous time steps (used for + //!< computing the first order source time derivative for + //!< SDP) + + // Delay group-wise 2D BD arrays (dg x time step) + vector> + source_bd_; //!< The final precursor population in each energy group from a + //!< finite number of previous time steps (used for computing + //!< the first order precursor time derivative) + + // Energy group-wise 1D RHS BD arrays + vector + scalar_flux_rhs_bd_; //!< RHS dervative for the scalar flux from previous + //!< timesteps. Used to compute the total scalar flux + //!< time derivative for both TI and SDP time-dependent + //!< simulations + vector source_rhs_bd_; //!< RHS derivative for the neutron source from + //!< previous timesteps Used for compute the + //!< total neutron source derivative for SDP + vector + scalar_flux_rhs_bd_2_; //!< 2nd order RHS derivative for the scalar flux + //!< from previous timesteps. Used to compute the + //!< total 2nd order scalar flux time derivative for + //!< SDP. + + // Delay group-wise 1D RHS BD arrays + vector + precursors_rhs_bd_; //!< RHS derivative for the precursors from previous + //!< timesteps. Used to compute the total precursor time + //!< derivative for solving the precursor equation using + //!< backwards differences. + + // 2D array representing values for all delay groups x tally + // tasks. Each group may have a different number of tally tasks + // associated with it, necessitating the use of a jagged array. + vector> tally_delay_task_; + }; // class SourceRegion class SourceRegionContainer { public: //---------------------------------------------------------------------------- // Constructors - SourceRegionContainer(int negroups, bool is_linear) - : negroups_(negroups), is_linear_(is_linear) + SourceRegionContainer(int negroups, int ndgroups, bool is_linear) + : negroups_(negroups), ndgroups_(ndgroups), is_linear_(is_linear) {} SourceRegionContainer() = default; @@ -555,21 +789,35 @@ class SourceRegionContainer { return scalar_flux_final_[se]; } - float& source(int64_t sr, int g) { return source_[index(sr, g)]; } - const float source(int64_t sr, int g) const { return source_[index(sr, g)]; } - float& source(int64_t se) { return source_[se]; } - const float source(int64_t se) const { return source_[se]; } + double& source(int64_t sr, int g) { return source_[index(sr, g)]; } + const double source(int64_t sr, int g) const { return source_[index(sr, g)]; } + double& source(int64_t se) { return source_[se]; } + const double source(int64_t se) const { return source_[se]; } + + double& source_final(int64_t sr, int g) + { + return source_final_[index(sr, g)]; + } + const double source_final(int64_t sr, int g) const + { + return source_final_[index(sr, g)]; + } + double& source_final(int64_t se) { return source_final_[se]; } + const double source_final(int64_t se) const { return source_final_[se]; } - float& external_source(int64_t sr, int g) + double& external_source(int64_t sr, int g) { return external_source_[index(sr, g)]; } - const float external_source(int64_t sr, int g) const + const double external_source(int64_t sr, int g) const { return external_source_[index(sr, g)]; } - float& external_source(int64_t se) { return external_source_[se]; } - const float external_source(int64_t se) const { return external_source_[se]; } + double& external_source(int64_t se) { return external_source_[se]; } + const double external_source(int64_t se) const + { + return external_source_[se]; + } vector& tally_task(int64_t sr, int g) { @@ -601,6 +849,272 @@ class SourceRegionContainer { int64_t& parent_sr(int64_t sr) { return parent_sr_[sr]; } const int64_t parent_sr(int64_t sr) const { return parent_sr_[sr]; } + //--------------------------------------- + // For kinetic simulations + + double& scalar_flux_td_old(int64_t sr, int g) + { + return scalar_flux_td_old_[index(sr, g)]; + } + const double& scalar_flux_td_old(int64_t sr, int g) const + { + return scalar_flux_td_old_[index(sr, g)]; + } + double& scalar_flux_td_old(int64_t se) { return scalar_flux_td_old_[se]; } + const double& scalar_flux_td_old(int64_t se) const + { + return scalar_flux_td_old_[se]; + } + + double& scalar_flux_td_new(int64_t sr, int g) + { + return scalar_flux_td_new_[index(sr, g)]; + } + const double& scalar_flux_td_new(int64_t sr, int g) const + { + return scalar_flux_td_new_[index(sr, g)]; + } + double& scalar_flux_td_new(int64_t se) { return scalar_flux_td_new_[se]; } + const double& scalar_flux_td_new(int64_t se) const + { + return scalar_flux_td_new_[se]; + } + + double& scalar_flux_td_final(int64_t sr, int g) + { + return scalar_flux_td_final_[index(sr, g)]; + } + const double& scalar_flux_td_final(int64_t sr, int g) const + { + return scalar_flux_td_final_[index(sr, g)]; + } + double& scalar_flux_td_final(int64_t se) { return scalar_flux_td_final_[se]; } + const double& scalar_flux_td_final(int64_t se) const + { + return scalar_flux_td_final_[se]; + } + + double& source_td(int64_t sr, int g) { return source_td_[index(sr, g)]; } + const double& source_td(int64_t sr, int g) const + { + return source_td_[index(sr, g)]; + } + double& source_td(int64_t se) { return source_td_[se]; } + const double& source_td(int64_t se) const { return source_td_[se]; } + + double& source_td_final(int64_t sr, int g) + { + return source_td_final_[index(sr, g)]; + } + const double& source_td_final(int64_t sr, int g) const + { + return source_td_final_[index(sr, g)]; + } + double& source_td_final(int64_t se) { return source_td_final_[se]; } + const double& source_td_final(int64_t se) const + { + return source_td_final_[se]; + } + + double& source_time_derivative(int64_t sr, int g) + { + return source_time_derivative_[index(sr, g)]; + } + const double& source_time_derivative(int64_t sr, int g) const + { + return source_time_derivative_[index(sr, g)]; + } + double& source_time_derivative(int64_t se) + { + return source_time_derivative_[se]; + } + const double& source_time_derivative(int64_t se) const + { + return source_time_derivative_[se]; + } + + double& scalar_flux_time_derivative_2(int64_t sr, int g) + { + return scalar_flux_time_derivative_2_[index(sr, g)]; + } + const double& scalar_flux_time_derivative_2(int64_t sr, int g) const + { + return scalar_flux_time_derivative_2_[index(sr, g)]; + } + double& scalar_flux_time_derivative_2(int64_t se) + { + return scalar_flux_time_derivative_2_[se]; + } + const double& scalar_flux_time_derivative_2(int64_t se) const + { + return scalar_flux_time_derivative_2_[se]; + } + + double& precursors_old(int64_t sr, int dg) + { + return precursors_old_[dindex(sr, dg)]; + } + const double& precursors_old(int64_t sr, int dg) const + { + return precursors_old_[dindex(sr, dg)]; + } + double& precursors_old(int64_t de) { return precursors_old_[de]; } + const double& precursors_old(int64_t de) const { return precursors_old_[de]; } + + double& precursors_new(int64_t sr, int dg) + { + return precursors_new_[dindex(sr, dg)]; + } + const double& precursors_new(int64_t sr, int dg) const + { + return precursors_new_[dindex(sr, dg)]; + } + double& precursors_new(int64_t de) { return precursors_new_[de]; } + const double& precursors_new(int64_t de) const { return precursors_new_[de]; } + + double& precursors_final(int64_t sr, int dg) + { + return precursors_final_[dindex(sr, dg)]; + } + const double& precursors_final(int64_t sr, int dg) const + { + return precursors_final_[dindex(sr, dg)]; + } + double& precursors_final(int64_t de) { return precursors_final_[de]; } + const double& precursors_final(int64_t de) const + { + return precursors_final_[de]; + } + + double& delayed_fission_source(int64_t sr, int dg) + { + return delayed_fission_source_[dindex(sr, dg)]; + } + const double& delayed_fission_source(int64_t sr, int dg) const + { + return delayed_fission_source_[dindex(sr, dg)]; + } + double& delayed_fission_source(int64_t de) + { + return delayed_fission_source_[de]; + } + const double& delayed_fission_source(int64_t de) const + { + return delayed_fission_source_[de]; + } + + std::deque& scalar_flux_bd(int64_t sr, int g) + { + return scalar_flux_bd_[index(sr, g)]; + } + const std::deque& scalar_flux_bd(int64_t sr, int g) const + { + return scalar_flux_bd_[index(sr, g)]; + } + std::deque& scalar_flux_bd(int64_t se) { return scalar_flux_bd_[se]; } + const std::deque& scalar_flux_bd(int64_t se) const + { + return scalar_flux_bd_[se]; + } + + std::deque& precursors_bd(int64_t sr, int dg) + { + return precursors_bd_[dindex(sr, dg)]; + } + const std::deque& precursors_bd(int64_t sr, int dg) const + { + return precursors_bd_[dindex(sr, dg)]; + } + std::deque& precursors_bd(int64_t de) { return precursors_bd_[de]; } + const std::deque& precursors_bd(int64_t de) const + { + return precursors_bd_[de]; + } + + std::deque& source_bd(int64_t sr, int g) + { + return source_bd_[index(sr, g)]; + } + const std::deque& source_bd(int64_t sr, int g) const + { + return source_bd_[index(sr, g)]; + } + std::deque& source_bd(int64_t se) { return source_bd_[se]; } + const std::deque& source_bd(int64_t se) const + { + return source_bd_[se]; + } + + double& scalar_flux_rhs_bd(int64_t sr, int g) + { + return scalar_flux_rhs_bd_[index(sr, g)]; + } + const double& scalar_flux_rhs_bd(int64_t sr, int g) const + { + return scalar_flux_rhs_bd_[index(sr, g)]; + } + double& scalar_flux_rhs_bd(int64_t se) { return scalar_flux_rhs_bd_[se]; } + const double& scalar_flux_rhs_bd(int64_t se) const + { + return scalar_flux_rhs_bd_[se]; + } + + double& precursors_rhs_bd(int64_t sr, int dg) + { + return precursors_rhs_bd_[dindex(sr, dg)]; + } + const double& precursors_rhs_bd(int64_t sr, int dg) const + { + return precursors_rhs_bd_[dindex(sr, dg)]; + } + double& precursors_rhs_bd(int64_t de) { return precursors_rhs_bd_[de]; } + const double& precursors_rhs_bd(int64_t de) const + { + return precursors_rhs_bd_[de]; + } + + double& source_rhs_bd(int64_t sr, int g) + { + return source_rhs_bd_[index(sr, g)]; + } + const double& source_rhs_bd(int64_t sr, int g) const + { + return source_rhs_bd_[index(sr, g)]; + } + double& source_rhs_bd(int64_t se) { return source_rhs_bd_[se]; } + const double& source_rhs_bd(int64_t se) const { return source_rhs_bd_[se]; } + + double& scalar_flux_rhs_bd_2(int64_t sr, int g) + { + return scalar_flux_rhs_bd_2_[index(sr, g)]; + } + const double& scalar_flux_rhs_bd_2(int64_t sr, int g) const + { + return scalar_flux_rhs_bd_2_[index(sr, g)]; + } + double& scalar_flux_rhs_bd_2(int64_t se) { return scalar_flux_rhs_bd_2_[se]; } + const double& scalar_flux_rhs_bd_2(int64_t se) const + { + return scalar_flux_rhs_bd_2_[se]; + } + + vector& tally_delay_task(int64_t sr, int dg) + { + return tally_delay_task_[dindex(sr, dg)]; + } + const vector& tally_delay_task(int64_t sr, int dg) const + { + return tally_delay_task_[dindex(sr, dg)]; + } + vector& tally_delay_task(int64_t de) + { + return tally_delay_task_[de]; + } + const vector& tally_delay_task(int64_t de) const + { + return tally_delay_task_[de]; + } + //---------------------------------------------------------------------------- // Public Methods @@ -616,11 +1130,23 @@ class SourceRegionContainer { SourceRegionHandle get_source_region_handle(int64_t sr); void adjoint_reset(); + //--------------------------------------------------------------------------- + // Public Methods for kinetic simulations + + int64_t n_delay_elements() const { return n_source_regions_ * ndgroups_; } + int& ndgroups() { return ndgroups_; } + const int ndgroups() const { return ndgroups_; } + + void flux_td_swap(); + void precursors_swap(); + void time_step_reset(); + private: //---------------------------------------------------------------------------- // Private Data Members int64_t n_source_regions_ {0}; int negroups_ {0}; + int ndgroups_ {0}; bool is_linear_ {false}; // SoA storage for scalar fields (one item per source region) @@ -652,8 +1178,9 @@ class SourceRegionContainer { vector scalar_flux_old_; vector scalar_flux_new_; vector scalar_flux_final_; - vector source_; - vector external_source_; + vector source_; + vector source_final_; + vector external_source_; vector source_gradients_; vector flux_moments_old_; @@ -667,11 +1194,53 @@ class SourceRegionContainer { // dimension. vector> tally_task_; + //--------------------------------------------------------------------------- + // Private Data Members for kinetic simulations + + // SoA energy group-wise 2D time-dependent arrays flattened to 1D + vector scalar_flux_td_old_; + vector scalar_flux_td_new_; + vector scalar_flux_td_final_; + + vector source_td_; + vector source_td_final_; + + // SoA energy group-wise 2D derivative arrays flattened to 1D + vector source_time_derivative_; + vector scalar_flux_time_derivative_2_; + + // SoA delay group-wise 2D arrays flattened to 1D + vector delayed_fission_source_; + vector precursors_old_; + vector precursors_new_; + vector precursors_final_; + + // SoA energy group-wise 3D BD arrays (sr x g/dg X timestep) flattened to 2D + vector> scalar_flux_bd_; + vector> precursors_bd_; + vector> source_bd_; + + // SoA energy group-wise 2D RHS BD arrays flattened to 1D + vector scalar_flux_rhs_bd_; + vector source_rhs_bd_; + vector scalar_flux_rhs_bd_2_; + + // SoA delay group-wise 2D RHS BD arrays flattened to 1D + vector precursors_rhs_bd_; + + // SoA 3D array representing values for all source regions x delay groups x + // tally tasks. The outer two dimensions (source regions and delay groups) + // are flattened to 1D. Each group may have a different number of tally tasks + // associated with it, necessitating the use of a jagged array for the inner + // dimension. + vector> tally_delay_task_; + //---------------------------------------------------------------------------- // Private Methods // Helper function for indexing inline int index(int64_t sr, int g) const { return sr * negroups_ + g; } + inline int dindex(int64_t sr, int dg) const { return sr * ndgroups_ + dg; } }; } // namespace openmc diff --git a/include/openmc/timer.h b/include/openmc/timer.h index d928aad4560..70d5d0acebb 100644 --- a/include/openmc/timer.h +++ b/include/openmc/timer.h @@ -33,6 +33,11 @@ extern Timer time_event_collision; extern Timer time_event_death; extern Timer time_update_src; +extern Timer time_initialize_td; +extern Timer time_update_bd_vectors_td; +extern Timer time_update_src_td; +extern Timer time_compute_precursors; + } // namespace simulation //============================================================================== diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index a9c551b64f6..becf2ab91a2 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -1,4 +1,5 @@ #include "openmc/random_ray/flat_source_domain.h" +#include "openmc/random_ray/bd_utilities.h" #include "openmc/cell.h" #include "openmc/constants.h" @@ -17,7 +18,9 @@ #include "openmc/timer.h" #include "openmc/weight_windows.h" +#include #include +#include namespace openmc { @@ -34,7 +37,10 @@ double FlatSourceDomain::diagonal_stabilization_rho_ {1.0}; std::unordered_map>> FlatSourceDomain::mesh_domain_map_; -FlatSourceDomain::FlatSourceDomain() : negroups_(data::mg.num_energy_groups_) +FlatSourceDomain::FlatSourceDomain() + : negroups_(data::mg.num_energy_groups_), + ndgroups_(data::mg.num_delayed_groups_) + { // Count the number of source regions, compute the cell offset // indices, and store the material type The reason for the offsets is that @@ -52,7 +58,7 @@ FlatSourceDomain::FlatSourceDomain() : negroups_(data::mg.num_energy_groups_) // Initialize source regions. bool is_linear = RandomRay::source_shape_ != RandomRaySourceShape::FLAT; - source_regions_ = SourceRegionContainer(negroups_, is_linear); + source_regions_ = SourceRegionContainer(negroups_, ndgroups_, is_linear); // Initialize tally volumes if (volume_normalized_flux_tallies_) { @@ -89,6 +95,13 @@ void FlatSourceDomain::batch_reset() for (int64_t se = 0; se < n_source_elements(); se++) { source_regions_.scalar_flux_new(se) = 0.0; } + + if (settings::kinetic_simulation && !settings::is_initial_condition) { +#pragma omp parallel for + for (int64_t se = 0; se < n_source_elements(); se++) { + source_regions_.scalar_flux_td_new(se) = 0.0; + } + } } void FlatSourceDomain::accumulate_iteration_flux() @@ -133,12 +146,19 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) } } + // TODO: Add control flow for k-eigenvalue forward-weighted adjoint // Add external source if in fixed source mode if (settings::run_mode == RunMode::FIXED_SOURCE) { for (int g = 0; g < negroups_; g++) { srh.source(g) += srh.external_source(g); } } + // Set souce_td to source for IC calculation + if (settings::is_initial_condition) { +#pragma omp parallel for + for (int g = 0; g < negroups_; g++) + srh.source_td(g) += srh.source(g); + } } // Compute new estimate of scattering + fission sources in each source region @@ -169,6 +189,8 @@ void FlatSourceDomain::normalize_scalar_flux_and_volumes( #pragma omp parallel for for (int64_t se = 0; se < n_source_elements(); se++) { source_regions_.scalar_flux_new(se) *= normalization_factor; + if (settings::kinetic_simulation && !settings::is_initial_condition) + source_regions_.scalar_flux_td_new(se) *= normalization_factor; } // Accumulate cell-wise ray length tallies collected this iteration, then @@ -190,17 +212,37 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( int64_t sr, double volume, int g) { int material = source_regions_.material(sr); + // TODO: Implement support for time-dependent void transport if (material == MATERIAL_VOID) { source_regions_.scalar_flux_new(sr, g) /= volume; if (settings::run_mode == RunMode::FIXED_SOURCE) { source_regions_.scalar_flux_new(sr, g) += - 0.5f * source_regions_.external_source(sr, g) * + 0.5 * source_regions_.external_source(sr, g) * source_regions_.volume_sq(sr); } } else { double sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; source_regions_.scalar_flux_new(sr, g) /= (sigma_t * volume); source_regions_.scalar_flux_new(sr, g) += source_regions_.source(sr, g); + if (settings::kinetic_simulation && !settings::is_initial_condition) { + double sigma_t_td = + sigma_t_td_[source_regions_.material(sr) * negroups_ + g]; + source_regions_.scalar_flux_td_new(sr, g) /= (sigma_t_td * volume); + source_regions_.scalar_flux_td_new(sr, g) += + source_regions_.source_td(sr, g); + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + // TODO: may need to adjust sigma t division here + double inverse_vbar = + inverse_vbar_[source_regions_.material(sr) * negroups_ + g]; + double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); + double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / + settings::dt; + source_regions_.scalar_flux_td_new(sr, g) -= + scalar_flux_rhs_bd * inverse_vbar / sigma_t_td; + source_regions_.scalar_flux_td_new(sr, g) /= + 1 + A0 * inverse_vbar / sigma_t_td; + } + } } } @@ -208,11 +250,19 @@ void FlatSourceDomain::set_flux_to_old_flux(int64_t sr, int g) { source_regions_.scalar_flux_new(sr, g) = source_regions_.scalar_flux_old(sr, g); + if (settings::kinetic_simulation && !settings::is_initial_condition) { + source_regions_.scalar_flux_td_new(sr, g) = + source_regions_.scalar_flux_td_old(sr, g); + } } void FlatSourceDomain::set_flux_to_source(int64_t sr, int g) { source_regions_.scalar_flux_new(sr, g) = source_regions_.source(sr, g); + if (settings::kinetic_simulation && !settings::is_initial_condition) { + source_regions_.scalar_flux_td_new(sr, g) = + source_regions_.source_td(sr, g); + } } // Combine transport flux contributions and flat source contributions from the @@ -290,6 +340,12 @@ int64_t FlatSourceDomain::add_source_to_scalar_flux() set_flux_to_source(sr, g); } } + // Set time-dependent flux to unperturbed flux during the initial + // condition calculation + if (settings::is_initial_condition) { + source_regions_.scalar_flux_td_new(sr, g) = + source_regions_.scalar_flux_new(sr, g); + } // Halt if NaN implosion is detected if (!std::isfinite(source_regions_.scalar_flux_new(sr, g))) { fatal_error("A source region scalar flux is not finite. " @@ -297,6 +353,16 @@ int64_t FlatSourceDomain::add_source_to_scalar_flux() "simulation. Consider increasing ray density or adjusting " "the source region mesh."); } + // Also check time-dependent flux + if (settings::kinetic_simulation) { + if (!std::isfinite(source_regions_.scalar_flux_td_new(sr, g))) { + fatal_error( + "A source region scalar flux is not finite. " + "This indicates a numerical instability in the " + "simulation. Consider increasing ray density or adjusting " + "the source region mesh."); + } + } } } @@ -479,6 +545,10 @@ void FlatSourceDomain::convert_source_regions_to_tallies(int64_t start_sr_id) // Loop over scores for (int score = 0; score < tally.scores_.size(); score++) { auto score_bin = tally.scores_[score]; + // Skip precursor score. These must be scored by delay group via + // tally_delay_task. + if (score_bin == SCORE_PRECURSORS) + break; // 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, score_bin); @@ -494,6 +564,63 @@ void FlatSourceDomain::convert_source_regions_to_tallies(int64_t start_sr_id) for (auto& match : p.filter_matches()) match.bins_present_ = false; } + // Loop over delayed groups (so as to support tallying delayed quantities) + if (settings::kinetic_simulation) { + for (int dg = 0; dg < ndgroups_; dg++) { + + // Set particle to the current delay group + p.delayed_group() = dg; + + int64_t delay_element = sr * ndgroups_ + dg; + + // If this task has already been populated, we don't need to do + // it again. + if (source_regions_.tally_delay_task(sr, dg).size() > 0) { + continue; + } + + // Loop over all active tallies. This logic is essentially identical + // to what happens when scanning for applicable tallies during + // MC transport. + // Loop over all active tallies. This logic is essentially identical + for (int i_tally = 0; i_tally < model::tallies.size(); i_tally++) { + Tally& tally {*model::tallies[i_tally]}; + + // Initialize an iterator over valid filter bin combinations. + // If there are no valid combinations, use a continue statement + // to ensure we skip the assume_separate break below. + auto filter_iter = FilterBinIter(tally, p); + auto end = FilterBinIter(tally, true, &p.filter_matches()); + if (filter_iter == end) + continue; + + // Loop over filter bins. + for (; filter_iter != end; ++filter_iter) { + auto filter_index = filter_iter.index_; + auto filter_weight = filter_iter.weight_; + + // Loop over scores + for (int score = 0; score < tally.scores_.size(); score++) { + auto score_bin = tally.scores_[score]; + // We only want to score precursors + if (score_bin != SCORE_PRECURSORS) + break; + // 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 + dg, score, score_bin); + source_regions_.tally_delay_task(sr, dg).push_back(task); + + // Also add this task to the list of volume tasks for this source + // region. + source_regions_.volume_task(sr).insert(task); + } + } + } + // Reset all the filter matches for the next tally event. + for (auto& match : p.filter_matches()) + match.bins_present_ = false; + } + } } openmc::simulation::time_tallies.stop(); @@ -538,6 +665,8 @@ double FlatSourceDomain::compute_fixed_source_normalization_factor() const // bookkeeping in MC which is all done per starting source neutron (not per // neutron produced). return k_eff_ / (fission_rate_ * simulation_volume_); + // TODO: check if a delayed fission rate needed to normalize the precursor + // population... need to run a test problem using mc tallies? } // If we are in adjoint mode of a fixed source problem, the external @@ -592,6 +721,7 @@ double FlatSourceDomain::compute_fixed_source_normalization_factor() const // tally function simply traverses the mapping data structure and executes // the scoring operations to OpenMC's native tally result arrays. +// TODO: Add support for prompt and delayed nu fission tallies void FlatSourceDomain::random_ray_tally() { openmc::simulation::time_tallies.start(); @@ -620,8 +750,14 @@ void FlatSourceDomain::random_ray_tally() double material = source_regions_.material(sr); for (int g = 0; g < negroups_; g++) { - double flux = - source_regions_.scalar_flux_new(sr, g) * source_normalization_factor; + double flux; + if (settings::kinetic_simulation && !settings::is_initial_condition) { + flux = source_regions_.scalar_flux_td_new(sr, g) * + source_normalization_factor; + } else { + flux = + source_regions_.scalar_flux_new(sr, g) * source_normalization_factor; + } // Determine numerical score value for (auto& task : source_regions_.tally_task(sr, g)) { @@ -634,18 +770,33 @@ void FlatSourceDomain::random_ray_tally() case SCORE_TOTAL: if (material != MATERIAL_VOID) { + double sigma_t; + if (settings::kinetic_simulation && !settings::is_initial_condition) + sigma_t = sigma_t_td_[material * negroups_ + g]; + else + sigma_t = sigma_t_[material * negroups_ + g]; score = flux * volume * sigma_t_[material * negroups_ + g]; } break; case SCORE_FISSION: if (material != MATERIAL_VOID) { + double sigma_f; + if (settings::kinetic_simulation && !settings::is_initial_condition) + sigma_f = sigma_f_td_[material * negroups_ + g]; + else + sigma_f = sigma_f_[material * negroups_ + g]; score = flux * volume * sigma_f_[material * negroups_ + g]; } break; case SCORE_NU_FISSION: if (material != MATERIAL_VOID) { + double nu_sigma_f; + if (settings::kinetic_simulation && !settings::is_initial_condition) + nu_sigma_f = nu_sigma_f_td_[material * negroups_ + g]; + else + nu_sigma_f = nu_sigma_f_[material * negroups_ + g]; score = flux * volume * nu_sigma_f_[material * negroups_ + g]; } break; @@ -654,10 +805,21 @@ void FlatSourceDomain::random_ray_tally() score = 1.0; break; + case SCORE_PRECURSORS: + // Score precursors in tally_delay_tasks + if (settings::kinetic_simulation) { + break; + } else { + fatal_error( + "Invalid score specified in tallies.xml. Precursors " + "are only supported in random ray mode for kinetic simulations."); + } + default: fatal_error("Invalid score specified in tallies.xml. Only flux, " "total, fission, nu-fission, and events are supported in " - "random ray mode."); + "random ray mode (precursors are supported in kinetic " + "simulations)."); break; } // Apply score to the appropriate tally bin @@ -667,13 +829,55 @@ void FlatSourceDomain::random_ray_tally() score; } } + if (settings::kinetic_simulation) { + for (int dg = 0; dg < ndgroups_; dg++) { + // Determine numerical score value + for (auto& task : source_regions_.tally_delay_task(sr, dg)) { + double score; + switch (task.score_type) { + + // Certain scores already tallied + case SCORE_FLUX: + case SCORE_TOTAL: + case SCORE_FISSION: + case SCORE_NU_FISSION: + case SCORE_EVENTS: + break; + + case SCORE_PRECURSORS: + // TODO: This will be slightly off. The source normalization factor + // should only be applied to the delayed fission source, but here we + // apply it to entire precursor concentration (sum of delayed + // fission source and precursor decay terms). + score = source_regions_.precursors_new(sr, dg) * + source_normalization_factor * volume; + break; + + default: + fatal_error( + "Invalid score specified in tallies.xml. Only flux, " + "total, fission, nu-fission, and events are supported in " + "random ray mode (precursors are supported in kinetic " + "simulations)."); + break; + } + + // Apply score to the appropriate tally bin + Tally& tally {*model::tallies[task.tally_idx]}; +#pragma omp atomic + tally.results_(task.filter_idx, task.score_idx, TallyResult::VALUE) += + score; + } + } + } - // For flux tallies, the total volume of the spatial region is needed - // for normalizing the flux. We store this volume in a separate tensor. - // We only contribute to each volume tally bin once per FSR. + // For flux and precursor tallies, the total volume of the spatial region is + // needed for normalizing the tally. We store this volume in a separate + // tensor. We only contribute to each volume tally bin once per FSR. if (volume_normalized_flux_tallies_) { for (const auto& task : source_regions_.volume_task(sr)) { - if (task.score_type == SCORE_FLUX) { + if (task.score_type == SCORE_FLUX || + task.score_type == SCORE_PRECURSORS) { #pragma omp atomic tally_volumes_[task.tally_idx](task.filter_idx, task.score_idx) += volume; @@ -682,11 +886,11 @@ void FlatSourceDomain::random_ray_tally() } } // end FSR loop - // Normalize any flux scores by the total volume of the FSRs scoring to that - // bin. To do this, we loop over all tallies, and then all filter bins, - // and then scores. For each score, we check the tally data structure to - // see what index that score corresponds to. If that score is a flux score, - // then we divide it by volume. + // Normalize any flux or precursor scores by the total volume of the FSRs + // scoring to that bin. To do this, we loop over all tallies, and then all + // filter bins, and then scores. For each score, we check the tally data + // structure to see what index that score corresponds to. If that score is a + // flux or precursor score, then we divide it by volume. if (volume_normalized_flux_tallies_) { for (int i = 0; i < model::tallies.size(); i++) { Tally& tally {*model::tallies[i]}; @@ -694,7 +898,7 @@ void FlatSourceDomain::random_ray_tally() for (int bin = 0; bin < tally.n_filter_bins(); bin++) { for (int score_idx = 0; score_idx < tally.n_scores(); score_idx++) { auto score_type = tally.scores_[score_idx]; - if (score_type == SCORE_FLUX) { + if (score_type == SCORE_FLUX || score_type == SCORE_PRECURSORS) { double vol = tally_volumes_[i](bin, score_idx); if (vol > 0.0) { tally.results_(bin, score_idx, TallyResult::VALUE) /= vol; @@ -708,6 +912,7 @@ void FlatSourceDomain::random_ray_tally() openmc::simulation::time_tallies.stop(); } +// TODO: Enable support for TD fluxes? double FlatSourceDomain::evaluate_flux_at_point( Position r, int64_t sr, int g) const { @@ -720,6 +925,7 @@ double FlatSourceDomain::evaluate_flux_at_point( // loaded and displayed by Paraview. Note that .vtk binary // files require big endian byte ordering, so endianness // is checked and flipped if necessary. +// TODO: Enable support for TD fluxes? void FlatSourceDomain::output_to_vtk() const { // Rename .h5 plot filename(s) to .vtk filenames @@ -1161,6 +1367,25 @@ void FlatSourceDomain::flatten_xs() if (g_out == g_in && sigma_s < 0.0) is_transport_stabilization_needed_ = true; } + // Prompt cross-sections for kinetic simulations + if (settings::kinetic_simulation) { + double chi_p = + m.get_xs(MgxsType::CHI_PROMPT, g_out, &g_out, NULL, NULL, t, a); + if (!std::isfinite(chi_p)) { + // MGXS interface may return NaN in some cases, such as when + // material is fissionable but has very small sigma_f. + chi_p = 0.0; + } + chi_p_.push_back(chi_p); + + double inverse_vbar = + m.get_xs(MgxsType::INVERSE_VELOCITY, g_out, NULL, NULL, NULL, t, a); + inverse_vbar_.push_back(inverse_vbar); + + double nu_p_Sigma_f = m.get_xs( + MgxsType::PROMPT_NU_FISSION, g_out, NULL, NULL, NULL, t, a); + nu_p_sigma_f_.push_back(nu_p_Sigma_f); + } } else { sigma_t_.push_back(0); nu_sigma_f_.push_back(0); @@ -1169,8 +1394,50 @@ void FlatSourceDomain::flatten_xs() for (int g_in = 0; g_in < negroups_; g_in++) { sigma_s_.push_back(0); } + if (settings::kinetic_simulation) { + chi_p_.push_back(0); + inverse_vbar_.push_back(0); + nu_p_sigma_f_.push_back(0); + } } } + // Delayed cross sections for time-dependent simulations + if (settings::kinetic_simulation) { + for (int dg = 0; dg < ndgroups_; dg++) { + if (m.exists_in_model) { + double lambda = + m.get_xs(MgxsType::DECAY_RATE, 0, NULL, NULL, &dg, t, a); + lambda_.push_back(lambda); + for (int g_out = 0; g_out < negroups_; g_out++) { + double nu_d_Sigma_f = m.get_xs( + MgxsType::DELAYED_NU_FISSION, g_out, NULL, NULL, &dg, t, a); + nu_d_sigma_f_.push_back(nu_d_Sigma_f); + double chi_d = + m.get_xs(MgxsType::CHI_DELAYED, g_out, &g_out, NULL, &dg, t, a); + if (!std::isfinite(chi_d)) { + // MGXS interface may return NaN in some cases, such as when + // material is fissionable but has very small sigma_f. + chi_d = 0.0; + } + chi_d_.push_back(chi_d); + } + } else { + lambda_.push_back(0); + for (int g_out = 0; g_out < negroups_; g_out++) { + nu_d_sigma_f_.push_back(0); + chi_d_.push_back(0); + } + } + } + } + } + // Create copies of cross section vectors for use with material density + // timeseries + if (settings::kinetic_simulation) { + sigma_t_td_ = sigma_t_; + nu_sigma_f_td_ = nu_sigma_f_; + sigma_f_td_ = sigma_f_; + sigma_s_td_ = sigma_s_; } } @@ -1278,6 +1545,17 @@ void FlatSourceDomain::serialize_final_fluxes(vector& flux) } } +void FlatSourceDomain::serialize_final_sources(vector& source) +{ + // Ensure array is correct size + source.resize(n_source_regions() * negroups_); + // Serialize the final sources for output +#pragma omp parallel for + for (int64_t se = 0; se < n_source_elements(); se++) { + source[se] = source_regions_.source_final(se); + } +} + void FlatSourceDomain::apply_mesh_to_cell_instances(int32_t i_cell, int32_t mesh_idx, int target_material_id, const vector& instances, bool is_target_void) @@ -1473,8 +1751,8 @@ SourceRegionHandle FlatSourceDomain::get_subdivided_source_region_handle( // Call the basic constructor for the source region and store in the parallel // map. bool is_linear = RandomRay::source_shape_ != RandomRaySourceShape::FLAT; - SourceRegion* sr_ptr = - discovered_source_regions_.emplace(sr_key, {negroups_, is_linear}); + SourceRegion* sr_ptr = discovered_source_regions_.emplace( + sr_key, {negroups_, ndgroups_, is_linear}); SourceRegionHandle handle {*sr_ptr}; // Determine the material @@ -1530,6 +1808,13 @@ SourceRegionHandle FlatSourceDomain::get_subdivided_source_region_handle( // Compute the combined source term update_single_neutron_source(handle); + if (settings::kinetic_simulation && !settings::is_initial_condition) { + update_single_neutron_source_td(handle); + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + compute_single_neutron_source_time_derivative(handle); + compute_single_scalar_flux_time_derivative_2(handle); + } + } // Unlock the parallel map. Note: we may be tempted to release // this lock earlier, and then just use the source region's lock to protect @@ -1624,6 +1909,22 @@ void FlatSourceDomain::apply_transport_stabilization() source_regions_.scalar_flux_new(sr, g) = (phi_new - D * phi_old) / (1.0 - D); } + // TODO: test this and td with mesh + // Duplicated stabilization for time-dependent simulations + if (settings::kinetic_simulation && !settings::is_initial_condition) { + double sigma_s_td = + sigma_s_td_[material * negroups_ * negroups_ + g * negroups_ + g]; + if (sigma_s_td < 0.0) { + double sigma_t_td = sigma_t_td_[material * negroups_ + g]; + double phi_td_new = source_regions_.scalar_flux_td_new(sr, g); + double phi_td_old = source_regions_.scalar_flux_td_old(sr, g); + + double D_td = diagonal_stabilization_rho_ * sigma_s_td / sigma_t_td; + + source_regions_.scalar_flux_td_new(sr, g) = + (phi_td_new - D_td * phi_td_old) / (1.0 - D_td); + } + } } } } @@ -1676,4 +1977,410 @@ int64_t FlatSourceDomain::lookup_mesh_bin(int64_t sr, Position r) const return mesh_bin; } +//------------------------------------------------------------------------------ +// Methods for kinetic simulations + +// Generates new estimate of k_dynamic based on the fraction between this +// timestep's estimate of neutron production and loss. (previous timestep +// fission vs current timestep fission?) +// TODO: implement compute_k_dynamic +// double FlatSourceDomain::compute_k_dynamic() const + +// Compute new estimate of scattering + fission + precursor decay sources in +// each source region based on the flux estimate from the previous iteration. +// Used for time-dependent simulations +void FlatSourceDomain::update_single_neutron_source_td(SourceRegionHandle& srh) +{ + // Reset all time-dependent source regions to zero (important for + // time-dependent void regions) + for (int g = 0; g < negroups_; g++) { + srh.source_td(g) = 0.0; + } + + // Add scattering + fission source + int material = srh.material(); + if (material != MATERIAL_VOID) { + double inverse_k_eff = 1.0 / k_eff_; + for (int g_out = 0; g_out < negroups_; g_out++) { + double sigma_t_td = sigma_t_td_[material * negroups_ + g_out]; + double scatter_source_td = 0.0; + double fission_source_td = 0.0; + for (int g_in = 0; g_in < negroups_; g_in++) { + double scalar_flux_td = srh.scalar_flux_td_old(g_in); + double sigma_s_td = sigma_s_td_[material * negroups_ * negroups_ + + g_out * negroups_ + g_in]; + // Use prompt cross section data if in time dependent mode + double nu_p_sigma_f = nu_p_sigma_f_[material * negroups_ + g_in]; + double chi_p = chi_p_[material * negroups_ + g_out]; + + scatter_source_td += sigma_s_td * scalar_flux_td; + fission_source_td += nu_p_sigma_f * scalar_flux_td * chi_p; + } + srh.source_td(g_out) = + (scatter_source_td + fission_source_td * inverse_k_eff); + + // Add delayed source if in time dependent mode + double delayed_source = 0.0; + for (int dg = 0; dg < ndgroups_; dg++) { + double chi_d = + chi_d_[material * negroups_ * ndgroups_ + dg * negroups_ + g_out]; + double lambda = lambda_[material * ndgroups_ + dg]; + double precursors = srh.precursors_old(dg); + delayed_source += chi_d * precursors * lambda; + } + srh.source_td(g_out) += delayed_source; + + // Add derivative of scalar flux (TI method) + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + double inverse_vbar = inverse_vbar_[material * negroups_ + g_out]; + double scalar_flux_rhs_bd = srh.scalar_flux_rhs_bd(g_out); + double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / + settings::dt; + double scalar_flux_td = srh.scalar_flux_td_old(g_out); + double scalar_flux_time_derivative = + A0 * scalar_flux_td + scalar_flux_rhs_bd; + srh.source_td(g_out) -= scalar_flux_time_derivative * inverse_vbar; + } + srh.source_td(g_out) /= sigma_t_td; + } + } +} + +void FlatSourceDomain::compute_single_neutron_source_time_derivative( + SourceRegionHandle& srh) +{ + double A0 = + (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; + for (int g = 0; g < negroups_; g++) { + double source_rhs_bd = srh.source_rhs_bd(g); + double source_td = srh.source_td(g); + // Multiply out sigma_t to correctly compute the derivative term + double sigma_t_td = sigma_t_td_[srh.material() * negroups_ + g]; + srh.source_time_derivative(g) = A0 * source_td * sigma_t_td + source_rhs_bd; + // Divide by sigma_t to save time during transport + srh.source_time_derivative(g) /= sigma_t_td; + } +} + +void FlatSourceDomain::compute_single_scalar_flux_time_derivative_2( + SourceRegionHandle& srh) +{ + double B0 = (bd_coefficients_second_order_.at(RandomRay::bd_order_))[0] / + (settings::dt * settings::dt); + for (int g = 0; g < negroups_; g++) { + double scalar_flux_rhs_bd_2 = srh.scalar_flux_rhs_bd_2(g); + double scalar_flux_td = srh.scalar_flux_td_old(g); + srh.scalar_flux_time_derivative_2(g) = + B0 * scalar_flux_td + scalar_flux_rhs_bd_2; + double sigma_t_td = sigma_t_td_[srh.material() * negroups_ + g]; + // Divide by sigma_t to save time during transport + srh.scalar_flux_time_derivative_2(g) /= sigma_t_td; + } +} + +void FlatSourceDomain::update_all_neutron_sources_td() +{ + simulation::time_update_src_td.start(); + +#pragma omp parallel for + for (int64_t sr = 0; sr < n_source_regions(); sr++) { + SourceRegionHandle srh = source_regions_.get_source_region_handle(sr); + update_single_neutron_source_td(srh); + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + compute_single_neutron_source_time_derivative(srh); + compute_single_scalar_flux_time_derivative_2(srh); + } + } + + simulation::time_update_src_td.stop(); +} + +// TODO: eliminate this and source region vars +void FlatSourceDomain::compute_single_delayed_fission_source( + SourceRegionHandle& srh) +{ + + // Reset all delayed fission sources to zero (important for void regions) + for (int dg = 0; dg < ndgroups_; dg++) { + srh.delayed_fission_source(dg) = 0.0; + } + + int material = srh.material(); + if (material != MATERIAL_VOID) { + double inverse_k_eff = 1.0 / k_eff_; + for (int dg = 0; dg < ndgroups_; dg++) { + // We cannot have delayed neutrons if there is no delayed data + double lambda = lambda_[material * ndgroups_ + dg]; + if (lambda != 0.0) { + for (int g = 0; g < negroups_; g++) { + double scalar_flux; + if (settings::is_initial_condition) { + scalar_flux = srh.scalar_flux_new(g); + } else { + scalar_flux = srh.scalar_flux_td_new(g); + } + double nu_d_sigma_f = nu_d_sigma_f_[material * negroups_ * ndgroups_ + + dg * negroups_ + g]; + srh.delayed_fission_source(dg) += nu_d_sigma_f * scalar_flux; + } + srh.delayed_fission_source(dg) *= inverse_k_eff; + } + } + } +} + +void FlatSourceDomain::compute_single_precursors(SourceRegionHandle& srh) +{ + // Reset all precursors to zero (important for void regions) + for (int g = 0; g < negroups_; g++) { + srh.precursors_new(g) = 0.0; + } + + int material = srh.material(); + if (material != MATERIAL_VOID) { + for (int dg = 0; dg < ndgroups_; dg++) { + double lambda = lambda_[material * ndgroups_ + dg]; + if (lambda != 0.0) { + double delayed_fission_source = srh.delayed_fission_source(dg); + if (settings::is_initial_condition) { + srh.precursors_new(dg) = delayed_fission_source / lambda; + } else { + double precursor_rhs_bd = srh.precursors_rhs_bd(dg); + srh.precursors_new(dg) = delayed_fission_source - precursor_rhs_bd; + double A0 = + (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / + settings::dt; + srh.precursors_new(dg) /= A0 + lambda; + } + } + } + } +} + +void FlatSourceDomain::compute_all_precursors() +{ + simulation::time_compute_precursors.start(); + +#pragma omp parallel for + for (int64_t sr = 0; sr < n_source_regions(); sr++) { + SourceRegionHandle srh = source_regions_.get_source_region_handle(sr); + compute_single_delayed_fission_source(srh); + compute_single_precursors(srh); + } + + simulation::time_compute_precursors.start(); +} + +void FlatSourceDomain::serialize_final_td_fluxes(vector& flux_td) +{ + // Ensure array is correct size + flux_td.resize(n_source_regions() * negroups_); +// Serialize the final fluxes for output +#pragma omp parallel for + for (int64_t se = 0; se < n_source_elements(); se++) { + flux_td[se] = source_regions_.scalar_flux_td_final(se); + } +} + +void FlatSourceDomain::serialize_final_td_sources(vector& source_td) +{ + // Ensure array is correct size + source_td.resize(n_source_regions() * negroups_); + // Serialize the final sources for output +#pragma omp parallel for + for (int64_t se = 0; se < n_source_elements(); se++) { + source_td[se] = source_regions_.source_td_final(se); + } +} + +void FlatSourceDomain::serialize_final_precursors(vector& precursors) +{ + // Ensure array is correct size + precursors.resize(n_source_regions() * ndgroups_); +// Serialize the precursors for output +#pragma omp parallel for + for (int64_t de = 0; de < n_delay_elements(); de++) { + precursors[de] = source_regions_.precursors_final(de); + } +} + +void FlatSourceDomain::flux_td_swap() +{ + source_regions_.flux_td_swap(); +} + +void FlatSourceDomain::precursors_swap() +{ + source_regions_.precursors_swap(); +} + +void FlatSourceDomain::accumulate_iteration_quantities() +{ + accumulate_iteration_flux(); + if (settings::kinetic_simulation) { +#pragma omp parallel for + for (int64_t sr = 0; sr < n_source_regions(); sr++) { + for (int g = 0; g < negroups_; g++) { + source_regions_.scalar_flux_td_final(sr, g) += + source_regions_.scalar_flux_td_new(sr, g); + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (settings::is_initial_condition) + source_regions_.source_final(sr, g) += + source_regions_.source(sr, g); + else + source_regions_.source_td_final(sr, g) += + source_regions_.source_td(sr, g); + } + } + for (int dg = 0; dg < ndgroups_; dg++) { + source_regions_.precursors_final(sr, dg) += + source_regions_.precursors_new(sr, dg); + } + } + } +} + +void FlatSourceDomain::normalize_final_quantities() +{ + // TODO: add timer + double normalization_factor = + 1.0 / (settings::n_batches - settings::n_inactive); + double source_normalization_factor = + compute_fixed_source_normalization_factor() * normalization_factor; + +#pragma omp parallel for + for (int64_t sr = 0; sr < n_source_regions(); sr++) { + for (int g = 0; g < negroups_; g++) { + source_regions_.scalar_flux_final(sr, g) *= source_normalization_factor; + if (settings::kinetic_simulation) + source_regions_.scalar_flux_td_final(sr, g) *= + source_normalization_factor; + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + source_regions_.source_td_final(sr, g) *= normalization_factor; + } + } + for (int dg = 0; dg < ndgroups_; dg++) { + source_regions_.precursors_final(sr, dg) *= source_normalization_factor; + } + } +} + +void FlatSourceDomain::propagate_final_quantities() +{ +// TODO: add timer +#pragma omp parallel for + for (int64_t sr = 0; sr < n_source_regions(); sr++) { + for (int g = 0; g < negroups_; g++) { + source_regions_.scalar_flux_old(sr, g) = + source_regions_.scalar_flux_final(sr, g); + source_regions_.scalar_flux_td_old(sr, g) = + source_regions_.scalar_flux_td_final(sr, g); + } + for (int dg = 0; dg < ndgroups_; dg++) { + source_regions_.precursors_old(sr, dg) = + source_regions_.precursors_final(sr, dg); + } + } +} + +// Helper function for store_time_step_quantities() +void add_value_to_bd_vector(std::deque& bd_vector, double& new_value, + bool increment_not_initialize, int initialize_size) +{ + bd_vector.push_front(new_value); + if (increment_not_initialize) { + bd_vector.pop_back(); + } else { + for (int i = 1; i < initialize_size; i++) + bd_vector.push_front(new_value); + } +} + +void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) +{ +// TODO: add timer +#pragma omp parallel for + for (int64_t sr = 0; sr < n_source_regions(); sr++) { + for (int g = 0; g < negroups_; g++) { + int j = 0; + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) + j = 1; + add_value_to_bd_vector(source_regions_.scalar_flux_bd(sr, g), + source_regions_.scalar_flux_td_final(sr, g), increment_not_initialize, + RandomRay::bd_order_ + j); + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + // Multiply out sigma_t to store the base source + double sigma_t; + if (settings::is_initial_condition) { + sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; + } else { + sigma_t = sigma_t_td_[source_regions_.material(sr) * negroups_ + g]; + } + double source = source_regions_.source_td_final(sr, g) * sigma_t; + add_value_to_bd_vector(source_regions_.source_bd(sr, g), source, + increment_not_initialize, RandomRay::bd_order_); + } + } + for (int dg = 0; dg < ndgroups_; dg++) { + add_value_to_bd_vector(source_regions_.precursors_bd(sr, dg), + source_regions_.precursors_final(sr, dg), increment_not_initialize, + RandomRay::bd_order_); + } + } +} + +void FlatSourceDomain::compute_rhs_bd_quantities() +{ +// TODO: add timer +#pragma omp parallel for + for (int64_t sr = 0; sr < n_source_regions(); sr++) { + for (int g = 0; g < negroups_; g++) { + source_regions_.scalar_flux_rhs_bd(sr, g) = + rhs_backwards_difference(source_regions_.scalar_flux_bd(sr, g), + RandomRay::bd_order_, settings::dt); + + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + source_regions_.source_rhs_bd(sr, g) = rhs_backwards_difference( + source_regions_.source_bd(sr, g), RandomRay::bd_order_, settings::dt); + + source_regions_.scalar_flux_rhs_bd_2(sr, g) = + rhs_backwards_difference(source_regions_.scalar_flux_bd(sr, g), + RandomRay::bd_order_, settings::dt, 2); + } + } + for (int dg = 0; dg < ndgroups_; dg++) { + source_regions_.precursors_rhs_bd(sr, dg) = + rhs_backwards_difference(source_regions_.precursors_bd(sr, dg), + RandomRay::bd_order_, settings::dt); + } + } +} + +// Update material density and cross sections +void FlatSourceDomain::update_material_density(int i) +{ +#pragma omp parallel for + for (int j = 0; j < model::materials.size(); j++) { + auto& mat {model::materials[j]}; + if (mat->density_timeseries_.size() != 0) { + double density_factor = mat->density_timeseries_[i] / mat->density_; + mat->density_ = mat->density_timeseries_[i]; + for (int g_out = 0; g_out < negroups_; g_out++) { + for (int dg = 0; dg < ndgroups_; dg++) { + nu_d_sigma_f_[j * negroups_ * ndgroups_ + dg * negroups_ + g_out] *= + density_factor; + } + nu_p_sigma_f_[j * negroups_ + g_out] *= density_factor; + sigma_t_td_[j * negroups_ + g_out] *= density_factor; + nu_sigma_f_td_[j * negroups_ + g_out] *= density_factor; + sigma_f_td_[j * negroups_ + g_out] *= density_factor; + for (int g_in = 0; g_in < negroups_; g_in++) { + sigma_s_td_[j * negroups_ * negroups_ + g_out * negroups_ + g_in] *= + density_factor; + } + } + } + } +} + } // namespace openmc diff --git a/src/random_ray/source_region.cpp b/src/random_ray/source_region.cpp index 3b06f0ed09f..854fcc99b9e 100644 --- a/src/random_ray/source_region.cpp +++ b/src/random_ray/source_region.cpp @@ -1,4 +1,5 @@ #include "openmc/random_ray/source_region.h" +#include "openmc/random_ray/random_ray.h" #include "openmc/error.h" #include "openmc/message_passing.h" @@ -23,19 +24,38 @@ SourceRegionHandle::SourceRegionHandle(SourceRegion& sr) volume_task_(&sr.volume_task_), mesh_(&sr.mesh_), parent_sr_(&sr.parent_sr_), scalar_flux_old_(sr.scalar_flux_old_.data()), scalar_flux_new_(sr.scalar_flux_new_.data()), source_(sr.source_.data()), + source_final_(sr.source_.data()), external_source_(sr.external_source_.data()), scalar_flux_final_(sr.scalar_flux_final_.data()), source_gradients_(sr.source_gradients_.data()), flux_moments_old_(sr.flux_moments_old_.data()), flux_moments_new_(sr.flux_moments_new_.data()), flux_moments_t_(sr.flux_moments_t_.data()), - tally_task_(sr.tally_task_.data()) + tally_task_(sr.tally_task_.data()), + scalar_flux_td_old_(sr.scalar_flux_td_old_.data()), + scalar_flux_td_new_(sr.scalar_flux_td_new_.data()), + scalar_flux_td_final_(sr.scalar_flux_td_final_.data()), + source_td_(sr.source_td_.data()), + source_td_final_(sr.source_td_final_.data()), + source_time_derivative_(sr.source_time_derivative_.data()), + scalar_flux_time_derivative_2_(sr.scalar_flux_time_derivative_2_.data()), + delayed_fission_source_(sr.delayed_fission_source_.data()), + precursors_old_(sr.precursors_old_.data()), + precursors_new_(sr.precursors_new_.data()), + precursors_final_(sr.precursors_final_.data()), + scalar_flux_bd_(sr.scalar_flux_bd_.data()), + source_bd_(sr.source_bd_.data()), precursors_bd_(sr.precursors_bd_.data()), + scalar_flux_rhs_bd_(sr.scalar_flux_rhs_bd_.data()), + source_rhs_bd_(sr.source_rhs_bd_.data()), + scalar_flux_rhs_bd_2_(sr.scalar_flux_rhs_bd_2_.data()), + precursors_rhs_bd_(sr.precursors_rhs_bd_.data()), + tally_delay_task_(sr.tally_delay_task_.data()) {} //============================================================================== // SourceRegion implementation //============================================================================== -SourceRegion::SourceRegion(int negroups, bool is_linear) +SourceRegion::SourceRegion(int negroups, int ndgroups, bool is_linear) { if (settings::run_mode == RunMode::EIGENVALUE) { // If in eigenvalue mode, set starting flux to guess of 1 @@ -58,6 +78,38 @@ SourceRegion::SourceRegion(int negroups, bool is_linear) flux_moments_new_.resize(negroups); flux_moments_t_.resize(negroups); } + if (settings::kinetic_simulation) { + scalar_flux_td_old_.assign(negroups, 0.0); + scalar_flux_td_new_.assign(negroups, 0.0); + source_td_.resize(negroups); + scalar_flux_td_final_.assign(negroups, 0.0); + + scalar_flux_bd_.resize(negroups); + scalar_flux_rhs_bd_.resize(negroups); + + // Source Derivative Propogation arrays + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + source_final_.assign(negroups, 0.0); + + source_td_final_.assign(negroups, 0.0); + source_time_derivative_.assign(negroups, 0.0); + scalar_flux_time_derivative_2_.assign(negroups, 0.0); + + source_bd_.resize(negroups); + source_rhs_bd_.resize(negroups); + scalar_flux_rhs_bd_2_.resize(negroups); + } + + delayed_fission_source_.assign(ndgroups, 0.0); + precursors_old_.assign(ndgroups, 0.0); + precursors_new_.assign(ndgroups, 0.0); + precursors_final_.assign(ndgroups, 0.0); + + precursors_bd_.resize(ndgroups); + precursors_rhs_bd_.resize(ndgroups); + + tally_delay_task_.resize(ndgroups); + } } //============================================================================== @@ -114,6 +166,45 @@ void SourceRegionContainer::push_back(const SourceRegion& sr) // Tally tasks tally_task_.emplace_back(sr.tally_task_[g]); + + // Energy-dependent fields for kinetic simulations + if (settings::kinetic_simulation) { + scalar_flux_td_old_.push_back(sr.scalar_flux_td_old_[g]); + scalar_flux_td_new_.push_back(sr.scalar_flux_td_new_[g]); + scalar_flux_td_final_.push_back(sr.scalar_flux_td_final_[g]); + source_td_.push_back(sr.source_td_[g]); + + scalar_flux_bd_.push_back(sr.scalar_flux_bd_[g]); + scalar_flux_rhs_bd_.push_back(sr.scalar_flux_rhs_bd_[g]); + + // Source Derivative Propogation arrays + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + source_final_.push_back(sr.source_final_[g]); + + source_td_final_.push_back(sr.source_final_[g]); + source_time_derivative_.push_back(sr.source_time_derivative_[g]); + scalar_flux_time_derivative_2_.push_back( + sr.scalar_flux_time_derivative_2_[g]); + + source_bd_.push_back(sr.source_bd_[g]); + source_rhs_bd_.push_back(sr.source_rhs_bd_[g]); + scalar_flux_rhs_bd_2_.push_back(sr.scalar_flux_rhs_bd_2_[g]); + } + } + } + // Delay group-dependent fields for kinetic simulations + if (settings::kinetic_simulation) { + for (int dg = 0; dg < ndgroups_; dg++) { + delayed_fission_source_.push_back(sr.delayed_fission_source_[dg]); + precursors_old_.push_back(sr.precursors_old_[dg]); + precursors_new_.push_back(sr.precursors_new_[dg]); + precursors_final_.push_back(sr.precursors_final_[dg]); + tally_delay_task_.emplace_back(sr.tally_delay_task_[dg]); + + // Backward difference arrays + precursors_bd_.push_back(sr.precursors_bd_[dg]); + precursors_rhs_bd_.push_back(sr.precursors_rhs_bd_[dg]); + } } } @@ -161,6 +252,37 @@ void SourceRegionContainer::assign( tally_task_.clear(); volume_task_.clear(); + // Clear existing data for kinetic simulatons + if (settings::kinetic_simulation) { + scalar_flux_td_old_.clear(); + scalar_flux_td_new_.clear(); + scalar_flux_td_final_.clear(); + source_td_.clear(); + + scalar_flux_bd_.clear(); + scalar_flux_rhs_bd_.clear(); + + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + source_final_.clear(); + + source_time_derivative_.clear(); + scalar_flux_time_derivative_2_.clear(); + + source_bd_.clear(); + source_rhs_bd_.clear(); + scalar_flux_rhs_bd_2_.clear(); + } + + precursors_bd_.clear(); + precursors_rhs_bd_.clear(); + + delayed_fission_source_.clear(); + precursors_old_.clear(); + precursors_new_.clear(); + precursors_final_.clear(); + tally_delay_task_.clear(); + } + // Fill with copies of source_region for (int i = 0; i < n_source_regions; ++i) { push_back(source_region); @@ -218,6 +340,39 @@ SourceRegionHandle SourceRegionContainer::get_source_region_handle(int64_t sr) handle.flux_moments_t_ = &flux_moments_t(sr, 0); } + if (settings::kinetic_simulation) { + handle.scalar_flux_td_old_ = &scalar_flux_td_old(sr, 0); + handle.scalar_flux_td_new_ = &scalar_flux_td_new(sr, 0); + handle.source_td_ = &source_td(sr, 0); + handle.scalar_flux_td_final_ = &scalar_flux_td_final(sr, 0); + + handle.scalar_flux_bd_ = &scalar_flux_bd(sr, 0); + handle.scalar_flux_rhs_bd_ = &scalar_flux_rhs_bd(sr, 0); + + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + handle.source_final_ = &source_final(sr, 0); + + handle.source_td_final_ = &source_td_final(sr, 0); + handle.source_time_derivative_ = &source_time_derivative(sr, 0); + handle.scalar_flux_time_derivative_2_ = + &scalar_flux_time_derivative_2(sr, 0); + + handle.source_bd_ = &source_bd(sr, 0); + handle.source_rhs_bd_ = &source_rhs_bd(sr, 0); + handle.scalar_flux_rhs_bd_2_ = &scalar_flux_rhs_bd_2(sr, 0); + } + + handle.delayed_fission_source_ = &delayed_fission_source(sr, 0); + handle.precursors_old_ = &precursors_old(sr, 0); + handle.precursors_new_ = &precursors_new(sr, 0); + handle.precursors_final_ = &precursors_final(sr, 0); + + handle.precursors_bd_ = &precursors_bd(sr, 0); + handle.precursors_rhs_bd_ = &precursors_rhs_bd(sr, 0); + + handle.tally_delay_task_ = &tally_delay_task(sr, 0); + } + return handle; } @@ -256,6 +411,53 @@ void SourceRegionContainer::adjoint_reset() MomentArray {0.0, 0.0, 0.0}); std::fill(flux_moments_t_.begin(), flux_moments_t_.end(), MomentArray {0.0, 0.0, 0.0}); + // Reset arrays for kinetic adjoint simulations + if (settings::kinetic_simulation && !settings::is_initial_condition) { + std::fill(scalar_flux_td_old_.begin(), scalar_flux_td_old_.end(), 0.0); + std::fill(scalar_flux_td_new_.begin(), scalar_flux_td_new_.end(), 0.0); + std::fill( + delayed_fission_source_.begin(), delayed_fission_source_.end(), 0.0); + std::fill(precursors_old_.begin(), precursors_old_.end(), 0.0); + std::fill(precursors_new_.begin(), precursors_new_.end(), 0.0); + + // BD Vectors + std::fill(scalar_flux_rhs_bd_.begin(), scalar_flux_rhs_bd_.end(), 0.0); + + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + std::fill( + source_time_derivative_.begin(), source_time_derivative_.end(), 0.0); + std::fill(scalar_flux_time_derivative_2_.begin(), + scalar_flux_time_derivative_2_.end(), 0.0); + + std::fill(source_rhs_bd_.begin(), source_rhs_bd_.end(), 0.0); + std::fill( + scalar_flux_rhs_bd_2_.begin(), scalar_flux_rhs_bd_2_.end(), 0.0); + } + std::fill(precursors_rhs_bd_.begin(), precursors_rhs_bd_.end(), 0.0); + } +} + +//----------------------------------------------------------------------------- +// Methods for kinetic simulations + +void SourceRegionContainer::flux_td_swap() +{ + scalar_flux_td_old_.swap(scalar_flux_td_new_); + // TODO: Add support for linear source regions +} + +void SourceRegionContainer::precursors_swap() +{ + precursors_old_.swap(precursors_new_); +} + +void SourceRegionContainer::time_step_reset() +{ + std::fill(scalar_flux_final_.begin(), scalar_flux_final_.end(), 0.0); + std::fill(scalar_flux_td_final_.begin(), scalar_flux_td_final_.end(), 0.0); + std::fill(precursors_final_.begin(), precursors_final_.end(), 0.0); + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) + std::fill(source_td_final_.begin(), source_td_final_.end(), 0.0); } } // namespace openmc diff --git a/src/timer.cpp b/src/timer.cpp index 6d692d4fbf6..d107d704cca 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -28,6 +28,12 @@ Timer time_event_collision; Timer time_event_death; Timer time_update_src; +// Timers for kinetic simulations +Timer time_initialize_td; +Timer time_update_bd_vectors_td; +Timer time_update_src_td; +Timer time_compute_precursors; + } // namespace simulation //============================================================================== @@ -87,6 +93,11 @@ void reset_timers() simulation::time_event_collision.reset(); simulation::time_event_death.reset(); simulation::time_update_src.reset(); + + simulation::time_initialize_td.reset(); + simulation::time_update_bd_vectors_td.reset(); + simulation::time_update_src_td.reset(); + simulation::time_compute_precursors.reset(); } } // namespace openmc From 27f4e3b88b663139edbd81792942bb45bf5e6f53 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 28 Dec 2025 17:08:10 -0600 Subject: [PATCH 04/64] add kinetic simulation machinery - add some missing precursor tally machinery in reaction.cpp and tally.cpp, and output.cpp - add testing harness for kinetic simulations - remove some unuesd timers - implement time stepping loop in random_ray_simulation.cpp and supporting funtions. --- include/openmc/random_ray/random_ray.h | 22 +- .../openmc/random_ray/random_ray_simulation.h | 20 +- include/openmc/simulation.h | 4 + include/openmc/timer.h | 1 - openmc/examples.py | 50 +-- src/output.cpp | 1 + src/random_ray/flat_source_domain.cpp | 6 +- src/random_ray/random_ray.cpp | 61 +++- src/random_ray/random_ray_simulation.cpp | 310 ++++++++++++++++-- src/reaction.cpp | 1 + src/settings.cpp | 10 +- src/simulation.cpp | 2 + src/tallies/tally.cpp | 16 +- src/timer.cpp | 2 - tests/testing_harness.py | 177 ++++++++++ 15 files changed, 610 insertions(+), 73 deletions(-) diff --git a/include/openmc/random_ray/random_ray.h b/include/openmc/random_ray/random_ray.h index 784c37997e0..49d575b9731 100644 --- a/include/openmc/random_ray/random_ray.h +++ b/include/openmc/random_ray/random_ray.h @@ -50,6 +50,16 @@ class RandomRay : public Particle { static RandomRaySourceShape source_shape_; // Flag for linear source static RandomRaySampleMethod sample_method_; // Flag for sampling method + static double avg_miss_rate_; // Average ray miss rate per + // iteration for reporting + static int64_t n_source_regions_; // Total number of source regions + static int64_t + n_external_source_regions_; // Total number of source regions with + // non-zero external source terms + static uint64_t total_geometric_intersections_; // Tracks the total number of + // geometric intersections by + // all rays for reporting + // Kinetic simulation variables static int bd_order_; // Order of backwards difference approximation for // time-derivatives @@ -60,9 +70,13 @@ class RandomRay : public Particle { //---------------------------------------------------------------------------- // Public data members vector angular_flux_; - bool ray_trace_only_ {false}; // If true, only perform geometry operations + //--------------------------------------------------------------------------- + // Public data members for kinetic simulations + vector angular_flux_td_; + vector angular_flux_td_prime_; + private: //---------------------------------------------------------------------------- // Private data members @@ -77,6 +91,12 @@ class RandomRay : public Particle { double distance_travelled_ {0}; bool is_active_ {false}; bool is_alive_ {true}; + + //--------------------------------------------------------------------------- + // Private data members for kinetic simulations + vector delta_psi_td_; + vector delta_psi_td_prime_; + }; // class RandomRay } // namespace openmc diff --git a/include/openmc/random_ray/random_ray_simulation.h b/include/openmc/random_ray/random_ray_simulation.h index 3dec48bf266..7e1e30cadcb 100644 --- a/include/openmc/random_ray/random_ray_simulation.h +++ b/include/openmc/random_ray/random_ray_simulation.h @@ -26,9 +26,7 @@ class RandomRaySimulation { void output_simulation_results() const; void instability_check( int64_t n_hits, double k_eff, double& avg_miss_rate) const; - void print_results_random_ray(uint64_t total_geometric_intersections, - double avg_miss_rate, int negroups, int64_t n_source_regions, - int64_t n_external_source_regions) const; + void print_results_random_ray() const; //---------------------------------------------------------------------------- // Accessors @@ -36,7 +34,7 @@ class RandomRaySimulation { private: //---------------------------------------------------------------------------- - // Data members + // Data Members // Contains all flat source region data unique_ptr domain_; @@ -51,6 +49,9 @@ class RandomRaySimulation { // Number of energy groups int negroups_; + // Number of delay groups + int ndgroups_; + }; // class RandomRaySimulation //============================================================================ @@ -61,6 +62,15 @@ void openmc_run_random_ray(); void validate_random_ray_inputs(); void openmc_reset_random_ray(); +//! Write data related to randaom ray to statepoint +//! \param[in] group HDF5 group +void write_random_ray_hdf5(hid_t group); + +// Functions for kinetic simulations +void set_time_dependent_settings(); +void rename_statepoint_file(int i); +void rename_tallies_file(int i); + } // namespace openmc -#endif // OPENMC_RANDOM_RAY_SIMULATION_H +#endif // OPENMC_RANDOM_RAY_SIMUgATION_H diff --git a/include/openmc/simulation.h b/include/openmc/simulation.h index 9a6cf1b2131..e130f752033 100644 --- a/include/openmc/simulation.h +++ b/include/openmc/simulation.h @@ -49,6 +49,10 @@ extern const RegularMesh* ufs_mesh; extern vector k_generation; extern vector work_index; +//----------------------------------------------------------------------------- +// Global variables for kinetic simulations +extern double current_time; + } // namespace simulation //============================================================================== diff --git a/include/openmc/timer.h b/include/openmc/timer.h index 70d5d0acebb..67752e00fbd 100644 --- a/include/openmc/timer.h +++ b/include/openmc/timer.h @@ -33,7 +33,6 @@ extern Timer time_event_collision; extern Timer time_event_death; extern Timer time_update_src; -extern Timer time_initialize_td; extern Timer time_update_bd_vectors_td; extern Timer time_update_src_td; extern Timer time_compute_precursors; diff --git a/openmc/examples.py b/openmc/examples.py index 097d7c99715..9f079e0104a 100644 --- a/openmc/examples.py +++ b/openmc/examples.py @@ -656,14 +656,14 @@ def slab_mg(num_regions=1, mat_names=None, mgxslib_name='2g.h5') -> openmc.Model return model -def _generate_c5g7_materials(time_dependent) -> openmc.Materials: +def _generate_c5g7_materials(kinetic) -> openmc.Materials: """Generate materials utilizing multi-group cross sections based on the the C5G7 Benchmark. Parameters ---------- - time_dependent : bool - Flag to generate cross sections for a time-dependent model or not. + kinetic : bool + Flag to generate cross sections for kinetic simulations. Returns ------- @@ -692,7 +692,7 @@ def _generate_c5g7_materials(time_dependent) -> openmc.Materials: # come from Hou et al., "OECD/NEA benchmark for time-dependnet neutron # transport calculations without homogeniztaion" # DOI: 10.1016/j.nucengdes.2017.02.008 - n_dg = C5G7_N_DG if time_dependent else 0 + n_dg = C5G7_N_DG if kinetic else 0 # Instantiate the 7-group (C5G7) cross section data uo2_xsdata = openmc.XSdata('UO2', groups, num_delayed_groups=n_dg) @@ -728,7 +728,7 @@ def _generate_c5g7_materials(time_dependent) -> openmc.Materials: 0.0000e+00, 0.0000e+00]) # Delayed and prompt cross sections for time-dependent simulation - if time_dependent: + if kinetic: # Table A2 in Hou et. al beta = np.array([[2.13333e-04, 2.13333e-04, 2.13333e-04, 2.13333e-04, 2.13333e-04, 2.13333e-04, 2.13333e-04], @@ -804,7 +804,7 @@ def _generate_c5g7_materials(time_dependent) -> openmc.Materials: scatter_matrix = np.rollaxis(scatter_matrix, 0, 3) h2o_xsdata.set_scatter_matrix(scatter_matrix) - if time_dependent: + if kinetic: # Table A4 in Hou et al. velocities = np.array([2.23517E+09, 4.98880E+08, 3.84974E+07, 5.12639E+06, 1.67542E+06, 7.26031E+05, 2.81629E+05]) @@ -822,7 +822,7 @@ def _generate_c5g7_materials(time_dependent) -> openmc.Materials: uo2.set_density('macro', 1.0) uo2.add_macroscopic('UO2') - if time_dependent: + if kinetic: densities = np.linspace(1, 0.95, 100) else: densities = None @@ -905,14 +905,14 @@ def _generate_random_ray_pin_cell(uo2, water) -> openmc.Universe: return pincell -def random_ray_pin_cell(time_dependent=False) -> openmc.Model: +def random_ray_pin_cell(kinetic=False) -> openmc.Model: """Create a PWR pin cell example using C5G7 cross section data. cross section data. Parameters ---------- - time_dependent : bool - Flag to generate a time-dependent model or not. + kinetic : bool + Flag to generate kinetic simulation model or not. Returns ------- @@ -924,7 +924,7 @@ def random_ray_pin_cell(time_dependent=False) -> openmc.Model: ########################################################################### # Create Materials for the problem - materials = _generate_c5g7_materials(time_dependent) + materials = _generate_c5g7_materials(kinetic) uo2 = materials[0] water = materials[1] @@ -962,9 +962,10 @@ def random_ray_pin_cell(time_dependent=False) -> openmc.Model: settings.random_ray['distance_inactive'] = 20.0 settings.random_ray['ray_source'] = rr_source settings.random_ray['volume_normalized_flux_tallies'] = True - if time_dependent: - settings.run_mode = "time dependent" - settings.time_dependent = { + if kinetic: + settings.random_ray['bd_order'] = 3 + settings.kinetic_simulation = True + settings.timestep_parameters = { "dt": 0.01, "n_timesteps": 20, "timestep_units": "s", @@ -980,7 +981,7 @@ def random_ray_pin_cell(time_dependent=False) -> openmc.Model: # Instantiate a Tallies collection and export to XML tallies = openmc.Tallies([tally]) - if time_dependent: + if kinetic: delay_filter = openmc.DelayedGroupFilter(np.arange(1, C5G7_N_DG+1, 1)) tally = openmc.Tally(name="Delayed tally") tally.filters = [delay_filter] @@ -997,7 +998,7 @@ def random_ray_pin_cell(time_dependent=False) -> openmc.Model: model.tallies = tallies return model -def random_ray_lattice(time_dependent=False) -> openmc.Model: +def random_ray_lattice(kinetic=False) -> openmc.Model: """Create a 2x2 PWR pin cell asymmetrical lattice example. This model is a 2x2 reflective lattice of fuel pins with one of the lattice @@ -1006,8 +1007,8 @@ def random_ray_lattice(time_dependent=False) -> openmc.Model: Parameters ---------- - time_dependent : bool - Flag to generate a time-dependent model or not. + kinetic : bool + Flag to generate a kinetic simulation model or not. Returns ------- @@ -1019,7 +1020,7 @@ def random_ray_lattice(time_dependent=False) -> openmc.Model: ########################################################################### # Create Materials for the problem - materials = _generate_c5g7_materials(time_dependent) + materials = _generate_c5g7_materials(kinetic) uo2 = materials[0] water = materials[1] @@ -1031,7 +1032,7 @@ def random_ray_lattice(time_dependent=False) -> openmc.Model: # Define a moderator lattice universe moderator_infinite = openmc.Cell(name='moderator infinite') - if time_dependent: + if kinetic: water_reflector = water.clone() water_reflector.name='Water Reflector' water_reflector.set_density('macro', 1.0) @@ -1094,9 +1095,10 @@ def random_ray_lattice(time_dependent=False) -> openmc.Model: settings.random_ray['distance_inactive'] = 20.0 settings.random_ray['ray_source'] = rr_source settings.random_ray['volume_normalized_flux_tallies'] = True - if time_dependent: - settings.run_mode = "time dependent" - settings.time_dependent = { + if kinetic: + settings.random_ray['bd_order'] = 3 + settings.kinetic_simulation = True + settings.timestep_parameters = { "dt": 0.01, "n_timesteps": 2, "timestep_units": "s", @@ -1127,7 +1129,7 @@ def random_ray_lattice(time_dependent=False) -> openmc.Model: # Instantiate a Tallies collection and export to XML tallies = openmc.Tallies([tally]) - if time_dependent: + if kinetic: delay_filter = openmc.DelayedGroupFilter(np.arange(1, C5G7_N_DG+1, 1)) tally = openmc.Tally(name="Mesh delayed tally") tally.filters = [mesh_filter, delay_filter] diff --git a/src/output.cpp b/src/output.cpp index 80e2b10ab89..e954923a3e2 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -598,6 +598,7 @@ const std::unordered_map score_names = { {SCORE_IFP_TIME_NUM, "IFP lifetime numerator"}, {SCORE_IFP_BETA_NUM, "IFP delayed fraction numerator"}, {SCORE_IFP_DENOM, "IFP common denominator"}, + {SCORE_PRECURSORS, "Precursor Population"}, }; //! Create an ASCII output file showing all tally results. diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index becf2ab91a2..167a8d907d5 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -96,10 +96,12 @@ void FlatSourceDomain::batch_reset() source_regions_.scalar_flux_new(se) = 0.0; } - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation) { #pragma omp parallel for for (int64_t se = 0; se < n_source_elements(); se++) { - source_regions_.scalar_flux_td_new(se) = 0.0; + source_regions_.precursors_new(se) = 0.0; + if (!settings::is_initial_condition) + source_regions_.scalar_flux_td_new(se) = 0.0; } } } diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index 96d4fcac508..1ea139a24b1 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -239,6 +239,11 @@ unique_ptr RandomRay::ray_source_; RandomRaySourceShape RandomRay::source_shape_ {RandomRaySourceShape::FLAT}; RandomRaySampleMethod RandomRay::sample_method_ {RandomRaySampleMethod::PRNG}; +double RandomRay::avg_miss_rate_; +int64_t RandomRay::n_source_regions_; +int64_t RandomRay::n_external_source_regions_; +uint64_t RandomRay::total_geometric_intersections_; + // Kinetic simulation variables int RandomRay::bd_order_ {3}; // order 3 BD balances accuracy with speed nicely RandomRayTimeMethod RandomRay::time_method_ {RandomRayTimeMethod::ISOTROPIC}; @@ -246,7 +251,12 @@ RandomRayTimeMethod RandomRay::time_method_ {RandomRayTimeMethod::ISOTROPIC}; RandomRay::RandomRay() : angular_flux_(data::mg.num_energy_groups_), delta_psi_(data::mg.num_energy_groups_), - negroups_(data::mg.num_energy_groups_) + negroups_(data::mg.num_energy_groups_), + angular_flux_td_(data::mg.num_energy_groups_), + delta_psi_td_(data::mg.num_energy_groups_), + angular_flux_td_prime_(data::mg.num_energy_groups_), + delta_psi_td_prime_(data::mg.num_energy_groups_) + { if (source_shape_ == RandomRaySourceShape::LINEAR || source_shape_ == RandomRaySourceShape::LINEAR_XY) { @@ -404,6 +414,7 @@ void RandomRay::attenuate_flux_inner( break; case RandomRaySourceShape::LINEAR: case RandomRaySourceShape::LINEAR_XY: + // TODO: time-dependent linear source regions if (srh.material() == MATERIAL_VOID) { attenuate_flux_linear_source_void(srh, distance, is_active, r); } else { @@ -445,6 +456,36 @@ void RandomRay::attenuate_flux_flat_source( float new_delta_psi = (angular_flux_[g] - srh.source(g)) * exponential; delta_psi_[g] = new_delta_psi; angular_flux_[g] -= new_delta_psi; + if (settings::kinetic_simulation && !settings::is_initial_condition) { + float sigma_t_td = domain_->sigma_t_td_[material * negroups_ + g]; + float tau_td = sigma_t_td * distance; + float exponential_td = + cjosey_exponential(tau_td); // exponential = 1 - exp(-tau) + float new_delta_psi_td = + (angular_flux_td_[g] - srh.source_td(g)) * exponential_td; + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + float source_derivative = srh.source_time_derivative(g); + float flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); + float T1 = (source_derivative - flux_derivative_2); + + // Source Derivative Propogation terms for Time Derivative + // Characteristic Equation + float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; + new_delta_psi_td += T1 * inverse_vbar * exponential_td / sigma_t_td; + new_delta_psi_td += distance * inverse_vbar * + (angular_flux_td_prime_[g] - T1) * + (1 - exponential_td); + + // Time Derivative Characteristic Equation + float new_delta_psi_td_prime = + (angular_flux_td_prime_[g] - T1) * exponential_td; + delta_psi_td_prime_[g] = new_delta_psi_td_prime; + angular_flux_td_prime_[g] -= new_delta_psi_td_prime; + } + + delta_psi_td_[g] = new_delta_psi_td; + angular_flux_td_[g] -= new_delta_psi_td; + } } // If ray is in the active phase (not in dead zone), make contributions to @@ -458,6 +499,8 @@ void RandomRay::attenuate_flux_flat_source( // this iteration for (int g = 0; g < negroups_; g++) { srh.scalar_flux_new(g) += delta_psi_[g]; + if (settings::kinetic_simulation && !settings::is_initial_condition) + srh.scalar_flux_td_new(g) += delta_psi_td_[g]; } // Accomulate volume (ray distance) into this iteration's estimate @@ -480,6 +523,7 @@ void RandomRay::attenuate_flux_flat_source( } // Alternative flux attenuation function for true void regions. +// TODO: Implement support for time dependent voids void RandomRay::attenuate_flux_flat_source_void( SourceRegionHandle& srh, double distance, bool is_active, Position r) { @@ -816,6 +860,21 @@ void RandomRay::initialize_ray(uint64_t ray_id, FlatSourceDomain* domain) for (int g = 0; g < negroups_; g++) { angular_flux_[g] = srh.source(g); } + if (settings::kinetic_simulation && !settings::is_initial_condition) { + for (int g = 0; g < negroups_; g++) { + angular_flux_td_[g] = srh.source_td(g); + } + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + for (int g = 0; g < negroups_; g++) { + double sigma_t_td = + domain_->sigma_t_td_[srh.material() * negroups_ + g]; + double source_derivative = srh.source_time_derivative(g); + double flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); + // T1 + angular_flux_td_prime_[g] = source_derivative - flux_derivative_2; + } + } + } } } diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index d475b2593ea..8b9ff6883cc 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -32,6 +32,11 @@ void openmc_run_random_ray() // calculation first and then the adjoint calculation later. bool adjoint_needed = FlatSourceDomain::adjoint_; + // TODO: no initial condition needed fof td fixed source simulations + // Check if this simulation is to establish an initial condition + if (settings::kinetic_simulation) + settings::is_initial_condition = true; + // Configure the domain for forward simulation FlatSourceDomain::adjoint_ = false; @@ -62,16 +67,8 @@ void openmc_run_random_ray() // End main simulation timer simulation::time_total.stop(); - // Normalize and save the final forward flux - double source_normalization_factor = - sim.domain()->compute_fixed_source_normalization_factor() / - (settings::n_batches - settings::n_inactive); - -#pragma omp parallel for - for (uint64_t se = 0; se < sim.domain()->n_source_elements(); se++) { - sim.domain()->source_regions_.scalar_flux_final(se) *= - source_normalization_factor; - } + // Normalize and save the final forward quantities + sim.domain()->normalize_final_quantities(); // Finalize OpenMC openmc_simulation_finalize(); @@ -79,6 +76,77 @@ void openmc_run_random_ray() // Output all simulation results sim.output_simulation_results(); + if (settings::kinetic_simulation) { + warning( + "Time-dependent explicit void treatment has not yet been " + "implemented. Use caution when interpreting results from models with " + "voids, as they may contain large inaccuracies."); + sim.domain()->store_time_step_quantities(false); + rename_statepoint_file(0); + if (settings::output_tallies) { + rename_tallies_file(0); + } + set_time_dependent_settings(); + + // Timestepping loop + // TODO: Add support for time-dependent restart + for (int i = 0; i < settings::n_timesteps; i++) { + settings::current_timestep = i + 1; + + // Print simulation information + if (mpi::master) { + std::string message = + fmt::format("TIME DEPENDENT SOLVE {0}", settings::current_timestep); + const char* msg = message.c_str(); + header(msg, 3); + } + + reset_timers(); + + // Initialize OpenMC general data structures + openmc_simulation_init(); + + sim.domain()->k_eff_ = simulation::keff; + sim.domain()->source_regions_.adjoint_reset(); + sim.domain()->propagate_final_quantities(); + sim.domain()->source_regions_.time_step_reset(); + + // Compute RHS backward differences to be used later + sim.domain()->compute_rhs_bd_quantities(); + + // Update time dependent cross section based on the density + sim.domain()->update_material_density(i); + + // Begin main simulation timer + simulation::time_total.start(); + + // Execute random ray simulation + sim.simulate(); + + // End main simulation timer + simulation::time_total.stop(); + + // Finalize OpenMC + openmc_simulation_finalize(); + + // Output all simulation results + sim.output_simulation_results(); + + // Rename statepoint and tallies file + rename_statepoint_file(settings::current_timestep); + if (settings::output_tallies) { + rename_tallies_file(settings::current_timestep); + } + + // Normalize and store final quantities for next time step + sim.domain()->normalize_final_quantities(); + sim.domain()->store_time_step_quantities(); + + // Advance time + simulation::current_time += settings::dt; + } + } + ////////////////////////////////////////////////////////// // Run adjoint simulation (if enabled) ////////////////////////////////////////////////////////// @@ -95,9 +163,6 @@ void openmc_run_random_ray() if (mpi::master) header("ADJOINT FLUX SOLVE", 3); - // Initialize OpenMC general data structures - openmc_simulation_init(); - sim.domain()->k_eff_ = 1.0; // Initialize adjoint fixed sources, if present @@ -109,6 +174,9 @@ void openmc_run_random_ray() // Swap nu_sigma_f and chi sim.domain()->nu_sigma_f_.swap(sim.domain()->chi_); + // Initialize OpenMC general data structures + openmc_simulation_init(); + // Begin main simulation timer simulation::time_total.start(); @@ -144,10 +212,22 @@ void validate_random_ray_inputs() case SCORE_NU_FISSION: case SCORE_EVENTS: break; + + // TODO: add support for prompt and delayed fission + case SCORE_PRECURSORS: { + if (settings::kinetic_simulation) { + break; + } else { + fatal_error("Invalid score specified in tallies.xml. Precursors can " + "only be scored for kinetic simulations."); + } + } default: fatal_error( "Invalid score specified. Only flux, total, fission, nu-fission, and " - "event scores are supported in random ray mode."); + "event scores are supported in random ray mode. (precursors are " + "supported for " + "kinetic simulations)."); } } @@ -165,15 +245,25 @@ void validate_random_ray_inputs() case FilterType::UNIVERSE: case FilterType::PARTICLE: break; + case FilterType::DELAYED_GROUP: + if (settings::kinetic_simulation) { + break; + } else { + fatal_error("Invalid filter specified in tallies.xml. Kinetic " + "simulations is required " + "to tally with a delayed_group filter."); + } default: fatal_error("Invalid filter specified. Only cell, cell_instance, " "distribcell, energy, material, mesh, and universe filters " - "are supported in random ray mode."); + "are supported in random ray mode (delayed_group is " + "supported for kinetic simulations)."); } } } - // Validate MGXS data + // TODO: validate kinetic data is present + // Validate MGXS data /////////////////////////////////////////////////////////////////// for (auto& material : data::mg.macro_xs_) { if (!material.is_isotropic) { @@ -353,12 +443,119 @@ void openmc_reset_random_ray() RandomRay::sample_method_ = RandomRaySampleMethod::PRNG; } +void write_random_ray_hdf5(hid_t group) +{ + hid_t random_ray_group = create_group(group, "random_ray"); + switch (RandomRay::source_shape_) { + case RandomRaySourceShape::FLAT: + write_dataset(random_ray_group, "source_shape", "flat"); + break; + case RandomRaySourceShape::LINEAR: + write_dataset(random_ray_group, "source_shape", "linear"); + break; + case RandomRaySourceShape::LINEAR_XY: + write_dataset(random_ray_group, "source_shape", "linear xy"); + break; + default: + break; + } + + switch (FlatSourceDomain::volume_estimator_) { + case RandomRayVolumeEstimator::SIMULATION_AVERAGED: + write_dataset(random_ray_group, "volume_estimator", "simulation averaged"); + break; + case RandomRayVolumeEstimator::NAIVE: + write_dataset(random_ray_group, "volume_estimator", "naive"); + break; + case RandomRayVolumeEstimator::HYBRID: + write_dataset(random_ray_group, "volume_estimator", "hybrid"); + break; + default: + break; + } + + write_dataset( + random_ray_group, "distance_active", RandomRay::distance_active_); + write_dataset( + random_ray_group, "distance_inactive", RandomRay::distance_inactive_); + write_dataset(random_ray_group, "volume_normalized_flux_tallies", + FlatSourceDomain::volume_normalized_flux_tallies_); + write_dataset(random_ray_group, "adjoint_mode", FlatSourceDomain::adjoint_); + + write_dataset(random_ray_group, "avg_miss_rate", RandomRay::avg_miss_rate_); + write_dataset( + random_ray_group, "n_source_regions", RandomRay::n_source_regions_); + write_dataset(random_ray_group, "n_external_source_regions", + RandomRay::n_external_source_regions_); + write_dataset(random_ray_group, "n_geometric_intersections", + RandomRay::total_geometric_intersections_); + int64_t n_integrations = + RandomRay::total_geometric_intersections_ * data::mg.num_energy_groups_; + write_dataset(random_ray_group, "n_integrations", n_integrations); + + if (settings::kinetic_simulation && !settings::is_initial_condition) { + write_dataset(random_ray_group, "bd_order", RandomRay::bd_order_); + switch (RandomRay::time_method_) { + case RandomRayTimeMethod::ISOTROPIC: + write_dataset(random_ray_group, "time_method", "isotropic"); + break; + case RandomRayTimeMethod::PROPOGATION: + write_dataset(random_ray_group, "time_method", "propogation"); + break; + default: + break; + } + } + close_group(random_ray_group); +} + +//----------------------------------------------------------------------------- +// Non-member functions for kinetic simulations + +void set_time_dependent_settings() +{ + // Reset flags + settings::is_initial_condition = false; + + // Set current time + simulation::current_time = settings::dt; +} + +// TODO: condense this into one function with rename_tallies_file and use char +// or string arguments +void rename_statepoint_file(int i) +{ + // Rename statepoint file + std::string old_filename_ = fmt::format( + "{0}statepoint.{1}.h5", settings::path_output, settings::n_batches); + std::string new_filename_ = + fmt::format("{0}openmc_td_simulation_{1}.h5", settings::path_output, i); + + const char* old_fname = old_filename_.c_str(); + const char* new_fname = new_filename_.c_str(); + std::rename(old_fname, new_fname); +} + +void rename_tallies_file(int i) +{ + // Rename tallies file + std::string old_filename_ = + fmt::format("{0}tallies.out", settings::path_output); + std::string new_filename_ = + fmt::format("{0}tallies_{1}.out", settings::path_output, i); + + const char* old_fname = old_filename_.c_str(); + const char* new_fname = new_filename_.c_str(); + std::rename(old_fname, new_fname); +} + //============================================================================== // RandomRaySimulation implementation //============================================================================== RandomRaySimulation::RandomRaySimulation() - : negroups_(data::mg.num_energy_groups_) + : negroups_(data::mg.num_energy_groups_), + ndgroups_(data::mg.num_delayed_groups_) { // There are no source sites in random ray mode, so be sure to disable to // ensure we don't attempt to write source sites to statepoint @@ -418,8 +615,13 @@ void RandomRaySimulation::simulate() // Reset total starting particle weight used for normalizing tallies simulation::total_weight = 1.0; + // TODO: add update source convenience function + // domain_->compute_neutron_source() // Update source term (scattering + fission) domain_->update_all_neutron_sources(); + if (settings::kinetic_simulation && !settings::is_initial_condition) { + domain_->update_all_neutron_sources_td(); + } // Reset scalar fluxes, iteration volume tallies, and region hit flags // to zero @@ -468,12 +670,16 @@ void RandomRaySimulation::simulate() global_tally_tracklength = domain_->k_eff_; } + // Compute precursors + if (settings::kinetic_simulation) + domain_->compute_all_precursors(); + // Execute all tallying tasks, if this is an active batch if (simulation::current_batch > settings::n_inactive) { // Add this iteration's scalar flux estimate to final accumulated // estimate - domain_->accumulate_iteration_flux(); + domain_->accumulate_iteration_quantities(); // Use above mapping to contribute FSR flux data to appropriate // tallies @@ -482,11 +688,21 @@ void RandomRaySimulation::simulate() // Set phi_old = phi_new domain_->flux_swap(); + if (settings::kinetic_simulation && !settings::is_initial_condition) { + domain_->flux_td_swap(); + domain_->precursors_swap(); + } // Check for any obvious insabilities/nans/infs instability_check(n_hits, domain_->k_eff_, avg_miss_rate_); } // End MPI master work + // Store simulation metrics + RandomRay::avg_miss_rate_ = avg_miss_rate_ / settings::n_batches; + RandomRay::total_geometric_intersections_ = total_geometric_intersections_; + RandomRay::n_external_source_regions_ = domain_->n_external_source_regions_; + RandomRay::n_source_regions_ = domain_->n_source_regions(); + // Finalize the current batch finalize_generation(); finalize_batch(); @@ -499,9 +715,7 @@ void RandomRaySimulation::output_simulation_results() const { // Print random ray results if (mpi::master) { - print_results_random_ray(total_geometric_intersections_, - avg_miss_rate_ / settings::n_batches, negroups_, - domain_->n_source_regions(), domain_->n_external_source_regions_); + print_results_random_ray(); if (model::plots.size() > 0) { domain_->output_to_vtk(); } @@ -539,20 +753,22 @@ void RandomRaySimulation::instability_check( } // Print random ray simulation results -void RandomRaySimulation::print_results_random_ray( - uint64_t total_geometric_intersections, double avg_miss_rate, int negroups, - int64_t n_source_regions, int64_t n_external_source_regions) const +void RandomRaySimulation::print_results_random_ray() const { using namespace simulation; if (settings::verbosity >= 6) { - double total_integrations = total_geometric_intersections * negroups; + double total_integrations = + RandomRay::total_geometric_intersections_ * negroups_; double time_per_integration = simulation::time_transport.elapsed() / total_integrations; double misc_time = time_total.elapsed() - time_update_src.elapsed() - time_transport.elapsed() - time_tallies.elapsed() - time_bank_sendrecv.elapsed(); + if (settings::kinetic_simulation && !settings::is_initial_condition) { + misc_time -= time_update_bd_vectors_td.elapsed(); + } header("Simulation Statistics", 4); fmt::print( " Total Iterations = {}\n", settings::n_batches); @@ -562,18 +778,24 @@ void RandomRaySimulation::print_results_random_ray( RandomRay::distance_inactive_); fmt::print(" Active Distance = {} cm\n", RandomRay::distance_active_); - fmt::print(" Source Regions (SRs) = {}\n", n_source_regions); - fmt::print( - " SRs Containing External Sources = {}\n", n_external_source_regions); + fmt::print(" Source Regions (SRs) = {}\n", + RandomRay::n_source_regions_); + fmt::print(" SRs Containing External Sources = {}\n", + RandomRay::n_external_source_regions_); fmt::print(" Total Geometric Intersections = {:.4e}\n", - static_cast(total_geometric_intersections)); + static_cast(RandomRay::total_geometric_intersections_)); fmt::print(" Avg per Iteration = {:.4e}\n", - static_cast(total_geometric_intersections) / settings::n_batches); + static_cast(RandomRay::total_geometric_intersections_) / + settings::n_batches); fmt::print(" Avg per Iteration per SR = {:.2f}\n", - static_cast(total_geometric_intersections) / - static_cast(settings::n_batches) / n_source_regions); - fmt::print(" Avg SR Miss Rate per Iteration = {:.4f}%\n", avg_miss_rate); - fmt::print(" Energy Groups = {}\n", negroups); + static_cast(RandomRay::total_geometric_intersections_) / + static_cast(settings::n_batches) / + RandomRay::n_source_regions_); + fmt::print(" Avg SR Miss Rate per Iteration = {:.4f}%\n", + RandomRay::avg_miss_rate_); + fmt::print(" Energy Groups = {}\n", negroups_); + if (settings::kinetic_simulation) + fmt::print(" Delay Groups = {}\n", ndgroups_); fmt::print( " Total Integrations = {:.4e}\n", total_integrations); fmt::print(" Avg per Iteration = {:.4e}\n", @@ -624,6 +846,15 @@ void RandomRaySimulation::print_results_random_ray( } else { fmt::print(" Transport XS Stabilization Used = NO\n"); } + if (settings::kinetic_simulation && !settings::is_initial_condition) { + std::string time_method = + (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) + ? "ISOTROPIC" + : "PROPOGATION"; + fmt::print(" Time Method = {}\n", time_method); + fmt::print( + " Backwards Difference Order = {}\n", RandomRay::bd_order_); + } header("Timing Statistics", 4); show_time("Total time for initialization", time_initialize.elapsed()); @@ -631,6 +862,17 @@ void RandomRaySimulation::print_results_random_ray( show_time("Total simulation time", time_total.elapsed()); show_time("Transport sweep only", time_transport.elapsed(), 1); show_time("Source update only", time_update_src.elapsed(), 1); + if (settings::kinetic_simulation) { + show_time( + "Precursor computation only", time_compute_precursors.elapsed(), 1); + misc_time -= time_compute_precursors.elapsed(); + + if (!settings::is_initial_condition) { + show_time( + "Time-dependent source update only", time_update_src_td.elapsed(), 1); + misc_time -= time_update_src_td.elapsed(); + } + } show_time("Tally conversion only", time_tallies.elapsed(), 1); show_time("MPI source reductions only", time_bank_sendrecv.elapsed(), 1); show_time("Other iteration routines", misc_time, 1); diff --git a/src/reaction.cpp b/src/reaction.cpp index d96790c6d43..cb931e5677c 100644 --- a/src/reaction.cpp +++ b/src/reaction.cpp @@ -205,6 +205,7 @@ std::unordered_map REACTION_NAME_MAP { {SCORE_IFP_TIME_NUM, "ifp-time-numerator"}, {SCORE_IFP_BETA_NUM, "ifp-beta-numerator"}, {SCORE_IFP_DENOM, "ifp-denominator"}, + {SCORE_PRECURSORS, "precursors"}, // Normal ENDF-based reactions {TOTAL_XS, "(n,total)"}, {ELASTIC, "(n,elastic)"}, diff --git a/src/settings.cpp b/src/settings.cpp index ee493b78135..422b897bb1e 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -348,8 +348,16 @@ void get_run_parameters(pugi::xml_node node_base) RandomRay::source_shape_ = RandomRaySourceShape::FLAT; } else if (temp_str == "linear") { RandomRay::source_shape_ = RandomRaySourceShape::LINEAR; + if (settings::kinetic_simulation) { + fatal_error( + "linear source shapes unimplemented for kinetic simulations."); + } } else if (temp_str == "linear_xy") { RandomRay::source_shape_ = RandomRaySourceShape::LINEAR_XY; + if (settings::kinetic_simulation) { + fatal_error( + "linear_xy source shapes unimplemented for kinetic simulations."); + } } else { fatal_error("Unrecognized source shape: " + temp_str); } @@ -415,8 +423,6 @@ void get_run_parameters(pugi::xml_node node_base) } else { RandomRay::bd_order_ = n; } - } else { - fatal_error("Specify BD approximation order in settings XML"); } if (check_for_node(random_ray_node, "time_derivative_method")) { std::string temp_str = diff --git a/src/simulation.cpp b/src/simulation.cpp index b536ae5881f..3064f65925f 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -323,6 +323,8 @@ const RegularMesh* ufs_mesh {nullptr}; vector k_generation; vector work_index; +double current_time; + } // namespace simulation //============================================================================== diff --git a/src/tallies/tally.cpp b/src/tallies/tally.cpp index 6eef1da9cfd..6d798bc9385 100644 --- a/src/tallies/tally.cpp +++ b/src/tallies/tally.cpp @@ -564,7 +564,7 @@ void Tally::set_scores(const vector& scores) // score. if (delayedgroup_filter_ != C_NONE) { if (score_str != "delayed-nu-fission" && score_str != "decay-rate" && - score_str != "ifp-beta-numerator") + score_str != "ifp-beta-numerator" && score_str != "precursors") fatal_error("Cannot tally " + score_str + "with a delayedgroup filter"); } @@ -657,6 +657,20 @@ void Tally::set_scores(const vector& scores) case SCORE_IFP_DENOM: estimator_ = TallyEstimator::COLLISION; break; + + case SCORE_PRECURSORS: + if (!settings::kinetic_simulation) + fatal_error("Can only tally precursors in kinetic simulations."); + if (!nuclides_.empty()) + if (!(nuclides_.size() == 1 && nuclides_[0] == -1)) + fatal_error("Cannot tally precursors for an individual nuclide."); + if (energyout_present) + fatal_error("Cannot tally precursors with an outgoing energy filter."); + // TODO: make this more robust: allow for tallying + // in eigenvalue and fixed source calculations by detecting + // delayed fission, delayed chi, and lambda cross sections (mg and ce) + // Also enable support for monte carlo solves + break; } scores_.push_back(score); diff --git a/src/timer.cpp b/src/timer.cpp index d107d704cca..fd1311e1d6e 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -29,7 +29,6 @@ Timer time_event_death; Timer time_update_src; // Timers for kinetic simulations -Timer time_initialize_td; Timer time_update_bd_vectors_td; Timer time_update_src_td; Timer time_compute_precursors; @@ -94,7 +93,6 @@ void reset_timers() simulation::time_event_death.reset(); simulation::time_update_src.reset(); - simulation::time_initialize_td.reset(); simulation::time_update_bd_vectors_td.reset(); simulation::time_update_src_td.reset(); simulation::time_compute_precursors.reset(); diff --git a/tests/testing_harness.py b/tests/testing_harness.py index 1ad91b7a89f..c6ffc2a5cad 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -87,6 +87,11 @@ def _get_results(self, hash_output=False): """Digest info in the statepoint and return as a string.""" # Read the statepoint file. statepoint = glob.glob(self._sp_name)[0] + return self._write_tallies(statepoint, hash_output) + + def _write_tallies(self, statepoint, hash_output): + """Get tally sum and sum_sq data from statepoint file + as a string""" with openmc.StatePoint(statepoint) as sp: outstr = '' if sp.run_mode == 'eigenvalue': @@ -285,6 +290,110 @@ def _cleanup(self): os.remove(f) +class KineticTestHarness(TestHarness): + """General class for running OpenMC regression tests for kinetic simulations.""" + + def __init__(self, n_timesteps): + self._sp_base = "openmc_td_simulation" + self._n_timesteps = n_timesteps + + def main(self): + """Accept commandline arguments and either run or update tests.""" + if config['update']: + self.update_results() + else: + self.execute_test() + + def execute_test(self): + """Run kinetic OpenMC test with the appropriate arguments and check the outputs.""" + try: + self._run_openmc() + self._harness_timestep_loop("test") + finally: + self._cleanup() + + def update_results(self): + """Update the results_true for each timestep using the current version of OpenMC.""" + try: + self._run_openmc() + self._harness_timestep_loop("update") + finally: + self._cleanup() + + def _harness_timestep_loop(self, loop_type): + """Test the results of each timestep""" + statepoint = glob.glob(self._sp_base + "*") + assert len(statepoint) == self._n_timesteps, f"Found {len(statepoint)} statepoint files exist" \ + f" but expected {self._n_timesteps}." + for i in range(self._n_timesteps): + self._test_output_created(i) + results = self._get_results(i) + self._write_results(results, i) + if loop_type == "test": + self._compare_results(i) + elif loop_type == "update": + self._overwrite_results(i) + else: + raise ValueError( + f"Invalid loop_type ({loop_type}) passed to _harness_timestep_loop") + + def _test_output_created(self, index): + """Make sure statepoint.* and tallies.out have been created for the current timestep.""" + statepoint = glob.glob(self._sp_base + f"_{index}*") + assert statepoint[0].endswith('h5'), \ + f"Statepoint file {statepoint[0]} is not a HDF5 file." + if os.path.exists('tallies.xml'): + assert os.path.exists(f"tallies_{index}.out"), \ + f"Tally output file tallies_{index}.out does not exist." + + def _get_results(self, index, hash_output=False): + """Digest info in the statepoints and return as a string.""" + # Read the statepoint files. + statepoint = glob.glob(self._sp_base + f"_{index}*")[0] + return self._write_tallies(statepoint, hash_output) + + @property + def statepoint_name(self, i): + return self._sp_base + f"_{i}.h5" + + def _write_results(self, results_string, index): + """Write the results to an ASCII file.""" + with open(f'results_test_{index}.dat', 'w') as fh: + fh.write(results_string) + + def _overwrite_results(self, index): + """Overwrite the results_true with the results_test.""" + shutil.copyfile(f'results_test_{index}.dat', + f'results_true_{index}.dat') + + def _compare_results(self, index): + """Make sure the current results agree with the reference.""" + compare = filecmp.cmp( + f'results_test_{index}.dat', 'results_true_{index}.dat') + if not compare: + expected = open(f'results_true_{index}.dat').readlines() + actual = open(f'results_test_{index}.dat').readlines() + diff = unified_diff(expected, actual, f'results_true_{index}.dat', + f'results_test_{index}.dat') + print(f'Timestep {index} result differences:') + print(''.join(colorize(diff))) + os.rename(f'results_test_{index}.dat', + f'results_error_{index}.dat') + assert compare, 'Results do not agree' + + def _cleanup(self): + """Delete statepoints, tally, and test files.""" + output = glob.glob('statepoint.*.h5') + output += ['summary.h5', 'tallies.out'] + output += glob.glob('tallies_*.out') + output += glob.glob('results_test_*.dat') + output += glob.glob('volume_*.h5') + output += glob.glob(f'{self._sp_base}_*.h5') + for f in output: + if os.path.exists(f): + os.remove(f) + + class PyAPITestHarness(TestHarness): def __init__(self, statepoint_name, model=None, inputs_true=None): super().__init__(statepoint_name) @@ -487,6 +596,74 @@ def _cleanup(self): os.remove(f) +class KineticPyAPITestHarness(KineticTestHarness, PyAPITestHarness): + def __init__(self, model, n_timesteps, inputs_true=None): + super().__init__(n_timesteps) + self._model = model + self._model.plots = [] + + self.inputs_true = "inputs_true.dat" if not inputs_true else inputs_true + + def execute_test(self): + """Build input XMLs, run OpenMC, and verify correct results.""" + try: + self._build_inputs() + inputs = self._get_inputs() + self._write_inputs(inputs) + self._compare_inputs() + self._run_openmc() + self._harness_timestep_loop("test") + finally: + self._cleanup() + + def update_results(self): + """Update results_true.dat and inputs_true.dat""" + try: + self._build_inputs() + inputs = self._get_inputs() + self._write_inputs(inputs) + self._overwrite_inputs() + self._run_openmc() + self._harness_timestep_loop("update") + finally: + self._cleanup() + + def _cleanup(self): + """Delete XMLs, statepoints, tally, and test files.""" + super()._cleanup() + output = ['materials.xml', 'geometry.xml', 'settings.xml', + 'tallies.xml', 'plots.xml', 'inputs_test.dat', 'model.xml'] + for f in output: + if os.path.exists(f): + os.remove(f) + + +class KineticTolerantPyAPITestHarness(KineticPyAPITestHarness, TolerantPyAPITestHarness): + """Specialized harness for running kinetic simulation tests in that involve + significant levels of floating point non-associativity when using shared + memory parallelism due to single precision usage (e.g., as in the random + ray solver). + + """ + + def _compare_results(self, i): + """Make sure the current results agree with the reference.""" + self._compare_files( + f'results_test_{i}.dat', f'results_true_{i}.dat', 1e-6, i) + + def _compare_files(self, file_test, file_true, tol, index): + compare = self._are_files_equal(file_test, file_true, 1e-6) + if not compare: + expected = open(file_true).readlines() + actual = open(file_test).readlines() + diff = unified_diff(expected, actual, file_true, + file_test) + print('Result differences:') + print(''.join(colorize(diff))) + os.rename(file_test, f'results_error_{i}.dat') + assert compare, 'Results do not agree' + + class PlotTestHarness(TestHarness): """Specialized TestHarness for running OpenMC plotting tests.""" From 4e04a33aaa555999c556c0e0f5334da907a5b922 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 28 Dec 2025 20:33:44 -0600 Subject: [PATCH 05/64] Proper normalization for kinetic simulations --- src/random_ray/flat_source_domain.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 167a8d907d5..6673595a259 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -666,7 +666,14 @@ double FlatSourceDomain::compute_fixed_source_normalization_factor() const // such that 1.2 neutrons are generated, so as to be consistent with the // bookkeeping in MC which is all done per starting source neutron (not per // neutron produced). - return k_eff_ / (fission_rate_ * simulation_volume_); + double normalization_factor; + // For a kinetic simulation, the normalization only needs to be performed + // once for the steady state. + if (settings::kinetic_simulation && !settings::is_initial_condition) + normalization_factor = 1.0; + else + normalization_factor = k_eff_ / (fission_rate_ * simulation_volume_); + return normalization_factor; // TODO: check if a delayed fission rate needed to normalize the precursor // population... need to run a test problem using mc tallies? } @@ -835,7 +842,7 @@ void FlatSourceDomain::random_ray_tally() for (int dg = 0; dg < ndgroups_; dg++) { // Determine numerical score value for (auto& task : source_regions_.tally_delay_task(sr, dg)) { - double score; + double score = 0.0; switch (task.score_type) { // Certain scores already tallied @@ -847,10 +854,6 @@ void FlatSourceDomain::random_ray_tally() break; case SCORE_PRECURSORS: - // TODO: This will be slightly off. The source normalization factor - // should only be applied to the delayed fission source, but here we - // apply it to entire precursor concentration (sum of delayed - // fission source and precursor decay terms). score = source_regions_.precursors_new(sr, dg) * source_normalization_factor * volume; break; From 85db78b972b2532f08de9b7cd323f3f80c5c8350 Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 29 Dec 2025 01:25:42 -0600 Subject: [PATCH 06/64] quality of life updates - PROPOGATION -> PROPAGATION - Write random ray data to HDF5 - Write some extra HDF5 data - Typo fixes --- include/openmc/constants.h | 2 +- .../openmc/random_ray/random_ray_simulation.h | 2 +- openmc/settings.py | 4 +-- src/random_ray/flat_source_domain.cpp | 16 ++++----- src/random_ray/random_ray.cpp | 4 +-- src/random_ray/random_ray_simulation.cpp | 8 ++--- src/random_ray/source_region.cpp | 12 +++---- src/settings.cpp | 14 ++++++-- src/state_point.cpp | 36 +++++++++++++++++++ tests/unit_tests/test_settings.py | 4 +-- 10 files changed, 74 insertions(+), 28 deletions(-) diff --git a/include/openmc/constants.h b/include/openmc/constants.h index 7bdb5070b30..b3659ce4689 100644 --- a/include/openmc/constants.h +++ b/include/openmc/constants.h @@ -370,7 +370,7 @@ enum class SolverType { MONTE_CARLO, RANDOM_RAY }; enum class RandomRayVolumeEstimator { NAIVE, SIMULATION_AVERAGED, HYBRID }; enum class RandomRaySourceShape { FLAT, LINEAR, LINEAR_XY }; enum class RandomRaySampleMethod { PRNG, HALTON }; -enum class RandomRayTimeMethod { ISOTROPIC, PROPOGATION }; +enum class RandomRayTimeMethod { ISOTROPIC, PROPAGATION }; //============================================================================== // Geometry Constants diff --git a/include/openmc/random_ray/random_ray_simulation.h b/include/openmc/random_ray/random_ray_simulation.h index 7e1e30cadcb..22a91c6e592 100644 --- a/include/openmc/random_ray/random_ray_simulation.h +++ b/include/openmc/random_ray/random_ray_simulation.h @@ -73,4 +73,4 @@ void rename_tallies_file(int i); } // namespace openmc -#endif // OPENMC_RANDOM_RAY_SIMUgATION_H +#endif // OPENMC_RANDOM_RAY_SIMULATION_H diff --git a/openmc/settings.py b/openmc/settings.py index 03111f87628..10672df0a84 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -233,7 +233,7 @@ class Settings: :time_derivative_method: Method for resolving :math:`\\frac{\\partial}{\\partial t} \\psi_{r,g}(s,t)` in the time-dependent charactersitic equation. - Options are 'isotropic' (default), or 'propogation'. + Options are 'isotropic' (default), or 'propagation'. .. versionadded:: 0.15.0 resonance_scattering : dict @@ -1409,7 +1409,7 @@ def random_ray(self, random_ray: dict): cv.check_less_than('BD order', value, 7) elif key == 'time_derivative method': cv.check_value('time derivative method', value, - ('isotropic', 'propogation')) + ('isotropic', 'propagation')) else: raise ValueError(f'Unable to set random ray to "{key}" which is ' 'unsupported by OpenMC') diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 6673595a259..cc4d3f35dbc 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -232,7 +232,7 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( source_regions_.scalar_flux_td_new(sr, g) /= (sigma_t_td * volume); source_regions_.scalar_flux_td_new(sr, g) += source_regions_.source_td(sr, g); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { // TODO: may need to adjust sigma t division here double inverse_vbar = inverse_vbar_[source_regions_.material(sr) * negroups_ + g]; @@ -1815,7 +1815,7 @@ SourceRegionHandle FlatSourceDomain::get_subdivided_source_region_handle( update_single_neutron_source(handle); if (settings::kinetic_simulation && !settings::is_initial_condition) { update_single_neutron_source_td(handle); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { compute_single_neutron_source_time_derivative(handle); compute_single_scalar_flux_time_derivative_2(handle); } @@ -2091,7 +2091,7 @@ void FlatSourceDomain::update_all_neutron_sources_td() for (int64_t sr = 0; sr < n_source_regions(); sr++) { SourceRegionHandle srh = source_regions_.get_source_region_handle(sr); update_single_neutron_source_td(srh); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { compute_single_neutron_source_time_derivative(srh); compute_single_scalar_flux_time_derivative_2(srh); } @@ -2228,7 +2228,7 @@ void FlatSourceDomain::accumulate_iteration_quantities() for (int g = 0; g < negroups_; g++) { source_regions_.scalar_flux_td_final(sr, g) += source_regions_.scalar_flux_td_new(sr, g); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { if (settings::is_initial_condition) source_regions_.source_final(sr, g) += source_regions_.source(sr, g); @@ -2260,7 +2260,7 @@ void FlatSourceDomain::normalize_final_quantities() if (settings::kinetic_simulation) source_regions_.scalar_flux_td_final(sr, g) *= source_normalization_factor; - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_regions_.source_td_final(sr, g) *= normalization_factor; } } @@ -2308,12 +2308,12 @@ void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) for (int64_t sr = 0; sr < n_source_regions(); sr++) { for (int g = 0; g < negroups_; g++) { int j = 0; - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) j = 1; add_value_to_bd_vector(source_regions_.scalar_flux_bd(sr, g), source_regions_.scalar_flux_td_final(sr, g), increment_not_initialize, RandomRay::bd_order_ + j); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { // Multiply out sigma_t to store the base source double sigma_t; if (settings::is_initial_condition) { @@ -2344,7 +2344,7 @@ void FlatSourceDomain::compute_rhs_bd_quantities() rhs_backwards_difference(source_regions_.scalar_flux_bd(sr, g), RandomRay::bd_order_, settings::dt); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_regions_.source_rhs_bd(sr, g) = rhs_backwards_difference( source_regions_.source_bd(sr, g), RandomRay::bd_order_, settings::dt); diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index 1ea139a24b1..ee8e0dd8ae5 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -463,7 +463,7 @@ void RandomRay::attenuate_flux_flat_source( cjosey_exponential(tau_td); // exponential = 1 - exp(-tau) float new_delta_psi_td = (angular_flux_td_[g] - srh.source_td(g)) * exponential_td; - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { float source_derivative = srh.source_time_derivative(g); float flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); float T1 = (source_derivative - flux_derivative_2); @@ -864,7 +864,7 @@ void RandomRay::initialize_ray(uint64_t ray_id, FlatSourceDomain* domain) for (int g = 0; g < negroups_; g++) { angular_flux_td_[g] = srh.source_td(g); } - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { for (int g = 0; g < negroups_; g++) { double sigma_t_td = domain_->sigma_t_td_[srh.material() * negroups_ + g]; diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index 8b9ff6883cc..febe0834f2d 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -95,8 +95,8 @@ void openmc_run_random_ray() // Print simulation information if (mpi::master) { - std::string message = - fmt::format("TIME DEPENDENT SOLVE {0}", settings::current_timestep); + std::string message = fmt::format( + "KINETIC SIMULATION TIME STEP {0}", settings::current_timestep); const char* msg = message.c_str(); header(msg, 3); } @@ -499,7 +499,7 @@ void write_random_ray_hdf5(hid_t group) case RandomRayTimeMethod::ISOTROPIC: write_dataset(random_ray_group, "time_method", "isotropic"); break; - case RandomRayTimeMethod::PROPOGATION: + case RandomRayTimeMethod::PROPAGATION: write_dataset(random_ray_group, "time_method", "propogation"); break; default: @@ -850,7 +850,7 @@ void RandomRaySimulation::print_results_random_ray() const std::string time_method = (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) ? "ISOTROPIC" - : "PROPOGATION"; + : "PROPAGATION"; fmt::print(" Time Method = {}\n", time_method); fmt::print( " Backwards Difference Order = {}\n", RandomRay::bd_order_); diff --git a/src/random_ray/source_region.cpp b/src/random_ray/source_region.cpp index 854fcc99b9e..36cd6a8c458 100644 --- a/src/random_ray/source_region.cpp +++ b/src/random_ray/source_region.cpp @@ -88,7 +88,7 @@ SourceRegion::SourceRegion(int negroups, int ndgroups, bool is_linear) scalar_flux_rhs_bd_.resize(negroups); // Source Derivative Propogation arrays - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.assign(negroups, 0.0); source_td_final_.assign(negroups, 0.0); @@ -178,7 +178,7 @@ void SourceRegionContainer::push_back(const SourceRegion& sr) scalar_flux_rhs_bd_.push_back(sr.scalar_flux_rhs_bd_[g]); // Source Derivative Propogation arrays - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.push_back(sr.source_final_[g]); source_td_final_.push_back(sr.source_final_[g]); @@ -262,7 +262,7 @@ void SourceRegionContainer::assign( scalar_flux_bd_.clear(); scalar_flux_rhs_bd_.clear(); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.clear(); source_time_derivative_.clear(); @@ -349,7 +349,7 @@ SourceRegionHandle SourceRegionContainer::get_source_region_handle(int64_t sr) handle.scalar_flux_bd_ = &scalar_flux_bd(sr, 0); handle.scalar_flux_rhs_bd_ = &scalar_flux_rhs_bd(sr, 0); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { handle.source_final_ = &source_final(sr, 0); handle.source_td_final_ = &source_td_final(sr, 0); @@ -423,7 +423,7 @@ void SourceRegionContainer::adjoint_reset() // BD Vectors std::fill(scalar_flux_rhs_bd_.begin(), scalar_flux_rhs_bd_.end(), 0.0); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { std::fill( source_time_derivative_.begin(), source_time_derivative_.end(), 0.0); std::fill(scalar_flux_time_derivative_2_.begin(), @@ -456,7 +456,7 @@ void SourceRegionContainer::time_step_reset() std::fill(scalar_flux_final_.begin(), scalar_flux_final_.end(), 0.0); std::fill(scalar_flux_td_final_.begin(), scalar_flux_td_final_.end(), 0.0); std::fill(precursors_final_.begin(), precursors_final_.end(), 0.0); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPOGATION) + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) std::fill(source_td_final_.begin(), source_td_final_.end(), 0.0); } diff --git a/src/settings.cpp b/src/settings.cpp index 422b897bb1e..1b02d5ea671 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -264,6 +264,16 @@ void get_run_parameters(pugi::xml_node node_base) // Kinetic variables if (check_for_node(node_base, "kinetic_simulation")) { kinetic_simulation = get_node_value_bool(node_base, "kinetic_simulation"); + if (solver_type != SolverType::RANDOM_RAY) { + fatal_error("Unsupported solver selected for kinetic simulation. Kinetic " + "simulations currently only support the random ray solver."); + } + if (run_mode != RunMode::EIGENVALUE) { + fatal_error( + "Unsupported run mode selected for kinetic simulation. Kinetic " + "simulations currently only support run mode based on an eigenvalue " + "simulation establishing an initial condition."); + } } // Get timestep parameters for kinetic simulations @@ -429,8 +439,8 @@ void get_run_parameters(pugi::xml_node node_base) get_node_value(random_ray_node, "time_derivative_method", true, true); if (temp_str == "isotropic") { RandomRay::time_method_ = RandomRayTimeMethod::ISOTROPIC; - } else if (temp_str == "propogation") { - RandomRay::time_method_ = RandomRayTimeMethod::PROPOGATION; + } else if (temp_str == "propagation") { + RandomRay::time_method_ = RandomRayTimeMethod::PROPAGATION; } else { fatal_error("Unrecognized time derivative method: " + temp_str); } diff --git a/src/state_point.cpp b/src/state_point.cpp index 8ccebeb05a7..53dd4d18284 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -22,6 +22,7 @@ #include "openmc/mgxs_interface.h" #include "openmc/nuclide.h" #include "openmc/output.h" +#include "openmc/random_ray/random_ray_simulation.h" #include "openmc/settings.h" #include "openmc/simulation.h" #include "openmc/tallies/derivative.h" @@ -96,6 +97,10 @@ extern "C" int openmc_statepoint_write(const char* filename, bool* write_source) // Write run information write_dataset(file_id, "energy_mode", settings::run_CE ? "continuous-energy" : "multi-group"); + if (!settings::run_CE) { + write_dataset(file_id, "n_energy_groups", data::mg.num_energy_groups_); + write_dataset(file_id, "n_delay_groups", data::mg.num_delayed_groups_); + } switch (settings::run_mode) { case RunMode::FIXED_SOURCE: write_dataset(file_id, "run_mode", "fixed source"); @@ -106,10 +111,32 @@ extern "C" int openmc_statepoint_write(const char* filename, bool* write_source) default: break; } + switch (settings::solver_type) { + case SolverType::MONTE_CARLO: + write_dataset(file_id, "solver_type", "monte carlo"); + break; + case SolverType::RANDOM_RAY: + write_dataset(file_id, "solver_type", "random ray"); + write_random_ray_hdf5(file_id); + break; + default: + break; + } write_attribute(file_id, "photon_transport", settings::photon_transport); write_dataset(file_id, "n_particles", settings::n_particles); write_dataset(file_id, "n_batches", settings::n_batches); + write_dataset(file_id, "kinetic_simulation", + settings::kinetic_simulation ? true : false); + if (settings::kinetic_simulation) { + hid_t timestep_group = create_group(file_id, "timestep_data"); + write_dataset(timestep_group, "dt", settings::dt); + write_dataset( + timestep_group, "current_timestep", settings::current_timestep); + write_dataset(timestep_group, "current_time", simulation::current_time); + close_group(timestep_group); + } + // Write out current batch number write_dataset(file_id, "current_batch", simulation::current_batch); @@ -315,6 +342,15 @@ extern "C" int openmc_statepoint_write(const char* filename, bool* write_source) write_dataset(runtime_group, "inactive batches", time_inactive.elapsed()); } write_dataset(runtime_group, "active batches", time_active.elapsed()); + if (settings::solver_type == SolverType::RANDOM_RAY) { + write_dataset(runtime_group, "source_update", time_update_src.elapsed()); + if (settings::kinetic_simulation) { + write_dataset( + runtime_group, "source_td_update", time_update_src_td.elapsed()); + write_dataset( + runtime_group, "precursor_update", time_compute_precursors.elapsed()); + } + } if (settings::run_mode == RunMode::EIGENVALUE) { write_dataset( runtime_group, "synchronizing fission bank", time_bank.elapsed()); diff --git a/tests/unit_tests/test_settings.py b/tests/unit_tests/test_settings.py index 9c0107566db..4cf41e92b9a 100644 --- a/tests/unit_tests/test_settings.py +++ b/tests/unit_tests/test_settings.py @@ -87,7 +87,7 @@ def test_export_to_xml(run_in_tmpdir, kinetic_simulation): } if kinetic_simulation: s.random_ray['bd_order'] = 3 - s.random_ray['time_derivative_method'] = 'propogation' + s.random_ray['time_derivative_method'] = 'propagation' s.max_particle_events = 100 s.max_secondaries = 1_000_000 s.source_rejection_fraction = 0.01 @@ -187,7 +187,7 @@ def test_export_to_xml(run_in_tmpdir, kinetic_simulation): assert s.random_ray['sample_method'] == 'halton' if kinetic_simulation: assert s.random_ray['bd_order'] == 3 - assert s.random_ray['time_derivative_method'] == 'propogation' + assert s.random_ray['time_derivative_method'] == 'propagation' assert s.max_secondaries == 1_000_000 assert s.source_rejection_fraction == 0.01 assert s.free_gas_threshold == 800.0 From d745b506a4b867a103ef4856ef5910df4fcff5bf Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 29 Dec 2025 12:17:58 -0600 Subject: [PATCH 07/64] make keff scaling consistent with keff normalization for kinetic simulations Kinetic simulations based on an eigenvalue solve need to multiply the prompt and delayed fission sources by the computed keff to bake-in the steady state initial condition. The keff scaling introduced in PR 3595 complicates this by multiplying tallied flux by keff. This is fine, however this new scaling factor is also applied to the final quantities which serve as the final estimate of quantities for each timestep in kinetic simulation. This would effetively undo the keff normalization putting the system out of steady state. In practice this looks like a shap step change in the values of tallied quantities. To address this, this commit introduces control flow to ensure that the keff scaling is applied to tallies at each timestep, but does not apply to the internal quantitities stored in memory until the final timestep, to ensure the keff normalization still bakes in that steady state. --- src/random_ray/flat_source_domain.cpp | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index cc4d3f35dbc..4d113dac700 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -666,16 +666,7 @@ double FlatSourceDomain::compute_fixed_source_normalization_factor() const // such that 1.2 neutrons are generated, so as to be consistent with the // bookkeeping in MC which is all done per starting source neutron (not per // neutron produced). - double normalization_factor; - // For a kinetic simulation, the normalization only needs to be performed - // once for the steady state. - if (settings::kinetic_simulation && !settings::is_initial_condition) - normalization_factor = 1.0; - else - normalization_factor = k_eff_ / (fission_rate_ * simulation_volume_); - return normalization_factor; - // TODO: check if a delayed fission rate needed to normalize the precursor - // population... need to run a test problem using mc tallies? + return k_eff_ / (fission_rate_ * simulation_volume_); } // If we are in adjoint mode of a fixed source problem, the external @@ -2137,8 +2128,8 @@ void FlatSourceDomain::compute_single_delayed_fission_source( void FlatSourceDomain::compute_single_precursors(SourceRegionHandle& srh) { // Reset all precursors to zero (important for void regions) - for (int g = 0; g < negroups_; g++) { - srh.precursors_new(g) = 0.0; + for (int dg = 0; dg < ndgroups_; dg++) { + srh.precursors_new(dg) = 0.0; } int material = srh.material(); @@ -2250,8 +2241,16 @@ void FlatSourceDomain::normalize_final_quantities() // TODO: add timer double normalization_factor = 1.0 / (settings::n_batches - settings::n_inactive); - double source_normalization_factor = - compute_fixed_source_normalization_factor() * normalization_factor; + double source_normalization_factor; + if (!settings::kinetic_simulation || + settings::kinetic_simulation && + settings::current_timestep == settings::n_timesteps) + source_normalization_factor = + compute_fixed_source_normalization_factor() * normalization_factor; + else + // The source normalization should only be applied to internal quantities at + // the end of time stepping in preparation for an adjoint solve. + source_normalization_factor = 1.0 * normalization_factor; #pragma omp parallel for for (int64_t sr = 0; sr < n_source_regions(); sr++) { @@ -2261,7 +2260,8 @@ void FlatSourceDomain::normalize_final_quantities() source_regions_.scalar_flux_td_final(sr, g) *= source_normalization_factor; if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - source_regions_.source_td_final(sr, g) *= normalization_factor; + // TODO: double check that this is correct for adjoint SDP + source_regions_.source_td_final(sr, g) *= source_normalization_factor; } } for (int dg = 0; dg < ndgroups_; dg++) { From b3be206989311ec593153405d43402b1b1e1ccbe Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 29 Dec 2025 17:59:52 -0600 Subject: [PATCH 08/64] move some global vars from settings.cpp to simulation.cpp - is_initial_condition - current_timetstep --- include/openmc/settings.h | 5 --- include/openmc/simulation.h | 6 +++- src/random_ray/flat_source_domain.cpp | 39 +++++++++++++----------- src/random_ray/random_ray.cpp | 6 ++-- src/random_ray/random_ray_simulation.cpp | 34 +++++++++++++-------- src/random_ray/source_region.cpp | 2 +- src/settings.cpp | 2 -- src/simulation.cpp | 2 ++ src/state_point.cpp | 2 +- 9 files changed, 55 insertions(+), 43 deletions(-) diff --git a/include/openmc/settings.h b/include/openmc/settings.h index 4a6bb70d915..a7fba61e24c 100644 --- a/include/openmc/settings.h +++ b/include/openmc/settings.h @@ -203,11 +203,6 @@ extern double weight_survive; //!< Survival weight after Russian roulette // Timestep variables for kinetic simulation extern int n_timesteps; //!< number of timesteps extern double dt; //!< fixed timestep size -extern int current_timestep; //!< current timestep index -extern bool - is_initial_condition; //!< if eigenvalue/fixed source sim is an initial - // condition for a time-dependent simulation - } // namespace settings //============================================================================== diff --git a/include/openmc/simulation.h b/include/openmc/simulation.h index e130f752033..69845a3e213 100644 --- a/include/openmc/simulation.h +++ b/include/openmc/simulation.h @@ -51,7 +51,11 @@ extern vector work_index; //----------------------------------------------------------------------------- // Global variables for kinetic simulations -extern double current_time; +extern bool + is_initial_condition; //!< if eigenvalue/fixed source sim is an initial + // condition for a kinetic simulation +extern int current_timestep; // !< current time step in kinetic simulation +extern double current_time; // !< current time in kinetic simulation } // namespace simulation diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 4d113dac700..ae3abd65f91 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -100,7 +100,7 @@ void FlatSourceDomain::batch_reset() #pragma omp parallel for for (int64_t se = 0; se < n_source_elements(); se++) { source_regions_.precursors_new(se) = 0.0; - if (!settings::is_initial_condition) + if (!simulation::is_initial_condition) source_regions_.scalar_flux_td_new(se) = 0.0; } } @@ -156,7 +156,7 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) } } // Set souce_td to source for IC calculation - if (settings::is_initial_condition) { + if (simulation::is_initial_condition) { #pragma omp parallel for for (int g = 0; g < negroups_; g++) srh.source_td(g) += srh.source(g); @@ -191,7 +191,7 @@ void FlatSourceDomain::normalize_scalar_flux_and_volumes( #pragma omp parallel for for (int64_t se = 0; se < n_source_elements(); se++) { source_regions_.scalar_flux_new(se) *= normalization_factor; - if (settings::kinetic_simulation && !settings::is_initial_condition) + if (settings::kinetic_simulation && !simulation::is_initial_condition) source_regions_.scalar_flux_td_new(se) *= normalization_factor; } @@ -226,7 +226,7 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( double sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; source_regions_.scalar_flux_new(sr, g) /= (sigma_t * volume); source_regions_.scalar_flux_new(sr, g) += source_regions_.source(sr, g); - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { double sigma_t_td = sigma_t_td_[source_regions_.material(sr) * negroups_ + g]; source_regions_.scalar_flux_td_new(sr, g) /= (sigma_t_td * volume); @@ -252,7 +252,7 @@ void FlatSourceDomain::set_flux_to_old_flux(int64_t sr, int g) { source_regions_.scalar_flux_new(sr, g) = source_regions_.scalar_flux_old(sr, g); - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { source_regions_.scalar_flux_td_new(sr, g) = source_regions_.scalar_flux_td_old(sr, g); } @@ -261,7 +261,7 @@ void FlatSourceDomain::set_flux_to_old_flux(int64_t sr, int g) void FlatSourceDomain::set_flux_to_source(int64_t sr, int g) { source_regions_.scalar_flux_new(sr, g) = source_regions_.source(sr, g); - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { source_regions_.scalar_flux_td_new(sr, g) = source_regions_.source_td(sr, g); } @@ -344,7 +344,7 @@ int64_t FlatSourceDomain::add_source_to_scalar_flux() } // Set time-dependent flux to unperturbed flux during the initial // condition calculation - if (settings::is_initial_condition) { + if (simulation::is_initial_condition) { source_regions_.scalar_flux_td_new(sr, g) = source_regions_.scalar_flux_new(sr, g); } @@ -751,7 +751,7 @@ void FlatSourceDomain::random_ray_tally() double material = source_regions_.material(sr); for (int g = 0; g < negroups_; g++) { double flux; - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { flux = source_regions_.scalar_flux_td_new(sr, g) * source_normalization_factor; } else { @@ -771,7 +771,8 @@ void FlatSourceDomain::random_ray_tally() case SCORE_TOTAL: if (material != MATERIAL_VOID) { double sigma_t; - if (settings::kinetic_simulation && !settings::is_initial_condition) + if (settings::kinetic_simulation && + !simulation::is_initial_condition) sigma_t = sigma_t_td_[material * negroups_ + g]; else sigma_t = sigma_t_[material * negroups_ + g]; @@ -782,7 +783,8 @@ void FlatSourceDomain::random_ray_tally() case SCORE_FISSION: if (material != MATERIAL_VOID) { double sigma_f; - if (settings::kinetic_simulation && !settings::is_initial_condition) + if (settings::kinetic_simulation && + !simulation::is_initial_condition) sigma_f = sigma_f_td_[material * negroups_ + g]; else sigma_f = sigma_f_[material * negroups_ + g]; @@ -793,7 +795,8 @@ void FlatSourceDomain::random_ray_tally() case SCORE_NU_FISSION: if (material != MATERIAL_VOID) { double nu_sigma_f; - if (settings::kinetic_simulation && !settings::is_initial_condition) + if (settings::kinetic_simulation && + !simulation::is_initial_condition) nu_sigma_f = nu_sigma_f_td_[material * negroups_ + g]; else nu_sigma_f = nu_sigma_f_[material * negroups_ + g]; @@ -1804,7 +1807,7 @@ SourceRegionHandle FlatSourceDomain::get_subdivided_source_region_handle( // Compute the combined source term update_single_neutron_source(handle); - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { update_single_neutron_source_td(handle); if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { compute_single_neutron_source_time_derivative(handle); @@ -1907,7 +1910,7 @@ void FlatSourceDomain::apply_transport_stabilization() } // TODO: test this and td with mesh // Duplicated stabilization for time-dependent simulations - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { double sigma_s_td = sigma_s_td_[material * negroups_ * negroups_ + g * negroups_ + g]; if (sigma_s_td < 0.0) { @@ -2110,7 +2113,7 @@ void FlatSourceDomain::compute_single_delayed_fission_source( if (lambda != 0.0) { for (int g = 0; g < negroups_; g++) { double scalar_flux; - if (settings::is_initial_condition) { + if (simulation::is_initial_condition) { scalar_flux = srh.scalar_flux_new(g); } else { scalar_flux = srh.scalar_flux_td_new(g); @@ -2138,7 +2141,7 @@ void FlatSourceDomain::compute_single_precursors(SourceRegionHandle& srh) double lambda = lambda_[material * ndgroups_ + dg]; if (lambda != 0.0) { double delayed_fission_source = srh.delayed_fission_source(dg); - if (settings::is_initial_condition) { + if (simulation::is_initial_condition) { srh.precursors_new(dg) = delayed_fission_source / lambda; } else { double precursor_rhs_bd = srh.precursors_rhs_bd(dg); @@ -2220,7 +2223,7 @@ void FlatSourceDomain::accumulate_iteration_quantities() source_regions_.scalar_flux_td_final(sr, g) += source_regions_.scalar_flux_td_new(sr, g); if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - if (settings::is_initial_condition) + if (simulation::is_initial_condition) source_regions_.source_final(sr, g) += source_regions_.source(sr, g); else @@ -2244,7 +2247,7 @@ void FlatSourceDomain::normalize_final_quantities() double source_normalization_factor; if (!settings::kinetic_simulation || settings::kinetic_simulation && - settings::current_timestep == settings::n_timesteps) + simulation::current_timestep == settings::n_timesteps) source_normalization_factor = compute_fixed_source_normalization_factor() * normalization_factor; else @@ -2316,7 +2319,7 @@ void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { // Multiply out sigma_t to store the base source double sigma_t; - if (settings::is_initial_condition) { + if (simulation::is_initial_condition) { sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; } else { sigma_t = sigma_t_td_[source_regions_.material(sr) * negroups_ + g]; diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index ee8e0dd8ae5..771f4ab766e 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -456,7 +456,7 @@ void RandomRay::attenuate_flux_flat_source( float new_delta_psi = (angular_flux_[g] - srh.source(g)) * exponential; delta_psi_[g] = new_delta_psi; angular_flux_[g] -= new_delta_psi; - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { float sigma_t_td = domain_->sigma_t_td_[material * negroups_ + g]; float tau_td = sigma_t_td * distance; float exponential_td = @@ -499,7 +499,7 @@ void RandomRay::attenuate_flux_flat_source( // this iteration for (int g = 0; g < negroups_; g++) { srh.scalar_flux_new(g) += delta_psi_[g]; - if (settings::kinetic_simulation && !settings::is_initial_condition) + if (settings::kinetic_simulation && !simulation::is_initial_condition) srh.scalar_flux_td_new(g) += delta_psi_td_[g]; } @@ -860,7 +860,7 @@ void RandomRay::initialize_ray(uint64_t ray_id, FlatSourceDomain* domain) for (int g = 0; g < negroups_; g++) { angular_flux_[g] = srh.source(g); } - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { for (int g = 0; g < negroups_; g++) { angular_flux_td_[g] = srh.source_td(g); } diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index febe0834f2d..cb34f17de85 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -35,11 +35,16 @@ void openmc_run_random_ray() // TODO: no initial condition needed fof td fixed source simulations // Check if this simulation is to establish an initial condition if (settings::kinetic_simulation) - settings::is_initial_condition = true; + simulation::is_initial_condition = true; // Configure the domain for forward simulation FlatSourceDomain::adjoint_ = false; + // If we're going to do a kinetic simulation, report that this is + // the initial condition. + if (settings::kinetic_simulation && mpi::master) + header("KINETIC SIMULATION INITIAL CONDITION", 3); + // If we're going to do an adjoint simulation afterwards, report that this is // the initial forward flux solve. if (adjoint_needed && mpi::master) @@ -91,16 +96,21 @@ void openmc_run_random_ray() // Timestepping loop // TODO: Add support for time-dependent restart for (int i = 0; i < settings::n_timesteps; i++) { - settings::current_timestep = i + 1; + simulation::current_timestep = i + 1; // Print simulation information if (mpi::master) { std::string message = fmt::format( - "KINETIC SIMULATION TIME STEP {0}", settings::current_timestep); + "KINETIC SIMULATION TIME STEP {0}", simulation::current_timestep); const char* msg = message.c_str(); header(msg, 3); } + // If we're going to do an adjoint simulation afterwards, report that this + // is the initial forward flux solve. + if (adjoint_needed && mpi::master) + header("FORWARD FLUX SOLVE", 3); + reset_timers(); // Initialize OpenMC general data structures @@ -133,9 +143,9 @@ void openmc_run_random_ray() sim.output_simulation_results(); // Rename statepoint and tallies file - rename_statepoint_file(settings::current_timestep); + rename_statepoint_file(simulation::current_timestep); if (settings::output_tallies) { - rename_tallies_file(settings::current_timestep); + rename_tallies_file(simulation::current_timestep); } // Normalize and store final quantities for next time step @@ -493,7 +503,7 @@ void write_random_ray_hdf5(hid_t group) RandomRay::total_geometric_intersections_ * data::mg.num_energy_groups_; write_dataset(random_ray_group, "n_integrations", n_integrations); - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { write_dataset(random_ray_group, "bd_order", RandomRay::bd_order_); switch (RandomRay::time_method_) { case RandomRayTimeMethod::ISOTROPIC: @@ -515,7 +525,7 @@ void write_random_ray_hdf5(hid_t group) void set_time_dependent_settings() { // Reset flags - settings::is_initial_condition = false; + simulation::is_initial_condition = false; // Set current time simulation::current_time = settings::dt; @@ -619,7 +629,7 @@ void RandomRaySimulation::simulate() // domain_->compute_neutron_source() // Update source term (scattering + fission) domain_->update_all_neutron_sources(); - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { domain_->update_all_neutron_sources_td(); } @@ -688,7 +698,7 @@ void RandomRaySimulation::simulate() // Set phi_old = phi_new domain_->flux_swap(); - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { domain_->flux_td_swap(); domain_->precursors_swap(); } @@ -766,7 +776,7 @@ void RandomRaySimulation::print_results_random_ray() const time_transport.elapsed() - time_tallies.elapsed() - time_bank_sendrecv.elapsed(); - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { misc_time -= time_update_bd_vectors_td.elapsed(); } header("Simulation Statistics", 4); @@ -846,7 +856,7 @@ void RandomRaySimulation::print_results_random_ray() const } else { fmt::print(" Transport XS Stabilization Used = NO\n"); } - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { std::string time_method = (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) ? "ISOTROPIC" @@ -867,7 +877,7 @@ void RandomRaySimulation::print_results_random_ray() const "Precursor computation only", time_compute_precursors.elapsed(), 1); misc_time -= time_compute_precursors.elapsed(); - if (!settings::is_initial_condition) { + if (!simulation::is_initial_condition) { show_time( "Time-dependent source update only", time_update_src_td.elapsed(), 1); misc_time -= time_update_src_td.elapsed(); diff --git a/src/random_ray/source_region.cpp b/src/random_ray/source_region.cpp index 36cd6a8c458..f4a6a31b678 100644 --- a/src/random_ray/source_region.cpp +++ b/src/random_ray/source_region.cpp @@ -412,7 +412,7 @@ void SourceRegionContainer::adjoint_reset() std::fill(flux_moments_t_.begin(), flux_moments_t_.end(), MomentArray {0.0, 0.0, 0.0}); // Reset arrays for kinetic adjoint simulations - if (settings::kinetic_simulation && !settings::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { std::fill(scalar_flux_td_old_.begin(), scalar_flux_td_old_.end(), 0.0); std::fill(scalar_flux_td_new_.begin(), scalar_flux_td_new_.end(), 0.0); std::fill( diff --git a/src/settings.cpp b/src/settings.cpp index 1b02d5ea671..c3bfad37532 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -153,8 +153,6 @@ double weight_survive {1.0}; // Timestep variables for kinetic simulation int n_timesteps; double dt; -int current_timestep; -bool is_initial_condition {false}; } // namespace settings diff --git a/src/simulation.cpp b/src/simulation.cpp index 3064f65925f..be87e9e73f0 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -323,6 +323,8 @@ const RegularMesh* ufs_mesh {nullptr}; vector k_generation; vector work_index; +bool is_initial_condition {false}; +int current_timestep; double current_time; } // namespace simulation diff --git a/src/state_point.cpp b/src/state_point.cpp index 53dd4d18284..8a79c06de66 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -132,7 +132,7 @@ extern "C" int openmc_statepoint_write(const char* filename, bool* write_source) hid_t timestep_group = create_group(file_id, "timestep_data"); write_dataset(timestep_group, "dt", settings::dt); write_dataset( - timestep_group, "current_timestep", settings::current_timestep); + timestep_group, "current_timestep", simulation::current_timestep); write_dataset(timestep_group, "current_time", simulation::current_time); close_group(timestep_group); } From e9cf50b2aabd704d8d203b59be09a7b38e35be72 Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 30 Dec 2025 14:53:07 -0600 Subject: [PATCH 09/64] time consistent seed approach --- .../openmc/random_ray/flat_source_domain.h | 18 +- include/openmc/random_ray/random_ray.h | 6 +- .../openmc/random_ray/random_ray_simulation.h | 6 + include/openmc/random_ray/source_region.h | 125 +----- include/openmc/simulation.h | 2 + include/openmc/timer.h | 3 +- src/random_ray/flat_source_domain.cpp | 400 ++++++------------ src/random_ray/random_ray.cpp | 74 ++-- src/random_ray/random_ray_simulation.cpp | 96 ++++- src/random_ray/source_region.cpp | 101 ++--- src/simulation.cpp | 1 + src/state_point.cpp | 2 - src/timer.cpp | 6 +- 13 files changed, 276 insertions(+), 564 deletions(-) diff --git a/include/openmc/random_ray/flat_source_domain.h b/include/openmc/random_ray/flat_source_domain.h index 7fced43a5bd..1ee98d03a84 100644 --- a/include/openmc/random_ray/flat_source_domain.h +++ b/include/openmc/random_ray/flat_source_domain.h @@ -76,22 +76,17 @@ class FlatSourceDomain { //---------------------------------------------------------------------------- // Methods for kinetic simulations - virtual void update_single_neutron_source_td(SourceRegionHandle& srh); void compute_single_neutron_source_time_derivative(SourceRegionHandle& srh); void compute_single_scalar_flux_time_derivative_2(SourceRegionHandle& srh); - virtual void update_all_neutron_sources_td(); void compute_single_delayed_fission_source(SourceRegionHandle& srh); void compute_single_precursors(SourceRegionHandle& srh); void compute_all_precursors(); - void serialize_final_td_fluxes(vector& flux_td); - void serialize_final_td_sources(vector& source_td); void serialize_final_precursors(vector& precursors); void serialize_final_delayed_fission_source( vector& delayed_fission_source); - void flux_td_swap(); void precursors_swap(); void accumulate_iteration_quantities(); void normalize_final_quantities(); @@ -124,6 +119,9 @@ class FlatSourceDomain { //---------------------------------------------------------------------------- // Public Data members double k_eff_ {1.0}; // Eigenvalue + double + fission_rate_; // The system's fission rate (per cm^3), in eigenvalue mode + bool mapped_all_tallies_ {false}; // If all source regions have been visited int64_t n_external_source_regions_ {0}; // Total number of source regions with @@ -200,13 +198,6 @@ class FlatSourceDomain { vector chi_p_; vector inverse_vbar_; - // Time-dependent cross section arrays for use with material density - // timeseries - vector sigma_t_td_; - vector nu_sigma_f_td_; - vector sigma_f_td_; - vector sigma_s_td_; - protected: //---------------------------------------------------------------------------- // Methods @@ -229,9 +220,6 @@ class FlatSourceDomain { simulation_volume_; // Total physical volume of the simulation domain, as // defined by the 3D box of the random ray source - double - fission_rate_; // The system's fission rate (per cm^3), in eigenvalue mode - // Volumes for each tally and bin/score combination. This intermediate data // structure is used when tallying quantities that must be normalized by // volume (i.e., flux). The vector is index by tally index, while the inner 2D diff --git a/include/openmc/random_ray/random_ray.h b/include/openmc/random_ray/random_ray.h index 49d575b9731..c5c2e6c3f86 100644 --- a/include/openmc/random_ray/random_ray.h +++ b/include/openmc/random_ray/random_ray.h @@ -74,8 +74,7 @@ class RandomRay : public Particle { //--------------------------------------------------------------------------- // Public data members for kinetic simulations - vector angular_flux_td_; - vector angular_flux_td_prime_; + vector angular_flux_prime_; private: //---------------------------------------------------------------------------- @@ -94,8 +93,7 @@ class RandomRay : public Particle { //--------------------------------------------------------------------------- // Private data members for kinetic simulations - vector delta_psi_td_; - vector delta_psi_td_prime_; + vector delta_psi_prime_; }; // class RandomRay diff --git a/include/openmc/random_ray/random_ray_simulation.h b/include/openmc/random_ray/random_ray_simulation.h index 22a91c6e592..c4becc65818 100644 --- a/include/openmc/random_ray/random_ray_simulation.h +++ b/include/openmc/random_ray/random_ray_simulation.h @@ -52,6 +52,12 @@ class RandomRaySimulation { // Number of delay groups int ndgroups_; + //---------------------------------------------------------------------------- + // Data Members for kinetic simulations + + vector static_k_eff_; + vector static_fission_rate_; + }; // class RandomRaySimulation //============================================================================ diff --git a/include/openmc/random_ray/source_region.h b/include/openmc/random_ray/source_region.h index 90c6975627a..a708029cee7 100644 --- a/include/openmc/random_ray/source_region.h +++ b/include/openmc/random_ray/source_region.h @@ -196,14 +196,6 @@ class SourceRegionHandle { //--------------------------------------------------------------------------- // Public Data Members for kinetic simulations - // Energy group-wise 1D time-dependent arrays - double* scalar_flux_td_old_; - double* scalar_flux_td_new_; - double* scalar_flux_td_final_; - - double* source_td_; - double* source_td_final_; - // Energy group-wise 1D time-derivative arrays double* source_time_derivative_; double* scalar_flux_time_derivative_2_; @@ -351,30 +343,6 @@ class SourceRegionHandle { //--------------------------------------------------------------------------- // Public Accessors for kinetic simulations - double& scalar_flux_td_old(int g) { return scalar_flux_td_old_[g]; } - const double scalar_flux_td_old(int g) const - { - return scalar_flux_td_old_[g]; - } - - double& scalar_flux_td_new(int g) { return scalar_flux_td_new_[g]; } - const double scalar_flux_td_new(int g) const - { - return scalar_flux_td_new_[g]; - } - - double& scalar_flux_td_final(int g) { return scalar_flux_td_final_[g]; } - const double scalar_flux_td_final(int g) const - { - return scalar_flux_td_final_[g]; - } - - double& source_td(int g) { return source_td_[g]; } - const double source_td(int g) const { return source_td_[g]; } - - double& source_td_final(int g) { return source_td_final_[g]; } - const double source_td_final(int g) const { return source_td_final_[g]; } - double& source_time_derivative(int g) { return source_time_derivative_[g]; } const double source_time_derivative(int g) const { @@ -531,23 +499,8 @@ class SourceRegion { // Public Data Members for kinetic simulations // Energy group-wise 1D time-dependent arrrays - vector source_final_; //!< The total source accumulated over all - //!< active iterations (used for SDP) - vector scalar_flux_td_old_; //!< The time-dependent scalar flux from - //!< the previous iteration - vector scalar_flux_td_new_; //!< The time-dependent scalar flux from - //!< the current iteration - vector - scalar_flux_td_final_; //!< The time-dependent scalar flux accumulated over - //!< all active iterations (used as the initial - //!< condition for the next timestep) - - vector - source_td_; //!< The total time-dependent source term (prompt - //!< prompt fission + scattering + delayed emission) - vector - source_td_final_; //!< The total time-dependent source accumulated over all - //!< active iterations (used for SDP) + vector source_final_; //!< The total source accumulated over all + //!< active iterations (used for SDP) // Energy group-wise 1D derivative arrays vector source_time_derivative_; //!< The time derivative of the @@ -851,71 +804,6 @@ class SourceRegionContainer { //--------------------------------------- // For kinetic simulations - - double& scalar_flux_td_old(int64_t sr, int g) - { - return scalar_flux_td_old_[index(sr, g)]; - } - const double& scalar_flux_td_old(int64_t sr, int g) const - { - return scalar_flux_td_old_[index(sr, g)]; - } - double& scalar_flux_td_old(int64_t se) { return scalar_flux_td_old_[se]; } - const double& scalar_flux_td_old(int64_t se) const - { - return scalar_flux_td_old_[se]; - } - - double& scalar_flux_td_new(int64_t sr, int g) - { - return scalar_flux_td_new_[index(sr, g)]; - } - const double& scalar_flux_td_new(int64_t sr, int g) const - { - return scalar_flux_td_new_[index(sr, g)]; - } - double& scalar_flux_td_new(int64_t se) { return scalar_flux_td_new_[se]; } - const double& scalar_flux_td_new(int64_t se) const - { - return scalar_flux_td_new_[se]; - } - - double& scalar_flux_td_final(int64_t sr, int g) - { - return scalar_flux_td_final_[index(sr, g)]; - } - const double& scalar_flux_td_final(int64_t sr, int g) const - { - return scalar_flux_td_final_[index(sr, g)]; - } - double& scalar_flux_td_final(int64_t se) { return scalar_flux_td_final_[se]; } - const double& scalar_flux_td_final(int64_t se) const - { - return scalar_flux_td_final_[se]; - } - - double& source_td(int64_t sr, int g) { return source_td_[index(sr, g)]; } - const double& source_td(int64_t sr, int g) const - { - return source_td_[index(sr, g)]; - } - double& source_td(int64_t se) { return source_td_[se]; } - const double& source_td(int64_t se) const { return source_td_[se]; } - - double& source_td_final(int64_t sr, int g) - { - return source_td_final_[index(sr, g)]; - } - const double& source_td_final(int64_t sr, int g) const - { - return source_td_final_[index(sr, g)]; - } - double& source_td_final(int64_t se) { return source_td_final_[se]; } - const double& source_td_final(int64_t se) const - { - return source_td_final_[se]; - } - double& source_time_derivative(int64_t sr, int g) { return source_time_derivative_[index(sr, g)]; @@ -1137,7 +1025,6 @@ class SourceRegionContainer { int& ndgroups() { return ndgroups_; } const int ndgroups() const { return ndgroups_; } - void flux_td_swap(); void precursors_swap(); void time_step_reset(); @@ -1197,14 +1084,6 @@ class SourceRegionContainer { //--------------------------------------------------------------------------- // Private Data Members for kinetic simulations - // SoA energy group-wise 2D time-dependent arrays flattened to 1D - vector scalar_flux_td_old_; - vector scalar_flux_td_new_; - vector scalar_flux_td_final_; - - vector source_td_; - vector source_td_final_; - // SoA energy group-wise 2D derivative arrays flattened to 1D vector source_time_derivative_; vector scalar_flux_time_derivative_2_; diff --git a/include/openmc/simulation.h b/include/openmc/simulation.h index 69845a3e213..80e5659eaa8 100644 --- a/include/openmc/simulation.h +++ b/include/openmc/simulation.h @@ -56,6 +56,8 @@ extern bool // condition for a kinetic simulation extern int current_timestep; // !< current time step in kinetic simulation extern double current_time; // !< current time in kinetic simulation +extern bool k_eff_correction; // !< flag to indicate if the simulation is meant + // to correct batchwise k_effs } // namespace simulation diff --git a/include/openmc/timer.h b/include/openmc/timer.h index 67752e00fbd..bcb2a7e644a 100644 --- a/include/openmc/timer.h +++ b/include/openmc/timer.h @@ -33,8 +33,7 @@ extern Timer time_event_collision; extern Timer time_event_death; extern Timer time_update_src; -extern Timer time_update_bd_vectors_td; -extern Timer time_update_src_td; +extern Timer time_update_bd_vectors; extern Timer time_compute_precursors; } // namespace simulation diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index ae3abd65f91..9a3ee4875cf 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -96,13 +96,10 @@ void FlatSourceDomain::batch_reset() source_regions_.scalar_flux_new(se) = 0.0; } - if (settings::kinetic_simulation) { + if (settings::kinetic_simulation && settings::create_delayed_neutrons) { #pragma omp parallel for - for (int64_t se = 0; se < n_source_elements(); se++) { + for (int64_t se = 0; se < n_source_elements(); se++) source_regions_.precursors_new(se) = 0.0; - if (!simulation::is_initial_condition) - source_regions_.scalar_flux_td_new(se) = 0.0; - } } } @@ -135,16 +132,50 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) double scalar_flux = srh.scalar_flux_old(g_in); double sigma_s = sigma_s_[material * negroups_ * negroups_ + g_out * negroups_ + g_in]; - double nu_sigma_f = nu_sigma_f_[material * negroups_ + g_in]; - double chi = chi_[material * negroups_ + g_out]; - + double nu_sigma_f; + double chi; + if (settings::kinetic_simulation && !simulation::is_initial_condition) { + nu_sigma_f = nu_p_sigma_f_[material * negroups_ + g_in]; + chi = chi_p_[material * negroups_ + g_out]; + } else { + nu_sigma_f = nu_sigma_f_[material * negroups_ + g_in]; + chi = chi_[material * negroups_ + g_out]; + } scatter_source += sigma_s * scalar_flux; if (settings::create_fission_neutrons) { fission_source += nu_sigma_f * scalar_flux * chi; } } - srh.source(g_out) = - (scatter_source + fission_source * inverse_k_eff) / sigma_t; + srh.source(g_out) = (scatter_source + fission_source * inverse_k_eff); + + if (settings::kinetic_simulation && !simulation::is_initial_condition) { + // Add delayed source + if (settings::create_delayed_neutrons) { + double delayed_source = 0.0; + for (int dg = 0; dg < ndgroups_; dg++) { + double chi_d = + chi_d_[material * negroups_ * ndgroups_ + dg * negroups_ + g_out]; + double lambda = lambda_[material * ndgroups_ + dg]; + double precursors = srh.precursors_old(dg); + delayed_source += chi_d * precursors * lambda; + } + srh.source(g_out) += delayed_source; + } + // Add derivative of scalar flux to source (only works for isotropic + // method) + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + double inverse_vbar = inverse_vbar_[material * negroups_ + g_out]; + double scalar_flux_rhs_bd = srh.scalar_flux_rhs_bd(g_out); + double A0 = + (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / + settings::dt; + double scalar_flux = srh.scalar_flux_old(g_out); + double scalar_flux_time_derivative = + A0 * scalar_flux + scalar_flux_rhs_bd; + srh.source(g_out) -= scalar_flux_time_derivative * inverse_vbar; + } + } + srh.source(g_out) /= sigma_t; } } @@ -155,12 +186,6 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) srh.source(g) += srh.external_source(g); } } - // Set souce_td to source for IC calculation - if (simulation::is_initial_condition) { -#pragma omp parallel for - for (int g = 0; g < negroups_; g++) - srh.source_td(g) += srh.source(g); - } } // Compute new estimate of scattering + fission sources in each source region @@ -173,6 +198,11 @@ void FlatSourceDomain::update_all_neutron_sources() for (int64_t sr = 0; sr < n_source_regions(); sr++) { SourceRegionHandle srh = source_regions_.get_source_region_handle(sr); update_single_neutron_source(srh); + if (settings::kinetic_simulation && !simulation::is_initial_condition && + RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + compute_single_neutron_source_time_derivative(srh); + compute_single_scalar_flux_time_derivative_2(srh); + } } simulation::time_update_src.stop(); @@ -191,8 +221,6 @@ void FlatSourceDomain::normalize_scalar_flux_and_volumes( #pragma omp parallel for for (int64_t se = 0; se < n_source_elements(); se++) { source_regions_.scalar_flux_new(se) *= normalization_factor; - if (settings::kinetic_simulation && !simulation::is_initial_condition) - source_regions_.scalar_flux_td_new(se) *= normalization_factor; } // Accumulate cell-wise ray length tallies collected this iteration, then @@ -226,24 +254,17 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( double sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; source_regions_.scalar_flux_new(sr, g) /= (sigma_t * volume); source_regions_.scalar_flux_new(sr, g) += source_regions_.source(sr, g); - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - double sigma_t_td = - sigma_t_td_[source_regions_.material(sr) * negroups_ + g]; - source_regions_.scalar_flux_td_new(sr, g) /= (sigma_t_td * volume); - source_regions_.scalar_flux_td_new(sr, g) += - source_regions_.source_td(sr, g); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - // TODO: may need to adjust sigma t division here - double inverse_vbar = - inverse_vbar_[source_regions_.material(sr) * negroups_ + g]; - double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); - double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / - settings::dt; - source_regions_.scalar_flux_td_new(sr, g) -= - scalar_flux_rhs_bd * inverse_vbar / sigma_t_td; - source_regions_.scalar_flux_td_new(sr, g) /= - 1 + A0 * inverse_vbar / sigma_t_td; - } + if (settings::kinetic_simulation && !simulation::is_initial_condition && + RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + // TODO: may need to adjust sigma t division here + double inverse_vbar = + inverse_vbar_[source_regions_.material(sr) * negroups_ + g]; + double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); + double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / + settings::dt; + source_regions_.scalar_flux_new(sr, g) -= + scalar_flux_rhs_bd * inverse_vbar / sigma_t; + source_regions_.scalar_flux_new(sr, g) /= 1 + A0 * inverse_vbar / sigma_t; } } } @@ -252,19 +273,11 @@ void FlatSourceDomain::set_flux_to_old_flux(int64_t sr, int g) { source_regions_.scalar_flux_new(sr, g) = source_regions_.scalar_flux_old(sr, g); - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - source_regions_.scalar_flux_td_new(sr, g) = - source_regions_.scalar_flux_td_old(sr, g); - } } void FlatSourceDomain::set_flux_to_source(int64_t sr, int g) { source_regions_.scalar_flux_new(sr, g) = source_regions_.source(sr, g); - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - source_regions_.scalar_flux_td_new(sr, g) = - source_regions_.source_td(sr, g); - } } // Combine transport flux contributions and flat source contributions from the @@ -342,12 +355,6 @@ int64_t FlatSourceDomain::add_source_to_scalar_flux() set_flux_to_source(sr, g); } } - // Set time-dependent flux to unperturbed flux during the initial - // condition calculation - if (simulation::is_initial_condition) { - source_regions_.scalar_flux_td_new(sr, g) = - source_regions_.scalar_flux_new(sr, g); - } // Halt if NaN implosion is detected if (!std::isfinite(source_regions_.scalar_flux_new(sr, g))) { fatal_error("A source region scalar flux is not finite. " @@ -355,16 +362,6 @@ int64_t FlatSourceDomain::add_source_to_scalar_flux() "simulation. Consider increasing ray density or adjusting " "the source region mesh."); } - // Also check time-dependent flux - if (settings::kinetic_simulation) { - if (!std::isfinite(source_regions_.scalar_flux_td_new(sr, g))) { - fatal_error( - "A source region scalar flux is not finite. " - "This indicates a numerical instability in the " - "simulation. Consider increasing ray density or adjusting " - "the source region mesh."); - } - } } } @@ -567,7 +564,7 @@ void FlatSourceDomain::convert_source_regions_to_tallies(int64_t start_sr_id) match.bins_present_ = false; } // Loop over delayed groups (so as to support tallying delayed quantities) - if (settings::kinetic_simulation) { + if (settings::kinetic_simulation && settings::create_delayed_neutrons) { for (int dg = 0; dg < ndgroups_; dg++) { // Set particle to the current delay group @@ -750,14 +747,8 @@ void FlatSourceDomain::random_ray_tally() double material = source_regions_.material(sr); for (int g = 0; g < negroups_; g++) { - double flux; - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - flux = source_regions_.scalar_flux_td_new(sr, g) * - source_normalization_factor; - } else { - flux = - source_regions_.scalar_flux_new(sr, g) * source_normalization_factor; - } + double flux = + source_regions_.scalar_flux_new(sr, g) * source_normalization_factor; // Determine numerical score value for (auto& task : source_regions_.tally_task(sr, g)) { @@ -770,36 +761,21 @@ void FlatSourceDomain::random_ray_tally() case SCORE_TOTAL: if (material != MATERIAL_VOID) { - double sigma_t; - if (settings::kinetic_simulation && - !simulation::is_initial_condition) - sigma_t = sigma_t_td_[material * negroups_ + g]; - else - sigma_t = sigma_t_[material * negroups_ + g]; + double sigma_t = sigma_t_[material * negroups_ + g]; score = flux * volume * sigma_t_[material * negroups_ + g]; } break; case SCORE_FISSION: if (material != MATERIAL_VOID) { - double sigma_f; - if (settings::kinetic_simulation && - !simulation::is_initial_condition) - sigma_f = sigma_f_td_[material * negroups_ + g]; - else - sigma_f = sigma_f_[material * negroups_ + g]; + double sigma_f = sigma_f_[material * negroups_ + g]; score = flux * volume * sigma_f_[material * negroups_ + g]; } break; case SCORE_NU_FISSION: if (material != MATERIAL_VOID) { - double nu_sigma_f; - if (settings::kinetic_simulation && - !simulation::is_initial_condition) - nu_sigma_f = nu_sigma_f_td_[material * negroups_ + g]; - else - nu_sigma_f = nu_sigma_f_[material * negroups_ + g]; + double nu_sigma_f = nu_sigma_f_[material * negroups_ + g]; score = flux * volume * nu_sigma_f_[material * negroups_ + g]; } break; @@ -810,19 +786,20 @@ void FlatSourceDomain::random_ray_tally() case SCORE_PRECURSORS: // Score precursors in tally_delay_tasks - if (settings::kinetic_simulation) { + if (settings::kinetic_simulation && + settings::create_delayed_neutrons) { break; } else { - fatal_error( - "Invalid score specified in tallies.xml. Precursors " - "are only supported in random ray mode for kinetic simulations."); + fatal_error("Invalid score specified in tallies.xml. Precursors " + "are only supported in random ray mode for kinetic " + "simulations when delayed neutrons are turned on."); } default: fatal_error("Invalid score specified in tallies.xml. Only flux, " "total, fission, nu-fission, and events are supported in " "random ray mode (precursors are supported in kinetic " - "simulations)."); + "simulations when delayed neutrons are turned on)."); break; } // Apply score to the appropriate tally bin @@ -832,7 +809,7 @@ void FlatSourceDomain::random_ray_tally() score; } } - if (settings::kinetic_simulation) { + if (settings::kinetic_simulation && settings::create_delayed_neutrons) { for (int dg = 0; dg < ndgroups_; dg++) { // Determine numerical score value for (auto& task : source_regions_.tally_delay_task(sr, dg)) { @@ -857,7 +834,7 @@ void FlatSourceDomain::random_ray_tally() "Invalid score specified in tallies.xml. Only flux, " "total, fission, nu-fission, and events are supported in " "random ray mode (precursors are supported in kinetic " - "simulations)."); + "simulations when delayed neutrons are turned on)."); break; } @@ -1430,14 +1407,6 @@ void FlatSourceDomain::flatten_xs() } } } - // Create copies of cross section vectors for use with material density - // timeseries - if (settings::kinetic_simulation) { - sigma_t_td_ = sigma_t_; - nu_sigma_f_td_ = nu_sigma_f_; - sigma_f_td_ = sigma_f_; - sigma_s_td_ = sigma_s_; - } } void FlatSourceDomain::set_adjoint_sources() @@ -1807,12 +1776,10 @@ SourceRegionHandle FlatSourceDomain::get_subdivided_source_region_handle( // Compute the combined source term update_single_neutron_source(handle); - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - update_single_neutron_source_td(handle); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - compute_single_neutron_source_time_derivative(handle); - compute_single_scalar_flux_time_derivative_2(handle); - } + if (settings::kinetic_simulation && !simulation::is_initial_condition && + RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + compute_single_neutron_source_time_derivative(handle); + compute_single_scalar_flux_time_derivative_2(handle); } // Unlock the parallel map. Note: we may be tempted to release @@ -1908,22 +1875,6 @@ void FlatSourceDomain::apply_transport_stabilization() source_regions_.scalar_flux_new(sr, g) = (phi_new - D * phi_old) / (1.0 - D); } - // TODO: test this and td with mesh - // Duplicated stabilization for time-dependent simulations - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - double sigma_s_td = - sigma_s_td_[material * negroups_ * negroups_ + g * negroups_ + g]; - if (sigma_s_td < 0.0) { - double sigma_t_td = sigma_t_td_[material * negroups_ + g]; - double phi_td_new = source_regions_.scalar_flux_td_new(sr, g); - double phi_td_old = source_regions_.scalar_flux_td_old(sr, g); - - double D_td = diagonal_stabilization_rho_ * sigma_s_td / sigma_t_td; - - source_regions_.scalar_flux_td_new(sr, g) = - (phi_td_new - D_td * phi_td_old) / (1.0 - D_td); - } - } } } } @@ -1988,62 +1939,6 @@ int64_t FlatSourceDomain::lookup_mesh_bin(int64_t sr, Position r) const // Compute new estimate of scattering + fission + precursor decay sources in // each source region based on the flux estimate from the previous iteration. // Used for time-dependent simulations -void FlatSourceDomain::update_single_neutron_source_td(SourceRegionHandle& srh) -{ - // Reset all time-dependent source regions to zero (important for - // time-dependent void regions) - for (int g = 0; g < negroups_; g++) { - srh.source_td(g) = 0.0; - } - - // Add scattering + fission source - int material = srh.material(); - if (material != MATERIAL_VOID) { - double inverse_k_eff = 1.0 / k_eff_; - for (int g_out = 0; g_out < negroups_; g_out++) { - double sigma_t_td = sigma_t_td_[material * negroups_ + g_out]; - double scatter_source_td = 0.0; - double fission_source_td = 0.0; - for (int g_in = 0; g_in < negroups_; g_in++) { - double scalar_flux_td = srh.scalar_flux_td_old(g_in); - double sigma_s_td = sigma_s_td_[material * negroups_ * negroups_ + - g_out * negroups_ + g_in]; - // Use prompt cross section data if in time dependent mode - double nu_p_sigma_f = nu_p_sigma_f_[material * negroups_ + g_in]; - double chi_p = chi_p_[material * negroups_ + g_out]; - - scatter_source_td += sigma_s_td * scalar_flux_td; - fission_source_td += nu_p_sigma_f * scalar_flux_td * chi_p; - } - srh.source_td(g_out) = - (scatter_source_td + fission_source_td * inverse_k_eff); - - // Add delayed source if in time dependent mode - double delayed_source = 0.0; - for (int dg = 0; dg < ndgroups_; dg++) { - double chi_d = - chi_d_[material * negroups_ * ndgroups_ + dg * negroups_ + g_out]; - double lambda = lambda_[material * ndgroups_ + dg]; - double precursors = srh.precursors_old(dg); - delayed_source += chi_d * precursors * lambda; - } - srh.source_td(g_out) += delayed_source; - - // Add derivative of scalar flux (TI method) - if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { - double inverse_vbar = inverse_vbar_[material * negroups_ + g_out]; - double scalar_flux_rhs_bd = srh.scalar_flux_rhs_bd(g_out); - double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / - settings::dt; - double scalar_flux_td = srh.scalar_flux_td_old(g_out); - double scalar_flux_time_derivative = - A0 * scalar_flux_td + scalar_flux_rhs_bd; - srh.source_td(g_out) -= scalar_flux_time_derivative * inverse_vbar; - } - srh.source_td(g_out) /= sigma_t_td; - } - } -} void FlatSourceDomain::compute_single_neutron_source_time_derivative( SourceRegionHandle& srh) @@ -2052,12 +1947,12 @@ void FlatSourceDomain::compute_single_neutron_source_time_derivative( (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; for (int g = 0; g < negroups_; g++) { double source_rhs_bd = srh.source_rhs_bd(g); - double source_td = srh.source_td(g); + double source = srh.source(g); // Multiply out sigma_t to correctly compute the derivative term - double sigma_t_td = sigma_t_td_[srh.material() * negroups_ + g]; - srh.source_time_derivative(g) = A0 * source_td * sigma_t_td + source_rhs_bd; + double sigma_t = sigma_t_[srh.material() * negroups_ + g]; + srh.source_time_derivative(g) = A0 * source * sigma_t + source_rhs_bd; // Divide by sigma_t to save time during transport - srh.source_time_derivative(g) /= sigma_t_td; + srh.source_time_derivative(g) /= sigma_t; } } @@ -2068,30 +1963,13 @@ void FlatSourceDomain::compute_single_scalar_flux_time_derivative_2( (settings::dt * settings::dt); for (int g = 0; g < negroups_; g++) { double scalar_flux_rhs_bd_2 = srh.scalar_flux_rhs_bd_2(g); - double scalar_flux_td = srh.scalar_flux_td_old(g); + double scalar_flux = srh.scalar_flux_old(g); srh.scalar_flux_time_derivative_2(g) = - B0 * scalar_flux_td + scalar_flux_rhs_bd_2; - double sigma_t_td = sigma_t_td_[srh.material() * negroups_ + g]; + B0 * scalar_flux + scalar_flux_rhs_bd_2; + double sigma_t = sigma_t_[srh.material() * negroups_ + g]; // Divide by sigma_t to save time during transport - srh.scalar_flux_time_derivative_2(g) /= sigma_t_td; - } -} - -void FlatSourceDomain::update_all_neutron_sources_td() -{ - simulation::time_update_src_td.start(); - -#pragma omp parallel for - for (int64_t sr = 0; sr < n_source_regions(); sr++) { - SourceRegionHandle srh = source_regions_.get_source_region_handle(sr); - update_single_neutron_source_td(srh); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - compute_single_neutron_source_time_derivative(srh); - compute_single_scalar_flux_time_derivative_2(srh); - } + srh.scalar_flux_time_derivative_2(g) /= sigma_t; } - - simulation::time_update_src_td.stop(); } // TODO: eliminate this and source region vars @@ -2112,12 +1990,7 @@ void FlatSourceDomain::compute_single_delayed_fission_source( double lambda = lambda_[material * ndgroups_ + dg]; if (lambda != 0.0) { for (int g = 0; g < negroups_; g++) { - double scalar_flux; - if (simulation::is_initial_condition) { - scalar_flux = srh.scalar_flux_new(g); - } else { - scalar_flux = srh.scalar_flux_td_new(g); - } + double scalar_flux = scalar_flux = srh.scalar_flux_new(g); double nu_d_sigma_f = nu_d_sigma_f_[material * negroups_ * ndgroups_ + dg * negroups_ + g]; srh.delayed_fission_source(dg) += nu_d_sigma_f * scalar_flux; @@ -2170,28 +2043,6 @@ void FlatSourceDomain::compute_all_precursors() simulation::time_compute_precursors.start(); } -void FlatSourceDomain::serialize_final_td_fluxes(vector& flux_td) -{ - // Ensure array is correct size - flux_td.resize(n_source_regions() * negroups_); -// Serialize the final fluxes for output -#pragma omp parallel for - for (int64_t se = 0; se < n_source_elements(); se++) { - flux_td[se] = source_regions_.scalar_flux_td_final(se); - } -} - -void FlatSourceDomain::serialize_final_td_sources(vector& source_td) -{ - // Ensure array is correct size - source_td.resize(n_source_regions() * negroups_); - // Serialize the final sources for output -#pragma omp parallel for - for (int64_t se = 0; se < n_source_elements(); se++) { - source_td[se] = source_regions_.source_td_final(se); - } -} - void FlatSourceDomain::serialize_final_precursors(vector& precursors) { // Ensure array is correct size @@ -2203,11 +2054,6 @@ void FlatSourceDomain::serialize_final_precursors(vector& precursors) } } -void FlatSourceDomain::flux_td_swap() -{ - source_regions_.flux_td_swap(); -} - void FlatSourceDomain::precursors_swap() { source_regions_.precursors_swap(); @@ -2220,20 +2066,15 @@ void FlatSourceDomain::accumulate_iteration_quantities() #pragma omp parallel for for (int64_t sr = 0; sr < n_source_regions(); sr++) { for (int g = 0; g < negroups_; g++) { - source_regions_.scalar_flux_td_final(sr, g) += - source_regions_.scalar_flux_td_new(sr, g); if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - if (simulation::is_initial_condition) - source_regions_.source_final(sr, g) += - source_regions_.source(sr, g); - else - source_regions_.source_td_final(sr, g) += - source_regions_.source_td(sr, g); + source_regions_.source_final(sr, g) += source_regions_.source(sr, g); } } - for (int dg = 0; dg < ndgroups_; dg++) { - source_regions_.precursors_final(sr, dg) += - source_regions_.precursors_new(sr, dg); + if (settings::create_delayed_neutrons) { + for (int dg = 0; dg < ndgroups_; dg++) { + source_regions_.precursors_final(sr, dg) += + source_regions_.precursors_new(sr, dg); + } } } } @@ -2259,16 +2100,15 @@ void FlatSourceDomain::normalize_final_quantities() for (int64_t sr = 0; sr < n_source_regions(); sr++) { for (int g = 0; g < negroups_; g++) { source_regions_.scalar_flux_final(sr, g) *= source_normalization_factor; - if (settings::kinetic_simulation) - source_regions_.scalar_flux_td_final(sr, g) *= - source_normalization_factor; if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { // TODO: double check that this is correct for adjoint SDP - source_regions_.source_td_final(sr, g) *= source_normalization_factor; + source_regions_.source_final(sr, g) *= source_normalization_factor; } } - for (int dg = 0; dg < ndgroups_; dg++) { - source_regions_.precursors_final(sr, dg) *= source_normalization_factor; + if (settings::kinetic_simulation) { + for (int dg = 0; dg < ndgroups_; dg++) { + source_regions_.precursors_final(sr, dg) *= source_normalization_factor; + } } } } @@ -2281,12 +2121,12 @@ void FlatSourceDomain::propagate_final_quantities() for (int g = 0; g < negroups_; g++) { source_regions_.scalar_flux_old(sr, g) = source_regions_.scalar_flux_final(sr, g); - source_regions_.scalar_flux_td_old(sr, g) = - source_regions_.scalar_flux_td_final(sr, g); } - for (int dg = 0; dg < ndgroups_; dg++) { - source_regions_.precursors_old(sr, dg) = - source_regions_.precursors_final(sr, dg); + if (settings::create_delayed_neutrons) { + for (int dg = 0; dg < ndgroups_; dg++) { + source_regions_.precursors_old(sr, dg) = + source_regions_.precursors_final(sr, dg); + } } } } @@ -2314,25 +2154,23 @@ void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) j = 1; add_value_to_bd_vector(source_regions_.scalar_flux_bd(sr, g), - source_regions_.scalar_flux_td_final(sr, g), increment_not_initialize, + source_regions_.scalar_flux_final(sr, g), increment_not_initialize, RandomRay::bd_order_ + j); if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { // Multiply out sigma_t to store the base source - double sigma_t; - if (simulation::is_initial_condition) { - sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; - } else { - sigma_t = sigma_t_td_[source_regions_.material(sr) * negroups_ + g]; - } - double source = source_regions_.source_td_final(sr, g) * sigma_t; + double sigma_t = sigma_t = + sigma_t_[source_regions_.material(sr) * negroups_ + g]; + double source = source_regions_.source_final(sr, g) * sigma_t; add_value_to_bd_vector(source_regions_.source_bd(sr, g), source, increment_not_initialize, RandomRay::bd_order_); } } - for (int dg = 0; dg < ndgroups_; dg++) { - add_value_to_bd_vector(source_regions_.precursors_bd(sr, dg), - source_regions_.precursors_final(sr, dg), increment_not_initialize, - RandomRay::bd_order_); + if (settings::create_delayed_neutrons) { + for (int dg = 0; dg < ndgroups_; dg++) { + add_value_to_bd_vector(source_regions_.precursors_bd(sr, dg), + source_regions_.precursors_final(sr, dg), increment_not_initialize, + RandomRay::bd_order_); + } } } } @@ -2356,10 +2194,12 @@ void FlatSourceDomain::compute_rhs_bd_quantities() RandomRay::bd_order_, settings::dt, 2); } } - for (int dg = 0; dg < ndgroups_; dg++) { - source_regions_.precursors_rhs_bd(sr, dg) = - rhs_backwards_difference(source_regions_.precursors_bd(sr, dg), - RandomRay::bd_order_, settings::dt); + if (settings::create_delayed_neutrons) { + for (int dg = 0; dg < ndgroups_; dg++) { + source_regions_.precursors_rhs_bd(sr, dg) = + rhs_backwards_difference(source_regions_.precursors_bd(sr, dg), + RandomRay::bd_order_, settings::dt); + } } } } @@ -2379,11 +2219,11 @@ void FlatSourceDomain::update_material_density(int i) density_factor; } nu_p_sigma_f_[j * negroups_ + g_out] *= density_factor; - sigma_t_td_[j * negroups_ + g_out] *= density_factor; - nu_sigma_f_td_[j * negroups_ + g_out] *= density_factor; - sigma_f_td_[j * negroups_ + g_out] *= density_factor; + sigma_t_[j * negroups_ + g_out] *= density_factor; + nu_sigma_f_[j * negroups_ + g_out] *= density_factor; + sigma_f_[j * negroups_ + g_out] *= density_factor; for (int g_in = 0; g_in < negroups_; g_in++) { - sigma_s_td_[j * negroups_ * negroups_ + g_out * negroups_ + g_in] *= + sigma_s_[j * negroups_ * negroups_ + g_out * negroups_ + g_in] *= density_factor; } } diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index 771f4ab766e..bc0acaeb6cf 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -252,10 +252,8 @@ RandomRay::RandomRay() : angular_flux_(data::mg.num_energy_groups_), delta_psi_(data::mg.num_energy_groups_), negroups_(data::mg.num_energy_groups_), - angular_flux_td_(data::mg.num_energy_groups_), - delta_psi_td_(data::mg.num_energy_groups_), - angular_flux_td_prime_(data::mg.num_energy_groups_), - delta_psi_td_prime_(data::mg.num_energy_groups_) + angular_flux_prime_(data::mg.num_energy_groups_), + delta_psi_prime_(data::mg.num_energy_groups_) { if (source_shape_ == RandomRaySourceShape::LINEAR || @@ -454,38 +452,26 @@ void RandomRay::attenuate_flux_flat_source( float tau = sigma_t * distance; float exponential = cjosey_exponential(tau); // exponential = 1 - exp(-tau) float new_delta_psi = (angular_flux_[g] - srh.source(g)) * exponential; + if (settings::kinetic_simulation && !simulation::is_initial_condition && + RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + float source_derivative = srh.source_time_derivative(g); + float flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); + float T1 = (source_derivative - flux_derivative_2); + + // Source Derivative Propogation terms for Time Derivative + // Characteristic Equation + float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; + new_delta_psi += T1 * inverse_vbar * exponential / sigma_t; + new_delta_psi += distance * inverse_vbar * (angular_flux_prime_[g] - T1) * + (1 - exponential); + + // Time Derivative Characteristic Equation + float new_delta_psi_prime = (angular_flux_prime_[g] - T1) * exponential; + delta_psi_prime_[g] = new_delta_psi_prime; + angular_flux_prime_[g] -= new_delta_psi_prime; + } delta_psi_[g] = new_delta_psi; angular_flux_[g] -= new_delta_psi; - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - float sigma_t_td = domain_->sigma_t_td_[material * negroups_ + g]; - float tau_td = sigma_t_td * distance; - float exponential_td = - cjosey_exponential(tau_td); // exponential = 1 - exp(-tau) - float new_delta_psi_td = - (angular_flux_td_[g] - srh.source_td(g)) * exponential_td; - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - float source_derivative = srh.source_time_derivative(g); - float flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); - float T1 = (source_derivative - flux_derivative_2); - - // Source Derivative Propogation terms for Time Derivative - // Characteristic Equation - float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; - new_delta_psi_td += T1 * inverse_vbar * exponential_td / sigma_t_td; - new_delta_psi_td += distance * inverse_vbar * - (angular_flux_td_prime_[g] - T1) * - (1 - exponential_td); - - // Time Derivative Characteristic Equation - float new_delta_psi_td_prime = - (angular_flux_td_prime_[g] - T1) * exponential_td; - delta_psi_td_prime_[g] = new_delta_psi_td_prime; - angular_flux_td_prime_[g] -= new_delta_psi_td_prime; - } - - delta_psi_td_[g] = new_delta_psi_td; - angular_flux_td_[g] -= new_delta_psi_td; - } } // If ray is in the active phase (not in dead zone), make contributions to @@ -499,8 +485,6 @@ void RandomRay::attenuate_flux_flat_source( // this iteration for (int g = 0; g < negroups_; g++) { srh.scalar_flux_new(g) += delta_psi_[g]; - if (settings::kinetic_simulation && !simulation::is_initial_condition) - srh.scalar_flux_td_new(g) += delta_psi_td_[g]; } // Accomulate volume (ray distance) into this iteration's estimate @@ -860,19 +844,13 @@ void RandomRay::initialize_ray(uint64_t ray_id, FlatSourceDomain* domain) for (int g = 0; g < negroups_; g++) { angular_flux_[g] = srh.source(g); } - if (settings::kinetic_simulation && !simulation::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition && + RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { for (int g = 0; g < negroups_; g++) { - angular_flux_td_[g] = srh.source_td(g); - } - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - for (int g = 0; g < negroups_; g++) { - double sigma_t_td = - domain_->sigma_t_td_[srh.material() * negroups_ + g]; - double source_derivative = srh.source_time_derivative(g); - double flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); - // T1 - angular_flux_td_prime_[g] = source_derivative - flux_derivative_2; - } + double source_derivative = srh.source_time_derivative(g); + double flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); + // T1 + angular_flux_prime_[g] = source_derivative - flux_derivative_2; } } } diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index cb34f17de85..3c5f233e94e 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -34,8 +34,9 @@ void openmc_run_random_ray() // TODO: no initial condition needed fof td fixed source simulations // Check if this simulation is to establish an initial condition - if (settings::kinetic_simulation) + if (settings::kinetic_simulation) { simulation::is_initial_condition = true; + } // Configure the domain for forward simulation FlatSourceDomain::adjoint_ = false; @@ -82,6 +83,53 @@ void openmc_run_random_ray() sim.output_simulation_results(); if (settings::kinetic_simulation) { + rename_statepoint_file(-1); + if (settings::output_tallies) { + rename_tallies_file(-1); + } + // Now do a second steady state simulation to correct the batch wise k-eff + // estimates + simulation::k_eff_correction = true; + + if (settings::kinetic_simulation && mpi::master) + header("KINETIC SIMULATION INITIAL CONDITION (K-EFF CORRECTION)", 3); + + // If we're going to do an adjoint simulation afterwards, report that this + // is the initial forward flux solve. + if (adjoint_needed && mpi::master) + header("FORWARD FLUX SOLVE", 3); + + // Initialize OpenMC general data structures + openmc_simulation_init(); + + double initial_k_eff = simulation::keff; + + sim.domain()->k_eff_ = initial_k_eff; + sim.domain()->source_regions_.adjoint_reset(); + sim.domain()->propagate_final_quantities(); + sim.domain()->source_regions_.time_step_reset(); + + // Begin main simulation timer + simulation::time_total.start(); + + // Execute random ray simulation + sim.simulate(); + + // End main simulation timer + simulation::time_total.stop(); + + // Normalize and save the final forward quantities + sim.domain()->normalize_final_quantities(); + + // Finalize OpenMC + openmc_simulation_finalize(); + + // Output all simulation results + sim.output_simulation_results(); + + //------------------------------------------------------------------------- + // KINETIC SIMULATION + warning( "Time-dependent explicit void treatment has not yet been " "implemented. Use caution when interpreting results from models with " @@ -116,7 +164,7 @@ void openmc_run_random_ray() // Initialize OpenMC general data structures openmc_simulation_init(); - sim.domain()->k_eff_ = simulation::keff; + sim.domain()->k_eff_ = initial_k_eff; sim.domain()->source_regions_.adjoint_reset(); sim.domain()->propagate_final_quantities(); sim.domain()->source_regions_.time_step_reset(); @@ -225,7 +273,7 @@ void validate_random_ray_inputs() // TODO: add support for prompt and delayed fission case SCORE_PRECURSORS: { - if (settings::kinetic_simulation) { + if (settings::kinetic_simulation && settings::create_delayed_neutrons) { break; } else { fatal_error("Invalid score specified in tallies.xml. Precursors can " @@ -237,7 +285,7 @@ void validate_random_ray_inputs() "Invalid score specified. Only flux, total, fission, nu-fission, and " "event scores are supported in random ray mode. (precursors are " "supported for " - "kinetic simulations)."); + "kinetic simulations when delayed neutrons are turned on)."); } } @@ -526,6 +574,7 @@ void set_time_dependent_settings() { // Reset flags simulation::is_initial_condition = false; + simulation::k_eff_correction = false; // Set current time simulation::current_time = settings::dt; @@ -590,6 +639,12 @@ RandomRaySimulation::RandomRaySimulation() // Convert OpenMC native MGXS into a more efficient format // internal to the random ray solver domain_->flatten_xs(); + + // Initialize vectors used for the steady state + if (settings::kinetic_simulation) { + static_k_eff_; + static_fission_rate_; + } } void RandomRaySimulation::apply_fixed_sources_and_mesh_domains() @@ -629,9 +684,6 @@ void RandomRaySimulation::simulate() // domain_->compute_neutron_source() // Update source term (scattering + fission) domain_->update_all_neutron_sources(); - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - domain_->update_all_neutron_sources_td(); - } // Reset scalar fluxes, iteration volume tallies, and region hit flags // to zero @@ -674,14 +726,25 @@ void RandomRaySimulation::simulate() if (settings::run_mode == RunMode::EIGENVALUE) { // Compute random ray k-eff - domain_->compute_k_eff(); + if (!settings::kinetic_simulation || + settings::kinetic_simulation && simulation::is_initial_condition) { + domain_->compute_k_eff(); + if (simulation::k_eff_correction) { + static_fission_rate_.push_back(domain_->fission_rate_); + static_k_eff_.push_back(domain_->k_eff_); + } + } else { + domain_->k_eff_ = static_k_eff_[simulation::current_batch - 1]; + domain_->fission_rate_ = + static_fission_rate_[simulation::current_batch - 1]; + } // Store random ray k-eff into OpenMC's native k-eff variable global_tally_tracklength = domain_->k_eff_; } - // Compute precursors - if (settings::kinetic_simulation) + // Compute precursors if delayed neutrons are turned on + if (settings::kinetic_simulation && settings::create_delayed_neutrons) domain_->compute_all_precursors(); // Execute all tallying tasks, if this is an active batch @@ -698,8 +761,7 @@ void RandomRaySimulation::simulate() // Set phi_old = phi_new domain_->flux_swap(); - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - domain_->flux_td_swap(); + if (settings::kinetic_simulation && settings::create_delayed_neutrons) { domain_->precursors_swap(); } @@ -777,7 +839,7 @@ void RandomRaySimulation::print_results_random_ray() const time_bank_sendrecv.elapsed(); if (settings::kinetic_simulation && !simulation::is_initial_condition) { - misc_time -= time_update_bd_vectors_td.elapsed(); + misc_time -= time_update_bd_vectors.elapsed(); } header("Simulation Statistics", 4); fmt::print( @@ -872,16 +934,10 @@ void RandomRaySimulation::print_results_random_ray() const show_time("Total simulation time", time_total.elapsed()); show_time("Transport sweep only", time_transport.elapsed(), 1); show_time("Source update only", time_update_src.elapsed(), 1); - if (settings::kinetic_simulation) { + if (settings::kinetic_simulation && settings::create_delayed_neutrons) { show_time( "Precursor computation only", time_compute_precursors.elapsed(), 1); misc_time -= time_compute_precursors.elapsed(); - - if (!simulation::is_initial_condition) { - show_time( - "Time-dependent source update only", time_update_src_td.elapsed(), 1); - misc_time -= time_update_src_td.elapsed(); - } } show_time("Tally conversion only", time_tallies.elapsed(), 1); show_time("MPI source reductions only", time_bank_sendrecv.elapsed(), 1); diff --git a/src/random_ray/source_region.cpp b/src/random_ray/source_region.cpp index f4a6a31b678..89d8d71b50f 100644 --- a/src/random_ray/source_region.cpp +++ b/src/random_ray/source_region.cpp @@ -32,11 +32,6 @@ SourceRegionHandle::SourceRegionHandle(SourceRegion& sr) flux_moments_new_(sr.flux_moments_new_.data()), flux_moments_t_(sr.flux_moments_t_.data()), tally_task_(sr.tally_task_.data()), - scalar_flux_td_old_(sr.scalar_flux_td_old_.data()), - scalar_flux_td_new_(sr.scalar_flux_td_new_.data()), - scalar_flux_td_final_(sr.scalar_flux_td_final_.data()), - source_td_(sr.source_td_.data()), - source_td_final_(sr.source_td_final_.data()), source_time_derivative_(sr.source_time_derivative_.data()), scalar_flux_time_derivative_2_(sr.scalar_flux_time_derivative_2_.data()), delayed_fission_source_(sr.delayed_fission_source_.data()), @@ -79,11 +74,6 @@ SourceRegion::SourceRegion(int negroups, int ndgroups, bool is_linear) flux_moments_t_.resize(negroups); } if (settings::kinetic_simulation) { - scalar_flux_td_old_.assign(negroups, 0.0); - scalar_flux_td_new_.assign(negroups, 0.0); - source_td_.resize(negroups); - scalar_flux_td_final_.assign(negroups, 0.0); - scalar_flux_bd_.resize(negroups); scalar_flux_rhs_bd_.resize(negroups); @@ -91,7 +81,6 @@ SourceRegion::SourceRegion(int negroups, int ndgroups, bool is_linear) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.assign(negroups, 0.0); - source_td_final_.assign(negroups, 0.0); source_time_derivative_.assign(negroups, 0.0); scalar_flux_time_derivative_2_.assign(negroups, 0.0); @@ -100,15 +89,17 @@ SourceRegion::SourceRegion(int negroups, int ndgroups, bool is_linear) scalar_flux_rhs_bd_2_.resize(negroups); } - delayed_fission_source_.assign(ndgroups, 0.0); - precursors_old_.assign(ndgroups, 0.0); - precursors_new_.assign(ndgroups, 0.0); - precursors_final_.assign(ndgroups, 0.0); + if (settings::create_delayed_neutrons) { + delayed_fission_source_.assign(ndgroups, 0.0); + precursors_old_.assign(ndgroups, 0.0); + precursors_new_.assign(ndgroups, 0.0); + precursors_final_.assign(ndgroups, 0.0); - precursors_bd_.resize(ndgroups); - precursors_rhs_bd_.resize(ndgroups); + precursors_bd_.resize(ndgroups); + precursors_rhs_bd_.resize(ndgroups); - tally_delay_task_.resize(ndgroups); + tally_delay_task_.resize(ndgroups); + } } } @@ -169,11 +160,6 @@ void SourceRegionContainer::push_back(const SourceRegion& sr) // Energy-dependent fields for kinetic simulations if (settings::kinetic_simulation) { - scalar_flux_td_old_.push_back(sr.scalar_flux_td_old_[g]); - scalar_flux_td_new_.push_back(sr.scalar_flux_td_new_[g]); - scalar_flux_td_final_.push_back(sr.scalar_flux_td_final_[g]); - source_td_.push_back(sr.source_td_[g]); - scalar_flux_bd_.push_back(sr.scalar_flux_bd_[g]); scalar_flux_rhs_bd_.push_back(sr.scalar_flux_rhs_bd_[g]); @@ -181,7 +167,6 @@ void SourceRegionContainer::push_back(const SourceRegion& sr) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.push_back(sr.source_final_[g]); - source_td_final_.push_back(sr.source_final_[g]); source_time_derivative_.push_back(sr.source_time_derivative_[g]); scalar_flux_time_derivative_2_.push_back( sr.scalar_flux_time_derivative_2_[g]); @@ -193,7 +178,7 @@ void SourceRegionContainer::push_back(const SourceRegion& sr) } } // Delay group-dependent fields for kinetic simulations - if (settings::kinetic_simulation) { + if (settings::kinetic_simulation && settings::create_delayed_neutrons) { for (int dg = 0; dg < ndgroups_; dg++) { delayed_fission_source_.push_back(sr.delayed_fission_source_[dg]); precursors_old_.push_back(sr.precursors_old_[dg]); @@ -254,11 +239,6 @@ void SourceRegionContainer::assign( // Clear existing data for kinetic simulatons if (settings::kinetic_simulation) { - scalar_flux_td_old_.clear(); - scalar_flux_td_new_.clear(); - scalar_flux_td_final_.clear(); - source_td_.clear(); - scalar_flux_bd_.clear(); scalar_flux_rhs_bd_.clear(); @@ -273,14 +253,16 @@ void SourceRegionContainer::assign( scalar_flux_rhs_bd_2_.clear(); } - precursors_bd_.clear(); - precursors_rhs_bd_.clear(); + if (settings::create_delayed_neutrons) { + precursors_bd_.clear(); + precursors_rhs_bd_.clear(); - delayed_fission_source_.clear(); - precursors_old_.clear(); - precursors_new_.clear(); - precursors_final_.clear(); - tally_delay_task_.clear(); + delayed_fission_source_.clear(); + precursors_old_.clear(); + precursors_new_.clear(); + precursors_final_.clear(); + tally_delay_task_.clear(); + } } // Fill with copies of source_region @@ -341,18 +323,12 @@ SourceRegionHandle SourceRegionContainer::get_source_region_handle(int64_t sr) } if (settings::kinetic_simulation) { - handle.scalar_flux_td_old_ = &scalar_flux_td_old(sr, 0); - handle.scalar_flux_td_new_ = &scalar_flux_td_new(sr, 0); - handle.source_td_ = &source_td(sr, 0); - handle.scalar_flux_td_final_ = &scalar_flux_td_final(sr, 0); - handle.scalar_flux_bd_ = &scalar_flux_bd(sr, 0); handle.scalar_flux_rhs_bd_ = &scalar_flux_rhs_bd(sr, 0); if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { handle.source_final_ = &source_final(sr, 0); - handle.source_td_final_ = &source_td_final(sr, 0); handle.source_time_derivative_ = &source_time_derivative(sr, 0); handle.scalar_flux_time_derivative_2_ = &scalar_flux_time_derivative_2(sr, 0); @@ -362,15 +338,17 @@ SourceRegionHandle SourceRegionContainer::get_source_region_handle(int64_t sr) handle.scalar_flux_rhs_bd_2_ = &scalar_flux_rhs_bd_2(sr, 0); } - handle.delayed_fission_source_ = &delayed_fission_source(sr, 0); - handle.precursors_old_ = &precursors_old(sr, 0); - handle.precursors_new_ = &precursors_new(sr, 0); - handle.precursors_final_ = &precursors_final(sr, 0); + if (settings::create_delayed_neutrons) { + handle.delayed_fission_source_ = &delayed_fission_source(sr, 0); + handle.precursors_old_ = &precursors_old(sr, 0); + handle.precursors_new_ = &precursors_new(sr, 0); + handle.precursors_final_ = &precursors_final(sr, 0); - handle.precursors_bd_ = &precursors_bd(sr, 0); - handle.precursors_rhs_bd_ = &precursors_rhs_bd(sr, 0); + handle.precursors_bd_ = &precursors_bd(sr, 0); + handle.precursors_rhs_bd_ = &precursors_rhs_bd(sr, 0); - handle.tally_delay_task_ = &tally_delay_task(sr, 0); + handle.tally_delay_task_ = &tally_delay_task(sr, 0); + } } return handle; @@ -413,12 +391,13 @@ void SourceRegionContainer::adjoint_reset() MomentArray {0.0, 0.0, 0.0}); // Reset arrays for kinetic adjoint simulations if (settings::kinetic_simulation && !simulation::is_initial_condition) { - std::fill(scalar_flux_td_old_.begin(), scalar_flux_td_old_.end(), 0.0); - std::fill(scalar_flux_td_new_.begin(), scalar_flux_td_new_.end(), 0.0); - std::fill( - delayed_fission_source_.begin(), delayed_fission_source_.end(), 0.0); - std::fill(precursors_old_.begin(), precursors_old_.end(), 0.0); - std::fill(precursors_new_.begin(), precursors_new_.end(), 0.0); + if (settings::create_delayed_neutrons) { + std::fill( + delayed_fission_source_.begin(), delayed_fission_source_.end(), 0.0); + std::fill(precursors_old_.begin(), precursors_old_.end(), 0.0); + std::fill(precursors_new_.begin(), precursors_new_.end(), 0.0); + std::fill(precursors_rhs_bd_.begin(), precursors_rhs_bd_.end(), 0.0); + } // BD Vectors std::fill(scalar_flux_rhs_bd_.begin(), scalar_flux_rhs_bd_.end(), 0.0); @@ -433,19 +412,12 @@ void SourceRegionContainer::adjoint_reset() std::fill( scalar_flux_rhs_bd_2_.begin(), scalar_flux_rhs_bd_2_.end(), 0.0); } - std::fill(precursors_rhs_bd_.begin(), precursors_rhs_bd_.end(), 0.0); } } //----------------------------------------------------------------------------- // Methods for kinetic simulations -void SourceRegionContainer::flux_td_swap() -{ - scalar_flux_td_old_.swap(scalar_flux_td_new_); - // TODO: Add support for linear source regions -} - void SourceRegionContainer::precursors_swap() { precursors_old_.swap(precursors_new_); @@ -454,10 +426,7 @@ void SourceRegionContainer::precursors_swap() void SourceRegionContainer::time_step_reset() { std::fill(scalar_flux_final_.begin(), scalar_flux_final_.end(), 0.0); - std::fill(scalar_flux_td_final_.begin(), scalar_flux_td_final_.end(), 0.0); std::fill(precursors_final_.begin(), precursors_final_.end(), 0.0); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) - std::fill(source_td_final_.begin(), source_td_final_.end(), 0.0); } } // namespace openmc diff --git a/src/simulation.cpp b/src/simulation.cpp index be87e9e73f0..5eb80789ee5 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -326,6 +326,7 @@ vector work_index; bool is_initial_condition {false}; int current_timestep; double current_time; +bool k_eff_correction {false}; } // namespace simulation diff --git a/src/state_point.cpp b/src/state_point.cpp index 8a79c06de66..294cd45c7f6 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -345,8 +345,6 @@ extern "C" int openmc_statepoint_write(const char* filename, bool* write_source) if (settings::solver_type == SolverType::RANDOM_RAY) { write_dataset(runtime_group, "source_update", time_update_src.elapsed()); if (settings::kinetic_simulation) { - write_dataset( - runtime_group, "source_td_update", time_update_src_td.elapsed()); write_dataset( runtime_group, "precursor_update", time_compute_precursors.elapsed()); } diff --git a/src/timer.cpp b/src/timer.cpp index fd1311e1d6e..15bca0de48c 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -29,8 +29,7 @@ Timer time_event_death; Timer time_update_src; // Timers for kinetic simulations -Timer time_update_bd_vectors_td; -Timer time_update_src_td; +Timer time_update_bd_vectors; Timer time_compute_precursors; } // namespace simulation @@ -93,8 +92,7 @@ void reset_timers() simulation::time_event_death.reset(); simulation::time_update_src.reset(); - simulation::time_update_bd_vectors_td.reset(); - simulation::time_update_src_td.reset(); + simulation::time_update_bd_vectors.reset(); simulation::time_compute_precursors.reset(); } From f8183de7a08227cf556d8cceb628ff08066a086f Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 30 Dec 2025 18:29:19 -0600 Subject: [PATCH 10/64] add kinetic simulation information to the user guide --- docs/source/io_formats/materials.rst | 16 +- docs/source/io_formats/settings.rst | 57 +++++ docs/source/io_formats/statepoint.rst | 21 ++ docs/source/methods/random_ray.rst | 313 ++++++++++++++++++++++++++ docs/source/usersguide/index.rst | 1 + docs/source/usersguide/kinetic.rst | 37 +++ 6 files changed, 441 insertions(+), 4 deletions(-) create mode 100644 docs/source/usersguide/kinetic.rst diff --git a/docs/source/io_formats/materials.rst b/docs/source/io_formats/materials.rst index 92b0165a43c..d0049b30312 100644 --- a/docs/source/io_formats/materials.rst +++ b/docs/source/io_formats/materials.rst @@ -49,8 +49,9 @@ Each ``material`` element can have the following attributes or sub-elements: ` is used. :density: - An element with attributes/sub-elements called ``value`` and ``units``. The - ``value`` attribute is the numeric value of the density while the ``units`` + An element with attributes/sub-elements called ``value``, ``units``, and + (optionally) ``value_timeseries``. The ``value`` attribute is the numeric + value of the density while the ``units`` can be "g/cm3", "kg/m3", "atom/b-cm", "atom/cm3", or "sum". The "sum" unit indicates that values appearing in ``ao`` or ``wo`` attributes for ```` and ```` sub-elements are to be interpreted as absolute nuclide/element @@ -59,14 +60,21 @@ Each ``material`` element can have the following attributes or sub-elements: a ``macroscopic`` quantity to indicate that the density is already included in the library and thus not needed here. However, if a value is provided for the ``value``, then this is treated as a number density multiplier on - the macroscopic cross sections in the multi-group data. This can be used, - for example, when perturbing the density slightly. + the macroscopic cross sections in the multi-group data. This can be used, + for example, when perturbing the density slightly. The ``value_timeseries`` + element indicates a material density changing in time. This can be used to + simulate various benchmark problems in kinetic simulations. The + ``value_timeseries`` attribute is assumed to use the same units specified + in the ``units`` attribute. *Default*: None .. note:: A ``macroscopic`` quantity can not be used in conjunction with a ``nuclide``, ``element``, or ``sab`` quantity. + .. note:: The ``value_timeseries`` attribute cannot be used with ``sum`` + densities. + :nuclide: An element with attributes/sub-elements called ``name``, and ``ao`` or ``wo``. The ``name`` attribute is the name of the cross-section for a diff --git a/docs/source/io_formats/settings.rst b/docs/source/io_formats/settings.rst index b7874fcf2f8..08e108d7e33 100644 --- a/docs/source/io_formats/settings.rst +++ b/docs/source/io_formats/settings.rst @@ -321,6 +321,18 @@ the estimated eigenvalue. It has the following attributes/sub-elements: .. note:: See section on the :ref:`trigger` for more information. +------------------------------------- +```` Element +------------------------------------- + +The ```` element indicates whether to run a static or +time-dependent simulation (with no feedbacks). If this element is set to +"true", a kinetic simulation will be run; otherwise a static simulation is run. + + *Default*: false + +.. _kinetic_simulation: + --------------------------- ```` Element --------------------------- @@ -585,6 +597,25 @@ found in the :ref:`random ray user guide `. *Default*: 1.0 +If a kinetic simulation is active, two additional settings are available: + + :bd_order: + Order for backwards difference approximation used in numerically estimating + time derivatives. The backwards difference approximation is stable for + orders less than or equal to 6, and is relatively straightforward to + implement. The default value of 3 balances higher precision with speed. + + *Default*: 3 + + :time_derivative_method: + The method used to resolve the angular flux time-derivative in the time-dependent + characteristic equation. The ``isotropic`` method utilizes an isotropic approximation + to resolve the angular flux time derivative. The ``propagation`` method + uses a technique called Time Derivative Propagation to resolve the angular + flux time derivative. + + *Default*: ``isotropic`` + ---------------------------------- ```` Element ---------------------------------- @@ -1286,6 +1317,32 @@ despite not being bounded on both sides. .. _trace: +--------------------------------- +```` Element +--------------------------------- + +The ```` element can be used specify for how long and +at what resolution to run a kinetic simulation. This element has the +following attributes/sub-elements: + + :n_timesteps: + The number of timesteps. Must be specified by the user. + + :dt: + Time step size. Must be specified by the user. + + :timestep_units: + Time step units. Available options are ``ms`` for milliseconds, ``s`` for seconds, + and ``min`` for minutes. + + *Default*: ``s`` + + .. note:: This element is required if the :ref:`kinetic_simulation` is ``true``. + + *Default*: None + +.. _timestep_parameters: + ------------------- ```` Element ------------------- diff --git a/docs/source/io_formats/statepoint.rst b/docs/source/io_formats/statepoint.rst index 2309643dc89..edb8a9a3f82 100644 --- a/docs/source/io_formats/statepoint.rst +++ b/docs/source/io_formats/statepoint.rst @@ -28,6 +28,10 @@ The current version of the statepoint file format is 18.1. 'continuous-energy' or 'multi-group'. - **run_mode** (*char[]*) -- Run mode used, either 'eigenvalue' or 'fixed source'. + - **solver_type** (*char[]*) -- Solver used, either 'monte carlo' or + 'random ray'. + - **kinetic_simulation** (*int*) -- Flag indicating whether a kinetic (1) + or static (0) simulation was run. - **n_particles** (*int8_t*) -- Number of particles used per generation. - **n_batches** (*int*) -- Number of batches to simulate. - **current_batch** (*int*) -- The number of batches already simulated. @@ -49,6 +53,10 @@ The current version of the statepoint file format is 18.1. combined estimate of k-effective. - **n_realizations** (*int*) -- Number of realizations for global tallies. + - **n_energy_groups** (*int*) -- Number of energy groups used if + **energy_mode** is 'multi-group'. + - **n_delay_groups** (*int*) -- Number of delay groups used if + **energy_mode** is 'multi-group'. - **global_tallies** (*double[][2]*) -- Accumulated sum and sum-of-squares for each global tally. - **source_bank** (Compound type) -- Source bank information for each @@ -197,3 +205,16 @@ All values are given in seconds and are measured on the master process. tally results and evaluating their statistics. - **writing statepoints** (*double*) -- Time spent writing statepoint files + + If random ray mode is used, the following times are also recorded: + - **source_update** (*double*) -- Time spent updating the neutron source. + - **precursor_update** (*double*) -- Time spent updating the precursors + (only written for kinetic simulations). + +**/timestep_data/** + +Time step information for kinetic simulation. All values are given in seconds. + +:Datasets: - **dt** (*double*) -- Length of the time step. + - **current_timestep** (*int*) -- Numbered time step. + - **current_time** (*double*) -- Simulated elapsed time. diff --git a/docs/source/methods/random_ray.rst b/docs/source/methods/random_ray.rst index 5e17316aa1c..228d134f3d1 100644 --- a/docs/source/methods/random_ray.rst +++ b/docs/source/methods/random_ray.rst @@ -87,6 +87,8 @@ derivations are reproduced here verbatim. Several extensions are also made to add clarity, particularly on the topic of OpenMC's treatment of cell volumes in the random ray solver. +.. _usersguide_moc: + ~~~~~~~~~~~~~~~~~~~~~~~~~ Method of Characteristics ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1059,6 +1061,315 @@ random ray and Monte Carlo, however. develop the scattering source by way of inactive batches before beginning active batches. +.. _usersguide_kinetic_random_ray: + +------------------ +Kinetic Random Ray +------------------ + +One can derive equations for time-dependent cases by following similar steps +shown in the derivation for the :ref:`Method of +Charactersistics`. This process stars with the time-dependent +form of neutron transport equation, + +.. math:: + :label: transport-td + + \frac{1}{v(E)} \frac{\partial}{\partial t} + \psi(\mathbf{r},\mathbf{\Omega},E,t) = -\mathbf{\Omega}\cdot + \nabla\psi(\mathbf{r},\mathbf{\Omega},E,t) - \Sigma_{t}(\mathbf{r}, E, + t)\psi(\mathbf{r},\mathbf{\Omega},E,t) + Q(\mathbf{r},\mathbf{\Omega},E,t) + +The neutron source, :math:`Q(\mathbf{r},\mathbf{\Omega},E,t)`, is composed of several +neutron producing sources: + +.. math:: + :label: source-td + + Q(\mathbf{r},\mathbf{\Omega},E,t) = F_{p}(\mathbf{r},E,t) + + S(\mathbf{r},\mathbf{\Omega},E,t) +D(\mathbf{r},E,t) + +where the prompt neutron source (:math:`F_{p}(\mathbf{r},E,t)`), the scattering +neutron source (:math:`S(\mathbf{r},\mathbf{\Omega},E,t)`), and the delayed +neutron source (:math:`D(\mathbf{r},E,t)`) are given by: + + +.. math:: + + \begin{align} + F_{p}(\mathbf{r},E,t) &= \frac{\chi^p(E)}{4\pi} \int_0^\infty \int_{4\pi} + \nu_{p}\Sigma_{f}(\mathbf{r},E^\prime,t) + \psi(\mathbf{r},\mathbf{\Omega}^\prime,E^\prime,t) \: + d\mathbf{\Omega}^\prime \: dE^\prime\nonumber\\ + S(\mathbf{r},\mathbf{\Omega},E,t) &= \int_0^\infty\int_{4\pi} + \Sigma_{s}(\mathbf{r},\mathbf{\Omega}^\prime\rightarrow\mathbf{\Omega},E^\prime\rightarrow + E,t) + \psi(\mathbf{r},\mathbf{\Omega}^\prime,E^\prime,t) \: + d\mathbf{\Omega}^\prime \: dE^\prime\nonumber\\ + D(\mathbf{r},E,t) &= \sum_m \frac{\chi^d_m(E)}{4\pi} \lambda_m + C_m(\mathbf{r}, t)\nonumber + \end{align} + +The :math:`C_m(\mathbf{r}, t)` term is the number of delayed neutron precursors of delayed +group :math:`m`, governed by + + +.. math:: + :label: dnp-eq + + \frac{\partial}{\partial t} C_m(\mathbf{r}, t) = \int_0^\infty\int_{4\pi} + \nu_{d,m} \Sigma_{f}(\mathbf{r},E^\prime,t) + \psi(\mathbf{r},\mathbf{\Omega}^\prime,E^\prime,t) \: + d\mathbf{\Omega}^\prime \: dE^\prime - \lambda_m C_m(\mathbf{r},t) + +The new variables in Equations :eq:`transport-td`, :eq:`source-td`, and +:eq:`dnp-eq` are + + +.. math:: + + \begin{align*} + v(E) &= \text{ neutron speed at energy $E$ [cm s$^{-1}$]},\\ + t &= \text{ time [s]},\\ + \beta &= \sum_m \beta_m = \text{ total delayed neutron fraction [-]},\\ + \nu_{p} &= (1-\beta) \nu = \text{ prompt neutron yield [-]}, \\ + \nu_{d,m} &= \beta_{m} \nu = \text{ delayed neutron yield [-]}, \\ + \chi^p(E) &= \text{ prompt fission neutron spectrum [-]},\\ + \chi^d_m(E) &= \text{ delayed fission neutron spectrum [-],},\\ + \lambda_m &= \text{ decay constant for precursor group $m$ [s$^{-1}$]},\\ + \beta_m &= \text{ delayed neutron fraction for precursor group $m$ [-]} + .\end{align*} + +Applying the characteristic transform to Equation :eq:`transport-td` yields the +time-dependent characteristic equation: + + +.. math:: + :label: char-td + + \frac{1}{v(E)} \frac{\partial}{\partial t} \psi(s,\mathbf{\Omega},E,t) = + -\frac{\partial}{\partial s} \psi(s,\mathbf{\Omega},E,t) - + \Sigma_{t}(s,E,t)\psi(s,\mathbf{\Omega},E,t) + Q(s,\mathbf{\Omega},E,t) + +A similar integrating factor is used to obtain a partial solution of the +time-dependent characteristic equation: + + +.. math:: + :label: moc_td_final_sub + + \psi(s,\mathbf{\Omega},E,t) = \psi(\mathbf{r}_0,\mathbf{\Omega},E,t) + e^{-\int_0^s ds^{\prime} \Sigma_t(s^{\prime},E,t)} + \mathcal{I}_{Q} - + \mathcal{I}_{\frac{\partial}{\partial t} \psi} + +where + + +.. math:: + + \begin{aligned} + \mathcal{I}_{Q} &= \int_0^{s} ds^{\prime\prime} + Q(s^{\prime\prime},\mathbf{\Omega},E,t) e^{\int_{s^{\prime\prime}}^{s'} + ds^{\prime} \Sigma_{t}(s^{\prime},E,t)}\\ + \mathcal{I}_{\frac{\partial}{\partial t} \psi} &= -\frac{1}{v(E)} + \int_0^{s} ds^{\prime\prime} \frac{\partial}{\partial t} + \psi(s^{\prime\prime},\mathbf{\Omega},E,t) e^{\int_{s^{\prime\prime}}^{s} + ds^{\prime} \Sigma_{t}(s^{\prime},E,t)} + \end{aligned} + +Rearranging terms in Equation :eq:`moc_td_final_sub` to solve in terms of +:math:`\Delta \psi_{r,g}(t) = \psi_{r,g}(0,t) - \psi_{r,g}(\ell_r, t)`, and +applying the same energy and spatial discretizations used for the static +case, results in a characteristic equation of the form yields + + +.. math:: + :label: moc_td_final + + \Delta \psi_{r,g}(t) = \psi_{r,g}(0,t) e^{-\Sigma_{t,i,g}(t) \ell_r} - \mathcal{I}_{Q} + \mathcal{I}_{\frac{\partial}{\partial t} \psi} + +The :math:`\mathcal{I}_Q` term is resolved by the analytic shape assumed for +the source term (flat, linear, quadratic, etc.). Applying a flat source approximation +to Equation :eq:`moc_td_final` results in a characteristic equation of the form: + + +.. math:: + :label: moc_td_final_flat + + \Delta \psi_{r,g}(t) = \left(\psi_{r,g}(0,t) - + \frac{Q_{i,g}(t)}{\Sigma_{t,i,g}(t)} \right) (1 - e^{-\Sigma_{t,i,g}(t) + \ell_r}) + \mathcal{I}_{\frac{\partial}{\partial t} \psi} + +The corresponding flat source term is + + +.. math:: + :label: source_td_final_flat + + Q_{i,g}(t) = \frac{1}{4\pi} \left(F_{p,i,g}(t) + S_{i,g}(t) + + D_{i,g}(t)\right) + + +where + +.. math:: + + \begin{align} + F_{p,i,g}(t) &= \chi_g^p\sum_{g'=1}^G + \nu_{p}\Sigma_{f,g',w}(t)\phi_{i,g'}(t)\nonumber\\ + S_{i,g}(t) &= \sum_{g'=1}^G + \Sigma_{s,i,g'\rightarrow g}(t) \phi_{i,g'}(t)\nonumber\\ + D_{i,g}(t) &= \sum_m \chi^d_{g,m} \lambda_m C_{i,m}(t)\nonumber + \end{align} + + +The same approximations applied to the precursor equation (Eq. :eq:`dnp-eq`) yields + + +.. math:: + :label: dnp-eq-final-flat + + \frac{\partial}{\partial t} C_{i,m}(t) = \sum_{g=1}^G + \nu_{d,m}\Sigma_{f,i,g}(t)\phi_{i,g}(t) - \lambda_m C_{i,m}(t) + +The most straightforward approach to resolve the +:math:`\mathcal{I}_{\frac{\partial}{\partial t} \psi}` term would be to +numerically estimate the derivative using a finite difference approximation. +This approach works for the Method of Characteristics and has been shown to +yield accurate answers (see `Hoffman `_), but requires storage of +angular fluxes which can be very expensive. Additionally, the stochastic +quadrature used in the random ray method ensures each time step has a different +spatial domain, making direct finite differencing of angular fluxes impossible. +Two alternative methods have been implemented into OpenMC: + +~~~~~~~~~~~~~~~~~~~~~~~ +Isotropic Approximation +~~~~~~~~~~~~~~~~~~~~~~~ +A commonly used approach to avoid storage of angular fluxes is to make an +isotropic approximation on the angular flux time derivative: + + +.. math:: + + \frac{\partial}{\partial t} \psi_{r,g}(s,t) \approx \frac{1}{4\pi} \frac{d}{d t} \phi_{g}(s,t) + + +This approximation incurs inaccuracies close to strongly absorbing regions due +to the strong flux anisotropies introduced by neutron absorption (i.e. no +neutrons will be emitted from the absorber). This will result in scalar flux +values higher than they should be near absorbing regions. The benefit is that +it is fast, requiring minimal new computation to numerically compute the scalar +flux time derivative. The isotropic approximation resolves the +:math:`\mathcal{I}_{\frac{\partial}{\partial t} \psi}` term to + + +.. math:: + :label: ical-isotropic + + \mathcal{I}_{\frac{\partial}{\partial t} \psi} \approx \frac{1}{4\pi v_g} + \frac{d}{d t} \phi_{i,g}(t) \frac{1 - e^{-\Sigma_{t,i,g}(t) \ell_r}}{\Sigma_{t,i,g}(t)} + +Applying Equation :eq:`ical-isotropic` to Equation :eq:`moc_td_final_flat` yields + + +.. math:: + :label: char-td-isotropic + + \Delta \psi(t) = \left(\psi_{r,g}(0, t) - \frac{Q_{i,g}(t)}{\Sigma{t,i,g}(t)} + \frac{1}{4\pi v_g \Sigma_{t,i,g}(t)} \frac{d}{d t} \phi_{i,g}(t)\right) (1 - e^{-\Sigma_t,i,g(t) \ell_r}) + + +This approach was first applied to the random ray method by `Kraus +`_. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Source Derivative Propagation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Source Derivative Propagation is a method developed by `Hoffman +`_ to solve the angular flux storage issue while also providing +a higher fidelity approximation storing angular fluxes. This method works by +forming a characteristic equation for the *angular flux time-derivative* which +is solved in the same way as the standard characteristic equation. The +time-derivative characteristic equation provides an analytical solution for +:math:`\frac{d}{d t} \psi_{r,i}(s,t)`. The time derivative characteristic +equation is formed by taking the time derivative of Equation +:eq:`moc_td_final_flat` and assuming :math:`\frac{d}{d t} \Sigma_{t,i,g}(t) +\approx 0`. The resulting :math:`\frac{\partial^2}{\partial t^2} \psi_{r,g}(s,t)` term +can be resolved with a second-order isotropic approximation, yielding: + + +.. math:: + :label: char-td-derivative-sdp + + \Delta \frac{\partial}{\partial t} \psi_{r,g}(s,t) = + \left(\frac{\partial}{\partial t} \psi_{r,g}(0, t) - \frac{T^{1}_{i,g}(t)}{\Sigma_{t,i,g}(t)} \right) + (1 - e^{-\Sigma_{t,i,g}(t)s}) + +where + + +.. math:: + :label: operator-T1 + + T^{1}_{i,g}(t) \equiv \frac{d Q_{i,g}}{d t} + -\frac{1}{4\pi v_g}\frac{d^2 \phi_{i,g}}{d t^2} + +Equation :eq:`char-td-derivative-sdp` can be rearranged to solve for +:math:`\frac{\partial}{\partial t} \psi_{r,g}(s,t)` and used to solve +:math:`\mathcal{I}_{\frac{\partial}{\partial t} \psi}` as: + + +.. math:: + + \mathcal{I}_{\frac{\partial}{\partial t} \psi} = + \frac{1}{v_g}\frac{T^{1}_{i,g}(t)}{(\Sigma_{t,i,g}(t))^{2}} (1 - + e^{-\Sigma_{t,i,g}(t) s}) + + \frac{s}{v_g} \left(\frac{\partial}{\partial t} \psi_{r,g}(0, t) - \frac{T^{1}_{i,g}(t)}{\Sigma_{t,i,g}(t)} \right) e^{-\Sigma_{t,i,g}(t)s} + +which can be substituted into Equation :eq:`moc_td_final_flat` to get + + +.. math:: + :label: char-td-sdp + + \begin{aligned} + \Delta \psi(t) = \bigg(\psi_{r,g}(0, t) - \frac{Q_{i,g}(t)}{\Sigma{t,i,g}(t)} + &+ \frac{1}{v_g} \frac{T^{1}_{i,g}(t)}{(\Sigma_{t,i,g}(t))^{2}}\bigg) (1 - + e^{-\Sigma_t,i,g(t) \ell_r})\\ &+ \frac{s}{v_g} + \bigg(\frac{\partial}{\partial t} \psi_{r,g}(0, t) - + \frac{T^{1}_{i,g}(t)}{\Sigma_{t,i,g}(t)} \bigg) e^{-\Sigma_{t,i,g}(t)s} + \end{aligned} + + +Equations :eq:`char-td-derivative-sdp` and :eq:`char-td-sdp` are solved in +sequence during flux propagation. The avoidance of a first-order isotropic +approximation may make Source Derivative Propagation more accurate in problems +with strongly absorbing regions. + + +~~~~~~~~~~~~~~~~~~ +Initial Conditions +~~~~~~~~~~~~~~~~~~ +An initial condition for a kinetic simulation may be obtained obtained by +running a static eigenvalue simulation. To bake-in the initial steady +state, the prompt fission source in the total source term (Eq. +:eq:`source_td_final_flat`) and the delayed fission source in the precursor +integration (Eq. :eq:`dnp-eq-final-flat`) are divided by +:math:`k_\text{eff}`. `Kraus `_ found that utilizing a single +value of :math:`k_\text{eff}` for the initial condition results in a biased +flux. This bias is due applying :math:`k_\text{eff}` computed on the initial +quadrature to source terms on a subsequent (different) quadrature. There are +two approaches to resolving this bias: + +1. Recomputing :math:`k_\text{eff}`: This approach recomputed + :math:`k_\text{eff}` of the unperturbed system used to scale the fission + source on the current quadrature. +2. Time-consistent seed: This approach resets the PRNG seed at the beginning of + each time step so the resulting quadrature is the same in each time step. + +The time-consistent seed approach results in lower variance and shorter run +times than the :math:`k_\text{eff}` recomputation approach, so is the approach +used in OpenMC's implementation of the time-dependent Random Ray Method. + .. _adjoint: ------------------------ @@ -1158,6 +1469,8 @@ in random ray particle transport are: .. _Cosgrove-2023: https://doi.org/10.1080/00295639.2023.2270618 .. _Ferrer-2016: https://doi.org/10.13182/NSE15-6 .. _Gunow-2018: https://dspace.mit.edu/handle/1721.1/119030 +.. _Hoffman-2013: https://doi.org/10.1016/j.jcp.2015.10.039 +.. _Kraus-2025: https://doi.org/10.1080/00295639.2025.2456413 .. only:: html diff --git a/docs/source/usersguide/index.rst b/docs/source/usersguide/index.rst index 5f8e0197e70..12e5555cfb9 100644 --- a/docs/source/usersguide/index.rst +++ b/docs/source/usersguide/index.rst @@ -29,4 +29,5 @@ essential aspects of using OpenMC to perform simulations. volume variance_reduction random_ray + kinetic troubleshoot diff --git a/docs/source/usersguide/kinetic.rst b/docs/source/usersguide/kinetic.rst new file mode 100644 index 00000000000..3d17c7f7e95 --- /dev/null +++ b/docs/source/usersguide/kinetic.rst @@ -0,0 +1,37 @@ +.. _random_ray: + +=================== +Kinetic Simulations +=================== + +Much of OpenMC's existing infrastructure assumes a system is at a steady state. +Users interested in reactor transients should use the kinetic simulation +capability. Kinetic simulations can be enabled as:: + + settings.kinetic_simulation = True + +Kinetic simulations require the user to specify time step settings using the +``settings.timestep_parameters`` object. As an example, a 10 second long +simulation using 1 millisecond time steps can be set as:: + + settings.timestep_parameters = {'n_timesteps': 1000, + 'dt': 1, + 'timestep_units': 'ms'} + +.. note:: + When running kineic simulations, OpenMC will generate a statepoint file for + each time step named ``openmc_td_simulation_{i}.h5``, where ``i`` is the + index of the time step. + +Currently, only material density transients can be simulated. A density +transient can be specified using the Python API:: + + water = openmc.Material(name='water') + + # Linear ramp transient + densities = np.linspace(1, 0.95, 1000) + + water.set_density('macro', 1.0, density_timeseries=densities) + +.. note:: + Kinetic simulations are currently only supported in eigenvalue mode using the Random Ray solver. From 0c30fd7605d2f13cbb4594a6c60d05a1022b15c3 Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 30 Dec 2025 19:44:00 -0600 Subject: [PATCH 11/64] minor formatting fix --- include/openmc/random_ray/flat_source_domain.h | 2 +- include/openmc/settings.h | 4 ++-- include/openmc/simulation.h | 12 ++++-------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/include/openmc/random_ray/flat_source_domain.h b/include/openmc/random_ray/flat_source_domain.h index 1ee98d03a84..0362cebf40b 100644 --- a/include/openmc/random_ray/flat_source_domain.h +++ b/include/openmc/random_ray/flat_source_domain.h @@ -118,7 +118,7 @@ class FlatSourceDomain { //---------------------------------------------------------------------------- // Public Data members - double k_eff_ {1.0}; // Eigenvalue + double k_eff_ {1.0}; // Eigenvalue double fission_rate_; // The system's fission rate (per cm^3), in eigenvalue mode diff --git a/include/openmc/settings.h b/include/openmc/settings.h index a7fba61e24c..f4372a2eca3 100644 --- a/include/openmc/settings.h +++ b/include/openmc/settings.h @@ -201,8 +201,8 @@ extern double weight_cutoff; //!< Weight cutoff for Russian roulette extern double weight_survive; //!< Survival weight after Russian roulette // Timestep variables for kinetic simulation -extern int n_timesteps; //!< number of timesteps -extern double dt; //!< fixed timestep size +extern int n_timesteps; //!< number of timesteps +extern double dt; //!< fixed timestep size } // namespace settings //============================================================================== diff --git a/include/openmc/simulation.h b/include/openmc/simulation.h index 80e5659eaa8..7f39691e974 100644 --- a/include/openmc/simulation.h +++ b/include/openmc/simulation.h @@ -51,14 +51,10 @@ extern vector work_index; //----------------------------------------------------------------------------- // Global variables for kinetic simulations -extern bool - is_initial_condition; //!< if eigenvalue/fixed source sim is an initial - // condition for a kinetic simulation -extern int current_timestep; // !< current time step in kinetic simulation -extern double current_time; // !< current time in kinetic simulation -extern bool k_eff_correction; // !< flag to indicate if the simulation is meant - // to correct batchwise k_effs - +extern bool is_initial_condition; //!< if eigenvalue/fixed source sim is an initial condition for a kinetic simulation +extern int current_timestep; // !< current time step in kinetic simulation +extern double current_time; // !< current time in kinetic simulation +extern bool k_eff_correction; // !< flag to indicate if the simulation is meant to correct batchwise k_effs } // namespace simulation //============================================================================== From 2f1b27bf097b4a49505dab2faf389dfdabaf7e4e Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 30 Dec 2025 23:17:50 -0600 Subject: [PATCH 12/64] don't store initial k_eff solve --- src/random_ray/random_ray_simulation.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index 3c5f233e94e..6a0b3357484 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -83,10 +83,6 @@ void openmc_run_random_ray() sim.output_simulation_results(); if (settings::kinetic_simulation) { - rename_statepoint_file(-1); - if (settings::output_tallies) { - rename_tallies_file(-1); - } // Now do a second steady state simulation to correct the batch wise k-eff // estimates simulation::k_eff_correction = true; From 89abd4404417474dd6c1864bdd89d3f3bb9a356f Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 30 Dec 2025 23:22:24 -0600 Subject: [PATCH 13/64] add random_ray_k_eff_kinetic regression test --- .../random_ray_k_eff_kinetic/__init__.py | 0 .../isotropic/inputs_true.dat | 86 +++++++++++++++++++ .../isotropic/results_true_0.dat | 26 ++++++ .../isotropic/results_true_1.dat | 26 ++++++ .../isotropic/results_true_2.dat | 26 ++++++ .../isotropic/results_true_3.dat | 26 ++++++ .../isotropic/results_true_4.dat | 26 ++++++ .../isotropic/results_true_5.dat | 26 ++++++ .../propagation/inputs_true.dat | 86 +++++++++++++++++++ .../propagation/results_true_0.dat | 26 ++++++ .../propagation/results_true_1.dat | 26 ++++++ .../propagation/results_true_2.dat | 26 ++++++ .../propagation/results_true_3.dat | 26 ++++++ .../propagation/results_true_4.dat | 26 ++++++ .../propagation/results_true_5.dat | 26 ++++++ .../random_ray_k_eff_kinetic/test.py | 30 +++++++ 16 files changed, 514 insertions(+) create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/__init__.py create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/isotropic/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/propagation/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/test.py diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/__init__.py b/tests/regression_tests/random_ray_k_eff_kinetic/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/inputs_true.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/inputs_true.dat new file mode 100644 index 00000000000..503ecabaa68 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/inputs_true.dat @@ -0,0 +1,86 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 400 + 200 + true + +
0.01
+ 5 + s +
+ multi-group + + 100.0 + 20.0 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + 3 + isotropic + +
+ + + 1 2 3 4 5 6 7 8 + + + flux fission nu-fission + analog + + + 1 + precursors + + +
diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_0.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_0.dat new file mode 100644 index 00000000000..3a18ad9c134 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_0.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.630331E+03 +3.459322E+04 +1.079948E+02 +5.831610E+01 +2.651573E+02 +3.515523E+02 +tally 2: +1.077582E+00 +5.805919E-03 +2.327022E+00 +2.707515E-02 +8.947059E-01 +4.002493E-03 +6.344423E-01 +2.012585E-03 +4.939693E-01 +1.220028E-03 +6.664308E-02 +2.220650E-05 +2.312960E-02 +2.674892E-06 +3.680705E-03 +6.773796E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat new file mode 100644 index 00000000000..46dba4d56f4 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.630190E+03 +3.458951E+04 +1.079890E+02 +5.830986E+01 +2.651431E+02 +3.515147E+02 +tally 2: +1.077582E+00 +5.805916E-03 +2.327021E+00 +2.707513E-02 +8.947056E-01 +4.002491E-03 +6.344421E-01 +2.012584E-03 +4.939691E-01 +1.220027E-03 +6.664304E-02 +2.220648E-05 +2.312958E-02 +2.674887E-06 +3.680701E-03 +6.773779E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat new file mode 100644 index 00000000000..59ce5cb6cf3 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.628842E+03 +3.455405E+04 +1.078945E+02 +5.820788E+01 +2.649118E+02 +3.509018E+02 +tally 2: +1.077582E+00 +5.805915E-03 +2.327021E+00 +2.707512E-02 +8.947054E-01 +4.002489E-03 +6.344416E-01 +2.012581E-03 +4.939683E-01 +1.220024E-03 +6.664281E-02 +2.220632E-05 +2.312938E-02 +2.674842E-06 +3.680634E-03 +6.773532E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat new file mode 100644 index 00000000000..c237ebd2591 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.626019E+03 +3.447990E+04 +1.077393E+02 +5.804055E+01 +2.645315E+02 +3.498950E+02 +tally 2: +1.077582E+00 +5.805913E-03 +2.327020E+00 +2.707510E-02 +8.947048E-01 +4.002483E-03 +6.344403E-01 +2.012572E-03 +4.939660E-01 +1.220012E-03 +6.664210E-02 +2.220585E-05 +2.312878E-02 +2.674703E-06 +3.680428E-03 +6.772777E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat new file mode 100644 index 00000000000..2a14986689a --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.621893E+03 +3.437163E+04 +1.075306E+02 +5.781591E+01 +2.640198E+02 +3.485426E+02 +tally 2: +1.077581E+00 +5.805908E-03 +2.327017E+00 +2.707505E-02 +8.947036E-01 +4.002472E-03 +6.344375E-01 +2.012555E-03 +4.939613E-01 +1.219989E-03 +6.664066E-02 +2.220489E-05 +2.312757E-02 +2.674422E-06 +3.680017E-03 +6.771264E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat new file mode 100644 index 00000000000..e66542145b7 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.616580E+03 +3.423247E+04 +1.072732E+02 +5.753947E+01 +2.633886E+02 +3.468780E+02 +tally 2: +1.077581E+00 +5.805900E-03 +2.327014E+00 +2.707497E-02 +8.947015E-01 +4.002454E-03 +6.344330E-01 +2.012526E-03 +4.939535E-01 +1.219950E-03 +6.663827E-02 +2.220330E-05 +2.312556E-02 +2.673959E-06 +3.679343E-03 +6.768783E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/inputs_true.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/inputs_true.dat new file mode 100644 index 00000000000..55e6e96a613 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/inputs_true.dat @@ -0,0 +1,86 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 400 + 200 + true + +
0.01
+ 5 + s +
+ multi-group + + 100.0 + 20.0 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + 3 + propagation + +
+ + + 1 2 3 4 5 6 7 8 + + + flux fission nu-fission + analog + + + 1 + precursors + + +
diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_0.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_0.dat new file mode 100644 index 00000000000..3a18ad9c134 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_0.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.630331E+03 +3.459322E+04 +1.079948E+02 +5.831610E+01 +2.651573E+02 +3.515523E+02 +tally 2: +1.077582E+00 +5.805919E-03 +2.327022E+00 +2.707515E-02 +8.947059E-01 +4.002493E-03 +6.344423E-01 +2.012585E-03 +4.939693E-01 +1.220028E-03 +6.664308E-02 +2.220650E-05 +2.312960E-02 +2.674892E-06 +3.680705E-03 +6.773796E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat new file mode 100644 index 00000000000..46dba4d56f4 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.630190E+03 +3.458951E+04 +1.079890E+02 +5.830986E+01 +2.651431E+02 +3.515147E+02 +tally 2: +1.077582E+00 +5.805916E-03 +2.327021E+00 +2.707513E-02 +8.947056E-01 +4.002491E-03 +6.344421E-01 +2.012584E-03 +4.939691E-01 +1.220027E-03 +6.664304E-02 +2.220648E-05 +2.312958E-02 +2.674887E-06 +3.680701E-03 +6.773779E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat new file mode 100644 index 00000000000..59ce5cb6cf3 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.628842E+03 +3.455405E+04 +1.078945E+02 +5.820788E+01 +2.649118E+02 +3.509018E+02 +tally 2: +1.077582E+00 +5.805915E-03 +2.327021E+00 +2.707512E-02 +8.947054E-01 +4.002489E-03 +6.344416E-01 +2.012581E-03 +4.939683E-01 +1.220024E-03 +6.664281E-02 +2.220632E-05 +2.312938E-02 +2.674842E-06 +3.680634E-03 +6.773532E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat new file mode 100644 index 00000000000..c237ebd2591 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.626019E+03 +3.447990E+04 +1.077393E+02 +5.804055E+01 +2.645315E+02 +3.498950E+02 +tally 2: +1.077582E+00 +5.805913E-03 +2.327020E+00 +2.707510E-02 +8.947048E-01 +4.002483E-03 +6.344403E-01 +2.012572E-03 +4.939660E-01 +1.220012E-03 +6.664210E-02 +2.220585E-05 +2.312878E-02 +2.674703E-06 +3.680428E-03 +6.772777E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat new file mode 100644 index 00000000000..99def7858bf --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.621893E+03 +3.437163E+04 +1.075306E+02 +5.781591E+01 +2.640198E+02 +3.485427E+02 +tally 2: +1.077581E+00 +5.805908E-03 +2.327017E+00 +2.707505E-02 +8.947036E-01 +4.002472E-03 +6.344375E-01 +2.012555E-03 +4.939613E-01 +1.219989E-03 +6.664066E-02 +2.220489E-05 +2.312757E-02 +2.674422E-06 +3.680017E-03 +6.771264E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat new file mode 100644 index 00000000000..e66542145b7 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.616580E+03 +3.423247E+04 +1.072732E+02 +5.753947E+01 +2.633886E+02 +3.468780E+02 +tally 2: +1.077581E+00 +5.805900E-03 +2.327014E+00 +2.707497E-02 +8.947015E-01 +4.002454E-03 +6.344330E-01 +2.012526E-03 +4.939535E-01 +1.219950E-03 +6.663827E-02 +2.220330E-05 +2.312556E-02 +2.673959E-06 +3.679343E-03 +6.768783E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_kinetic/test.py new file mode 100644 index 00000000000..93f87535786 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/test.py @@ -0,0 +1,30 @@ +import os + +import openmc +from openmc.utility_funcs import change_directory +from openmc.examples import random_ray_pin_cell +import pytest + +from tests.testing_harness import KineticTolerantPyAPITestHarness + + +class KineticMGXSTestHarness(KineticTolerantPyAPITestHarness): + def _cleanup(self): + super()._cleanup() + f = 'mgxs.h5' + if os.path.exists(f): + os.remove(f) + + +@pytest.mark.parametrize("time_method", ["isotropic", + "propagation"]) +def test_random_ray_time_dependent(time_method): + with change_directory(time_method): + openmc.reset_auto_ids() + model = random_ray_pin_cell(kinetic=True) + model.settings.timestep_parameters['n_timesteps'] = 5 + model.settings.random_ray['time_method'] = time_method + model.settings.batches = 400 + model.settings.inactive = 200 + harness = KineticMGXSTestHarness(model, 6)# 21) + harness.main() From 5c86858d222afc66591f9acf8387b481a10430a8 Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 31 Dec 2025 18:04:07 -0600 Subject: [PATCH 14/64] add kinetic functionality to auto setup feature --- openmc/material.py | 2 + openmc/model/model.py | 307 +++++++++--------- src/material.cpp | 9 +- .../random_ray_auto_convert/test.py | 2 +- .../__init__.py | 0 .../infinite_medium/inputs_true.dat | 69 ++++ .../infinite_medium/results_true_0.dat | 2 + .../infinite_medium/results_true_1.dat | 2 + .../infinite_medium/results_true_2.dat | 2 + .../infinite_medium/results_true_3.dat | 2 + .../infinite_medium/results_true_4.dat | 2 + .../infinite_medium/results_true_5.dat | 2 + .../material_wise/inputs_true.dat | 69 ++++ .../material_wise/results_true_0.dat | 2 + .../material_wise/results_true_1.dat | 2 + .../material_wise/results_true_2.dat | 2 + .../material_wise/results_true_3.dat | 2 + .../material_wise/results_true_4.dat | 2 + .../material_wise/results_true_5.dat | 2 + .../stochastic_slab/inputs_true.dat | 69 ++++ .../stochastic_slab/results_true_0.dat | 2 + .../stochastic_slab/results_true_1.dat | 2 + .../stochastic_slab/results_true_2.dat | 2 + .../stochastic_slab/results_true_3.dat | 2 + .../stochastic_slab/results_true_4.dat | 2 + .../stochastic_slab/results_true_5.dat | 2 + .../random_ray_auto_convert_kinetic/test.py | 57 ++++ .../test.py | 2 +- 28 files changed, 465 insertions(+), 157 deletions(-) create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/__init__.py create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_5.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_5.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_5.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/test.py diff --git a/openmc/material.py b/openmc/material.py index c483401adbc..f8ce661c0d3 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -609,6 +609,8 @@ def set_density(self, units: str, density: float | None = None, if density_timeseries is not None: cv.check_type(f'the density timeseries for Material ID="{self.id}"', density_timeseries, Iterable, Real) + [cv.check_greater_than(f'an element in density timeseries for Material ID="{self.id}"', + x, 0.0) for x in density_timeseries] self._density_timeseries = density_timeseries else: self._density_timeseries = None diff --git a/openmc/model/model.py b/openmc/model/model.py index 6e4c1c5856d..36364124694 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -1685,9 +1685,101 @@ def differentiate_mats(self, diff_volume_method: str = None, depletable_only: bo self.geometry.get_all_materials().values() ) + + def _auto_generate_mgxs_lib( + self, + model: openmc.model.model, + energy_groups: openmc.mgxs.EnergyGroups, + correction: str | none, + directory: pathlike, + kinetic: bool | None = None, + num_delayed_groups: int = 0, + ) -> openmc.mgxs.Library: + """ + Automatically generate a multi-group cross section libray from a model + with the specified group structure. + + Parameters + ---------- + energy_groups : openmc.mgxs.EnergyGroups + Energy group structure for the MGXS. + nparticles : int + Number of particles to simulate per batch when generating MGXS. + mgxs_path : str + Filename for the MGXS HDF5 file. + correction : str + Transport correction to apply to the MGXS. Options are None and + "P0". + directory : str + Directory to run the simulation in, so as to contain XML files. + kinetic : bool, optional + Flag to indicate if kinetic simulation cross sections are needed. + num_delayed_groups : int, optional + Number of delayed groups for kinetic simulations. + + Returns + ------- + mgxs_lib : openmc.mgxs.Library + OpenMC MGXS Library object + """ + + # Initialize MGXS library with a finished OpenMC geometry object + mgxs_lib = openmc.mgxs.Library(model.geometry) + + # Pick energy group structure + mgxs_lib.energy_groups = energy_groups + + if (kinetic): + mgxs_lib.num_delayed_groups = num_delayed_groups + + # Disable transport correction + mgxs_lib.correction = correction + + # Specify needed cross sections for random ray + if correction == 'P0': + mgxs_lib.mgxs_types = [ + 'nu-transport', 'absorption', 'nu-fission', 'fission', + 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' + ] + elif correction is None: + mgxs_lib.mgxs_types = [ + 'total', 'absorption', 'nu-fission', 'fission', + 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' + ] + if kinetic: + mgxs_lib.mgxs_types += ['chi-prompt', 'chi-delayed', 'decay-rate', 'inverse-velocity', 'beta'] + + # Specify a "cell" domain type for the cross section tally filters + mgxs_lib.domain_type = "material" + + # Specify the cell domains over which to compute multi-group cross sections + mgxs_lib.domains = model.geometry.get_all_materials().values() + + # Do not compute cross sections on a nuclide-by-nuclide basis + mgxs_lib.by_nuclide = False + + # Check the library - if no errors are raised, then the library is satisfactory. + mgxs_lib.check_library_for_openmc_mgxs() + + # Construct all tallies needed for the multi-group cross section library + mgxs_lib.build_library() + + # Create a "tallies.xml" file for the MGXS Library + mgxs_lib.add_to_tallies(model.tallies, merge=True) + + # Run + statepoint_filename = model.run(cwd=directory) + + # Load MGXS + with openmc.StatePoint(statepoint_filename) as sp: + mgxs_lib.load_from_statepoint(sp) + + return mgxs_lib + + def _create_mgxs_sources( self, - groups: openmc.mgxs.EnergyGroups, + energy_groups: openmc.mgxs.EnergyGroups, spatial_dist: openmc.stats.Spatial, source_energy: openmc.stats.Univariate | None = None, ) -> list[openmc.IndependentSource]: @@ -1709,7 +1801,7 @@ def _create_mgxs_sources( Parameters ---------- - groups : openmc.mgxs.EnergyGroups + energy_groups : openmc.mgxs.EnergyGroups Energy group structure for the MGXS. spatial_dist : openmc.stats.Spatial Spatial distribution to use for all sources. @@ -1725,8 +1817,8 @@ def _create_mgxs_sources( # Make a discrete source that is uniform over the bins of the group structure midpoints = [] strengths = [] - for i in range(groups.num_groups): - bounds = groups.get_group_bounds(i+1) + for i in range(energy_groups.num_groups): + bounds = energy_groups.get_group_bounds(i+1) midpoints.append((bounds[0] + bounds[1]) / 2.0) strengths.append(1.0) @@ -1772,12 +1864,14 @@ def _create_mgxs_sources( def _generate_infinite_medium_mgxs( self, - groups: openmc.mgxs.EnergyGroups, + energy_groups: openmc.mgxs.EnergyGroups, nparticles: int, mgxs_path: PathLike, correction: str | None, directory: PathLike, source_energy: openmc.stats.Univariate | None = None, + kinetic: bool | None = None, + num_delayed_groups: int = 0, ): """Generate a MGXS library by running multiple OpenMC simulations, each representing an infinite medium simulation of a single isolated @@ -1802,7 +1896,7 @@ def _generate_infinite_medium_mgxs( Parameters ---------- - groups : openmc.mgxs.EnergyGroups + energy_groups : openmc.mgxs.EnergyGroups Energy group structure for the MGXS. nparticles : int Number of particles to simulate per batch when generating MGXS. @@ -1816,6 +1910,11 @@ def _generate_infinite_medium_mgxs( source_energy : openmc.stats.Univariate, optional Energy distribution to use when generating MGXS data, replacing any existing sources in the model. + kinetic : bool, optional + Flag to indicate if kinetic simulation cross sections are needed. + num_delayed_groups : int, optional + Number of delayed groups for kinetic simulations. + """ mgxs_sets = [] for material in self.materials: @@ -1829,7 +1928,7 @@ def _generate_infinite_medium_mgxs( model.settings.particles = nparticles model.settings.source = self._create_mgxs_sources( - groups, + energy_groups, spatial_dist=openmc.stats.Point(), source_energy=source_energy ) @@ -1848,59 +1947,14 @@ def _generate_infinite_medium_mgxs( model.geometry.root_universe = infinite_universe # Add MGXS Tallies - - # Initialize MGXS library with a finished OpenMC geometry object - mgxs_lib = openmc.mgxs.Library(model.geometry) - - # Pick energy group structure - mgxs_lib.energy_groups = groups - - # Disable transport correction - mgxs_lib.correction = correction - - # Specify needed cross sections for random ray - if correction == 'P0': - mgxs_lib.mgxs_types = [ - 'nu-transport', 'absorption', 'nu-fission', 'fission', - 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' - ] - elif correction is None: - mgxs_lib.mgxs_types = [ - 'total', 'absorption', 'nu-fission', 'fission', - 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' - ] - - # Specify a "cell" domain type for the cross section tally filters - mgxs_lib.domain_type = "material" - - # Specify the cell domains over which to compute multi-group cross sections - mgxs_lib.domains = model.geometry.get_all_materials().values() - - # Do not compute cross sections on a nuclide-by-nuclide basis - mgxs_lib.by_nuclide = False - - # Check the library - if no errors are raised, then the library is satisfactory. - mgxs_lib.check_library_for_openmc_mgxs() - - # Construct all tallies needed for the multi-group cross section library - mgxs_lib.build_library() - - # Create a "tallies.xml" file for the MGXS Library - mgxs_lib.add_to_tallies(model.tallies, merge=True) - - # Run - statepoint_filename = model.run(cwd=directory) - - # Load MGXS - with openmc.StatePoint(statepoint_filename) as sp: - mgxs_lib.load_from_statepoint(sp) + mgxs_lib = self._auto_generate_mgxs_lib(model, energy_groups, correction, directory, kinetic, num_delayed_groups) # Create a MGXS File which can then be written to disk mgxs_set = mgxs_lib.get_xsdata(domain=material, xsdata_name=name) mgxs_sets.append(mgxs_set) # Write the file to disk - mgxs_file = openmc.MGXSLibrary(energy_groups=groups) + mgxs_file = openmc.MGXSLibrary(energy_groups=energy_groups, num_delayed_groups=num_delayed_groups) for mgxs_set in mgxs_sets: mgxs_file.add_xsdata(mgxs_set) mgxs_file.export_to_hdf5(mgxs_path) @@ -1981,12 +2035,14 @@ def _create_stochastic_slab_geometry( def _generate_stochastic_slab_mgxs( self, - groups: openmc.mgxs.EnergyGroups, + energy_groups: openmc.mgxs.EnergyGroups, nparticles: int, mgxs_path: PathLike, correction: str | None, directory: PathLike, source_energy: openmc.stats.Univariate | None = None, + kinetic: bool | None = None, + num_delayed_groups: int = 0, ) -> None: """Generate MGXS assuming a stochastic "sandwich" of materials in a layered slab geometry. While geometry-specific spatial shielding effects are not @@ -2000,7 +2056,7 @@ def _generate_stochastic_slab_mgxs( Parameters ---------- - groups : openmc.mgxs.EnergyGroups + energy_groups : openmc.mgxs.EnergyGroups Energy group structure for the MGXS. nparticles : int Number of particles to simulate per batch when generating MGXS. @@ -2028,6 +2084,11 @@ def _generate_stochastic_slab_mgxs( no sources are defined on the model and the run mode is 'eigenvalue', then a default Watt spectrum source (strength = 0.99) is added. + kinetic : bool, optional + Flag to indicate if kinetic simulation cross sections are needed. + num_delayed_groups : int, optional + Number of delayed groups for kinetic simulations. + """ model = openmc.Model() model.materials = self.materials @@ -2044,7 +2105,7 @@ def _generate_stochastic_slab_mgxs( # Define the sources model.settings.source = self._create_mgxs_sources( - groups, + energy_groups, spatial_dist=spatial_distribution, source_energy=source_energy ) @@ -2055,48 +2116,7 @@ def _generate_stochastic_slab_mgxs( model.settings.output = {'summary': True, 'tallies': False} # Add MGXS Tallies - - # Initialize MGXS library with a finished OpenMC geometry object - mgxs_lib = openmc.mgxs.Library(model.geometry) - - # Pick energy group structure - mgxs_lib.energy_groups = groups - - # Disable transport correction - mgxs_lib.correction = correction - - # Specify needed cross sections for random ray - if correction == 'P0': - mgxs_lib.mgxs_types = ['nu-transport', 'absorption', 'nu-fission', 'fission', - 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi'] - elif correction is None: - mgxs_lib.mgxs_types = ['total', 'absorption', 'nu-fission', 'fission', - 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi'] - - # Specify a "cell" domain type for the cross section tally filters - mgxs_lib.domain_type = "material" - - # Specify the cell domains over which to compute multi-group cross sections - mgxs_lib.domains = model.geometry.get_all_materials().values() - - # Do not compute cross sections on a nuclide-by-nuclide basis - mgxs_lib.by_nuclide = False - - # Check the library - if no errors are raised, then the library is satisfactory. - mgxs_lib.check_library_for_openmc_mgxs() - - # Construct all tallies needed for the multi-group cross section library - mgxs_lib.build_library() - - # Create a "tallies.xml" file for the MGXS Library - mgxs_lib.add_to_tallies(model.tallies, merge=True) - - # Run - statepoint_filename = model.run(cwd=directory) - - # Load MGXS - with openmc.StatePoint(statepoint_filename) as sp: - mgxs_lib.load_from_statepoint(sp) + mgxs_lib = self._auto_generate_mgxs_lib(model, energy_groups, correction, directory, kinetic, num_delayed_groups) names = [mat.name for mat in mgxs_lib.domains] @@ -2106,11 +2126,13 @@ def _generate_stochastic_slab_mgxs( def _generate_material_wise_mgxs( self, - groups: openmc.mgxs.EnergyGroups, + energy_groups: openmc.mgxs.EnergyGroups, nparticles: int, mgxs_path: PathLike, correction: str | None, directory: PathLike, + kinetic: bool | None = None, + num_delayed_groups: int = 0, ) -> None: """Generate a material-wise MGXS library for the model by running the original continuous energy OpenMC simulation of the full material @@ -2124,7 +2146,7 @@ def _generate_material_wise_mgxs( Parameters ---------- - groups : openmc.mgxs.EnergyGroups + energy_groups : openmc.mgxs.EnergyGroups Energy group structure for the MGXS. nparticles : int Number of particles to simulate per batch when generating MGXS. @@ -2135,6 +2157,11 @@ def _generate_material_wise_mgxs( "P0". directory : PathLike Directory to run the simulation in, so as to contain XML files. + kinetic : bool, optional + Flag to indicate if kinetic simulation cross sections are needed. + num_delayed_groups : int, optional + Number of delayed groups for kinetic simulations. + """ model = copy.deepcopy(self) model.tallies = openmc.Tallies() @@ -2146,52 +2173,7 @@ def _generate_material_wise_mgxs( model.settings.output = {'summary': True, 'tallies': False} # Add MGXS Tallies - - # Initialize MGXS library with a finished OpenMC geometry object - mgxs_lib = openmc.mgxs.Library(model.geometry) - - # Pick energy group structure - mgxs_lib.energy_groups = groups - - # Disable transport correction - mgxs_lib.correction = correction - - # Specify needed cross sections for random ray - if correction == 'P0': - mgxs_lib.mgxs_types = [ - 'nu-transport', 'absorption', 'nu-fission', 'fission', - 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' - ] - elif correction is None: - mgxs_lib.mgxs_types = [ - 'total', 'absorption', 'nu-fission', 'fission', - 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' - ] - - # Specify a "cell" domain type for the cross section tally filters - mgxs_lib.domain_type = "material" - - # Specify the cell domains over which to compute multi-group cross sections - mgxs_lib.domains = model.geometry.get_all_materials().values() - - # Do not compute cross sections on a nuclide-by-nuclide basis - mgxs_lib.by_nuclide = False - - # Check the library - if no errors are raised, then the library is satisfactory. - mgxs_lib.check_library_for_openmc_mgxs() - - # Construct all tallies needed for the multi-group cross section library - mgxs_lib.build_library() - - # Create a "tallies.xml" file for the MGXS Library - mgxs_lib.add_to_tallies(model.tallies, merge=True) - - # Run - statepoint_filename = model.run(cwd=directory) - - # Load MGXS - with openmc.StatePoint(statepoint_filename) as sp: - mgxs_lib.load_from_statepoint(sp) + mgxs_lib = self._auto_generate_mgxs_lib(model, energy_groups, correction, directory, kinetic, num_delayed_groups) names = [mat.name for mat in mgxs_lib.domains] @@ -2203,12 +2185,14 @@ def _generate_material_wise_mgxs( def convert_to_multigroup( self, method: str = "material_wise", - groups: str = "CASMO-2", + energy_groups: str = "CASMO-2", nparticles: int = 2000, overwrite_mgxs_library: bool = False, mgxs_path: PathLike = "mgxs.h5", correction: str | None = None, source_energy: openmc.stats.Univariate | None = None, + kinetic: bool | None = None, + num_delayed_groups: int = 0, ): """Convert all materials from continuous energy to multigroup. @@ -2219,7 +2203,7 @@ def convert_to_multigroup( ---------- method : {"material_wise", "stochastic_slab", "infinite_medium"}, optional Method to generate the MGXS. - groups : openmc.mgxs.EnergyGroups or str, optional + energy_groups : openmc.mgxs.EnergyGroups or str, optional Energy group structure for the MGXS or the name of the group structure (based on keys from openmc.mgxs.GROUP_STRUCTURES). nparticles : int, optional @@ -2249,9 +2233,13 @@ def convert_to_multigroup( 'eigenvalue', then a default Watt spectrum source (strength = 0.99) is added. Note that this argument is only used when using the "stochastic_slab" or "infinite_medium" MGXS generation methods. + kinetic : bool, optional + Flag to indicate if kinetic simulation cross sections are needed. + num_delayed_groups : int, optional + Number of delayed groups for kinetic simulations. """ - if isinstance(groups, str): - groups = openmc.mgxs.EnergyGroups(groups) + if isinstance(energy_groups, str): + energy_groups = openmc.mgxs.EnergyGroups(energy_groups) # Do all work (including MGXS generation) in a temporary directory # to avoid polluting the working directory with residual XML files @@ -2278,13 +2266,13 @@ def convert_to_multigroup( if not Path(mgxs_path).is_file() or overwrite_mgxs_library: if method == "infinite_medium": self._generate_infinite_medium_mgxs( - groups, nparticles, mgxs_path, correction, tmpdir, source_energy) + energy_groups, nparticles, mgxs_path, correction, tmpdir, source_energy, kinetic, num_delayed_groups) elif method == "material_wise": self._generate_material_wise_mgxs( - groups, nparticles, mgxs_path, correction, tmpdir) + energy_groups, nparticles, mgxs_path, correction, tmpdir, kinetic, num_delayed_groups) elif method == "stochastic_slab": self._generate_stochastic_slab_mgxs( - groups, nparticles, mgxs_path, correction, tmpdir, source_energy) + energy_groups, nparticles, mgxs_path, correction, tmpdir, source_energy, kinetic, num_delayed_groups) else: raise ValueError( f'MGXS generation method "{method}" not recognized') @@ -2301,6 +2289,17 @@ def convert_to_multigroup( self.settings.energy_mode = 'multi-group' + # If making a set the time step size to 0.01 + if kinetic: + self.settings.kinetic_simulation = True + warnings.warn("Kinetic model. Currently, only the random ray solver" + " supports kinetic simulations. The number of time" + " steps to run and material density transient using " + " openmc.Settings.timestep_parameters['n_timesteps'] " + " and openmc.Material.set_density(), respectively.") + self.settings.timestep_parameters = {'dt': 0.01, 'timestep_units': 's'} + + def convert_to_random_ray(self): """Convert a multigroup model to use random ray. diff --git a/src/material.cpp b/src/material.cpp index 1e848f3f731..156b149caa1 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -137,8 +137,15 @@ Material::Material(pugi::xml_node node) } // Scale density_timeseries_ to the same units as density_ if (density_timeseries_.size() > 0) { - for (double& p : density_timeseries_) + for (double& p : density_timeseries_) { + if (p <= 0) { + fatal_error( + "Zero or negative value detected in material timeseries. This " + "will break any time-dependent simulations. Please fix the " + "density timeseries in your input file. Aborting..."); + } p *= scale_factor; + } // Check that all elements are the same sign. vector zero_vector; diff --git a/tests/regression_tests/random_ray_auto_convert/test.py b/tests/regression_tests/random_ray_auto_convert/test.py index 99a931dce86..ea25ffbd2da 100644 --- a/tests/regression_tests/random_ray_auto_convert/test.py +++ b/tests/regression_tests/random_ray_auto_convert/test.py @@ -27,7 +27,7 @@ def test_random_ray_auto_convert(method): # Convert to a multi-group model model.convert_to_multigroup( - method=method, groups='CASMO-2', nparticles=100, + method=method, energy_groups='CASMO-2', nparticles=100, overwrite_mgxs_library=False, mgxs_path="mgxs.h5" ) diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/__init__.py b/tests/regression_tests/random_ray_auto_convert_kinetic/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/inputs_true.dat new file mode 100644 index 00000000000..4e68307d0a7 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/inputs_true.dat @@ -0,0 +1,69 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + true + +
0.01
+ s + 5 +
+ + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + + + 8 8 + -0.63 -0.63 + 0.63 0.63 + +
+
diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_0.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_0.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_0.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_1.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_1.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_1.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_2.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_2.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_2.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_3.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_3.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_3.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_4.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_4.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_4.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_5.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_5.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_5.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/inputs_true.dat new file mode 100644 index 00000000000..4e68307d0a7 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/inputs_true.dat @@ -0,0 +1,69 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + true + +
0.01
+ s + 5 +
+ + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + + + 8 8 + -0.63 -0.63 + 0.63 0.63 + +
+
diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_0.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_0.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_0.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_1.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_1.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_1.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_2.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_2.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_2.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_3.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_3.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_3.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_4.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_4.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_4.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_5.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_5.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_5.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/inputs_true.dat new file mode 100644 index 00000000000..4e68307d0a7 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/inputs_true.dat @@ -0,0 +1,69 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + true + +
0.01
+ s + 5 +
+ + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + + + 8 8 + -0.63 -0.63 + 0.63 0.63 + +
+
diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_0.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_0.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_0.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_1.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_1.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_1.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_2.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_2.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_2.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_3.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_3.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_3.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_4.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_4.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_4.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_5.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_5.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_5.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py new file mode 100644 index 00000000000..3a79c1d2836 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py @@ -0,0 +1,57 @@ +import os + +import openmc +from openmc.examples import pwr_pin_cell +from openmc import RegularMesh +from openmc.utility_funcs import change_directory +import pytest +import numpy as np + +from tests.testing_harness import KineticTolerantPyAPITestHarness + + +class KineticMGXSTestHarness(KineticTolerantPyAPITestHarness): + def _cleanup(self): + super()._cleanup() + f = 'mgxs.h5' + if os.path.exists(f): + os.remove(f) + + +@pytest.mark.parametrize("method", ["material_wise", "stochastic_slab", "infinite_medium"]) +def test_random_ray_auto_convert(method): + with change_directory(method): + openmc.reset_auto_ids() + + # Start with a normal continuous energy model + model = pwr_pin_cell() + + # Convert to a multi-group model + model.convert_to_multigroup( + method=method, energy_groups='CASMO-2', nparticles=30, + overwrite_mgxs_library=False, mgxs_path="mgxs.h5", kinetic=True, + num_delayed_groups=6 + ) + + model.settings.timestep_parameters['n_timesteps'] = 5 + density_timeseries = np.linspace(1, 0.95, 100) + model.materials[2].set_density('macro', density=1.0, density_timeseries=density_timeseries) + + # Convert to a random ray model + model.convert_to_random_ray() + + # Set the number of particles + model.settings.particles = 100 + + # Overlay an basic 8x8 mesh + n = 8 + mesh = RegularMesh() + mesh.dimension = (n, n) + bbox = model.geometry.bounding_box + mesh.lower_left = (bbox.lower_left[0], bbox.lower_left[1]) + mesh.upper_right = (bbox.upper_right[0], bbox.upper_right[1]) + model.settings.random_ray['source_region_meshes'] = [ + (mesh, [model.geometry.root_universe])] + + harness = KineticMGXSTestHarness(model, 6) + harness.main() diff --git a/tests/regression_tests/random_ray_auto_convert_source_energy/test.py b/tests/regression_tests/random_ray_auto_convert_source_energy/test.py index bb9119d8953..1e0ab315eec 100644 --- a/tests/regression_tests/random_ray_auto_convert_source_energy/test.py +++ b/tests/regression_tests/random_ray_auto_convert_source_energy/test.py @@ -38,7 +38,7 @@ def test_random_ray_auto_convert_source_energy(method, source_type): # Convert to a multi-group model model.convert_to_multigroup( - method=method, groups='CASMO-8', nparticles=100, + method=method, energy_groups='CASMO-8', nparticles=100, overwrite_mgxs_library=False, mgxs_path="mgxs.h5", source_energy=source_energy ) From 521cbc0a695cd3d3e128fc95f6b01085f85e17dc Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 31 Dec 2025 18:09:59 -0600 Subject: [PATCH 15/64] Add time-dependent mesh regression test --- .../random_ray_k_eff_kinetic/test.py | 2 +- .../random_ray_k_eff_mesh_kinetic/__init__.py | 0 .../inputs_true.dat | 137 ++++++++++ .../results_true_0.dat | 236 ++++++++++++++++++ .../results_true_1.dat | 236 ++++++++++++++++++ .../results_true_2.dat | 236 ++++++++++++++++++ .../results_true_3.dat | 236 ++++++++++++++++++ .../results_true_4.dat | 236 ++++++++++++++++++ .../results_true_5.dat | 236 ++++++++++++++++++ .../random_ray_k_eff_mesh_kinetic/test.py | 39 +++ 10 files changed, 1593 insertions(+), 1 deletion(-) create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/__init__.py create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_kinetic/test.py index 93f87535786..8f17d6f5412 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_kinetic/test.py @@ -26,5 +26,5 @@ def test_random_ray_time_dependent(time_method): model.settings.random_ray['time_method'] = time_method model.settings.batches = 400 model.settings.inactive = 200 - harness = KineticMGXSTestHarness(model, 6)# 21) + harness = KineticMGXSTestHarness(model, 6) harness.main() diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/__init__.py b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/inputs_true.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/inputs_true.dat new file mode 100644 index 00000000000..2b3fe3bc8c0 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/inputs_true.dat @@ -0,0 +1,137 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.126 0.126 + 10 10 + -0.63 -0.63 + +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 +3 3 3 3 3 3 3 3 3 3 + + + 1.26 1.26 + 2 2 + -1.26 -1.26 + +2 2 +2 5 + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 400 + 200 + true + +
0.01
+ 5 + s +
+ multi-group + + 100.0 + 20.0 + + + -1.26 -1.26 -1 1.26 1.26 1 + + + true + 3 + + + + + + + + 40 40 + -1.26 -1.26 + 1.26 1.26 + +
+ + + 2 2 + -1.26 -1.26 + 1.26 1.26 + + + 1 + + + 1e-05 0.0635 10.0 100.0 1000.0 500000.0 1000000.0 20000000.0 + + + 1 2 3 4 5 6 7 8 + + + 1 2 + flux fission nu-fission + analog + + + 1 3 + precursors + + +
diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_0.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_0.dat new file mode 100644 index 00000000000..b7863f78005 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_0.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.829734E+01 +2.332560E+01 +2.535005E+01 +3.214213E+00 +6.169695E+01 +1.903901E+01 +4.338057E+01 +9.409840E+00 +6.449747E+00 +2.080191E-01 +1.569739E+01 +1.232177E+00 +2.952526E+01 +4.358735E+00 +9.562385E-01 +4.572024E-03 +2.327293E+00 +2.708184E-02 +3.764580E+01 +7.086116E+00 +1.253550E+00 +7.857205E-03 +3.050891E+00 +4.654123E-02 +9.736564E+01 +4.740043E+01 +1.143250E+00 +6.535133E-03 +2.782476E+00 +3.871104E-02 +2.108671E+02 +2.223325E+02 +3.217847E-01 +5.177688E-04 +7.962336E-01 +3.170197E-03 +1.121239E+02 +6.287031E+01 +1.520419E+00 +1.156430E-02 +4.228968E+00 +8.946678E-02 +1.128474E+02 +6.367345E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.341703E+01 +1.426702E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.110513E+01 +4.837669E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.101197E+01 +8.409994E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.815385E+01 +4.817107E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.887447E+02 +1.781287E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.671216E+01 +4.678026E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.892637E+01 +1.736282E+01 +2.179942E+01 +2.376644E+00 +5.305542E+01 +1.407777E+01 +4.076286E+01 +8.308305E+00 +6.059136E+00 +1.835802E-01 +1.474673E+01 +1.087416E+00 +2.909448E+01 +4.232468E+00 +9.431274E-01 +4.447499E-03 +2.295383E+00 +2.634424E-02 +3.699617E+01 +6.843656E+00 +1.232522E+00 +7.595798E-03 +2.999711E+00 +4.499282E-02 +9.745207E+01 +4.748461E+01 +1.145047E+00 +6.555693E-03 +2.786851E+00 +3.883283E-02 +2.151446E+02 +2.314420E+02 +3.282013E-01 +5.386136E-04 +8.121113E-01 +3.297825E-03 +1.139091E+02 +6.488702E+01 +1.540814E+00 +1.187500E-02 +4.285697E+00 +9.187046E-02 +6.816479E+01 +2.323491E+01 +2.537715E+01 +3.221014E+00 +6.176291E+01 +1.907929E+01 +4.333813E+01 +9.391406E+00 +6.462978E+00 +2.088716E-01 +1.572960E+01 +1.237227E+00 +2.951601E+01 +4.356011E+00 +9.587693E-01 +4.596260E-03 +2.333452E+00 +2.722540E-02 +3.763313E+01 +7.081357E+00 +1.256873E+00 +7.898901E-03 +3.058977E+00 +4.678821E-02 +9.737405E+01 +4.740862E+01 +1.146696E+00 +6.574588E-03 +2.790864E+00 +3.894475E-02 +2.109852E+02 +2.225806E+02 +3.228462E-01 +5.211850E-04 +7.988604E-01 +3.191114E-03 +1.121527E+02 +6.290039E+01 +1.524613E+00 +1.162754E-02 +4.240634E+00 +8.995597E-02 +tally 2: +3.727239E-01 +6.947125E-04 +8.048913E-01 +3.239702E-03 +3.094690E-01 +4.789219E-04 +2.194466E-01 +2.408177E-04 +1.708586E-01 +1.459836E-04 +2.305111E-02 +2.657139E-06 +8.000274E-03 +3.200666E-07 +1.273116E-03 +8.105247E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327663E-01 +5.537155E-04 +7.186034E-01 +2.582180E-03 +2.762925E-01 +3.817212E-04 +1.959210E-01 +1.919420E-04 +1.525418E-01 +1.163551E-04 +2.057993E-02 +2.117853E-06 +7.142610E-03 +2.551067E-07 +1.136632E-03 +6.460228E-09 +3.721919E-01 +6.927141E-04 +8.037423E-01 +3.230382E-03 +3.090272E-01 +4.775443E-04 +2.191334E-01 +2.401250E-04 +1.706146E-01 +1.455636E-04 +2.301820E-02 +2.649495E-06 +7.988854E-03 +3.191459E-07 +1.271298E-03 +8.081932E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat new file mode 100644 index 00000000000..53b4b39f8df --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.835752E+01 +2.336672E+01 +2.537238E+01 +3.219879E+00 +6.175130E+01 +1.907257E+01 +4.341875E+01 +9.426410E+00 +6.455423E+00 +2.083854E-01 +1.571121E+01 +1.234346E+00 +2.955121E+01 +4.366400E+00 +9.570789E-01 +4.580063E-03 +2.329338E+00 +2.712946E-02 +3.767887E+01 +7.098573E+00 +1.254652E+00 +7.871018E-03 +3.053571E+00 +4.662305E-02 +9.745113E+01 +4.748370E+01 +1.144254E+00 +6.546615E-03 +2.784919E+00 +3.877905E-02 +2.110519E+02 +2.227224E+02 +3.220667E-01 +5.186767E-04 +7.969314E-01 +3.175756E-03 +1.122226E+02 +6.298103E+01 +1.521757E+00 +1.158467E-02 +4.232690E+00 +8.962434E-02 +1.129469E+02 +6.378582E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.346406E+01 +1.429216E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.113246E+01 +4.846176E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.104800E+01 +8.424776E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.824002E+01 +4.825568E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.889102E+02 +1.784412E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.679727E+01 +4.686264E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.897826E+01 +1.739342E+01 +2.181861E+01 +2.380831E+00 +5.310214E+01 +1.410257E+01 +4.079873E+01 +8.322934E+00 +6.064468E+00 +1.839035E-01 +1.475970E+01 +1.089331E+00 +2.912005E+01 +4.239911E+00 +9.439562E-01 +4.455320E-03 +2.297401E+00 +2.639056E-02 +3.702868E+01 +6.855687E+00 +1.233605E+00 +7.609153E-03 +3.002347E+00 +4.507192E-02 +9.753763E+01 +4.756803E+01 +1.146053E+00 +6.567210E-03 +2.789297E+00 +3.890105E-02 +2.153331E+02 +2.318478E+02 +3.284889E-01 +5.395577E-04 +8.128227E-01 +3.303606E-03 +1.140093E+02 +6.500127E+01 +1.542170E+00 +1.189591E-02 +4.289468E+00 +9.203222E-02 +6.822483E+01 +2.327586E+01 +2.539950E+01 +3.226689E+00 +6.181730E+01 +1.911291E+01 +4.337627E+01 +9.407943E+00 +6.468666E+00 +2.092394E-01 +1.574344E+01 +1.239405E+00 +2.954195E+01 +4.363671E+00 +9.596119E-01 +4.604342E-03 +2.335503E+00 +2.727327E-02 +3.766620E+01 +7.093806E+00 +1.257977E+00 +7.912788E-03 +3.061664E+00 +4.687047E-02 +9.745954E+01 +4.749190E+01 +1.147703E+00 +6.586138E-03 +2.793314E+00 +3.901316E-02 +2.111701E+02 +2.229707E+02 +3.231290E-01 +5.220983E-04 +7.995600E-01 +3.196706E-03 +1.122513E+02 +6.301114E+01 +1.525955E+00 +1.164801E-02 +4.244366E+00 +9.011434E-02 +tally 2: +3.727210E-01 +6.946049E-04 +8.048851E-01 +3.239200E-03 +3.094666E-01 +4.788479E-04 +2.194451E-01 +2.407807E-04 +1.708575E-01 +1.459614E-04 +2.305100E-02 +2.656744E-06 +8.000275E-03 +3.200220E-07 +1.273127E-03 +8.104266E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327638E-01 +5.536587E-04 +7.185980E-01 +2.581916E-03 +2.762905E-01 +3.816822E-04 +1.959196E-01 +1.919225E-04 +1.525408E-01 +1.163435E-04 +2.057984E-02 +2.117649E-06 +7.142612E-03 +2.550845E-07 +1.136643E-03 +6.459783E-09 +3.721891E-01 +6.926236E-04 +8.037363E-01 +3.229960E-03 +3.090249E-01 +4.774820E-04 +2.191319E-01 +2.400939E-04 +1.706136E-01 +1.455450E-04 +2.301810E-02 +2.649166E-06 +7.988856E-03 +3.191091E-07 +1.271310E-03 +8.081148E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat new file mode 100644 index 00000000000..23ac3db9a86 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.841002E+01 +2.340263E+01 +2.539209E+01 +3.224884E+00 +6.179927E+01 +1.910222E+01 +4.345795E+01 +9.443438E+00 +6.461264E+00 +2.087626E-01 +1.572542E+01 +1.236581E+00 +2.958149E+01 +4.375353E+00 +9.580602E-01 +4.589460E-03 +2.331727E+00 +2.718512E-02 +3.771759E+01 +7.113168E+00 +1.255942E+00 +7.887213E-03 +3.056711E+00 +4.671898E-02 +9.755563E+01 +4.758560E+01 +1.145481E+00 +6.560664E-03 +2.787906E+00 +3.886227E-02 +2.112846E+02 +2.232138E+02 +3.224201E-01 +5.198158E-04 +7.978060E-01 +3.182731E-03 +1.123398E+02 +6.311269E+01 +1.523334E+00 +1.160868E-02 +4.237076E+00 +8.981014E-02 +1.130415E+02 +6.389267E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.351354E+01 +1.431862E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116478E+01 +4.856241E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.109112E+01 +8.442486E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.834626E+01 +4.836011E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891192E+02 +1.788363E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.689929E+01 +4.696147E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.902247E+01 +1.741950E+01 +2.183516E+01 +2.384443E+00 +5.314240E+01 +1.412397E+01 +4.083553E+01 +8.337955E+00 +6.069953E+00 +1.842363E-01 +1.477305E+01 +1.091302E+00 +2.914979E+01 +4.248577E+00 +9.449213E-01 +4.464434E-03 +2.299749E+00 +2.644455E-02 +3.706648E+01 +6.869692E+00 +1.234866E+00 +7.624718E-03 +3.005416E+00 +4.516412E-02 +9.764189E+01 +4.766977E+01 +1.147278E+00 +6.581260E-03 +2.792280E+00 +3.898427E-02 +2.155703E+02 +2.323588E+02 +3.288490E-01 +5.407413E-04 +8.137137E-01 +3.310853E-03 +1.141283E+02 +6.513702E+01 +1.543766E+00 +1.192054E-02 +4.293907E+00 +9.222278E-02 +6.827719E+01 +2.331160E+01 +2.541921E+01 +3.231700E+00 +6.186528E+01 +1.914259E+01 +4.341541E+01 +9.424932E+00 +6.474517E+00 +2.096181E-01 +1.575768E+01 +1.241648E+00 +2.957222E+01 +4.372617E+00 +9.605956E-01 +4.613787E-03 +2.337897E+00 +2.732922E-02 +3.770489E+01 +7.108388E+00 +1.259270E+00 +7.929064E-03 +3.064812E+00 +4.696688E-02 +9.756404E+01 +4.759381E+01 +1.148934E+00 +6.600271E-03 +2.796309E+00 +3.909688E-02 +2.114029E+02 +2.234627E+02 +3.234836E-01 +5.232451E-04 +8.004376E-01 +3.203727E-03 +1.123686E+02 +6.314287E+01 +1.527536E+00 +1.167216E-02 +4.248764E+00 +9.030121E-02 +tally 2: +3.727211E-01 +6.946052E-04 +8.048854E-01 +3.239203E-03 +3.094668E-01 +4.788484E-04 +2.194454E-01 +2.407815E-04 +1.708581E-01 +1.459624E-04 +2.305119E-02 +2.656788E-06 +8.000435E-03 +3.200348E-07 +1.273182E-03 +8.104960E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327638E-01 +5.536589E-04 +7.185983E-01 +2.581918E-03 +2.762906E-01 +3.816826E-04 +1.959200E-01 +1.919231E-04 +1.525414E-01 +1.163444E-04 +2.058001E-02 +2.117684E-06 +7.142754E-03 +2.550947E-07 +1.136691E-03 +6.460334E-09 +3.721891E-01 +6.926238E-04 +8.037366E-01 +3.229963E-03 +3.090251E-01 +4.774825E-04 +2.191322E-01 +2.400946E-04 +1.706142E-01 +1.455461E-04 +2.301829E-02 +2.649209E-06 +7.989016E-03 +3.191219E-07 +1.271365E-03 +8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat new file mode 100644 index 00000000000..e808b21c1bd --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.846307E+01 +2.343894E+01 +2.541200E+01 +3.229943E+00 +6.184772E+01 +1.913218E+01 +4.349756E+01 +9.460661E+00 +6.467166E+00 +2.091442E-01 +1.573979E+01 +1.238841E+00 +2.961208E+01 +4.384409E+00 +9.590517E-01 +4.598964E-03 +2.334140E+00 +2.724142E-02 +3.775670E+01 +7.127929E+00 +1.257245E+00 +7.903591E-03 +3.059883E+00 +4.681599E-02 +9.766116E+01 +4.768861E+01 +1.146720E+00 +6.574867E-03 +2.790922E+00 +3.894640E-02 +2.115194E+02 +2.237102E+02 +3.227768E-01 +5.209666E-04 +7.986886E-01 +3.189776E-03 +1.124581E+02 +6.324566E+01 +1.524925E+00 +1.163294E-02 +4.241501E+00 +8.999778E-02 +1.131371E+02 +6.400074E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.356354E+01 +1.434539E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.119742E+01 +4.866419E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.113468E+01 +8.460394E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.845352E+01 +4.846566E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.893301E+02 +1.792354E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.700220E+01 +4.706127E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.906713E+01 +1.744587E+01 +2.185187E+01 +2.388094E+00 +5.318307E+01 +1.414559E+01 +4.087271E+01 +8.353147E+00 +6.075495E+00 +1.845728E-01 +1.478654E+01 +1.093296E+00 +2.917985E+01 +4.257342E+00 +9.458963E-01 +4.473653E-03 +2.302122E+00 +2.649915E-02 +3.710467E+01 +6.883857E+00 +1.236140E+00 +7.640460E-03 +3.008517E+00 +4.525737E-02 +9.774718E+01 +4.777263E+01 +1.148515E+00 +6.595464E-03 +2.795291E+00 +3.906841E-02 +2.158096E+02 +2.328751E+02 +3.292123E-01 +5.419369E-04 +8.146128E-01 +3.318173E-03 +1.142483E+02 +6.527411E+01 +1.545376E+00 +1.194541E-02 +4.298386E+00 +9.241523E-02 +6.833010E+01 +2.334774E+01 +2.543913E+01 +3.236766E+00 +6.191375E+01 +1.917260E+01 +4.345497E+01 +9.442115E+00 +6.480429E+00 +2.100011E-01 +1.577207E+01 +1.243917E+00 +2.960280E+01 +4.381666E+00 +9.615896E-01 +4.623340E-03 +2.340316E+00 +2.738581E-02 +3.774398E+01 +7.123136E+00 +1.260577E+00 +7.945526E-03 +3.067991E+00 +4.706439E-02 +9.766957E+01 +4.769682E+01 +1.150177E+00 +6.614557E-03 +2.799334E+00 +3.918151E-02 +2.116379E+02 +2.239597E+02 +3.238415E-01 +5.244036E-04 +8.013232E-01 +3.210820E-03 +1.124869E+02 +6.327591E+01 +1.529132E+00 +1.169655E-02 +4.253202E+00 +9.048993E-02 +tally 2: +3.727212E-01 +6.946055E-04 +8.048859E-01 +3.239206E-03 +3.094670E-01 +4.788493E-04 +2.194460E-01 +2.407828E-04 +1.708591E-01 +1.459642E-04 +2.305151E-02 +2.656862E-06 +8.000704E-03 +3.200564E-07 +1.273273E-03 +8.106118E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327639E-01 +5.536592E-04 +7.185987E-01 +2.581921E-03 +2.762909E-01 +3.816833E-04 +1.959205E-01 +1.919242E-04 +1.525423E-01 +1.163458E-04 +2.058029E-02 +2.117742E-06 +7.142994E-03 +2.551118E-07 +1.136772E-03 +6.461253E-09 +3.721892E-01 +6.926241E-04 +8.037371E-01 +3.229967E-03 +3.090254E-01 +4.774833E-04 +2.191328E-01 +2.400960E-04 +1.706153E-01 +1.455479E-04 +2.301861E-02 +2.649283E-06 +7.989285E-03 +3.191434E-07 +1.271455E-03 +8.082994E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat new file mode 100644 index 00000000000..4e969c448a1 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.851748E+01 +2.347622E+01 +2.543241E+01 +3.235134E+00 +6.189740E+01 +1.916293E+01 +4.353803E+01 +9.478272E+00 +6.473195E+00 +2.095344E-01 +1.575446E+01 +1.241152E+00 +2.964326E+01 +4.393647E+00 +9.600620E-01 +4.608659E-03 +2.336599E+00 +2.729884E-02 +3.779657E+01 +7.142988E+00 +1.258573E+00 +7.920298E-03 +3.063115E+00 +4.691496E-02 +9.776864E+01 +4.779362E+01 +1.147982E+00 +6.589347E-03 +2.793994E+00 +3.903217E-02 +2.117585E+02 +2.242162E+02 +3.231400E-01 +5.221396E-04 +7.995873E-01 +3.196958E-03 +1.125787E+02 +6.338132E+01 +1.526546E+00 +1.165769E-02 +4.246011E+00 +9.018927E-02 +1.132349E+02 +6.411143E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361459E+01 +1.437275E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123068E+01 +4.876800E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117905E+01 +8.478656E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856275E+01 +4.857326E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895448E+02 +1.796421E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710707E+01 +4.716308E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911296E+01 +1.747295E+01 +2.186901E+01 +2.391843E+00 +5.322479E+01 +1.416780E+01 +4.091071E+01 +8.368683E+00 +6.081156E+00 +1.849170E-01 +1.480032E+01 +1.095334E+00 +2.921048E+01 +4.266284E+00 +9.468900E-01 +4.483057E-03 +2.304541E+00 +2.655486E-02 +3.714360E+01 +6.898309E+00 +1.237438E+00 +7.656520E-03 +3.011677E+00 +4.535250E-02 +9.785441E+01 +4.787751E+01 +1.149776E+00 +6.609946E-03 +2.798358E+00 +3.915419E-02 +2.160533E+02 +2.334013E+02 +3.295823E-01 +5.431557E-04 +8.155283E-01 +3.325636E-03 +1.143707E+02 +6.541399E+01 +1.547017E+00 +1.197080E-02 +4.302951E+00 +9.261162E-02 +6.838436E+01 +2.338484E+01 +2.545955E+01 +3.241965E+00 +6.196345E+01 +1.920339E+01 +4.349538E+01 +9.459686E+00 +6.486469E+00 +2.103927E-01 +1.578677E+01 +1.246237E+00 +2.963397E+01 +4.390897E+00 +9.626024E-01 +4.633085E-03 +2.342782E+00 +2.744353E-02 +3.778382E+01 +7.138180E+00 +1.261908E+00 +7.962318E-03 +3.071232E+00 +4.716385E-02 +9.777704E+01 +4.780184E+01 +1.151442E+00 +6.629123E-03 +2.802415E+00 +3.926779E-02 +2.118771E+02 +2.244662E+02 +3.242060E-01 +5.255844E-04 +8.022250E-01 +3.218050E-03 +1.126075E+02 +6.341165E+01 +1.530758E+00 +1.172144E-02 +4.257726E+00 +9.068250E-02 +tally 2: +3.727213E-01 +6.946060E-04 +8.048865E-01 +3.239212E-03 +3.094674E-01 +4.788505E-04 +2.194469E-01 +2.407847E-04 +1.708606E-01 +1.459668E-04 +2.305197E-02 +2.656966E-06 +8.001084E-03 +3.200867E-07 +1.273400E-03 +8.107735E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327641E-01 +5.536596E-04 +7.185993E-01 +2.581925E-03 +2.762912E-01 +3.816842E-04 +1.959213E-01 +1.919257E-04 +1.525436E-01 +1.163478E-04 +2.058070E-02 +2.117825E-06 +7.143330E-03 +2.551359E-07 +1.136885E-03 +6.462534E-09 +3.721894E-01 +6.926247E-04 +8.037378E-01 +3.229972E-03 +3.090257E-01 +4.774846E-04 +2.191337E-01 +2.400979E-04 +1.706168E-01 +1.455504E-04 +2.301907E-02 +2.649387E-06 +7.989664E-03 +3.191736E-07 +1.271582E-03 +8.084606E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat new file mode 100644 index 00000000000..12b4941ec4b --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.857313E+01 +2.351436E+01 +2.545329E+01 +3.240447E+00 +6.194820E+01 +1.919440E+01 +4.357930E+01 +9.496248E+00 +6.479343E+00 +2.099326E-01 +1.576943E+01 +1.243511E+00 +2.967500E+01 +4.403058E+00 +9.610902E-01 +4.618536E-03 +2.339101E+00 +2.735735E-02 +3.783713E+01 +7.158327E+00 +1.259925E+00 +7.937318E-03 +3.066405E+00 +4.701577E-02 +9.787794E+01 +4.790055E+01 +1.149266E+00 +6.604089E-03 +2.797118E+00 +3.911950E-02 +2.120015E+02 +2.247312E+02 +3.235092E-01 +5.233335E-04 +8.005009E-01 +3.204269E-03 +1.127013E+02 +6.351950E+01 +1.528196E+00 +1.168290E-02 +4.250600E+00 +9.038432E-02 +1.133347E+02 +6.422456E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366663E+01 +1.440067E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126452E+01 +4.887375E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122419E+01 +8.497255E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867383E+01 +4.868280E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897631E+02 +1.800561E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721376E+01 +4.726677E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915985E+01 +1.750068E+01 +2.188655E+01 +2.395681E+00 +5.326748E+01 +1.419053E+01 +4.094945E+01 +8.384540E+00 +6.086929E+00 +1.852683E-01 +1.481437E+01 +1.097415E+00 +2.924165E+01 +4.275395E+00 +9.479013E-01 +4.492638E-03 +2.307002E+00 +2.661161E-02 +3.718322E+01 +6.913032E+00 +1.238760E+00 +7.672882E-03 +3.014894E+00 +4.544942E-02 +9.796347E+01 +4.798428E+01 +1.151057E+00 +6.624691E-03 +2.801478E+00 +3.924154E-02 +2.163011E+02 +2.339368E+02 +3.299585E-01 +5.443962E-04 +8.164591E-01 +3.333231E-03 +1.144952E+02 +6.555646E+01 +1.548688E+00 +1.199666E-02 +4.307596E+00 +9.281167E-02 +6.843986E+01 +2.342281E+01 +2.548043E+01 +3.247284E+00 +6.201426E+01 +1.923491E+01 +4.353660E+01 +9.477620E+00 +6.492628E+00 +2.107925E-01 +1.580176E+01 +1.248604E+00 +2.966568E+01 +4.400301E+00 +9.636332E-01 +4.643013E-03 +2.345290E+00 +2.750234E-02 +3.782436E+01 +7.153506E+00 +1.263263E+00 +7.979424E-03 +3.074529E+00 +4.726518E-02 +9.788634E+01 +4.790877E+01 +1.152730E+00 +6.643953E-03 +2.805547E+00 +3.935564E-02 +2.121203E+02 +2.249818E+02 +3.245765E-01 +5.267864E-04 +8.031417E-01 +3.225410E-03 +1.127302E+02 +6.354990E+01 +1.532413E+00 +1.174680E-02 +4.262329E+00 +9.087866E-02 +tally 2: +3.727215E-01 +6.946067E-04 +8.048874E-01 +3.239219E-03 +3.094679E-01 +4.788521E-04 +2.194480E-01 +2.407872E-04 +1.708625E-01 +1.459700E-04 +2.305255E-02 +2.657101E-06 +8.001572E-03 +3.201258E-07 +1.273562E-03 +8.109799E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327642E-01 +5.536601E-04 +7.186001E-01 +2.581931E-03 +2.762917E-01 +3.816855E-04 +1.959223E-01 +1.919277E-04 +1.525453E-01 +1.163504E-04 +2.058122E-02 +2.117932E-06 +7.143764E-03 +2.551668E-07 +1.137028E-03 +6.464168E-09 +3.721896E-01 +6.926253E-04 +8.037386E-01 +3.229979E-03 +3.090263E-01 +4.774861E-04 +2.191348E-01 +2.401004E-04 +1.706187E-01 +1.455537E-04 +2.301965E-02 +2.649522E-06 +7.990151E-03 +3.192126E-07 +1.271744E-03 +8.086663E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py new file mode 100644 index 00000000000..d18951cf3cb --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py @@ -0,0 +1,39 @@ +import os + +import openmc +from openmc.examples import random_ray_lattice + +from tests.testing_harness import KineticTolerantPyAPITestHarness + + +class KineticMGXSTestHarness(KineticTolerantPyAPITestHarness): + def _cleanup(self): + super()._cleanup() + f = 'mgxs.h5' + if os.path.exists(f): + os.remove(f) + + +def test_random_ray_k_eff_mesh(): + model = random_ray_lattice(kinetic=True) + model.settings.timestep_parameters['n_timesteps'] = 5 + model.settings.batches = 400 + model.settings.inactive = 200 + + # The model already has some geometrical subdivisions + # up to a 10x10 grid in the moderator region. So, we + # increase the resolution 40x40 applied over the full + # 2x2 lattice. + pitch = 1.26 + dim = 40 + mesh = openmc.RegularMesh() + mesh.dimension = (dim, dim) + mesh.lower_left = (-pitch, -pitch) + mesh.upper_right = (pitch, pitch) + + root = model.geometry.root_universe + + model.settings.random_ray['source_region_meshes'] = [(mesh, [root])] + + harness = KineticMGXSTestHarness(model, 6) + harness.main() From 326b71796942c5730f13f4980838e67a9e60f36a Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 31 Dec 2025 18:14:22 -0600 Subject: [PATCH 16/64] add blurb about kinetic automagic setup --- docs/source/usersguide/random_ray.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/source/usersguide/random_ray.rst b/docs/source/usersguide/random_ray.rst index 382381a9eea..111d58065c9 100644 --- a/docs/source/usersguide/random_ray.rst +++ b/docs/source/usersguide/random_ray.rst @@ -640,7 +640,7 @@ model to use these multigroup cross sections. An example is given below:: # Assume we already have a working continuous energy model model.convert_to_multigroup( method="material_wise", - groups="CASMO-2", + energy_groups="CASMO-2", nparticles=2000, overwrite_mgxs_library=False, mgxs_path="mgxs.h5", @@ -707,6 +707,11 @@ generation and use an existing library file. with a :math:`\rho` default value of 1.0, which can be adjusted with the ``settings.random_ray['diagonal_stabilization_rho']`` parameter. +.. note:: + Cross sections for kinetic simulations may be generating by passing the + ``kinetic`` parameter as ``True``. Delay groups may be specified with an additional + parameter, ``num_delayed_group``, which by default is zero. + When generating MGXS data with either the ``stochastic_slab`` or ``infinite_medium`` methods, by default the simulation will use a uniform source distribution spread evenly over all energy groups. This ensures that all energy From 808818dcd47884ff5872a0cdc8ff6d9bf24b71e7 Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 31 Dec 2025 18:33:02 -0600 Subject: [PATCH 17/64] change all source quantities back to floats --- include/openmc/random_ray/random_ray.h | 2 +- include/openmc/random_ray/source_region.h | 94 +++++++++++------------ src/random_ray/flat_source_domain.cpp | 15 ++-- 3 files changed, 56 insertions(+), 55 deletions(-) diff --git a/include/openmc/random_ray/random_ray.h b/include/openmc/random_ray/random_ray.h index c5c2e6c3f86..eb879585e3e 100644 --- a/include/openmc/random_ray/random_ray.h +++ b/include/openmc/random_ray/random_ray.h @@ -93,7 +93,7 @@ class RandomRay : public Particle { //--------------------------------------------------------------------------- // Private data members for kinetic simulations - vector delta_psi_prime_; + vector delta_psi_prime_; }; // class RandomRay diff --git a/include/openmc/random_ray/source_region.h b/include/openmc/random_ray/source_region.h index a708029cee7..0fd4ce44c4a 100644 --- a/include/openmc/random_ray/source_region.h +++ b/include/openmc/random_ray/source_region.h @@ -178,9 +178,9 @@ class SourceRegionHandle { // Energy group-wise 1D arrays double* scalar_flux_old_; double* scalar_flux_new_; - double* source_; - double* source_final_; - double* external_source_; + float* source_; + float* source_final_; + float* external_source_; double* scalar_flux_final_; MomentArray* source_gradients_; @@ -197,7 +197,7 @@ class SourceRegionHandle { // Public Data Members for kinetic simulations // Energy group-wise 1D time-derivative arrays - double* source_time_derivative_; + float* source_time_derivative_; double* scalar_flux_time_derivative_2_; // Delay group-wise 1D arrays @@ -215,7 +215,7 @@ class SourceRegionHandle { // Energy group-wise 1D RHS BD arrays double* scalar_flux_rhs_bd_; - double* source_rhs_bd_; + float* source_rhs_bd_; double* scalar_flux_rhs_bd_2_; // Delay group-wise 1D RHS BD arrays @@ -308,14 +308,14 @@ class SourceRegionHandle { double& scalar_flux_final(int g) { return scalar_flux_final_[g]; } const double scalar_flux_final(int g) const { return scalar_flux_final_[g]; } - double& source(int g) { return source_[g]; } - const double source(int g) const { return source_[g]; } + float& source(int g) { return source_[g]; } + const float source(int g) const { return source_[g]; } - double& source_final(int g) { return source_final_[g]; } - const double source_final(int g) const { return source_final_[g]; } + float& source_final(int g) { return source_final_[g]; } + const float source_final(int g) const { return source_final_[g]; } - double& external_source(int g) { return external_source_[g]; } - const double external_source(int g) const { return external_source_[g]; } + float& external_source(int g) { return external_source_[g]; } + const float external_source(int g) const { return external_source_[g]; } MomentArray& source_gradients(int g) { return source_gradients_[g]; } const MomentArray source_gradients(int g) const @@ -343,8 +343,8 @@ class SourceRegionHandle { //--------------------------------------------------------------------------- // Public Accessors for kinetic simulations - double& source_time_derivative(int g) { return source_time_derivative_[g]; } - const double source_time_derivative(int g) const + float& source_time_derivative(int g) { return source_time_derivative_[g]; } + const float source_time_derivative(int g) const { return source_time_derivative_[g]; } @@ -394,8 +394,8 @@ class SourceRegionHandle { return scalar_flux_rhs_bd_[g]; } - double& source_rhs_bd(int g) { return source_rhs_bd_[g]; } - const double source_rhs_bd(int g) const { return source_rhs_bd_[g]; } + float& source_rhs_bd(int g) { return source_rhs_bd_[g]; } + const float source_rhs_bd(int g) const { return source_rhs_bd_[g]; } double& scalar_flux_rhs_bd_2(int g) { return scalar_flux_rhs_bd_2_[g]; } const double scalar_flux_rhs_bd_2(int g) const @@ -471,9 +471,9 @@ class SourceRegion { scalar_flux_old_; //!< The scalar flux from the previous iteration vector scalar_flux_new_; //!< The scalar flux from the current iteration - vector + vector source_; //!< The total source term (fission + scattering + external) - vector external_source_; //!< The external source term + vector external_source_; //!< The external source term vector scalar_flux_final_; //!< The scalar flux accumulated over all //!< active iterations (used for plotting, //!< computing adjoint sources, or @@ -499,11 +499,11 @@ class SourceRegion { // Public Data Members for kinetic simulations // Energy group-wise 1D time-dependent arrrays - vector source_final_; //!< The total source accumulated over all + vector source_final_; //!< The total source accumulated over all //!< active iterations (used for SDP) // Energy group-wise 1D derivative arrays - vector source_time_derivative_; //!< The time derivative of the + vector source_time_derivative_; //!< The time derivative of the //!< source (used for SDP) vector scalar_flux_time_derivative_2_; //!< The 2nd order time //!< derivative of the scalar @@ -544,9 +544,9 @@ class SourceRegion { //!< timesteps. Used to compute the total scalar flux //!< time derivative for both TI and SDP time-dependent //!< simulations - vector source_rhs_bd_; //!< RHS derivative for the neutron source from - //!< previous timesteps Used for compute the - //!< total neutron source derivative for SDP + vector source_rhs_bd_; //!< RHS derivative for the neutron source from + //!< previous timesteps Used for compute the + //!< total neutron source derivative for SDP vector scalar_flux_rhs_bd_2_; //!< 2nd order RHS derivative for the scalar flux //!< from previous timesteps. Used to compute the @@ -742,32 +742,32 @@ class SourceRegionContainer { return scalar_flux_final_[se]; } - double& source(int64_t sr, int g) { return source_[index(sr, g)]; } - const double source(int64_t sr, int g) const { return source_[index(sr, g)]; } - double& source(int64_t se) { return source_[se]; } - const double source(int64_t se) const { return source_[se]; } + float& source(int64_t sr, int g) { return source_[index(sr, g)]; } + const float source(int64_t sr, int g) const { return source_[index(sr, g)]; } + float& source(int64_t se) { return source_[se]; } + const float source(int64_t se) const { return source_[se]; } - double& source_final(int64_t sr, int g) + float& source_final(int64_t sr, int g) { return source_final_[index(sr, g)]; } - const double source_final(int64_t sr, int g) const + const float source_final(int64_t sr, int g) const { return source_final_[index(sr, g)]; } - double& source_final(int64_t se) { return source_final_[se]; } - const double source_final(int64_t se) const { return source_final_[se]; } + float& source_final(int64_t se) { return source_final_[se]; } + const float source_final(int64_t se) const { return source_final_[se]; } - double& external_source(int64_t sr, int g) + float& external_source(int64_t sr, int g) { return external_source_[index(sr, g)]; } - const double external_source(int64_t sr, int g) const + const float external_source(int64_t sr, int g) const { return external_source_[index(sr, g)]; } - double& external_source(int64_t se) { return external_source_[se]; } - const double external_source(int64_t se) const + float& external_source(int64_t se) { return external_source_[se]; } + const float external_source(int64_t se) const { return external_source_[se]; } @@ -804,19 +804,19 @@ class SourceRegionContainer { //--------------------------------------- // For kinetic simulations - double& source_time_derivative(int64_t sr, int g) + float& source_time_derivative(int64_t sr, int g) { return source_time_derivative_[index(sr, g)]; } - const double& source_time_derivative(int64_t sr, int g) const + const float& source_time_derivative(int64_t sr, int g) const { return source_time_derivative_[index(sr, g)]; } - double& source_time_derivative(int64_t se) + float& source_time_derivative(int64_t se) { return source_time_derivative_[se]; } - const double& source_time_derivative(int64_t se) const + const float& source_time_derivative(int64_t se) const { return source_time_derivative_[se]; } @@ -961,16 +961,16 @@ class SourceRegionContainer { return precursors_rhs_bd_[de]; } - double& source_rhs_bd(int64_t sr, int g) + float& source_rhs_bd(int64_t sr, int g) { return source_rhs_bd_[index(sr, g)]; } - const double& source_rhs_bd(int64_t sr, int g) const + const float& source_rhs_bd(int64_t sr, int g) const { return source_rhs_bd_[index(sr, g)]; } - double& source_rhs_bd(int64_t se) { return source_rhs_bd_[se]; } - const double& source_rhs_bd(int64_t se) const { return source_rhs_bd_[se]; } + float& source_rhs_bd(int64_t se) { return source_rhs_bd_[se]; } + const float& source_rhs_bd(int64_t se) const { return source_rhs_bd_[se]; } double& scalar_flux_rhs_bd_2(int64_t sr, int g) { @@ -1065,9 +1065,9 @@ class SourceRegionContainer { vector scalar_flux_old_; vector scalar_flux_new_; vector scalar_flux_final_; - vector source_; - vector source_final_; - vector external_source_; + vector source_; + vector source_final_; + vector external_source_; vector source_gradients_; vector flux_moments_old_; @@ -1085,7 +1085,7 @@ class SourceRegionContainer { // Private Data Members for kinetic simulations // SoA energy group-wise 2D derivative arrays flattened to 1D - vector source_time_derivative_; + vector source_time_derivative_; vector scalar_flux_time_derivative_2_; // SoA delay group-wise 2D arrays flattened to 1D @@ -1101,7 +1101,7 @@ class SourceRegionContainer { // SoA energy group-wise 2D RHS BD arrays flattened to 1D vector scalar_flux_rhs_bd_; - vector source_rhs_bd_; + vector source_rhs_bd_; vector scalar_flux_rhs_bd_2_; // SoA delay group-wise 2D RHS BD arrays flattened to 1D diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 9a3ee4875cf..299d3dbe72a 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -127,6 +127,7 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) double sigma_t = sigma_t_[material * negroups_ + g_out]; double scatter_source = 0.0; double fission_source = 0.0; + double total_source = 0.0; for (int g_in = 0; g_in < negroups_; g_in++) { double scalar_flux = srh.scalar_flux_old(g_in); @@ -146,7 +147,7 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) fission_source += nu_sigma_f * scalar_flux * chi; } } - srh.source(g_out) = (scatter_source + fission_source * inverse_k_eff); + total_source = (scatter_source + fission_source * inverse_k_eff); if (settings::kinetic_simulation && !simulation::is_initial_condition) { // Add delayed source @@ -159,7 +160,7 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) double precursors = srh.precursors_old(dg); delayed_source += chi_d * precursors * lambda; } - srh.source(g_out) += delayed_source; + total_source += delayed_source; } // Add derivative of scalar flux to source (only works for isotropic // method) @@ -172,10 +173,10 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) double scalar_flux = srh.scalar_flux_old(g_out); double scalar_flux_time_derivative = A0 * scalar_flux + scalar_flux_rhs_bd; - srh.source(g_out) -= scalar_flux_time_derivative * inverse_vbar; + total_source -= scalar_flux_time_derivative * inverse_vbar; } } - srh.source(g_out) /= sigma_t; + srh.source(g_out) = total_source / sigma_t; } } @@ -247,7 +248,7 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( source_regions_.scalar_flux_new(sr, g) /= volume; if (settings::run_mode == RunMode::FIXED_SOURCE) { source_regions_.scalar_flux_new(sr, g) += - 0.5 * source_regions_.external_source(sr, g) * + 0.5f * source_regions_.external_source(sr, g) * source_regions_.volume_sq(sr); } } else { @@ -1946,8 +1947,8 @@ void FlatSourceDomain::compute_single_neutron_source_time_derivative( double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; for (int g = 0; g < negroups_; g++) { - double source_rhs_bd = srh.source_rhs_bd(g); - double source = srh.source(g); + float source_rhs_bd = srh.source_rhs_bd(g); + float source = srh.source(g); // Multiply out sigma_t to correctly compute the derivative term double sigma_t = sigma_t_[srh.material() * negroups_ + g]; srh.source_time_derivative(g) = A0 * source * sigma_t + source_rhs_bd; From f22753ae000136f3f378b3c73d31d5863f25993b Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 31 Dec 2025 18:37:25 -0600 Subject: [PATCH 18/64] remove cruft comments --- src/random_ray/flat_source_domain.cpp | 16 +++------------- src/random_ray/random_ray_simulation.cpp | 5 +---- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 299d3dbe72a..ee91837230c 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -257,7 +257,6 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( source_regions_.scalar_flux_new(sr, g) += source_regions_.source(sr, g); if (settings::kinetic_simulation && !simulation::is_initial_condition && RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - // TODO: may need to adjust sigma t division here double inverse_vbar = inverse_vbar_[source_regions_.material(sr) * negroups_ + g]; double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); @@ -889,7 +888,6 @@ void FlatSourceDomain::random_ray_tally() openmc::simulation::time_tallies.stop(); } -// TODO: Enable support for TD fluxes? double FlatSourceDomain::evaluate_flux_at_point( Position r, int64_t sr, int g) const { @@ -902,7 +900,6 @@ double FlatSourceDomain::evaluate_flux_at_point( // loaded and displayed by Paraview. Note that .vtk binary // files require big endian byte ordering, so endianness // is checked and flipped if necessary. -// TODO: Enable support for TD fluxes? void FlatSourceDomain::output_to_vtk() const { // Rename .h5 plot filename(s) to .vtk filenames @@ -1935,11 +1932,10 @@ int64_t FlatSourceDomain::lookup_mesh_bin(int64_t sr, Position r) const // timestep's estimate of neutron production and loss. (previous timestep // fission vs current timestep fission?) // TODO: implement compute_k_dynamic -// double FlatSourceDomain::compute_k_dynamic() const -// Compute new estimate of scattering + fission + precursor decay sources in -// each source region based on the flux estimate from the previous iteration. -// Used for time-dependent simulations +// Compute new estimate of scattering + fission (+ precursor decay for +// kinetic simulations) sources in each source region based on the flux +// estimate from the previous iteration. void FlatSourceDomain::compute_single_neutron_source_time_derivative( SourceRegionHandle& srh) @@ -1973,7 +1969,6 @@ void FlatSourceDomain::compute_single_scalar_flux_time_derivative_2( } } -// TODO: eliminate this and source region vars void FlatSourceDomain::compute_single_delayed_fission_source( SourceRegionHandle& srh) { @@ -2083,7 +2078,6 @@ void FlatSourceDomain::accumulate_iteration_quantities() void FlatSourceDomain::normalize_final_quantities() { - // TODO: add timer double normalization_factor = 1.0 / (settings::n_batches - settings::n_inactive); double source_normalization_factor; @@ -2102,7 +2096,6 @@ void FlatSourceDomain::normalize_final_quantities() for (int g = 0; g < negroups_; g++) { source_regions_.scalar_flux_final(sr, g) *= source_normalization_factor; if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - // TODO: double check that this is correct for adjoint SDP source_regions_.source_final(sr, g) *= source_normalization_factor; } } @@ -2116,7 +2109,6 @@ void FlatSourceDomain::normalize_final_quantities() void FlatSourceDomain::propagate_final_quantities() { -// TODO: add timer #pragma omp parallel for for (int64_t sr = 0; sr < n_source_regions(); sr++) { for (int g = 0; g < negroups_; g++) { @@ -2147,7 +2139,6 @@ void add_value_to_bd_vector(std::deque& bd_vector, double& new_value, void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) { -// TODO: add timer #pragma omp parallel for for (int64_t sr = 0; sr < n_source_regions(); sr++) { for (int g = 0; g < negroups_; g++) { @@ -2178,7 +2169,6 @@ void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) void FlatSourceDomain::compute_rhs_bd_quantities() { -// TODO: add timer #pragma omp parallel for for (int64_t sr = 0; sr < n_source_regions(); sr++) { for (int g = 0; g < negroups_; g++) { diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index 6a0b3357484..47b61d84f5a 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -32,7 +32,6 @@ void openmc_run_random_ray() // calculation first and then the adjoint calculation later. bool adjoint_needed = FlatSourceDomain::adjoint_; - // TODO: no initial condition needed fof td fixed source simulations // Check if this simulation is to establish an initial condition if (settings::kinetic_simulation) { simulation::is_initial_condition = true; @@ -676,9 +675,7 @@ void RandomRaySimulation::simulate() // Reset total starting particle weight used for normalizing tallies simulation::total_weight = 1.0; - // TODO: add update source convenience function - // domain_->compute_neutron_source() - // Update source term (scattering + fission) + // Update source term (scattering + fission (+ delayed if kinetic)) domain_->update_all_neutron_sources(); // Reset scalar fluxes, iteration volume tallies, and region hit flags From 409847a96ee102fba6c6bbb79fc379261d70e61c Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 31 Dec 2025 18:45:04 -0600 Subject: [PATCH 19/64] autopep8 --- openmc/examples.py | 8 +++- openmc/material.py | 94 +++++++++++++++++++++++------------------- openmc/model/model.py | 95 +++++++++++++++++++++++-------------------- openmc/settings.py | 11 +++-- openmc/statepoint.py | 29 ++++++++----- 5 files changed, 137 insertions(+), 100 deletions(-) diff --git a/openmc/examples.py b/openmc/examples.py index 9f079e0104a..19c2e3e73d1 100644 --- a/openmc/examples.py +++ b/openmc/examples.py @@ -7,6 +7,7 @@ C5G7_N_DG = 8 PINCELL_PITCH = 1.26 + def pwr_pin_cell() -> openmc.Model: """Create a PWR pin-cell model. @@ -656,6 +657,7 @@ def slab_mg(num_regions=1, mat_names=None, mgxslib_name='2g.h5') -> openmc.Model return model + def _generate_c5g7_materials(kinetic) -> openmc.Materials: """Generate materials utilizing multi-group cross sections based on the the C5G7 Benchmark. @@ -836,6 +838,7 @@ def _generate_c5g7_materials(kinetic) -> openmc.Materials: materials.cross_sections = "mgxs.h5" return materials + def _generate_random_ray_pin_cell(uo2, water) -> openmc.Universe: """Create a random ray pin cell universe. Helper function for random_ray_pin_cell() and random_ray_lattice() @@ -905,6 +908,7 @@ def _generate_random_ray_pin_cell(uo2, water) -> openmc.Universe: return pincell + def random_ray_pin_cell(kinetic=False) -> openmc.Model: """Create a PWR pin cell example using C5G7 cross section data. cross section data. @@ -998,6 +1002,7 @@ def random_ray_pin_cell(kinetic=False) -> openmc.Model: model.tallies = tallies return model + def random_ray_lattice(kinetic=False) -> openmc.Model: """Create a 2x2 PWR pin cell asymmetrical lattice example. @@ -1034,7 +1039,7 @@ def random_ray_lattice(kinetic=False) -> openmc.Model: moderator_infinite = openmc.Cell(name='moderator infinite') if kinetic: water_reflector = water.clone() - water_reflector.name='Water Reflector' + water_reflector.name = 'Water Reflector' water_reflector.set_density('macro', 1.0) materials.append(water_reflector) moderator_infinite.fill = water_reflector @@ -1146,6 +1151,7 @@ def random_ray_lattice(kinetic=False) -> openmc.Model: model.tallies = tallies return model + def random_ray_three_region_cube() -> openmc.Model: """Create a three region cube model. diff --git a/openmc/material.py b/openmc/material.py index f8ce661c0d3..f4343a50739 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -183,7 +183,6 @@ def __init__( if components is not None: self.add_components(components, percent_type=percent_type) - def __repr__(self) -> str: string = 'Material\n' string += '{: <16}=\t{}\n'.format('\tID', self._id) @@ -204,7 +203,8 @@ def __repr__(self) -> str: string += '{: <16}\n'.format('\tS(a,b) Tables') if self._ncrystal_cfg: - string += '{: <16}=\t{}\n'.format('\tNCrystal conf', self._ncrystal_cfg) + string += '{: <16}=\t{}\n'.format('\tNCrystal conf', + self._ncrystal_cfg) for sab in self._sab: string += '{: <16}=\t{}\n'.format('\tS(a,b)', sab) @@ -335,7 +335,7 @@ def fissionable_mass(self) -> float: Z = openmc.data.zam(nuc)[0] if Z >= 90: density += 1e24 * atoms_per_bcm * openmc.data.atomic_mass(nuc) \ - / openmc.data.AVOGADRO + / openmc.data.AVOGADRO return density*self.volume @property @@ -384,7 +384,8 @@ def get_decay_photon_energy( cv.check_value('units', units, {'Bq', 'Bq/g', 'Bq/kg', 'Bq/cm3'}) if exclude_nuclides is not None and include_nuclides is not None: - raise ValueError("Cannot specify both exclude_nuclides and include_nuclides") + raise ValueError( + "Cannot specify both exclude_nuclides and include_nuclides") if units == 'Bq': multiplier = volume if volume is not None else self.volume @@ -515,12 +516,12 @@ def from_ncrystal(cls, cfg, **kwargs) -> Material: nc_mat = NCrystal.createInfo(cfg) def openmc_natabund(Z): - #nc_mat.getFlattenedComposition might need natural abundancies. - #This call-back function is used so NCrystal can flatten composition - #using OpenMC's natural abundancies. In practice this function will - #only get invoked in the unlikely case where a material is specified - #by referring both to natural elements and specific isotopes of the - #same element. + # nc_mat.getFlattenedComposition might need natural abundancies. + # This call-back function is used so NCrystal can flatten composition + # using OpenMC's natural abundancies. In practice this function will + # only get invoked in the unlikely case where a material is specified + # by referring both to natural elements and specific isotopes of the + # same element. elem_name = openmc.data.ATOMIC_SYMBOL[Z] return [ (int(iso_name[len(elem_name):]), abund) @@ -564,7 +565,8 @@ def add_volume_information(self, volume_calc): raise ValueError('No volume information found for material ID={}.' .format(self.id)) else: - raise ValueError(f'No volume information found for material ID={self.id}.') + raise ValueError( + f'No volume information found for material ID={self.id}.') def set_density(self, units: str, density: float | None = None, density_timeseries: list[float] | None = None): @@ -608,9 +610,9 @@ def set_density(self, units: str, density: float | None = None, self._density = density if density_timeseries is not None: cv.check_type(f'the density timeseries for Material ID="{self.id}"', - density_timeseries, Iterable, Real) + density_timeseries, Iterable, Real) [cv.check_greater_than(f'an element in density timeseries for Material ID="{self.id}"', - x, 0.0) for x in density_timeseries] + x, 0.0) for x in density_timeseries] self._density_timeseries = density_timeseries else: self._density_timeseries = None @@ -635,7 +637,8 @@ def add_nuclide(self, nuclide: str, percent: float, percent_type: str = 'ao'): if self._macroscopic is not None: msg = 'Unable to add a Nuclide to Material ID="{}" as a ' \ - 'macroscopic data-set has already been added'.format(self._id) + 'macroscopic data-set has already been added'.format( + self._id) raise ValueError(msg) if self._ncrystal_cfg is not None: @@ -872,7 +875,8 @@ def add_element(self, element: str, percent: float, percent_type: str = 'ao', if self._macroscopic is not None: msg = 'Unable to add an Element to Material ID="{}" as a ' \ - 'macroscopic data-set has already been added'.format(self._id) + 'macroscopic data-set has already been added'.format( + self._id) raise ValueError(msg) if enrichment is not None and enrichment_target is None: @@ -961,10 +965,10 @@ def add_elements_from_formula(self, formula: str, percent_type: str = 'ao', msg = f'Formula entry {token} not an element symbol.' raise ValueError(msg) elif token not in ['(', ')', ''] and not token.isdigit(): - msg = 'Formula must be made from a sequence of ' \ - 'element symbols, integers, and brackets. ' \ - '{} is not an allowable entry.'.format(token) - raise ValueError(msg) + msg = 'Formula must be made from a sequence of ' \ + 'element symbols, integers, and brackets. ' \ + '{} is not an allowable entry.'.format(token) + raise ValueError(msg) # Checks that the number of opening and closing brackets are equal if formula.count('(') != formula.count(')'): @@ -1026,12 +1030,13 @@ def add_s_alpha_beta(self, name: str, fraction: float = 1.0): if self._macroscopic is not None: msg = 'Unable to add an S(a,b) table to Material ID="{}" as a ' \ - 'macroscopic data-set has already been added'.format(self._id) + 'macroscopic data-set has already been added'.format( + self._id) raise ValueError(msg) if not isinstance(name, str): msg = 'Unable to add an S(a,b) table to Material ID="{}" with a ' \ - 'non-string table name "{}"'.format(self._id, name) + 'non-string table name "{}"'.format(self._id, name) raise ValueError(msg) cv.check_type('S(a,b) fraction', fraction, Real) @@ -1168,7 +1173,7 @@ def get_nuclide_atom_densities(self, nuclide: str | None = None) -> dict[str, fl if not percent_in_atom: for n, nuc in enumerate(nucs): nuc_densities[n] *= self.average_molar_mass / \ - openmc.data.atomic_mass(nuc) + openmc.data.atomic_mass(nuc) # Now that we have the atomic amounts, lets finish calculating densities sum_percent = np.sum(nuc_densities) @@ -1177,7 +1182,7 @@ def get_nuclide_atom_densities(self, nuclide: str | None = None) -> dict[str, fl # Convert the mass density to an atom density if not density_in_atom: density = -density / self.average_molar_mass * 1.e-24 \ - * openmc.data.AVOGADRO + * openmc.data.AVOGADRO nuc_densities = density * nuc_densities @@ -1217,7 +1222,8 @@ def get_element_atom_densities(self, element: str | None = None) -> dict[str, fl # Accumulate densities for each nuclide for nuclide, density in nuc_densities.items(): - nuc_element = openmc.data.ATOMIC_SYMBOL[openmc.data.zam(nuclide)[0]] + nuc_element = openmc.data.ATOMIC_SYMBOL[openmc.data.zam(nuclide)[ + 0]] if element is None or element == nuc_element: if nuc_element not in densities: densities[nuc_element] = 0.0 @@ -1225,11 +1231,10 @@ def get_element_atom_densities(self, element: str | None = None) -> dict[str, fl # If specific element was requested, make sure it is present if element is not None and element not in densities: - raise ValueError(f'Element {element} not found in material.') + raise ValueError(f'Element {element} not found in material.') return densities - def get_activity(self, units: str = 'Bq/cm3', by_nuclide: bool = False, volume: float | None = None) -> dict[str, float] | float: """Returns the activity of the material or of each nuclide within. @@ -1259,7 +1264,8 @@ def get_activity(self, units: str = 'Bq/cm3', by_nuclide: bool = False, of the material is returned as a float. """ - cv.check_value('units', units, {'Bq', 'Bq/g', 'Bq/kg', 'Bq/cm3', 'Ci', 'Ci/m3'}) + cv.check_value('units', units, { + 'Bq', 'Bq/g', 'Bq/kg', 'Bq/cm3', 'Ci', 'Ci/m3'}) cv.check_type('by_nuclide', by_nuclide, bool) if volume is None: @@ -1332,7 +1338,8 @@ def get_decay_heat(self, units: str = 'W', by_nuclide: bool = False, decay_erg = openmc.data.decay_energy(nuclide) inv_seconds = openmc.data.decay_constant(nuclide) decay_erg *= openmc.data.JOULE_PER_EV - decayheat[nuclide] = inv_seconds * decay_erg * 1e24 * atoms_per_bcm * multiplier + decayheat[nuclide] = inv_seconds * decay_erg * \ + 1e24 * atoms_per_bcm * multiplier return decayheat if by_nuclide else sum(decayheat.values()) @@ -1383,7 +1390,7 @@ def get_mass_density(self, nuclide: str | None = None) -> float: mass_density = 0.0 for nuc, atoms_per_bcm in self.get_nuclide_atom_densities(nuclide=nuclide).items(): density_i = 1e24 * atoms_per_bcm * openmc.data.atomic_mass(nuc) \ - / openmc.data.AVOGADRO + / openmc.data.AVOGADRO mass_density += density_i return mass_density @@ -1566,12 +1573,13 @@ def _get_macroscopic_xml(self, macroscopic: str) -> ET.Element: def _get_nuclides_xml( self, nuclides: Iterable[NuclideTuple], - nuclides_to_ignore: Iterable[str] | None = None)-> list[ET.Element]: + nuclides_to_ignore: Iterable[str] | None = None) -> list[ET.Element]: xml_elements = [] # Remove any nuclides to ignore from the XML export if nuclides_to_ignore: - nuclides = [nuclide for nuclide in nuclides if nuclide.name not in nuclides_to_ignore] + nuclides = [ + nuclide for nuclide in nuclides if nuclide.name not in nuclides_to_ignore] xml_elements = [self._get_nuclide_xml(nuclide) for nuclide in nuclides] @@ -1608,9 +1616,11 @@ def to_xml_element( if self._ncrystal_cfg: if self._sab: - raise ValueError("NCrystal materials are not compatible with S(a,b).") + raise ValueError( + "NCrystal materials are not compatible with S(a,b).") if self._macroscopic is not None: - raise ValueError("NCrystal materials are not compatible with macroscopic cross sections.") + raise ValueError( + "NCrystal materials are not compatible with macroscopic cross sections.") element.set("cfg", str(self._ncrystal_cfg)) @@ -1625,11 +1635,13 @@ def to_xml_element( subelement.set("value", str(self._density)) subelement.set("units", self._density_units) if self._density_timeseries is not None: - timeseries_text = " ".join(str(x) for x in self._density_timeseries) + timeseries_text = " ".join(str(x) + for x in self._density_timeseries) subelement.set("value_timeseries", timeseries_text) else: - raise ValueError(f'Density has not been set for material {self.id}!') + raise ValueError( + f'Density has not been set for material {self.id}!') if self._macroscopic is None: # Create nuclide XML subelements @@ -1730,17 +1742,18 @@ def mix_materials(cls, materials, fracs: Iterable[float], nuc_per_cc = wgt*1.e24*atoms_per_bcm nuclides_per_cc[nuc] += nuc_per_cc mass_per_cc[nuc] += nuc_per_cc*openmc.data.atomic_mass(nuc) / \ - openmc.data.AVOGADRO + openmc.data.AVOGADRO # Create the new material with the desired name if "name" not in kwargs: kwargs["name"] = '-'.join([f'{m.name}({f})' for m, f in - zip(materials, fracs)]) + zip(materials, fracs)]) new_mat = cls(**kwargs) # Compute atom fractions of nuclides and add them to the new material - tot_nuclides_per_cc = np.sum([dens for dens in nuclides_per_cc.values()]) + tot_nuclides_per_cc = np.sum( + [dens for dens in nuclides_per_cc.values()]) for nuc, atom_dens in nuclides_per_cc.items(): new_mat.add_nuclide(nuc, atom_dens/tot_nuclides_per_cc, 'ao') @@ -1887,7 +1900,6 @@ def deplete( return depleted_materials_dict[self.id] - def mean_free_path(self, energy: float) -> float: """Calculate the mean free path of neutrons in the material at a given energy. @@ -2030,7 +2042,8 @@ def _write_xml(self, file, header=True, level=0, spaces_per_level=2, # Write the elements. for material in sorted(set(self), key=lambda x: x.id): - element = material.to_xml_element(nuclides_to_ignore=nuclides_to_ignore) + element = material.to_xml_element( + nuclides_to_ignore=nuclides_to_ignore) clean_indentation(element, level=level+1) element.tail = element.tail.strip(' ') file.write((level+1)*spaces_per_level*' ') @@ -2116,7 +2129,6 @@ def from_xml(cls, path: PathLike = 'materials.xml') -> Materials: return cls.from_xml_element(root) - def deplete( self, multigroup_fluxes: Sequence[Sequence[float]], diff --git a/openmc/model/model.py b/openmc/model/model.py index 36364124694..53e68463f79 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -259,7 +259,8 @@ def add_kinetics_parameters_tallies(self, num_groups: int | None = None): beta_tally = openmc.Tally(name='IFP beta numerator') beta_tally.scores = ['ifp-beta-numerator'] if num_groups is not None: - beta_tally.filters = [openmc.DelayedGroupFilter(list(range(1, num_groups + 1)))] + beta_tally.filters = [openmc.DelayedGroupFilter( + list(range(1, num_groups + 1)))] self.tallies.append(beta_tally) if not any('ifp-denominator' in t.scores for t in self.tallies): denom_tally = openmc.Tally(name='IFP denominator') @@ -523,7 +524,8 @@ def deplete( check_value('method', method, dep.integrators.integrator_by_name.keys()) integrator_class = dep.integrators.integrator_by_name[method] - integrator = integrator_class(depletion_operator, **integrator_kwargs) + integrator = integrator_class( + depletion_operator, **integrator_kwargs) # Now perform the depletion with openmc.lib.quiet_dll(output): @@ -583,7 +585,8 @@ def export_to_xml(self, directory: PathLike = '.', remove_surfs: bool = False, # for all materials in the geometry and use that to automatically build # a collection. if self.materials: - self.materials.export_to_xml(d, nuclides_to_ignore=nuclides_to_ignore) + self.materials.export_to_xml( + d, nuclides_to_ignore=nuclides_to_ignore) else: materials = openmc.Materials(self.geometry.get_all_materials() .values()) @@ -622,7 +625,8 @@ def export_to_model_xml(self, path: PathLike = 'model.xml', remove_surfs: bool = if not xml_path.exists(): xml_path.mkdir(parents=True, exist_ok=True) elif not xml_path.is_dir(): - raise FileExistsError(f"File exists and is not a directory: '{xml_path}'") + raise FileExistsError( + f"File exists and is not a directory: '{xml_path}'") xml_path /= 'model.xml' # if this is an XML file location and the file's parent directory does # not exist, create it before continuing @@ -723,18 +727,18 @@ def import_properties(self, filename: PathLike): lib_cell.set_temperature(temperature[0]) if group['density']: - density = group['density'][()] - if density.size > 1: - cell.density = [rho for rho in density] - else: - cell.density = density - if self.is_initialized: - lib_cell = openmc.lib.cells[cell_id] - if density.size > 1: - for i, rho in enumerate(density): - lib_cell.set_density(rho, i) - else: - lib_cell.set_density(density[0]) + density = group['density'][()] + if density.size > 1: + cell.density = [rho for rho in density] + else: + cell.density = density + if self.is_initialized: + lib_cell = openmc.lib.cells[cell_id] + if density.size > 1: + for i, rho in enumerate(density): + lib_cell.set_density(rho, i) + else: + lib_cell.set_density(density[0]) # Make sure number of materials matches mats_group = fh['materials'] @@ -996,7 +1000,6 @@ def calculate_volumes( openmc.lib.materials[domain_id].volume = \ vol_calc.volumes[domain_id].n - def _set_plot_defaults( self, origin: Sequence[float] | None, @@ -1179,8 +1182,8 @@ def plot( # Convert ID map to RGB image img = id_map_to_rgb( - id_map=id_map, - color_by=color_by, + id_map=id_map, + color_by=color_by, colors=colors, overlap_color=overlap_color ) @@ -1217,7 +1220,7 @@ def plot( extent=(x_min, x_max, y_min, y_max), **contour_kwargs ) - + # If only showing outline, set the axis limits and aspect explicitly if outline == 'only': axes.set_xlim(x_min, x_max) @@ -1620,7 +1623,8 @@ def differentiate_mats(self, diff_volume_method: str = None, depletable_only: bo Default is True, only depletable materials will be differentiated. If False, all materials will be differentiated. """ - check_value('volume differentiation method', diff_volume_method, ("divide equally", "match cell", None)) + check_value('volume differentiation method', + diff_volume_method, ("divide equally", "match cell", None)) # Count the number of instances for each cell and material self.geometry.determine_paths(instances_only=True) @@ -1668,7 +1672,8 @@ def differentiate_mats(self, diff_volume_method: str = None, depletable_only: bo # Clone materials if cell.num_instances > 1: - cell.fill = [mat.clone() for _ in range(cell.num_instances)] + cell.fill = [mat.clone() + for _ in range(cell.num_instances)] else: cell.fill = mat.clone() @@ -1685,10 +1690,9 @@ def differentiate_mats(self, diff_volume_method: str = None, depletable_only: bo self.geometry.get_all_materials().values() ) - def _auto_generate_mgxs_lib( self, - model: openmc.model.model, + model: openmc.model.model, energy_groups: openmc.mgxs.EnergyGroups, correction: str | none, directory: pathlike, @@ -1729,7 +1733,7 @@ def _auto_generate_mgxs_lib( # Pick energy group structure mgxs_lib.energy_groups = energy_groups - if (kinetic): + if (kinetic): mgxs_lib.num_delayed_groups = num_delayed_groups # Disable transport correction @@ -1747,7 +1751,8 @@ def _auto_generate_mgxs_lib( 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' ] if kinetic: - mgxs_lib.mgxs_types += ['chi-prompt', 'chi-delayed', 'decay-rate', 'inverse-velocity', 'beta'] + mgxs_lib.mgxs_types += ['chi-prompt', 'chi-delayed', + 'decay-rate', 'inverse-velocity', 'beta'] # Specify a "cell" domain type for the cross section tally filters mgxs_lib.domain_type = "material" @@ -1776,7 +1781,6 @@ def _auto_generate_mgxs_lib( return mgxs_lib - def _create_mgxs_sources( self, energy_groups: openmc.mgxs.EnergyGroups, @@ -1823,7 +1827,8 @@ def _create_mgxs_sources( strengths.append(1.0) uniform_energy = openmc.stats.Discrete(x=midpoints, p=strengths) - uniform_distribution = openmc.IndependentSource(spatial_dist, energy=uniform_energy, strength=0.01) + uniform_distribution = openmc.IndependentSource( + spatial_dist, energy=uniform_energy, strength=0.01) sources = [uniform_distribution] # If the user provided an energy distribution, use that @@ -1943,18 +1948,21 @@ def _generate_infinite_medium_mgxs( 100000.0, 100000.0, boundary_type='reflective') name = material.name infinite_cell = openmc.Cell(name=name, fill=material, region=-box) - infinite_universe = openmc.Universe(name=name, cells=[infinite_cell]) + infinite_universe = openmc.Universe( + name=name, cells=[infinite_cell]) model.geometry.root_universe = infinite_universe # Add MGXS Tallies - mgxs_lib = self._auto_generate_mgxs_lib(model, energy_groups, correction, directory, kinetic, num_delayed_groups) + mgxs_lib = self._auto_generate_mgxs_lib( + model, energy_groups, correction, directory, kinetic, num_delayed_groups) # Create a MGXS File which can then be written to disk mgxs_set = mgxs_lib.get_xsdata(domain=material, xsdata_name=name) mgxs_sets.append(mgxs_set) # Write the file to disk - mgxs_file = openmc.MGXSLibrary(energy_groups=energy_groups, num_delayed_groups=num_delayed_groups) + mgxs_file = openmc.MGXSLibrary( + energy_groups=energy_groups, num_delayed_groups=num_delayed_groups) for mgxs_set in mgxs_sets: mgxs_file.add_xsdata(mgxs_set) mgxs_file.export_to_hdf5(mgxs_path) @@ -2116,12 +2124,14 @@ def _generate_stochastic_slab_mgxs( model.settings.output = {'summary': True, 'tallies': False} # Add MGXS Tallies - mgxs_lib = self._auto_generate_mgxs_lib(model, energy_groups, correction, directory, kinetic, num_delayed_groups) + mgxs_lib = self._auto_generate_mgxs_lib( + model, energy_groups, correction, directory, kinetic, num_delayed_groups) names = [mat.name for mat in mgxs_lib.domains] # Create a MGXS File which can then be written to disk - mgxs_file = mgxs_lib.create_mg_library(xs_type='macro', xsdata_names=names) + mgxs_file = mgxs_lib.create_mg_library( + xs_type='macro', xsdata_names=names) mgxs_file.export_to_hdf5(mgxs_path) def _generate_material_wise_mgxs( @@ -2173,7 +2183,8 @@ def _generate_material_wise_mgxs( model.settings.output = {'summary': True, 'tallies': False} # Add MGXS Tallies - mgxs_lib = self._auto_generate_mgxs_lib(model, energy_groups, correction, directory, kinetic, num_delayed_groups) + mgxs_lib = self._auto_generate_mgxs_lib( + model, energy_groups, correction, directory, kinetic, num_delayed_groups) names = [mat.name for mat in mgxs_lib.domains] @@ -2292,13 +2303,13 @@ def convert_to_multigroup( # If making a set the time step size to 0.01 if kinetic: self.settings.kinetic_simulation = True - warnings.warn("Kinetic model. Currently, only the random ray solver" - " supports kinetic simulations. The number of time" - " steps to run and material density transient using " - " openmc.Settings.timestep_parameters['n_timesteps'] " - " and openmc.Material.set_density(), respectively.") - self.settings.timestep_parameters = {'dt': 0.01, 'timestep_units': 's'} - + warnings.warn("Kinetic model. Currently, only the random ray solver" + " supports kinetic simulations. The number of time" + " steps to run and material density transient using " + " openmc.Settings.timestep_parameters['n_timesteps'] " + " and openmc.Material.set_density(), respectively.") + self.settings.timestep_parameters = { + 'dt': 0.01, 'timestep_units': 's'} def convert_to_random_ray(self): """Convert a multigroup model to use random ray. @@ -2616,5 +2627,3 @@ def function_calls(self) -> int: def total_batches(self) -> int: """Total number of active batches used across all evaluations.""" return sum(self.batches) - - diff --git a/openmc/settings.py b/openmc/settings.py index 10672df0a84..d6d7e6c7922 100644 --- a/openmc/settings.py +++ b/openmc/settings.py @@ -26,6 +26,7 @@ class RunMode(Enum): VOLUME = 'volume' PARTICLE_RESTART = 'particle restart' + _RES_SCAT_METHODS = {'dbrc', 'rvs'} @@ -622,7 +623,7 @@ def kinetic_simulation(self, value: bool): @property def timestep_parameters(self) -> dict: return self._timestep_parameters - + @timestep_parameters.setter def timestep_parameters(self, timestep_parameters: dict): if not isinstance(timestep_parameters, Mapping): @@ -1063,7 +1064,7 @@ def temperature(self, temperature: dict): cv.check_type('temperature', T, Real) self._temperature = temperature - + @property def trace(self) -> Iterable: return self._trace @@ -1447,7 +1448,8 @@ def free_gas_threshold(self) -> float | None: def free_gas_threshold(self, free_gas_threshold: float | None): if free_gas_threshold is not None: cv.check_type('free gas threshold', free_gas_threshold, Real) - cv.check_greater_than('free gas threshold', free_gas_threshold, 0.0) + cv.check_greater_than('free gas threshold', + free_gas_threshold, 0.0) self._free_gas_threshold = free_gas_threshold def _create_run_mode_subelement(self, root): @@ -1966,7 +1968,8 @@ def _create_random_ray_subelement(self, root, mesh_memo=None): domain_elem.set( 'type', domain.__class__.__name__.lower()) if mesh_memo is not None and mesh.id not in mesh_memo: - domain_elem.set('type', domain.__class__.__name__.lower()) + domain_elem.set( + 'type', domain.__class__.__name__.lower()) # See if a element already exists -- if not, add it path = f"./mesh[@id='{mesh.id}']" if root.find(path) is None: diff --git a/openmc/statepoint.py b/openmc/statepoint.py index fa7ed350369..175388839c1 100644 --- a/openmc/statepoint.py +++ b/openmc/statepoint.py @@ -17,7 +17,8 @@ _VERSION_STATEPOINT = 18 -KineticsParameters = namedtuple("KineticsParameters", ["generation_time", "beta_effective"]) +KineticsParameters = namedtuple( + "KineticsParameters", ["generation_time", "beta_effective"]) class StatePoint: @@ -176,12 +177,14 @@ def __init__(self, filepath, autolink=True): # Automatically link in a summary file if one exists if autolink: - path_summary = os.path.join(os.path.dirname(filename), 'summary.h5') + path_summary = os.path.join( + os.path.dirname(filename), 'summary.h5') if os.path.exists(path_summary): su = openmc.Summary(path_summary) self.link_with_summary(su) - path_volume = os.path.join(os.path.dirname(filename), 'volume_*.h5') + path_volume = os.path.join( + os.path.dirname(filename), 'volume_*.h5') for path_i in glob.glob(path_volume): if re.search(r'volume_\d+\.h5', path_i): vol = openmc.VolumeCalculation.from_hdf5(path_i) @@ -275,8 +278,8 @@ def global_tallies(self): ('mean', 'f8'), ('std_dev', 'f8')]) gt['name'] = ['k-collision', 'k-absorption', 'k-tracklength', 'leakage'] - gt['sum'] = data[:,1] - gt['sum_sq'] = data[:,2] + gt['sum'] = data[:, 1] + gt['sum_sq'] = data[:, 2] # Calculate mean and sample standard deviation of mean n = self.n_realizations @@ -406,7 +409,7 @@ def random_ray(self): return rr else: return None - + @property def run_mode(self): return self._f['run_mode'][()].decode() @@ -489,15 +492,18 @@ def tallies(self): # Create Tally object and assign basic properties tally = openmc.Tally(tally_id) tally._sp_filename = Path(self._f.filename) - tally.name = group['name'][()].decode() if 'name' in group else '' + tally.name = group['name'][()].decode( + ) if 'name' in group else '' # Check if tally has multiply_density attribute if "multiply_density" in group.attrs: - tally.multiply_density = group.attrs["multiply_density"].item() > 0 + tally.multiply_density = group.attrs["multiply_density"].item( + ) > 0 # Check if tally has higher_moments attribute if 'higher_moments' in group.attrs: - tally.higher_moments = bool(group.attrs['higher_moments'][()]) + tally.higher_moments = bool( + group.attrs['higher_moments'][()]) # Read the number of realizations n_realizations = group['n_realizations'][()] @@ -525,7 +531,8 @@ def tallies(self): nuclide_names = group['nuclides'][()] # Add all nuclides to the Tally - tally.nuclides = [name.decode().strip() for name in nuclide_names] + tally.nuclides = [name.decode().strip() + for name in nuclide_names] # Add the scores to the Tally scores = group['score_bins'][()] @@ -770,7 +777,7 @@ def link_with_summary(self, summary): if not isinstance(summary, openmc.Summary): msg = f'Unable to link statepoint with "{summary}" which is not a' \ - 'Summary object' + 'Summary object' raise ValueError(msg) cells = summary.geometry.get_all_cells() From 991c0baa3eebefab652656ff521cd5b7c65ac2cf Mon Sep 17 00:00:00 2001 From: yardasol Date: Sat, 3 Jan 2026 21:01:04 -0600 Subject: [PATCH 20/64] fix tests, memory leak, and add more depth to userguide --- docs/source/usersguide/kinetic.rst | 53 ++++++++++++++ src/random_ray/flat_source_domain.cpp | 6 -- .../random_ray_diagonal_stabilization/test.py | 2 +- .../__init__.py | 0 .../inputs_true.dat | 70 +++++++++++++++++++ .../results_true_0.dat | 2 + .../results_true_1.dat | 2 + .../results_true_2.dat | 2 + .../results_true_3.dat | 2 + .../results_true_4.dat | 2 + .../results_true_5.dat | 2 + .../test.py | 64 +++++++++++++++++ 12 files changed, 200 insertions(+), 7 deletions(-) create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/__init__.py create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_5.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py diff --git a/docs/source/usersguide/kinetic.rst b/docs/source/usersguide/kinetic.rst index 3d17c7f7e95..ec32c82d590 100644 --- a/docs/source/usersguide/kinetic.rst +++ b/docs/source/usersguide/kinetic.rst @@ -35,3 +35,56 @@ transient can be specified using the Python API:: .. note:: Kinetic simulations are currently only supported in eigenvalue mode using the Random Ray solver. + +---------------------- +Random Ray Quick Start +---------------------- + +Random Ray's :ref:`automatic setup workflow ` can +be utilized to quickly generate models for kinetic simulations, however +slight modifications are needed: + +1. The `kinetic` flag should be set to `True`, and the number of delay groups must be + specified via `num_delay_groups` in the call to :meth:`openmc.Model.convert_to_multigroup`. + Take care to not specify more delay groups than the cross section library you + are using supports, as this will cause all sorts of problems when you try to run + the simulation. +2. By default, a time step size of 1 ms is chosen to accurately resolve delayed + neutron precursor dynamics, but the number of time steps must be manually + set in `openmc.Settings.timestep_parameters['n_timesteps']`. +3. Material density timeseries' must be manually added. + +An example process of converting an existing continuous energy +Monte Carlo model to a random ray model for kinetic simulations +is show below:: + + # Define continuous energy model as normal + model = openmc.Model() + ... + + # Convert model to kinetic multigroup (will auto-generate MGXS library if needed) + # Most cross-section libraries support 6 delay groups + model.convert_to_multigroup(kinetic=True, num_delayed_groups=6) + + # Add required manual kinetic simulation settigns + model.settings.timestep_parameters['n_timesteps'] = 5 + + # Add a material density timeseries to material 0 in the model + density_timeseries = np.linspace(1, 0.95, 100) + model.materials[0].set_density('macro', density=1.0, density_timeseries=density_timeseries) + + # Convert model to random ray and initialize random ray parameters + # to reasonable defaults based on the specifics of the geometry + model.convert_to_random_ray() + + # (Optional) Overlay source region decomposition mesh to improve fidelity of the + # random ray solver. Adjust 'n' for fidelity vs runtime. + n = 100 + mesh = openmc.RegularMesh() + mesh.dimension = (n, n, n) + mesh.lower_left = model.geometry.bounding_box.lower_left + mesh.upper_right = model.geometry.bounding_box.upper_right + model.settings.random_ray['source_region_meshes'] = [(mesh, [model.geometry.root_universe])] + + # (Optional) Increase the number of rays/batch, to reduce uncertainty + model.settings.particles = 500 diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index ee91837230c..e528f86bd08 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -95,12 +95,6 @@ void FlatSourceDomain::batch_reset() for (int64_t se = 0; se < n_source_elements(); se++) { source_regions_.scalar_flux_new(se) = 0.0; } - - if (settings::kinetic_simulation && settings::create_delayed_neutrons) { -#pragma omp parallel for - for (int64_t se = 0; se < n_source_elements(); se++) - source_regions_.precursors_new(se) = 0.0; - } } void FlatSourceDomain::accumulate_iteration_flux() diff --git a/tests/regression_tests/random_ray_diagonal_stabilization/test.py b/tests/regression_tests/random_ray_diagonal_stabilization/test.py index 8d36e1d2581..2acc1915334 100644 --- a/tests/regression_tests/random_ray_diagonal_stabilization/test.py +++ b/tests/regression_tests/random_ray_diagonal_stabilization/test.py @@ -23,7 +23,7 @@ def test_random_ray_diagonal_stabilization(): # MGXS data with some negatives on the diagonal, in order # to trigger diagonal correction. model.convert_to_multigroup( - method='material_wise', groups='CASMO-70', nparticles=13, + method='material_wise', energy_groups='CASMO-70', nparticles=13, overwrite_mgxs_library=True, mgxs_path="mgxs.h5", correction='P0' ) diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/__init__.py b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/inputs_true.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/inputs_true.dat new file mode 100644 index 00000000000..69627bcfb0e --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/inputs_true.dat @@ -0,0 +1,70 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 20 + 15 + true + +
0.01
+ s + 5 +
+ + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + 0.5 + + + 8 8 + -0.63 -0.63 + 0.63 0.63 + +
+
diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_0.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_0.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_0.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_1.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_1.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_1.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_2.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_2.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_2.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_3.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_3.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_3.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_4.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_4.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_4.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_5.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_5.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_5.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py new file mode 100644 index 00000000000..8312e7f6df7 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py @@ -0,0 +1,64 @@ +import os + +from openmc.examples import pwr_pin_cell +from openmc import RegularMesh +import numpy as np + +from tests.testing_harness import KineticTolerantPyAPITestHarness + + +class KineticMGXSTestHarness(KineticTolerantPyAPITestHarness): + def _cleanup(self): + super()._cleanup() + f = 'mgxs.h5' + if os.path.exists(f): + os.remove(f) + + +def test_random_ray_diagonal_stabilization(): + # Start with a normal continuous energy model + model = pwr_pin_cell() + + # Convert to a multi-group model, with 70 group XS + # and transport correction enabled. This will generate + # MGXS data with some negatives on the diagonal, in order + # to trigger diagonal correction. + model.convert_to_multigroup( + method='material_wise', energy_groups='CASMO-70', nparticles=30, + overwrite_mgxs_library=True, mgxs_path="mgxs.h5", correction='P0', + kinetic=True, num_delayed_groups=6 + ) + + model.settings.timestep_parameters['n_timesteps'] = 5 + density_timeseries = np.linspace(1, 0.95, 100) + model.materials[2].set_density('macro', density=1.0, density_timeseries=density_timeseries) + + # Convert to a random ray model + model.convert_to_random_ray() + + # Set the number of particles + model.settings.particles = 100 + + # Overlay an 8x8 mesh + n = 8 + mesh = RegularMesh() + mesh.dimension = (n, n) + bbox = model.geometry.bounding_box + mesh.lower_left = (bbox.lower_left[0], bbox.lower_left[1]) + mesh.upper_right = (bbox.upper_right[0], bbox.upper_right[1]) + model.settings.random_ray['source_region_meshes'] = [ + (mesh, [model.geometry.root_universe])] + + # Explicitly set the diagonal stabilization rho (default is otherwise 1.0). + # Note that if we set this to 0.0 (thus distabling stabilization), the + # problem should fail due to instability, so this is actually a good test + # problem. + model.settings.random_ray['diagonal_stabilization_rho'] = 0.5 + + # If rho was 0.0, the instability would cause failure after iteration 14, + # so we go a little past that. + model.settings.inactive = 15 + model.settings.batches = 20 + + harness = KineticMGXSTestHarness(model, 6) + harness.main() From 2530d7a99678e6beb30f207fd10d3b3f26de02a9 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sat, 3 Jan 2026 21:29:48 -0600 Subject: [PATCH 21/64] formatting fixes --- include/openmc/random_ray/source_region.h | 16 +++++----------- include/openmc/simulation.h | 11 +++++++---- src/random_ray/flat_source_domain.cpp | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/include/openmc/random_ray/source_region.h b/include/openmc/random_ray/source_region.h index 0fd4ce44c4a..ab678c2d3c3 100644 --- a/include/openmc/random_ray/source_region.h +++ b/include/openmc/random_ray/source_region.h @@ -473,7 +473,7 @@ class SourceRegion { scalar_flux_new_; //!< The scalar flux from the current iteration vector source_; //!< The total source term (fission + scattering + external) - vector external_source_; //!< The external source term + vector external_source_; //!< The external source term vector scalar_flux_final_; //!< The scalar flux accumulated over all //!< active iterations (used for plotting, //!< computing adjoint sources, or @@ -500,10 +500,10 @@ class SourceRegion { // Energy group-wise 1D time-dependent arrrays vector source_final_; //!< The total source accumulated over all - //!< active iterations (used for SDP) + //!< active iterations (used for SDP) // Energy group-wise 1D derivative arrays - vector source_time_derivative_; //!< The time derivative of the + vector source_time_derivative_; //!< The time derivative of the //!< source (used for SDP) vector scalar_flux_time_derivative_2_; //!< The 2nd order time //!< derivative of the scalar @@ -747,10 +747,7 @@ class SourceRegionContainer { float& source(int64_t se) { return source_[se]; } const float source(int64_t se) const { return source_[se]; } - float& source_final(int64_t sr, int g) - { - return source_final_[index(sr, g)]; - } + float& source_final(int64_t sr, int g) { return source_final_[index(sr, g)]; } const float source_final(int64_t sr, int g) const { return source_final_[index(sr, g)]; @@ -767,10 +764,7 @@ class SourceRegionContainer { return external_source_[index(sr, g)]; } float& external_source(int64_t se) { return external_source_[se]; } - const float external_source(int64_t se) const - { - return external_source_[se]; - } + const float external_source(int64_t se) const { return external_source_[se]; } vector& tally_task(int64_t sr, int g) { diff --git a/include/openmc/simulation.h b/include/openmc/simulation.h index 7f39691e974..2e310726fb8 100644 --- a/include/openmc/simulation.h +++ b/include/openmc/simulation.h @@ -51,10 +51,13 @@ extern vector work_index; //----------------------------------------------------------------------------- // Global variables for kinetic simulations -extern bool is_initial_condition; //!< if eigenvalue/fixed source sim is an initial condition for a kinetic simulation -extern int current_timestep; // !< current time step in kinetic simulation -extern double current_time; // !< current time in kinetic simulation -extern bool k_eff_correction; // !< flag to indicate if the simulation is meant to correct batchwise k_effs +extern bool + is_initial_condition; //!< if eigenvalue/fixed source sim is an initial + //!< condition for a kinetic simulation +extern int current_timestep; // !< current time step in kinetic simulation +extern double current_time; // !< current time in kinetic simulation +extern bool k_eff_correction; // !< flag to indicate if the simulation is meant + // to correct batchwise k_effs } // namespace simulation //============================================================================== diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index e528f86bd08..468e1b533cc 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -170,7 +170,7 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) total_source -= scalar_flux_time_derivative * inverse_vbar; } } - srh.source(g_out) = total_source / sigma_t; + srh.source(g_out) = total_source / sigma_t; } } From 7e2620a5875993a7c58862404cd71e1cd3255d71 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 4 Jan 2026 00:48:49 -0600 Subject: [PATCH 22/64] fix precursor batch reset --- src/random_ray/flat_source_domain.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 468e1b533cc..c606683c645 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -95,6 +95,12 @@ void FlatSourceDomain::batch_reset() for (int64_t se = 0; se < n_source_elements(); se++) { source_regions_.scalar_flux_new(se) = 0.0; } + + if (settings::kinetic_simulation && settings::create_delayed_neutrons) { +#pragma omp parallel for + for (int64_t de = 0; de < n_delay_elements(); de++) + source_regions_.precursors_new(de) = 0.0; + } } void FlatSourceDomain::accumulate_iteration_flux() From 08bff5d914454f3395f2c1f0c680e96f6092c27a Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 4 Jan 2026 13:31:08 -0600 Subject: [PATCH 23/64] fix failing unit test due to api change --- tests/unit_tests/weightwindows/test_ww_gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/weightwindows/test_ww_gen.py b/tests/unit_tests/weightwindows/test_ww_gen.py index a4456e6809a..928596832c0 100644 --- a/tests/unit_tests/weightwindows/test_ww_gen.py +++ b/tests/unit_tests/weightwindows/test_ww_gen.py @@ -367,7 +367,7 @@ def test_ww_generation_with_dagmc(run_in_tmpdir): method="stochastic_slab", overwrite_mgxs_library=True, nparticles=10, - groups="CASMO-2" + energy_groups="CASMO-2" ) rr_model.convert_to_random_ray() From 3f46d31b8b8b459de58aaf763ada72cc6a8ede71 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 4 Jan 2026 19:27:37 -0600 Subject: [PATCH 24/64] parameterize main random ray function+ - parameterize rename_file function - change base statepoint name used for kinetic simulations (now is closer to the base openmc format) - update corresponding test infrastructure --- .../openmc/random_ray/random_ray_simulation.h | 18 +- src/random_ray/random_ray_simulation.cpp | 391 ++++++++---------- src/simulation.cpp | 15 +- .../random_ray_auto_convert_kinetic/test.py | 2 +- .../test.py | 2 +- .../random_ray_k_eff_kinetic/test.py | 2 +- .../random_ray_k_eff_mesh_kinetic/test.py | 2 +- tests/testing_harness.py | 10 +- 8 files changed, 213 insertions(+), 229 deletions(-) diff --git a/include/openmc/random_ray/random_ray_simulation.h b/include/openmc/random_ray/random_ray_simulation.h index c4becc65818..ff93c9bf93a 100644 --- a/include/openmc/random_ray/random_ray_simulation.h +++ b/include/openmc/random_ray/random_ray_simulation.h @@ -19,9 +19,13 @@ class RandomRaySimulation { //---------------------------------------------------------------------------- // Methods - void compute_segment_correction_factors(); void apply_fixed_sources_and_mesh_domains(); void prepare_fixed_sources_adjoint(); + void print_random_ray_headers(); + void run_single_simulation(); + void random_ray_adjoint(); + void kinetic_initial_condition(); + void kinetic_single_time_step(int i); void simulate(); void output_simulation_results() const; void instability_check( @@ -52,9 +56,16 @@ class RandomRaySimulation { // Number of delay groups int ndgroups_; + // Toggle for first simulation + bool is_first_simulation_; + + // Flag for adjoint simulation; + bool adjoint_needed_; + //---------------------------------------------------------------------------- // Data Members for kinetic simulations + double static_avg_k_eff_; vector static_k_eff_; vector static_fission_rate_; @@ -71,11 +82,12 @@ void openmc_reset_random_ray(); //! Write data related to randaom ray to statepoint //! \param[in] group HDF5 group void write_random_ray_hdf5(hid_t group); +void print_random_ray_headers(bool& adjoint_needed); // Functions for kinetic simulations void set_time_dependent_settings(); -void rename_statepoint_file(int i); -void rename_tallies_file(int i); +void rename_time_step_file( + std::string base_filename, std::string extension, int i); } // namespace openmc diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index 47b61d84f5a..901148ad224 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -28,28 +28,11 @@ void openmc_run_random_ray() // Run forward simulation ////////////////////////////////////////////////////////// - // Check if adjoint calculation is needed. If it is, we will run the forward - // calculation first and then the adjoint calculation later. - bool adjoint_needed = FlatSourceDomain::adjoint_; - - // Check if this simulation is to establish an initial condition - if (settings::kinetic_simulation) { - simulation::is_initial_condition = true; + if (mpi::master) { + bool adjoint_needed = FlatSourceDomain::adjoint_; + print_random_ray_headers(adjoint_needed); } - // Configure the domain for forward simulation - FlatSourceDomain::adjoint_ = false; - - // If we're going to do a kinetic simulation, report that this is - // the initial condition. - if (settings::kinetic_simulation && mpi::master) - header("KINETIC SIMULATION INITIAL CONDITION", 3); - - // If we're going to do an adjoint simulation afterwards, report that this is - // the initial forward flux solve. - if (adjoint_needed && mpi::master) - header("FORWARD FLUX SOLVE", 3); - // Initialize OpenMC general data structures openmc_simulation_init(); @@ -63,187 +46,27 @@ void openmc_run_random_ray() // Initialize fixed sources, if present sim.apply_fixed_sources_and_mesh_domains(); - // Begin main simulation timer - simulation::time_total.start(); - - // Execute random ray simulation - sim.simulate(); - - // End main simulation timer - simulation::time_total.stop(); - - // Normalize and save the final forward quantities - sim.domain()->normalize_final_quantities(); - - // Finalize OpenMC - openmc_simulation_finalize(); - - // Output all simulation results - sim.output_simulation_results(); + // Run initial random ray simulation + sim.run_single_simulation(); if (settings::kinetic_simulation) { - // Now do a second steady state simulation to correct the batch wise k-eff - // estimates - simulation::k_eff_correction = true; - - if (settings::kinetic_simulation && mpi::master) - header("KINETIC SIMULATION INITIAL CONDITION (K-EFF CORRECTION)", 3); - - // If we're going to do an adjoint simulation afterwards, report that this - // is the initial forward flux solve. - if (adjoint_needed && mpi::master) - header("FORWARD FLUX SOLVE", 3); - - // Initialize OpenMC general data structures - openmc_simulation_init(); - - double initial_k_eff = simulation::keff; - - sim.domain()->k_eff_ = initial_k_eff; - sim.domain()->source_regions_.adjoint_reset(); - sim.domain()->propagate_final_quantities(); - sim.domain()->source_regions_.time_step_reset(); - - // Begin main simulation timer - simulation::time_total.start(); - - // Execute random ray simulation - sim.simulate(); - - // End main simulation timer - simulation::time_total.stop(); - - // Normalize and save the final forward quantities - sim.domain()->normalize_final_quantities(); - - // Finalize OpenMC - openmc_simulation_finalize(); - - // Output all simulation results - sim.output_simulation_results(); - - //------------------------------------------------------------------------- - // KINETIC SIMULATION + // Second steady state simulation to correct the batchwise k-eff + sim.kinetic_initial_condition(); warning( "Time-dependent explicit void treatment has not yet been " "implemented. Use caution when interpreting results from models with " "voids, as they may contain large inaccuracies."); - sim.domain()->store_time_step_quantities(false); - rename_statepoint_file(0); - if (settings::output_tallies) { - rename_tallies_file(0); - } - set_time_dependent_settings(); - // Timestepping loop - // TODO: Add support for time-dependent restart - for (int i = 0; i < settings::n_timesteps; i++) { - simulation::current_timestep = i + 1; - - // Print simulation information - if (mpi::master) { - std::string message = fmt::format( - "KINETIC SIMULATION TIME STEP {0}", simulation::current_timestep); - const char* msg = message.c_str(); - header(msg, 3); - } - - // If we're going to do an adjoint simulation afterwards, report that this - // is the initial forward flux solve. - if (adjoint_needed && mpi::master) - header("FORWARD FLUX SOLVE", 3); - - reset_timers(); - - // Initialize OpenMC general data structures - openmc_simulation_init(); - - sim.domain()->k_eff_ = initial_k_eff; - sim.domain()->source_regions_.adjoint_reset(); - sim.domain()->propagate_final_quantities(); - sim.domain()->source_regions_.time_step_reset(); - - // Compute RHS backward differences to be used later - sim.domain()->compute_rhs_bd_quantities(); - - // Update time dependent cross section based on the density - sim.domain()->update_material_density(i); - - // Begin main simulation timer - simulation::time_total.start(); - - // Execute random ray simulation - sim.simulate(); - - // End main simulation timer - simulation::time_total.stop(); - - // Finalize OpenMC - openmc_simulation_finalize(); - - // Output all simulation results - sim.output_simulation_results(); - - // Rename statepoint and tallies file - rename_statepoint_file(simulation::current_timestep); - if (settings::output_tallies) { - rename_tallies_file(simulation::current_timestep); - } - - // Normalize and store final quantities for next time step - sim.domain()->normalize_final_quantities(); - sim.domain()->store_time_step_quantities(); - - // Advance time - simulation::current_time += settings::dt; - } + for (int i = 0; i < settings::n_timesteps; i++) + sim.kinetic_single_time_step(i); } ////////////////////////////////////////////////////////// // Run adjoint simulation (if enabled) ////////////////////////////////////////////////////////// - if (!adjoint_needed) { - return; - } - - reset_timers(); - - // Configure the domain for adjoint simulation - FlatSourceDomain::adjoint_ = true; - - if (mpi::master) - header("ADJOINT FLUX SOLVE", 3); - - sim.domain()->k_eff_ = 1.0; - - // Initialize adjoint fixed sources, if present - sim.prepare_fixed_sources_adjoint(); - - // Transpose scattering matrix - sim.domain()->transpose_scattering_matrix(); - - // Swap nu_sigma_f and chi - sim.domain()->nu_sigma_f_.swap(sim.domain()->chi_); - - // Initialize OpenMC general data structures - openmc_simulation_init(); - - // Begin main simulation timer - simulation::time_total.start(); - - // Execute random ray simulation - sim.simulate(); - - // End main simulation timer - simulation::time_total.stop(); - - // Finalize OpenMC - openmc_simulation_finalize(); - - // Output all simulation results - sim.output_simulation_results(); + sim.random_ray_adjoint(); } // Enforces restrictions on inputs in random ray mode. While there are @@ -494,6 +317,8 @@ void openmc_reset_random_ray() RandomRay::ray_source_.reset(); RandomRay::source_shape_ = RandomRaySourceShape::FLAT; RandomRay::sample_method_ = RandomRaySampleMethod::PRNG; + RandomRay::bd_order_ = 3; + RandomRay::time_method_ = RandomRayTimeMethod::ISOTROPIC; } void write_random_ray_hdf5(hid_t group) @@ -562,41 +387,29 @@ void write_random_ray_hdf5(hid_t group) close_group(random_ray_group); } -//----------------------------------------------------------------------------- -// Non-member functions for kinetic simulations - -void set_time_dependent_settings() +void print_random_ray_headers(bool& adjoint_needed) { - // Reset flags - simulation::is_initial_condition = false; - simulation::k_eff_correction = false; + // If we're going to do an adjoint simulation afterwards, report that this is + // the initial forward flux solve. + if (adjoint_needed && !FlatSourceDomain::adjoint_) + header("FORWARD FLUX SOLVE", 3); - // Set current time - simulation::current_time = settings::dt; + // Otherwise report that we are doing the adjoint simulation + if (adjoint_needed && FlatSourceDomain::adjoint_) + header("ADJOINT FLUX SOLVE", 3); } -// TODO: condense this into one function with rename_tallies_file and use char -// or string arguments -void rename_statepoint_file(int i) -{ - // Rename statepoint file - std::string old_filename_ = fmt::format( - "{0}statepoint.{1}.h5", settings::path_output, settings::n_batches); - std::string new_filename_ = - fmt::format("{0}openmc_td_simulation_{1}.h5", settings::path_output, i); - - const char* old_fname = old_filename_.c_str(); - const char* new_fname = new_filename_.c_str(); - std::rename(old_fname, new_fname); -} +//----------------------------------------------------------------------------- +// Non-member functions for kinetic simulations -void rename_tallies_file(int i) +void rename_time_step_file( + std::string base_filename, std::string extension, int i) { - // Rename tallies file + // Rename file std::string old_filename_ = - fmt::format("{0}tallies.out", settings::path_output); - std::string new_filename_ = - fmt::format("{0}tallies_{1}.out", settings::path_output, i); + fmt::format("{0}{1}{2}", settings::path_output, base_filename, extension); + std::string new_filename_ = fmt::format( + "{0}{1}_{2}{3}", settings::path_output, base_filename, i, extension); const char* old_fname = old_filename_.c_str(); const char* new_fname = new_filename_.c_str(); @@ -635,8 +448,21 @@ RandomRaySimulation::RandomRaySimulation() // internal to the random ray solver domain_->flatten_xs(); - // Initialize vectors used for the steady state + // Check if adjoint calculation is needed. If it is, we will run the forward + // calculation first and then the adjoint calculation later. + adjoint_needed_ = FlatSourceDomain::adjoint_; + + // Adjoint is always false for the forward calculation + FlatSourceDomain::adjoint_ = false; + + // The first simulation is run after initialization + is_first_simulation_ = true; + + // Initialize vectors used for baking in the initial condition during time + // stepping if (settings::kinetic_simulation) { + // Initialize vars used for time-consistent seed approach + static_avg_k_eff_; static_k_eff_; static_fission_rate_; } @@ -660,6 +486,139 @@ void RandomRaySimulation::prepare_fixed_sources_adjoint() } } +void RandomRaySimulation::print_random_ray_headers() +{ + openmc::print_random_ray_headers(adjoint_needed_); +} + +void RandomRaySimulation::run_single_simulation() +{ + if (!is_first_simulation_) { + if (mpi::master) + print_random_ray_headers(); + + // Reset the timers and reinitialize the general OpenMC datastructures if + // this is after the first simulation + reset_timers(); + + // Initialize OpenMC general data structures + openmc_simulation_init(); + } + + // Begin main simulation timer + simulation::time_total.start(); + + // Execute random ray simulation + simulate(); + + // End main simulation timer + simulation::time_total.stop(); + + // Normalize and save the final forward quantities + domain_->normalize_final_quantities(); + + // Finalize OpenMC + openmc_simulation_finalize(); + + // Output all simulation results + output_simulation_results(); + + // Toggle that the simulation object has been initialized after the first + // simulation + if (is_first_simulation_) + is_first_simulation_ = false; +} + +void RandomRaySimulation::random_ray_adjoint() +{ + if (!adjoint_needed_) { + return; + } + + // Configure the domain for adjoint simulation + FlatSourceDomain::adjoint_ = true; + + // Reset k-eff + domain_->k_eff_ = 1.0; + + // Initialize adjoint fixed sources, if present + prepare_fixed_sources_adjoint(); + + // Transpose scattering matrix + domain_->transpose_scattering_matrix(); + + // Swap nu_sigma_f and chi + domain_->nu_sigma_f_.swap(domain_->chi_); + + // Run a single simulation + run_single_simulation(); +} + +void RandomRaySimulation::kinetic_initial_condition() +{ + // Set flag for k_eff correction + simulation::k_eff_correction = true; + + static_avg_k_eff_ = simulation::keff; + domain_->k_eff_ = static_avg_k_eff_; + domain_->source_regions_.adjoint_reset(); + domain_->propagate_final_quantities(); + domain_->source_regions_.time_step_reset(); + + // Run the initial condition + run_single_simulation(); + + // Initialize the BD arrays + domain_->store_time_step_quantities(false); + + // Store k-eff corrected initial condition statepoints + rename_time_step_file( + fmt::format("statepoint.{0}", settings::n_batches), ".h5", 0); + if (settings::output_tallies) { + rename_time_step_file("tallies", ".out", 0); + } + + // Set flags for kinetic simulation + simulation::is_initial_condition = false; + simulation::k_eff_correction = false; + + // Set starting time as zero + simulation::current_time = 0; +} + +// TODO: Add support for time-dependent restart +void RandomRaySimulation::kinetic_single_time_step(int i) +{ + // Increment time step + simulation::current_timestep = i + 1; + simulation::current_time += settings::dt; + + // Propogate results of previous simulation + domain_->k_eff_ = static_avg_k_eff_; + domain_->source_regions_.adjoint_reset(); + domain_->propagate_final_quantities(); + domain_->source_regions_.time_step_reset(); + + // Compute RHS backward differences + domain_->compute_rhs_bd_quantities(); + + // Update time dependent cross section based on the density + domain_->update_material_density(i); + + // Run the simulation for the current time step + run_single_simulation(); + + // Rename statepoint and tallies file for the current time step + rename_time_step_file(fmt::format("statepoint.{0}", settings::n_batches), + ".h5", simulation::current_timestep); + if (settings::output_tallies) { + rename_time_step_file("tallies", ".out", simulation::current_timestep); + } + + // Store final quantities for the current time step + domain_->store_time_step_quantities(); +} + void RandomRaySimulation::simulate() { // Random ray power iteration loop diff --git a/src/simulation.cpp b/src/simulation.cpp index 5eb80789ee5..7fd325593d0 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -139,6 +139,19 @@ int openmc_simulation_init() // Display header if (mpi::master) { + if (settings::kinetic_simulation) { + if (simulation::is_initial_condition) { + if (simulation::k_eff_correction) + header("KINETIC SIMULATION INITIAL CONDITION (K-EFF CORRECTION)", 3); + else + header("KINETIC SIMULATION INITIAL CONDITION", 3); + } else { + std::string message = fmt::format( + "KINETIC SIMULATION TIME STEP {0}", simulation::current_timestep); + const char* msg = message.c_str(); + header(msg, 3); + } + } if (settings::run_mode == RunMode::FIXED_SOURCE) { if (settings::solver_type == SolverType::MONTE_CARLO) { header("FIXED SOURCE TRANSPORT SIMULATION", 3); @@ -323,7 +336,7 @@ const RegularMesh* ufs_mesh {nullptr}; vector k_generation; vector work_index; -bool is_initial_condition {false}; +bool is_initial_condition {true}; int current_timestep; double current_time; bool k_eff_correction {false}; diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py index 3a79c1d2836..dc0a60b51fb 100644 --- a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py @@ -53,5 +53,5 @@ def test_random_ray_auto_convert(method): model.settings.random_ray['source_region_meshes'] = [ (mesh, [model.geometry.root_universe])] - harness = KineticMGXSTestHarness(model, 6) + harness = KineticMGXSTestHarness("statepoint.10", 6, model) harness.main() diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py index 8312e7f6df7..50d4419d479 100644 --- a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py @@ -60,5 +60,5 @@ def test_random_ray_diagonal_stabilization(): model.settings.inactive = 15 model.settings.batches = 20 - harness = KineticMGXSTestHarness(model, 6) + harness = KineticMGXSTestHarness('statepoint.20', 6, model) harness.main() diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_kinetic/test.py index 8f17d6f5412..11a2b30fe87 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_kinetic/test.py @@ -26,5 +26,5 @@ def test_random_ray_time_dependent(time_method): model.settings.random_ray['time_method'] = time_method model.settings.batches = 400 model.settings.inactive = 200 - harness = KineticMGXSTestHarness(model, 6) + harness = KineticMGXSTestHarness('statepoint.400', 6, model) harness.main() diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py index d18951cf3cb..7e330c4257c 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py @@ -35,5 +35,5 @@ def test_random_ray_k_eff_mesh(): model.settings.random_ray['source_region_meshes'] = [(mesh, [root])] - harness = KineticMGXSTestHarness(model, 6) + harness = KineticMGXSTestHarness('statepoint.400', 6, model) harness.main() diff --git a/tests/testing_harness.py b/tests/testing_harness.py index c6ffc2a5cad..0adcc6c2825 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -293,8 +293,8 @@ def _cleanup(self): class KineticTestHarness(TestHarness): """General class for running OpenMC regression tests for kinetic simulations.""" - def __init__(self, n_timesteps): - self._sp_base = "openmc_td_simulation" + def __init__(self, statepoint_base, n_timesteps): + self._sp_base = statepoint_base self._n_timesteps = n_timesteps def main(self): @@ -597,8 +597,8 @@ def _cleanup(self): class KineticPyAPITestHarness(KineticTestHarness, PyAPITestHarness): - def __init__(self, model, n_timesteps, inputs_true=None): - super().__init__(n_timesteps) + def __init__(self, statepoint_base, n_timesteps, model, inputs_true=None): + super().__init__(statepoint_base, n_timesteps) self._model = model self._model.plots = [] @@ -660,7 +660,7 @@ def _compare_files(self, file_test, file_true, tol, index): file_test) print('Result differences:') print(''.join(colorize(diff))) - os.rename(file_test, f'results_error_{i}.dat') + os.rename(file_test, f'results_error_{index}.dat') assert compare, 'Results do not agree' From 604653b2991180962efd736ab5cc43f88bd3ddc6 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 4 Jan 2026 21:41:45 -0600 Subject: [PATCH 25/64] prepare for void material support in kinetic simulations - add void material flow control to kinetic machinery, in particular the calculation of source and scalar flux time derivatives - add some missing necessary terms to propagation machinery (inverse_velocity multiplication) - add SDP contributions to scalar flux in set_flux_to_flux_plus_source --- src/random_ray/flat_source_domain.cpp | 91 ++++++++++++++++++--------- 1 file changed, 62 insertions(+), 29 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index c606683c645..25688c9c34b 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -149,44 +149,52 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) } total_source = (scatter_source + fission_source * inverse_k_eff); - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - // Add delayed source - if (settings::create_delayed_neutrons) { - double delayed_source = 0.0; - for (int dg = 0; dg < ndgroups_; dg++) { - double chi_d = - chi_d_[material * negroups_ * ndgroups_ + dg * negroups_ + g_out]; - double lambda = lambda_[material * ndgroups_ + dg]; - double precursors = srh.precursors_old(dg); - delayed_source += chi_d * precursors * lambda; - } - total_source += delayed_source; - } - // Add derivative of scalar flux to source (only works for isotropic - // method) - if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { - double inverse_vbar = inverse_vbar_[material * negroups_ + g_out]; - double scalar_flux_rhs_bd = srh.scalar_flux_rhs_bd(g_out); - double A0 = - (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / - settings::dt; - double scalar_flux = srh.scalar_flux_old(g_out); - double scalar_flux_time_derivative = - A0 * scalar_flux + scalar_flux_rhs_bd; - total_source -= scalar_flux_time_derivative * inverse_vbar; + // Add delayed source for kinetic simulation if delayed neutrons are turned on + if (settings::kinetic_simulation && !simulation::is_initial_condition && + settings::create_delayed_neutrons) { + double delayed_source = 0.0; + for (int dg = 0; dg < ndgroups_; dg++) { + double chi_d = + chi_d_[material * negroups_ * ndgroups_ + dg * negroups_ + g_out]; + double lambda = lambda_[material * ndgroups_ + dg]; + double precursors = srh.precursors_old(dg); + delayed_source += chi_d * precursors * lambda; } + total_source += delayed_source; } srh.source(g_out) = total_source / sigma_t; } } - // TODO: Add control flow for k-eigenvalue forward-weighted adjoint // Add external source if in fixed source mode if (settings::run_mode == RunMode::FIXED_SOURCE) { for (int g = 0; g < negroups_; g++) { srh.source(g) += srh.external_source(g); } } + + // Add derivative of scalar flux to source (only works for isotropic + // method) + if (settings::kinetic_simulation && !simulation::is_initial_condition && + RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + int material = srh.material(); + for (int g = 0; g < negroups_; g++) { + double inverse_vbar = inverse_vbar_[material * negroups_ + g]; + double scalar_flux_rhs_bd = srh.scalar_flux_rhs_bd(g); + double A0 = + (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / + settings::dt; + double scalar_flux = srh.scalar_flux_old(g); + double scalar_flux_time_derivative = + A0 * scalar_flux + scalar_flux_rhs_bd; + + double sigma_t = 1.0; + if (material != MATERIAL_VOID) + double sigma_t = sigma_t_[material * negroups_ + g]; + + srh.source(g) -= scalar_flux_time_derivative * inverse_vbar / sigma_t; + } + } } // Compute new estimate of scattering + fission sources in each source region @@ -243,7 +251,6 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( int64_t sr, double volume, int g) { int material = source_regions_.material(sr); - // TODO: Implement support for time-dependent void transport if (material == MATERIAL_VOID) { source_regions_.scalar_flux_new(sr, g) /= volume; if (settings::run_mode == RunMode::FIXED_SOURCE) { @@ -251,6 +258,16 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( 0.5f * source_regions_.external_source(sr, g) * source_regions_.volume_sq(sr); } + // TODO: simplify this with the other one... + if (settings::kinetic_simulation && !simulation::is_initial_condition) { + double inverse_vbar = inverse_vbar_[material * negroups_ + g]; + double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); + double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / + settings::dt; + source_regions_.scalar_flux_new(sr, g) -= + scalar_flux_rhs_bd * inverse_vbar; + source_regions_.scalar_flux_new(sr, g) /= 1 + A0 * inverse_vbar; + } } else { double sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; source_regions_.scalar_flux_new(sr, g) /= (sigma_t * volume); @@ -1937,16 +1954,23 @@ int64_t FlatSourceDomain::lookup_mesh_bin(int64_t sr, Position r) const // kinetic simulations) sources in each source region based on the flux // estimate from the previous iteration. +//TODO: combine source time derivative and scalar flux time derivative into +// T1 void FlatSourceDomain::compute_single_neutron_source_time_derivative( SourceRegionHandle& srh) { double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; + int material = srh.material(); for (int g = 0; g < negroups_; g++) { float source_rhs_bd = srh.source_rhs_bd(g); float source = srh.source(g); + + double sigma_t = 1.0; + if (material != MATERIAL_VOID) + double sigma_t = sigma_t_[material * negroups_ + g]; + // Multiply out sigma_t to correctly compute the derivative term - double sigma_t = sigma_t_[srh.material() * negroups_ + g]; srh.source_time_derivative(g) = A0 * source * sigma_t + source_rhs_bd; // Divide by sigma_t to save time during transport srh.source_time_derivative(g) /= sigma_t; @@ -1958,12 +1982,21 @@ void FlatSourceDomain::compute_single_scalar_flux_time_derivative_2( { double B0 = (bd_coefficients_second_order_.at(RandomRay::bd_order_))[0] / (settings::dt * settings::dt); + int material = srh.material(); for (int g = 0; g < negroups_; g++) { double scalar_flux_rhs_bd_2 = srh.scalar_flux_rhs_bd_2(g); double scalar_flux = srh.scalar_flux_old(g); srh.scalar_flux_time_derivative_2(g) = B0 * scalar_flux + scalar_flux_rhs_bd_2; - double sigma_t = sigma_t_[srh.material() * negroups_ + g]; + double inverse_vbar = inverse_vbar_[material * negroups_ + g]; + + // Multiply by inverse_velocitiy to save time during transport + srh.scalar_flux_time_derivative_2(g) *= inverse_vbar; + + double sigma_t = 1.0; + if (material != MATERIAL_VOID) + double sigma_t = sigma_t_[material * negroups_ + g]; + // Divide by sigma_t to save time during transport srh.scalar_flux_time_derivative_2(g) /= sigma_t; } From ca5969e4c46a32ca6979eb3a5c9c0eaee15aba45 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 4 Jan 2026 22:15:50 -0600 Subject: [PATCH 26/64] use T1 variable instead of source_time_derivative and scalar_flux_time_derivative_2 --- .../openmc/random_ray/flat_source_domain.h | 3 +- include/openmc/random_ray/source_region.h | 66 +++----------- src/random_ray/flat_source_domain.cpp | 85 +++++++------------ src/random_ray/source_region.cpp | 23 ++--- 4 files changed, 49 insertions(+), 128 deletions(-) diff --git a/include/openmc/random_ray/flat_source_domain.h b/include/openmc/random_ray/flat_source_domain.h index 0362cebf40b..61e0ab0dd57 100644 --- a/include/openmc/random_ray/flat_source_domain.h +++ b/include/openmc/random_ray/flat_source_domain.h @@ -76,8 +76,7 @@ class FlatSourceDomain { //---------------------------------------------------------------------------- // Methods for kinetic simulations - void compute_single_neutron_source_time_derivative(SourceRegionHandle& srh); - void compute_single_scalar_flux_time_derivative_2(SourceRegionHandle& srh); + void compute_single_T1(SourceRegionHandle& srh); void compute_single_delayed_fission_source(SourceRegionHandle& srh); void compute_single_precursors(SourceRegionHandle& srh); diff --git a/include/openmc/random_ray/source_region.h b/include/openmc/random_ray/source_region.h index ab678c2d3c3..a3f795708bd 100644 --- a/include/openmc/random_ray/source_region.h +++ b/include/openmc/random_ray/source_region.h @@ -197,8 +197,7 @@ class SourceRegionHandle { // Public Data Members for kinetic simulations // Energy group-wise 1D time-derivative arrays - float* source_time_derivative_; - double* scalar_flux_time_derivative_2_; + double* T1_; // Delay group-wise 1D arrays double* delayed_fission_source_; @@ -343,20 +342,8 @@ class SourceRegionHandle { //--------------------------------------------------------------------------- // Public Accessors for kinetic simulations - float& source_time_derivative(int g) { return source_time_derivative_[g]; } - const float source_time_derivative(int g) const - { - return source_time_derivative_[g]; - } - - double& scalar_flux_time_derivative_2(int g) - { - return scalar_flux_time_derivative_2_[g]; - } - const double scalar_flux_time_derivative_2(int g) const - { - return scalar_flux_time_derivative_2_[g]; - } + double& T1(int g) { return T1_[g]; } + const double T1(int g) const { return T1_[g]; } double& delayed_fission_source(int dg) { return delayed_fission_source_[dg]; } const double delayed_fission_source(int dg) const @@ -503,11 +490,8 @@ class SourceRegion { //!< active iterations (used for SDP) // Energy group-wise 1D derivative arrays - vector source_time_derivative_; //!< The time derivative of the - //!< source (used for SDP) - vector scalar_flux_time_derivative_2_; //!< The 2nd order time - //!< derivative of the scalar - //!< flux (used for SDP) + vector T1_; //!< The combined sourcetime derivative and 2nd order + //!< scalar flux time derivative (used for SDP) // Delay group-wise 1D arrays vector delayed_fission_source_; //!< The delayed fission source binned //!< by delay group @@ -798,39 +782,10 @@ class SourceRegionContainer { //--------------------------------------- // For kinetic simulations - float& source_time_derivative(int64_t sr, int g) - { - return source_time_derivative_[index(sr, g)]; - } - const float& source_time_derivative(int64_t sr, int g) const - { - return source_time_derivative_[index(sr, g)]; - } - float& source_time_derivative(int64_t se) - { - return source_time_derivative_[se]; - } - const float& source_time_derivative(int64_t se) const - { - return source_time_derivative_[se]; - } - - double& scalar_flux_time_derivative_2(int64_t sr, int g) - { - return scalar_flux_time_derivative_2_[index(sr, g)]; - } - const double& scalar_flux_time_derivative_2(int64_t sr, int g) const - { - return scalar_flux_time_derivative_2_[index(sr, g)]; - } - double& scalar_flux_time_derivative_2(int64_t se) - { - return scalar_flux_time_derivative_2_[se]; - } - const double& scalar_flux_time_derivative_2(int64_t se) const - { - return scalar_flux_time_derivative_2_[se]; - } + double& T1(int64_t sr, int g) { return T1_[index(sr, g)]; } + const double& T1(int64_t sr, int g) const { return T1_[index(sr, g)]; } + double& T1(int64_t se) { return T1_[se]; } + const double& T1(int64_t se) const { return T1_[se]; } double& precursors_old(int64_t sr, int dg) { @@ -1079,8 +1034,7 @@ class SourceRegionContainer { // Private Data Members for kinetic simulations // SoA energy group-wise 2D derivative arrays flattened to 1D - vector source_time_derivative_; - vector scalar_flux_time_derivative_2_; + vector T1_; // SoA delay group-wise 2D arrays flattened to 1D vector delayed_fission_source_; diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 25688c9c34b..7a9acd128cd 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -149,9 +149,10 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) } total_source = (scatter_source + fission_source * inverse_k_eff); - // Add delayed source for kinetic simulation if delayed neutrons are turned on + // Add delayed source for kinetic simulation if delayed neutrons are + // turned on if (settings::kinetic_simulation && !simulation::is_initial_condition && - settings::create_delayed_neutrons) { + settings::create_delayed_neutrons) { double delayed_source = 0.0; for (int dg = 0; dg < ndgroups_; dg++) { double chi_d = @@ -175,24 +176,23 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) // Add derivative of scalar flux to source (only works for isotropic // method) - if (settings::kinetic_simulation && !simulation::is_initial_condition && - RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + if (settings::kinetic_simulation && !simulation::is_initial_condition && + RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { int material = srh.material(); for (int g = 0; g < negroups_; g++) { - double inverse_vbar = inverse_vbar_[material * negroups_ + g]; - double scalar_flux_rhs_bd = srh.scalar_flux_rhs_bd(g); - double A0 = - (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / - settings::dt; - double scalar_flux = srh.scalar_flux_old(g); - double scalar_flux_time_derivative = - A0 * scalar_flux + scalar_flux_rhs_bd; + double inverse_vbar = inverse_vbar_[material * negroups_ + g]; + double scalar_flux_rhs_bd = srh.scalar_flux_rhs_bd(g); + double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / + settings::dt; + double scalar_flux = srh.scalar_flux_old(g); + double scalar_flux_time_derivative = + A0 * scalar_flux + scalar_flux_rhs_bd; - double sigma_t = 1.0; - if (material != MATERIAL_VOID) - double sigma_t = sigma_t_[material * negroups_ + g]; + double sigma_t = 1.0; + if (material != MATERIAL_VOID) + double sigma_t = sigma_t_[material * negroups_ + g]; - srh.source(g) -= scalar_flux_time_derivative * inverse_vbar / sigma_t; + srh.source(g) -= scalar_flux_time_derivative * inverse_vbar / sigma_t; } } } @@ -209,8 +209,7 @@ void FlatSourceDomain::update_all_neutron_sources() update_single_neutron_source(srh); if (settings::kinetic_simulation && !simulation::is_initial_condition && RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - compute_single_neutron_source_time_derivative(srh); - compute_single_scalar_flux_time_derivative_2(srh); + compute_single_T1(srh); } } @@ -259,7 +258,8 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( source_regions_.volume_sq(sr); } // TODO: simplify this with the other one... - if (settings::kinetic_simulation && !simulation::is_initial_condition) { + if (settings::kinetic_simulation && !simulation::is_initial_condition && + RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { double inverse_vbar = inverse_vbar_[material * negroups_ + g]; double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / @@ -1793,8 +1793,7 @@ SourceRegionHandle FlatSourceDomain::get_subdivided_source_region_handle( update_single_neutron_source(handle); if (settings::kinetic_simulation && !simulation::is_initial_condition && RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - compute_single_neutron_source_time_derivative(handle); - compute_single_scalar_flux_time_derivative_2(handle); + compute_single_T1(handle); } // Unlock the parallel map. Note: we may be tempted to release @@ -1954,51 +1953,31 @@ int64_t FlatSourceDomain::lookup_mesh_bin(int64_t sr, Position r) const // kinetic simulations) sources in each source region based on the flux // estimate from the previous iteration. -//TODO: combine source time derivative and scalar flux time derivative into -// T1 -void FlatSourceDomain::compute_single_neutron_source_time_derivative( - SourceRegionHandle& srh) +// T1 calculation +void FlatSourceDomain::compute_single_T1(SourceRegionHandle& srh) { double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; - int material = srh.material(); - for (int g = 0; g < negroups_; g++) { - float source_rhs_bd = srh.source_rhs_bd(g); - float source = srh.source(g); - - double sigma_t = 1.0; - if (material != MATERIAL_VOID) - double sigma_t = sigma_t_[material * negroups_ + g]; - - // Multiply out sigma_t to correctly compute the derivative term - srh.source_time_derivative(g) = A0 * source * sigma_t + source_rhs_bd; - // Divide by sigma_t to save time during transport - srh.source_time_derivative(g) /= sigma_t; - } -} - -void FlatSourceDomain::compute_single_scalar_flux_time_derivative_2( - SourceRegionHandle& srh) -{ double B0 = (bd_coefficients_second_order_.at(RandomRay::bd_order_))[0] / (settings::dt * settings::dt); int material = srh.material(); for (int g = 0; g < negroups_; g++) { - double scalar_flux_rhs_bd_2 = srh.scalar_flux_rhs_bd_2(g); - double scalar_flux = srh.scalar_flux_old(g); - srh.scalar_flux_time_derivative_2(g) = - B0 * scalar_flux + scalar_flux_rhs_bd_2; double inverse_vbar = inverse_vbar_[material * negroups_ + g]; - - // Multiply by inverse_velocitiy to save time during transport - srh.scalar_flux_time_derivative_2(g) *= inverse_vbar; - double sigma_t = 1.0; if (material != MATERIAL_VOID) double sigma_t = sigma_t_[material * negroups_ + g]; + // Multiply out sigma_t to correctly compute the derivative term + double source_time_derivative = + A0 * srh.source(g) * sigma_t + srh.source_rhs_bd(g); + + double scalar_flux_time_derivative_2 = + B0 * srh.scalar_flux_old(g) + srh.scalar_flux_rhs_bd_2(g); + scalar_flux_time_derivative_2 *= inverse_vbar; + // Divide by sigma_t to save time during transport - srh.scalar_flux_time_derivative_2(g) /= sigma_t; + srh.T1(g) = + source_time_derivative - scalar_flux_time_derivative_2 / sigma_t; } } diff --git a/src/random_ray/source_region.cpp b/src/random_ray/source_region.cpp index 89d8d71b50f..503d8ab2b31 100644 --- a/src/random_ray/source_region.cpp +++ b/src/random_ray/source_region.cpp @@ -31,9 +31,7 @@ SourceRegionHandle::SourceRegionHandle(SourceRegion& sr) flux_moments_old_(sr.flux_moments_old_.data()), flux_moments_new_(sr.flux_moments_new_.data()), flux_moments_t_(sr.flux_moments_t_.data()), - tally_task_(sr.tally_task_.data()), - source_time_derivative_(sr.source_time_derivative_.data()), - scalar_flux_time_derivative_2_(sr.scalar_flux_time_derivative_2_.data()), + tally_task_(sr.tally_task_.data()), T1_(sr.T1_.data()), delayed_fission_source_(sr.delayed_fission_source_.data()), precursors_old_(sr.precursors_old_.data()), precursors_new_(sr.precursors_new_.data()), @@ -81,8 +79,7 @@ SourceRegion::SourceRegion(int negroups, int ndgroups, bool is_linear) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.assign(negroups, 0.0); - source_time_derivative_.assign(negroups, 0.0); - scalar_flux_time_derivative_2_.assign(negroups, 0.0); + T1_.assign(negroups, 0.0); source_bd_.resize(negroups); source_rhs_bd_.resize(negroups); @@ -167,9 +164,7 @@ void SourceRegionContainer::push_back(const SourceRegion& sr) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.push_back(sr.source_final_[g]); - source_time_derivative_.push_back(sr.source_time_derivative_[g]); - scalar_flux_time_derivative_2_.push_back( - sr.scalar_flux_time_derivative_2_[g]); + T1_.push_back(sr.T1_[g]); source_bd_.push_back(sr.source_bd_[g]); source_rhs_bd_.push_back(sr.source_rhs_bd_[g]); @@ -245,8 +240,7 @@ void SourceRegionContainer::assign( if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.clear(); - source_time_derivative_.clear(); - scalar_flux_time_derivative_2_.clear(); + T1_.clear(); source_bd_.clear(); source_rhs_bd_.clear(); @@ -329,9 +323,7 @@ SourceRegionHandle SourceRegionContainer::get_source_region_handle(int64_t sr) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { handle.source_final_ = &source_final(sr, 0); - handle.source_time_derivative_ = &source_time_derivative(sr, 0); - handle.scalar_flux_time_derivative_2_ = - &scalar_flux_time_derivative_2(sr, 0); + handle.T1_ = &T1(sr, 0); handle.source_bd_ = &source_bd(sr, 0); handle.source_rhs_bd_ = &source_rhs_bd(sr, 0); @@ -403,10 +395,7 @@ void SourceRegionContainer::adjoint_reset() std::fill(scalar_flux_rhs_bd_.begin(), scalar_flux_rhs_bd_.end(), 0.0); if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - std::fill( - source_time_derivative_.begin(), source_time_derivative_.end(), 0.0); - std::fill(scalar_flux_time_derivative_2_.begin(), - scalar_flux_time_derivative_2_.end(), 0.0); + std::fill(T1_.begin(), T1_.end(), 0.0); std::fill(source_rhs_bd_.begin(), source_rhs_bd_.end(), 0.0); std::fill( From ef4ffcbf8f3b846623ae3099181b8f94be31571e Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 4 Jan 2026 22:24:48 -0600 Subject: [PATCH 27/64] add SDP void char eqs, simplify SDP scalar flux calc --- src/random_ray/flat_source_domain.cpp | 40 ++++++++++++--------------- src/random_ray/random_ray.cpp | 37 +++++++++++++++---------- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 7a9acd128cd..5299dc20faa 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -257,32 +257,26 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( 0.5f * source_regions_.external_source(sr, g) * source_regions_.volume_sq(sr); } - // TODO: simplify this with the other one... - if (settings::kinetic_simulation && !simulation::is_initial_condition && - RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - double inverse_vbar = inverse_vbar_[material * negroups_ + g]; - double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); - double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / - settings::dt; - source_regions_.scalar_flux_new(sr, g) -= - scalar_flux_rhs_bd * inverse_vbar; - source_regions_.scalar_flux_new(sr, g) /= 1 + A0 * inverse_vbar; - } } else { - double sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; + double sigma_t = sigma_t_[material * negroups_ + g]; source_regions_.scalar_flux_new(sr, g) /= (sigma_t * volume); source_regions_.scalar_flux_new(sr, g) += source_regions_.source(sr, g); - if (settings::kinetic_simulation && !simulation::is_initial_condition && - RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - double inverse_vbar = - inverse_vbar_[source_regions_.material(sr) * negroups_ + g]; - double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); - double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / - settings::dt; - source_regions_.scalar_flux_new(sr, g) -= - scalar_flux_rhs_bd * inverse_vbar / sigma_t; - source_regions_.scalar_flux_new(sr, g) /= 1 + A0 * inverse_vbar / sigma_t; - } + } + if (settings::kinetic_simulation && !simulation::is_initial_condition && + RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + double inverse_vbar = + inverse_vbar_[source_regions_.material(sr) * negroups_ + g]; + double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); + double A0 = + (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; + + double sigma_t = 1.0; + if (material != MATERIAL_VOID) + sigma_t = sigma_t_[material * negroups_ + g]; + + source_regions_.scalar_flux_new(sr, g) -= + scalar_flux_rhs_bd * inverse_vbar / sigma_t; + source_regions_.scalar_flux_new(sr, g) /= 1 + A0 * inverse_vbar / sigma_t; } } diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index bc0acaeb6cf..a7ca573efda 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -454,19 +454,17 @@ void RandomRay::attenuate_flux_flat_source( float new_delta_psi = (angular_flux_[g] - srh.source(g)) * exponential; if (settings::kinetic_simulation && !simulation::is_initial_condition && RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - float source_derivative = srh.source_time_derivative(g); - float flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); - float T1 = (source_derivative - flux_derivative_2); - - // Source Derivative Propogation terms for Time Derivative - // Characteristic Equation float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; + float T1 = srh.T1(g); + + // Source Derivative Propogation terms for Characteristic Equation + float new_delta_psi_prime = (angular_flux_prime_[g] - T1); new_delta_psi += T1 * inverse_vbar * exponential / sigma_t; - new_delta_psi += distance * inverse_vbar * (angular_flux_prime_[g] - T1) * - (1 - exponential); + new_delta_psi += + distance * inverse_vbar * new_delta_psi_prime * (1 - exponential); // Time Derivative Characteristic Equation - float new_delta_psi_prime = (angular_flux_prime_[g] - T1) * exponential; + new_delta_psi_prime *= exponential; delta_psi_prime_[g] = new_delta_psi_prime; angular_flux_prime_[g] -= new_delta_psi_prime; } @@ -507,7 +505,6 @@ void RandomRay::attenuate_flux_flat_source( } // Alternative flux attenuation function for true void regions. -// TODO: Implement support for time dependent voids void RandomRay::attenuate_flux_flat_source_void( SourceRegionHandle& srh, double distance, bool is_active, Position r) { @@ -553,6 +550,21 @@ void RandomRay::attenuate_flux_flat_source_void( angular_flux_[g] += srh.external_source(g) * distance; } } + + if (settings::kinetic_simulation && !simulation::is_initial_condition && + RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + for (int g = 0; g < negroups_; g++) { + float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; + float T1 = srh.T1(g); + + // Source Derivative Propogation terms for Characteristic Equation + angular_flux_[g] -= inverse_vbar * angular_flux_prime_[g] * distance; + angular_flux_[g] -= distance * distance * 0.5f * T1; + + // Time Derivative Characteristic Equation + angular_flux_prime_[g] += T1 * distance; + } + } } void RandomRay::attenuate_flux_linear_source( @@ -847,10 +859,7 @@ void RandomRay::initialize_ray(uint64_t ray_id, FlatSourceDomain* domain) if (settings::kinetic_simulation && !simulation::is_initial_condition && RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { for (int g = 0; g < negroups_; g++) { - double source_derivative = srh.source_time_derivative(g); - double flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); - // T1 - angular_flux_prime_[g] = source_derivative - flux_derivative_2; + angular_flux_prime_[g] = srh.T1(g); } } } From a6250836bef72a40c234e5a246cf603016257b41 Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 5 Jan 2026 11:30:00 -0600 Subject: [PATCH 28/64] pincell benchmark doesn't change significantly, so it's safe to update tests --- .../isotropic/results_error_1.dat | 26 ++ .../isotropic/results_true_1.dat | 16 +- .../isotropic/results_true_2.dat | 20 +- .../isotropic/results_true_3.dat | 24 +- .../isotropic/results_true_4.dat | 30 +- .../isotropic/results_true_5.dat | 30 +- .../propagation/results_error_1.dat | 26 ++ .../propagation/results_true_1.dat | 16 +- .../propagation/results_true_2.dat | 20 +- .../propagation/results_true_3.dat | 24 +- .../propagation/results_true_4.dat | 30 +- .../propagation/results_true_5.dat | 30 +- .../results_error_1.dat | 236 ++++++++++ .../results_true_1.dat | 374 +++++++-------- .../results_true_2.dat | 392 ++++++++-------- .../results_true_3.dat | 406 ++++++++--------- .../results_true_4.dat | 414 ++++++++--------- .../results_true_5.dat | 424 +++++++++--------- 18 files changed, 1413 insertions(+), 1125 deletions(-) create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_error_1.dat create mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_error_1.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_error_1.dat diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_error_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_error_1.dat new file mode 100644 index 00000000000..724fc7d4d34 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_error_1.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.630159E+03 +3.458870E+04 +1.079877E+02 +5.830849E+01 +2.651400E+02 +3.515064E+02 +tally 2: +1.077582E+00 +5.805916E-03 +2.327021E+00 +2.707513E-02 +8.947056E-01 +4.002491E-03 +6.344421E-01 +2.012584E-03 +4.939691E-01 +1.220027E-03 +6.664304E-02 +2.220648E-05 +2.312958E-02 +2.674887E-06 +3.680700E-03 +6.773776E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat index 46dba4d56f4..724fc7d4d34 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.630190E+03 -3.458951E+04 -1.079890E+02 -5.830986E+01 -2.651431E+02 -3.515147E+02 +2.630159E+03 +3.458870E+04 +1.079877E+02 +5.830849E+01 +2.651400E+02 +3.515064E+02 tally 2: 1.077582E+00 5.805916E-03 @@ -22,5 +22,5 @@ tally 2: 2.220648E-05 2.312958E-02 2.674887E-06 -3.680701E-03 -6.773779E-08 +3.680700E-03 +6.773776E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat index 59ce5cb6cf3..fb51d52e79c 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628842E+03 -3.455405E+04 -1.078945E+02 -5.820788E+01 -2.649118E+02 -3.509018E+02 +2.628805E+03 +3.455310E+04 +1.078930E+02 +5.820630E+01 +2.649083E+02 +3.508923E+02 tally 2: 1.077582E+00 5.805915E-03 @@ -17,10 +17,10 @@ tally 2: 6.344416E-01 2.012581E-03 4.939683E-01 -1.220024E-03 +1.220023E-03 6.664281E-02 2.220632E-05 2.312938E-02 -2.674842E-06 -3.680634E-03 -6.773532E-08 +2.674841E-06 +3.680631E-03 +6.773523E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat index c237ebd2591..7138bda0c59 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.626019E+03 -3.447990E+04 -1.077393E+02 -5.804055E+01 -2.645315E+02 -3.498950E+02 +2.625967E+03 +3.447853E+04 +1.077372E+02 +5.803829E+01 +2.645264E+02 +3.498813E+02 tally 2: 1.077582E+00 5.805913E-03 @@ -18,9 +18,9 @@ tally 2: 2.012572E-03 4.939660E-01 1.220012E-03 -6.664210E-02 -2.220585E-05 -2.312878E-02 -2.674703E-06 -3.680428E-03 -6.772777E-08 +6.664208E-02 +2.220584E-05 +2.312877E-02 +2.674700E-06 +3.680424E-03 +6.772761E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat index 2a14986689a..47573c06fbd 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat @@ -1,26 +1,26 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621893E+03 -3.437163E+04 -1.075306E+02 -5.781591E+01 -2.640198E+02 -3.485426E+02 +2.621830E+03 +3.436997E+04 +1.075280E+02 +5.781316E+01 +2.640135E+02 +3.485261E+02 tally 2: 1.077581E+00 5.805908E-03 2.327017E+00 2.707505E-02 -8.947036E-01 +8.947035E-01 4.002472E-03 6.344375E-01 2.012555E-03 -4.939613E-01 -1.219989E-03 -6.664066E-02 -2.220489E-05 -2.312757E-02 -2.674422E-06 -3.680017E-03 -6.771264E-08 +4.939612E-01 +1.219988E-03 +6.664063E-02 +2.220487E-05 +2.312755E-02 +2.674417E-06 +3.680010E-03 +6.771238E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat index e66542145b7..e60cc8f7d0d 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616580E+03 -3.423247E+04 -1.072732E+02 -5.753947E+01 -2.633886E+02 -3.468780E+02 +2.616508E+03 +3.423058E+04 +1.072703E+02 +5.753634E+01 +2.633814E+02 +3.468591E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -14,13 +14,13 @@ tally 2: 2.707497E-02 8.947015E-01 4.002454E-03 -6.344330E-01 -2.012526E-03 -4.939535E-01 +6.344329E-01 +2.012525E-03 +4.939534E-01 1.219950E-03 -6.663827E-02 -2.220330E-05 -2.312556E-02 -2.673959E-06 -3.679343E-03 -6.768783E-08 +6.663823E-02 +2.220327E-05 +2.312553E-02 +2.673952E-06 +3.679333E-03 +6.768747E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_error_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_error_1.dat new file mode 100644 index 00000000000..724fc7d4d34 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_error_1.dat @@ -0,0 +1,26 @@ +k-combined: +1.325787E+00 5.102917E-04 +tally 1: +2.630159E+03 +3.458870E+04 +1.079877E+02 +5.830849E+01 +2.651400E+02 +3.515064E+02 +tally 2: +1.077582E+00 +5.805916E-03 +2.327021E+00 +2.707513E-02 +8.947056E-01 +4.002491E-03 +6.344421E-01 +2.012584E-03 +4.939691E-01 +1.220027E-03 +6.664304E-02 +2.220648E-05 +2.312958E-02 +2.674887E-06 +3.680700E-03 +6.773776E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat index 46dba4d56f4..724fc7d4d34 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.630190E+03 -3.458951E+04 -1.079890E+02 -5.830986E+01 -2.651431E+02 -3.515147E+02 +2.630159E+03 +3.458870E+04 +1.079877E+02 +5.830849E+01 +2.651400E+02 +3.515064E+02 tally 2: 1.077582E+00 5.805916E-03 @@ -22,5 +22,5 @@ tally 2: 2.220648E-05 2.312958E-02 2.674887E-06 -3.680701E-03 -6.773779E-08 +3.680700E-03 +6.773776E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat index 59ce5cb6cf3..fb51d52e79c 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628842E+03 -3.455405E+04 -1.078945E+02 -5.820788E+01 -2.649118E+02 -3.509018E+02 +2.628805E+03 +3.455310E+04 +1.078930E+02 +5.820630E+01 +2.649083E+02 +3.508923E+02 tally 2: 1.077582E+00 5.805915E-03 @@ -17,10 +17,10 @@ tally 2: 6.344416E-01 2.012581E-03 4.939683E-01 -1.220024E-03 +1.220023E-03 6.664281E-02 2.220632E-05 2.312938E-02 -2.674842E-06 -3.680634E-03 -6.773532E-08 +2.674841E-06 +3.680631E-03 +6.773523E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat index c237ebd2591..7138bda0c59 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.626019E+03 -3.447990E+04 -1.077393E+02 -5.804055E+01 -2.645315E+02 -3.498950E+02 +2.625967E+03 +3.447853E+04 +1.077372E+02 +5.803829E+01 +2.645264E+02 +3.498813E+02 tally 2: 1.077582E+00 5.805913E-03 @@ -18,9 +18,9 @@ tally 2: 2.012572E-03 4.939660E-01 1.220012E-03 -6.664210E-02 -2.220585E-05 -2.312878E-02 -2.674703E-06 -3.680428E-03 -6.772777E-08 +6.664208E-02 +2.220584E-05 +2.312877E-02 +2.674700E-06 +3.680424E-03 +6.772761E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat index 99def7858bf..47573c06fbd 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat @@ -1,26 +1,26 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621893E+03 -3.437163E+04 -1.075306E+02 -5.781591E+01 -2.640198E+02 -3.485427E+02 +2.621830E+03 +3.436997E+04 +1.075280E+02 +5.781316E+01 +2.640135E+02 +3.485261E+02 tally 2: 1.077581E+00 5.805908E-03 2.327017E+00 2.707505E-02 -8.947036E-01 +8.947035E-01 4.002472E-03 6.344375E-01 2.012555E-03 -4.939613E-01 -1.219989E-03 -6.664066E-02 -2.220489E-05 -2.312757E-02 -2.674422E-06 -3.680017E-03 -6.771264E-08 +4.939612E-01 +1.219988E-03 +6.664063E-02 +2.220487E-05 +2.312755E-02 +2.674417E-06 +3.680010E-03 +6.771238E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat index e66542145b7..e60cc8f7d0d 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616580E+03 -3.423247E+04 -1.072732E+02 -5.753947E+01 -2.633886E+02 -3.468780E+02 +2.616508E+03 +3.423058E+04 +1.072703E+02 +5.753634E+01 +2.633814E+02 +3.468591E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -14,13 +14,13 @@ tally 2: 2.707497E-02 8.947015E-01 4.002454E-03 -6.344330E-01 -2.012526E-03 -4.939535E-01 +6.344329E-01 +2.012525E-03 +4.939534E-01 1.219950E-03 -6.663827E-02 -2.220330E-05 -2.312556E-02 -2.673959E-06 -3.679343E-03 -6.768783E-08 +6.663823E-02 +2.220327E-05 +2.312553E-02 +2.673952E-06 +3.679333E-03 +6.768747E-08 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_error_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_error_1.dat new file mode 100644 index 00000000000..5998849c911 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_error_1.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.835334E+01 +2.336386E+01 +2.537083E+01 +3.219486E+00 +6.174753E+01 +1.907024E+01 +4.341616E+01 +9.425285E+00 +6.455038E+00 +2.083605E-01 +1.571027E+01 +1.234199E+00 +2.954946E+01 +4.365884E+00 +9.570224E-01 +4.579522E-03 +2.329201E+00 +2.712626E-02 +3.767664E+01 +7.097731E+00 +1.254577E+00 +7.870084E-03 +3.053390E+00 +4.661752E-02 +9.744533E+01 +4.747806E+01 +1.144186E+00 +6.545836E-03 +2.784754E+00 +3.877444E-02 +2.110393E+02 +2.226958E+02 +3.220474E-01 +5.186148E-04 +7.968838E-01 +3.175377E-03 +1.122158E+02 +6.297343E+01 +1.521665E+00 +1.158327E-02 +4.232435E+00 +8.961352E-02 +1.129400E+02 +6.377795E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.346085E+01 +1.429044E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.113062E+01 +4.845602E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.104556E+01 +8.423776E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.823418E+01 +4.824994E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.888989E+02 +1.784199E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.679142E+01 +4.685698E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.897467E+01 +1.739130E+01 +2.181728E+01 +2.380541E+00 +5.309890E+01 +1.410086E+01 +4.079630E+01 +8.321943E+00 +6.064107E+00 +1.838816E-01 +1.475882E+01 +1.089201E+00 +2.911833E+01 +4.239410E+00 +9.439005E-01 +4.454794E-03 +2.297265E+00 +2.638745E-02 +3.702648E+01 +6.854874E+00 +1.233532E+00 +7.608250E-03 +3.002169E+00 +4.506658E-02 +9.753183E+01 +4.756237E+01 +1.145985E+00 +6.566429E-03 +2.789132E+00 +3.889642E-02 +2.153203E+02 +2.318201E+02 +3.284693E-01 +5.394933E-04 +8.127742E-01 +3.303212E-03 +1.140024E+02 +6.499342E+01 +1.542077E+00 +1.189447E-02 +4.289209E+00 +9.202110E-02 +6.822066E+01 +2.327301E+01 +2.539795E+01 +3.226296E+00 +6.181353E+01 +1.911058E+01 +4.337368E+01 +9.406821E+00 +6.468280E+00 +2.092145E-01 +1.574250E+01 +1.239257E+00 +2.954020E+01 +4.363155E+00 +9.595552E-01 +4.603798E-03 +2.335365E+00 +2.727005E-02 +3.766396E+01 +7.092965E+00 +1.257902E+00 +7.911849E-03 +3.061483E+00 +4.686491E-02 +9.745374E+01 +4.748626E+01 +1.147635E+00 +6.585354E-03 +2.793148E+00 +3.900853E-02 +2.111575E+02 +2.229440E+02 +3.231097E-01 +5.220360E-04 +7.995123E-01 +3.196324E-03 +1.122446E+02 +6.300353E+01 +1.525862E+00 +1.164660E-02 +4.244109E+00 +9.010346E-02 +tally 2: +3.727210E-01 +6.946049E-04 +8.048851E-01 +3.239200E-03 +3.094666E-01 +4.788479E-04 +2.194451E-01 +2.407807E-04 +1.708574E-01 +1.459613E-04 +2.305100E-02 +2.656743E-06 +8.000270E-03 +3.200217E-07 +1.273126E-03 +8.104247E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327638E-01 +5.536587E-04 +7.185980E-01 +2.581916E-03 +2.762905E-01 +3.816822E-04 +1.959196E-01 +1.919225E-04 +1.525408E-01 +1.163435E-04 +2.057984E-02 +2.117648E-06 +7.142608E-03 +2.550842E-07 +1.136641E-03 +6.459768E-09 +3.721891E-01 +6.926236E-04 +8.037363E-01 +3.229960E-03 +3.090249E-01 +4.774820E-04 +2.191318E-01 +2.400938E-04 +1.706136E-01 +1.455450E-04 +2.301810E-02 +2.649164E-06 +7.988852E-03 +3.191088E-07 +1.271309E-03 +8.081129E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat index 53b4b39f8df..5998849c911 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835752E+01 -2.336672E+01 -2.537238E+01 -3.219879E+00 -6.175130E+01 -1.907257E+01 -4.341875E+01 -9.426410E+00 -6.455423E+00 -2.083854E-01 -1.571121E+01 -1.234346E+00 -2.955121E+01 -4.366400E+00 -9.570789E-01 -4.580063E-03 -2.329338E+00 -2.712946E-02 -3.767887E+01 -7.098573E+00 -1.254652E+00 -7.871018E-03 -3.053571E+00 -4.662305E-02 -9.745113E+01 -4.748370E+01 -1.144254E+00 -6.546615E-03 -2.784919E+00 -3.877905E-02 -2.110519E+02 -2.227224E+02 -3.220667E-01 -5.186767E-04 -7.969314E-01 -3.175756E-03 -1.122226E+02 -6.298103E+01 -1.521757E+00 -1.158467E-02 -4.232690E+00 -8.962434E-02 -1.129469E+02 -6.378582E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.346406E+01 -1.429216E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.113246E+01 -4.846176E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.104800E+01 -8.424776E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.824002E+01 -4.825568E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.889102E+02 -1.784412E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.679727E+01 -4.686264E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.897826E+01 -1.739342E+01 -2.181861E+01 -2.380831E+00 -5.310214E+01 -1.410257E+01 -4.079873E+01 -8.322934E+00 -6.064468E+00 -1.839035E-01 -1.475970E+01 -1.089331E+00 -2.912005E+01 -4.239911E+00 -9.439562E-01 -4.455320E-03 -2.297401E+00 -2.639056E-02 -3.702868E+01 -6.855687E+00 -1.233605E+00 -7.609153E-03 -3.002347E+00 -4.507192E-02 -9.753763E+01 -4.756803E+01 -1.146053E+00 -6.567210E-03 -2.789297E+00 -3.890105E-02 -2.153331E+02 -2.318478E+02 -3.284889E-01 -5.395577E-04 -8.128227E-01 -3.303606E-03 -1.140093E+02 -6.500127E+01 -1.542170E+00 -1.189591E-02 -4.289468E+00 -9.203222E-02 -6.822483E+01 -2.327586E+01 -2.539950E+01 -3.226689E+00 -6.181730E+01 -1.911291E+01 -4.337627E+01 -9.407943E+00 -6.468666E+00 -2.092394E-01 -1.574344E+01 -1.239405E+00 -2.954195E+01 -4.363671E+00 -9.596119E-01 -4.604342E-03 -2.335503E+00 -2.727327E-02 -3.766620E+01 -7.093806E+00 -1.257977E+00 -7.912788E-03 -3.061664E+00 -4.687047E-02 -9.745954E+01 -4.749190E+01 -1.147703E+00 -6.586138E-03 -2.793314E+00 -3.901316E-02 -2.111701E+02 -2.229707E+02 -3.231290E-01 -5.220983E-04 -7.995600E-01 -3.196706E-03 -1.122513E+02 -6.301114E+01 -1.525955E+00 -1.164801E-02 -4.244366E+00 -9.011434E-02 +6.835334E+01 +2.336386E+01 +2.537083E+01 +3.219486E+00 +6.174753E+01 +1.907024E+01 +4.341616E+01 +9.425285E+00 +6.455038E+00 +2.083605E-01 +1.571027E+01 +1.234199E+00 +2.954946E+01 +4.365884E+00 +9.570224E-01 +4.579522E-03 +2.329201E+00 +2.712626E-02 +3.767664E+01 +7.097731E+00 +1.254577E+00 +7.870084E-03 +3.053390E+00 +4.661752E-02 +9.744533E+01 +4.747806E+01 +1.144186E+00 +6.545836E-03 +2.784754E+00 +3.877444E-02 +2.110393E+02 +2.226958E+02 +3.220474E-01 +5.186148E-04 +7.968838E-01 +3.175377E-03 +1.122158E+02 +6.297343E+01 +1.521665E+00 +1.158327E-02 +4.232435E+00 +8.961352E-02 +1.129400E+02 +6.377795E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.346085E+01 +1.429044E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.113062E+01 +4.845602E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.104556E+01 +8.423776E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.823418E+01 +4.824994E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.888989E+02 +1.784199E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.679142E+01 +4.685698E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.897467E+01 +1.739130E+01 +2.181728E+01 +2.380541E+00 +5.309890E+01 +1.410086E+01 +4.079630E+01 +8.321943E+00 +6.064107E+00 +1.838816E-01 +1.475882E+01 +1.089201E+00 +2.911833E+01 +4.239410E+00 +9.439005E-01 +4.454794E-03 +2.297265E+00 +2.638745E-02 +3.702648E+01 +6.854874E+00 +1.233532E+00 +7.608250E-03 +3.002169E+00 +4.506658E-02 +9.753183E+01 +4.756237E+01 +1.145985E+00 +6.566429E-03 +2.789132E+00 +3.889642E-02 +2.153203E+02 +2.318201E+02 +3.284693E-01 +5.394933E-04 +8.127742E-01 +3.303212E-03 +1.140024E+02 +6.499342E+01 +1.542077E+00 +1.189447E-02 +4.289209E+00 +9.202110E-02 +6.822066E+01 +2.327301E+01 +2.539795E+01 +3.226296E+00 +6.181353E+01 +1.911058E+01 +4.337368E+01 +9.406821E+00 +6.468280E+00 +2.092145E-01 +1.574250E+01 +1.239257E+00 +2.954020E+01 +4.363155E+00 +9.595552E-01 +4.603798E-03 +2.335365E+00 +2.727005E-02 +3.766396E+01 +7.092965E+00 +1.257902E+00 +7.911849E-03 +3.061483E+00 +4.686491E-02 +9.745374E+01 +4.748626E+01 +1.147635E+00 +6.585354E-03 +2.793148E+00 +3.900853E-02 +2.111575E+02 +2.229440E+02 +3.231097E-01 +5.220360E-04 +7.995123E-01 +3.196324E-03 +1.122446E+02 +6.300353E+01 +1.525862E+00 +1.164660E-02 +4.244109E+00 +9.010346E-02 tally 2: 3.727210E-01 6.946049E-04 @@ -178,14 +178,14 @@ tally 2: 4.788479E-04 2.194451E-01 2.407807E-04 -1.708575E-01 -1.459614E-04 +1.708574E-01 +1.459613E-04 2.305100E-02 -2.656744E-06 -8.000275E-03 -3.200220E-07 -1.273127E-03 -8.104266E-09 +2.656743E-06 +8.000270E-03 +3.200217E-07 +1.273126E-03 +8.104247E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -213,24 +213,24 @@ tally 2: 1.525408E-01 1.163435E-04 2.057984E-02 -2.117649E-06 -7.142612E-03 -2.550845E-07 -1.136643E-03 -6.459783E-09 +2.117648E-06 +7.142608E-03 +2.550842E-07 +1.136641E-03 +6.459768E-09 3.721891E-01 6.926236E-04 8.037363E-01 3.229960E-03 3.090249E-01 4.774820E-04 -2.191319E-01 -2.400939E-04 +2.191318E-01 +2.400938E-04 1.706136E-01 1.455450E-04 2.301810E-02 -2.649166E-06 -7.988856E-03 -3.191091E-07 -1.271310E-03 -8.081148E-09 +2.649164E-06 +7.988852E-03 +3.191088E-07 +1.271309E-03 +8.081129E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat index 23ac3db9a86..96983433132 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat @@ -1,191 +1,191 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.841002E+01 -2.340263E+01 -2.539209E+01 -3.224884E+00 -6.179927E+01 -1.910222E+01 -4.345795E+01 -9.443438E+00 -6.461264E+00 -2.087626E-01 -1.572542E+01 -1.236581E+00 -2.958149E+01 -4.375353E+00 -9.580602E-01 -4.589460E-03 -2.331727E+00 -2.718512E-02 -3.771759E+01 -7.113168E+00 -1.255942E+00 -7.887213E-03 -3.056711E+00 -4.671898E-02 -9.755563E+01 -4.758560E+01 -1.145481E+00 -6.560664E-03 -2.787906E+00 -3.886227E-02 -2.112846E+02 -2.232138E+02 -3.224201E-01 -5.198158E-04 -7.978060E-01 -3.182731E-03 -1.123398E+02 -6.311269E+01 -1.523334E+00 -1.160868E-02 -4.237076E+00 -8.981014E-02 -1.130415E+02 -6.389267E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.351354E+01 -1.431862E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.116478E+01 -4.856241E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.109112E+01 -8.442486E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.834626E+01 -4.836011E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.891192E+02 -1.788363E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.689929E+01 -4.696147E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.902247E+01 -1.741950E+01 -2.183516E+01 -2.384443E+00 -5.314240E+01 -1.412397E+01 -4.083553E+01 -8.337955E+00 -6.069953E+00 -1.842363E-01 -1.477305E+01 -1.091302E+00 -2.914979E+01 -4.248577E+00 -9.449213E-01 -4.464434E-03 -2.299749E+00 -2.644455E-02 -3.706648E+01 -6.869692E+00 -1.234866E+00 -7.624718E-03 -3.005416E+00 -4.516412E-02 -9.764189E+01 -4.766977E+01 -1.147278E+00 -6.581260E-03 -2.792280E+00 -3.898427E-02 -2.155703E+02 -2.323588E+02 -3.288490E-01 -5.407413E-04 -8.137137E-01 -3.310853E-03 -1.141283E+02 -6.513702E+01 -1.543766E+00 -1.192054E-02 -4.293907E+00 -9.222278E-02 -6.827719E+01 -2.331160E+01 -2.541921E+01 -3.231700E+00 -6.186528E+01 -1.914259E+01 -4.341541E+01 -9.424932E+00 -6.474517E+00 -2.096181E-01 -1.575768E+01 -1.241648E+00 -2.957222E+01 -4.372617E+00 -9.605956E-01 -4.613787E-03 -2.337897E+00 -2.732922E-02 -3.770489E+01 -7.108388E+00 -1.259270E+00 -7.929064E-03 -3.064812E+00 -4.696688E-02 -9.756404E+01 -4.759381E+01 -1.148934E+00 -6.600271E-03 -2.796309E+00 -3.909688E-02 -2.114029E+02 -2.234627E+02 -3.234836E-01 -5.232451E-04 -8.004376E-01 -3.203727E-03 -1.123686E+02 -6.314287E+01 -1.527536E+00 -1.167216E-02 -4.248764E+00 -9.030121E-02 +6.840334E+01 +2.339806E+01 +2.538961E+01 +3.224253E+00 +6.179323E+01 +1.909848E+01 +4.345373E+01 +9.441604E+00 +6.460636E+00 +2.087221E-01 +1.572390E+01 +1.236341E+00 +2.957863E+01 +4.374507E+00 +9.579675E-01 +4.588572E-03 +2.331501E+00 +2.717986E-02 +3.771394E+01 +7.111791E+00 +1.255820E+00 +7.885686E-03 +3.056415E+00 +4.670993E-02 +9.754619E+01 +4.757639E+01 +1.145370E+00 +6.559394E-03 +2.787636E+00 +3.885475E-02 +2.112642E+02 +2.231706E+02 +3.223889E-01 +5.197153E-04 +7.977288E-01 +3.182115E-03 +1.123289E+02 +6.310040E+01 +1.523185E+00 +1.160642E-02 +4.236663E+00 +8.979264E-02 +1.130304E+02 +6.388017E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.350834E+01 +1.431584E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116176E+01 +4.855301E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.108714E+01 +8.440852E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.833674E+01 +4.835074E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891009E+02 +1.788017E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.688985E+01 +4.695232E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.901670E+01 +1.741609E+01 +2.183302E+01 +2.383977E+00 +5.313721E+01 +1.412121E+01 +4.083157E+01 +8.336336E+00 +6.069364E+00 +1.842005E-01 +1.477162E+01 +1.091090E+00 +2.914697E+01 +4.247755E+00 +9.448299E-01 +4.463571E-03 +2.299527E+00 +2.643943E-02 +3.706289E+01 +6.868362E+00 +1.234746E+00 +7.623242E-03 +3.005125E+00 +4.515537E-02 +9.763244E+01 +4.766055E+01 +1.147167E+00 +6.579986E-03 +2.792009E+00 +3.897673E-02 +2.155494E+02 +2.323139E+02 +3.288171E-01 +5.406366E-04 +8.136350E-01 +3.310212E-03 +1.141172E+02 +6.512433E+01 +1.543616E+00 +1.191822E-02 +4.293489E+00 +9.220481E-02 +6.827052E+01 +2.330704E+01 +2.541673E+01 +3.231069E+00 +6.185924E+01 +1.913885E+01 +4.341120E+01 +9.423102E+00 +6.473888E+00 +2.095774E-01 +1.575615E+01 +1.241407E+00 +2.956936E+01 +4.371772E+00 +9.605027E-01 +4.612895E-03 +2.337671E+00 +2.732394E-02 +3.770124E+01 +7.107012E+00 +1.259148E+00 +7.927529E-03 +3.064515E+00 +4.695779E-02 +9.755460E+01 +4.758459E+01 +1.148823E+00 +6.598993E-03 +2.796039E+00 +3.908931E-02 +2.113825E+02 +2.234194E+02 +3.234523E-01 +5.231438E-04 +8.003602E-01 +3.203107E-03 +1.123577E+02 +6.313057E+01 +1.527387E+00 +1.166989E-02 +4.248351E+00 +9.028362E-02 tally 2: 3.727211E-01 -6.946052E-04 +6.946051E-04 8.048854E-01 -3.239203E-03 +3.239202E-03 3.094668E-01 4.788484E-04 2.194454E-01 -2.407815E-04 -1.708581E-01 -1.459624E-04 -2.305119E-02 -2.656788E-06 -8.000435E-03 -3.200348E-07 -1.273182E-03 -8.104960E-09 +2.407814E-04 +1.708580E-01 +1.459623E-04 +2.305118E-02 +2.656784E-06 +8.000421E-03 +3.200337E-07 +1.273177E-03 +8.104900E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -208,29 +208,29 @@ tally 2: 2.581918E-03 2.762906E-01 3.816826E-04 -1.959200E-01 +1.959199E-01 1.919231E-04 -1.525414E-01 -1.163444E-04 -2.058001E-02 -2.117684E-06 -7.142754E-03 -2.550947E-07 -1.136691E-03 -6.460334E-09 +1.525413E-01 +1.163443E-04 +2.057999E-02 +2.117681E-06 +7.142742E-03 +2.550938E-07 +1.136687E-03 +6.460287E-09 3.721891E-01 6.926238E-04 8.037366E-01 -3.229963E-03 +3.229962E-03 3.090251E-01 4.774825E-04 2.191322E-01 2.400946E-04 1.706142E-01 -1.455461E-04 -2.301829E-02 -2.649209E-06 -7.989016E-03 -3.191219E-07 -1.271365E-03 -8.081840E-09 +1.455460E-04 +2.301828E-02 +2.649205E-06 +7.989002E-03 +3.191208E-07 +1.271360E-03 +8.081780E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat index e808b21c1bd..77d63f0fe88 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat @@ -1,191 +1,191 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.846307E+01 -2.343894E+01 -2.541200E+01 -3.229943E+00 -6.184772E+01 -1.913218E+01 -4.349756E+01 -9.460661E+00 -6.467166E+00 -2.091442E-01 -1.573979E+01 -1.238841E+00 -2.961208E+01 -4.384409E+00 -9.590517E-01 -4.598964E-03 -2.334140E+00 -2.724142E-02 -3.775670E+01 -7.127929E+00 -1.257245E+00 -7.903591E-03 -3.059883E+00 -4.681599E-02 -9.766116E+01 -4.768861E+01 -1.146720E+00 -6.574867E-03 -2.790922E+00 -3.894640E-02 -2.115194E+02 -2.237102E+02 -3.227768E-01 -5.209666E-04 -7.986886E-01 -3.189776E-03 -1.124581E+02 -6.324566E+01 -1.524925E+00 -1.163294E-02 -4.241501E+00 -8.999778E-02 -1.131371E+02 -6.400074E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.356354E+01 -1.434539E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.119742E+01 -4.866419E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.113468E+01 -8.460394E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.845352E+01 -4.846566E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.893301E+02 -1.792354E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.700220E+01 -4.706127E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.906713E+01 -1.744587E+01 -2.185187E+01 -2.388094E+00 -5.318307E+01 -1.414559E+01 -4.087271E+01 -8.353147E+00 -6.075495E+00 -1.845728E-01 -1.478654E+01 -1.093296E+00 -2.917985E+01 -4.257342E+00 -9.458963E-01 -4.473653E-03 -2.302122E+00 -2.649915E-02 -3.710467E+01 -6.883857E+00 -1.236140E+00 -7.640460E-03 -3.008517E+00 -4.525737E-02 -9.774718E+01 -4.777263E+01 -1.148515E+00 -6.595464E-03 -2.795291E+00 -3.906841E-02 -2.158096E+02 -2.328751E+02 -3.292123E-01 -5.419369E-04 -8.146128E-01 -3.318173E-03 -1.142483E+02 -6.527411E+01 -1.545376E+00 -1.194541E-02 -4.298386E+00 -9.241523E-02 -6.833010E+01 -2.334774E+01 -2.543913E+01 -3.236766E+00 -6.191375E+01 -1.917260E+01 -4.345497E+01 -9.442115E+00 -6.480429E+00 -2.100011E-01 -1.577207E+01 -1.243917E+00 -2.960280E+01 -4.381666E+00 -9.615896E-01 -4.623340E-03 -2.340316E+00 -2.738581E-02 -3.774398E+01 -7.123136E+00 -1.260577E+00 -7.945526E-03 -3.067991E+00 -4.706439E-02 -9.766957E+01 -4.769682E+01 -1.150177E+00 -6.614557E-03 -2.799334E+00 -3.918151E-02 -2.116379E+02 -2.239597E+02 -3.238415E-01 -5.244036E-04 -8.013232E-01 -3.210820E-03 -1.124869E+02 -6.327591E+01 -1.529132E+00 -1.169655E-02 -4.253202E+00 -9.048993E-02 +6.845368E+01 +2.343251E+01 +2.540851E+01 +3.229056E+00 +6.183923E+01 +1.912693E+01 +4.349163E+01 +9.458082E+00 +6.466284E+00 +2.090872E-01 +1.573764E+01 +1.238504E+00 +2.960807E+01 +4.383219E+00 +9.589215E-01 +4.597715E-03 +2.333823E+00 +2.723402E-02 +3.775158E+01 +7.125993E+00 +1.257074E+00 +7.901443E-03 +3.059467E+00 +4.680327E-02 +9.764789E+01 +4.767565E+01 +1.146565E+00 +6.573080E-03 +2.790543E+00 +3.893582E-02 +2.114907E+02 +2.236494E+02 +3.227330E-01 +5.208251E-04 +7.985801E-01 +3.188910E-03 +1.124427E+02 +6.322836E+01 +1.524716E+00 +1.162976E-02 +4.240920E+00 +8.997317E-02 +1.131215E+02 +6.398314E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.355623E+01 +1.434148E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.119318E+01 +4.865097E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.112909E+01 +8.458095E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.844015E+01 +4.845249E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.893044E+02 +1.791866E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.698893E+01 +4.704839E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.905902E+01 +1.744108E+01 +2.184887E+01 +2.387439E+00 +5.317577E+01 +1.414171E+01 +4.086715E+01 +8.350871E+00 +6.074667E+00 +1.845226E-01 +1.478452E+01 +1.092998E+00 +2.917589E+01 +4.256186E+00 +9.457679E-01 +4.472438E-03 +2.301810E+00 +2.649196E-02 +3.709963E+01 +6.881987E+00 +1.235972E+00 +7.638384E-03 +3.008108E+00 +4.524507E-02 +9.773390E+01 +4.775965E+01 +1.148359E+00 +6.593672E-03 +2.794911E+00 +3.905779E-02 +2.157803E+02 +2.328118E+02 +3.291676E-01 +5.417897E-04 +8.145022E-01 +3.317272E-03 +1.142327E+02 +6.525626E+01 +1.545165E+00 +1.194215E-02 +4.297798E+00 +9.238995E-02 +6.832072E+01 +2.334133E+01 +2.543564E+01 +3.235878E+00 +6.190525E+01 +1.916734E+01 +4.344905E+01 +9.439542E+00 +6.479546E+00 +2.099439E-01 +1.576992E+01 +1.243578E+00 +2.959878E+01 +4.380476E+00 +9.614590E-01 +4.622085E-03 +2.339999E+00 +2.737837E-02 +3.773886E+01 +7.121201E+00 +1.260405E+00 +7.943367E-03 +3.067575E+00 +4.705160E-02 +9.765630E+01 +4.768386E+01 +1.150020E+00 +6.612760E-03 +2.798954E+00 +3.917086E-02 +2.116091E+02 +2.238988E+02 +3.237976E-01 +5.242611E-04 +8.012144E-01 +3.209948E-03 +1.124716E+02 +6.325860E+01 +1.528922E+00 +1.169335E-02 +4.252620E+00 +9.046517E-02 tally 2: 3.727212E-01 6.946055E-04 -8.048859E-01 +8.048858E-01 3.239206E-03 3.094670E-01 -4.788493E-04 +4.788492E-04 2.194460E-01 -2.407828E-04 -1.708591E-01 -1.459642E-04 -2.305151E-02 -2.656862E-06 -8.000704E-03 -3.200564E-07 -1.273273E-03 -8.106118E-09 +2.407827E-04 +1.708590E-01 +1.459640E-04 +2.305148E-02 +2.656854E-06 +8.000676E-03 +3.200541E-07 +1.273263E-03 +8.105994E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -205,32 +205,32 @@ tally 2: 3.327639E-01 5.536592E-04 7.185987E-01 -2.581921E-03 +2.581920E-03 2.762909E-01 -3.816833E-04 -1.959205E-01 -1.919242E-04 -1.525423E-01 -1.163458E-04 -2.058029E-02 -2.117742E-06 -7.142994E-03 -2.551118E-07 -1.136772E-03 -6.461253E-09 +3.816832E-04 +1.959204E-01 +1.919241E-04 +1.525422E-01 +1.163456E-04 +2.058026E-02 +2.117736E-06 +7.142968E-03 +2.551100E-07 +1.136763E-03 +6.461154E-09 3.721892E-01 6.926241E-04 -8.037371E-01 -3.229967E-03 -3.090254E-01 +8.037370E-01 +3.229966E-03 +3.090253E-01 4.774833E-04 2.191328E-01 -2.400960E-04 -1.706153E-01 -1.455479E-04 -2.301861E-02 -2.649283E-06 -7.989285E-03 -3.191434E-07 -1.271455E-03 -8.082994E-09 +2.400958E-04 +1.706152E-01 +1.455477E-04 +2.301858E-02 +2.649275E-06 +7.989256E-03 +3.191411E-07 +1.271446E-03 +8.082870E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat index 4e969c448a1..5cde6dffcdc 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat @@ -1,191 +1,191 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.851748E+01 -2.347622E+01 -2.543241E+01 -3.235134E+00 -6.189740E+01 -1.916293E+01 -4.353803E+01 -9.478272E+00 -6.473195E+00 -2.095344E-01 -1.575446E+01 -1.241152E+00 -2.964326E+01 -4.393647E+00 -9.600620E-01 -4.608659E-03 -2.336599E+00 -2.729884E-02 -3.779657E+01 -7.142988E+00 -1.258573E+00 -7.920298E-03 -3.063115E+00 -4.691496E-02 -9.776864E+01 -4.779362E+01 -1.147982E+00 -6.589347E-03 -2.793994E+00 -3.903217E-02 -2.117585E+02 -2.242162E+02 -3.231400E-01 -5.221396E-04 -7.995873E-01 -3.196958E-03 -1.125787E+02 -6.338132E+01 -1.526546E+00 -1.165769E-02 -4.246011E+00 -9.018927E-02 -1.132349E+02 -6.411143E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361459E+01 -1.437275E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123068E+01 -4.876800E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117905E+01 -8.478656E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856275E+01 -4.857326E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895448E+02 -1.796421E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710707E+01 -4.716308E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911296E+01 -1.747295E+01 -2.186901E+01 -2.391843E+00 -5.322479E+01 -1.416780E+01 -4.091071E+01 -8.368683E+00 -6.081156E+00 -1.849170E-01 -1.480032E+01 -1.095334E+00 -2.921048E+01 -4.266284E+00 -9.468900E-01 -4.483057E-03 -2.304541E+00 -2.655486E-02 -3.714360E+01 -6.898309E+00 -1.237438E+00 -7.656520E-03 -3.011677E+00 -4.535250E-02 -9.785441E+01 -4.787751E+01 -1.149776E+00 -6.609946E-03 -2.798358E+00 -3.915419E-02 -2.160533E+02 -2.334013E+02 -3.295823E-01 -5.431557E-04 -8.155283E-01 -3.325636E-03 -1.143707E+02 -6.541399E+01 -1.547017E+00 -1.197080E-02 -4.302951E+00 -9.261162E-02 -6.838436E+01 -2.338484E+01 -2.545955E+01 -3.241965E+00 -6.196345E+01 -1.920339E+01 -4.349538E+01 -9.459686E+00 -6.486469E+00 -2.103927E-01 -1.578677E+01 -1.246237E+00 -2.963397E+01 -4.390897E+00 -9.626024E-01 -4.633085E-03 -2.342782E+00 -2.744353E-02 -3.778382E+01 -7.138180E+00 -1.261908E+00 -7.962318E-03 -3.071232E+00 -4.716385E-02 -9.777704E+01 -4.780184E+01 -1.151442E+00 -6.629123E-03 -2.802415E+00 -3.926779E-02 -2.118771E+02 -2.244662E+02 -3.242060E-01 -5.255844E-04 -8.022250E-01 -3.218050E-03 -1.126075E+02 -6.341165E+01 -1.530758E+00 -1.172144E-02 -4.257726E+00 -9.068250E-02 +6.850556E+01 +2.346805E+01 +2.542799E+01 +3.234009E+00 +6.188664E+01 +1.915627E+01 +4.353050E+01 +9.474995E+00 +6.472076E+00 +2.094619E-01 +1.575174E+01 +1.240723E+00 +2.963816E+01 +4.392134E+00 +9.598967E-01 +4.607072E-03 +2.336196E+00 +2.728944E-02 +3.779005E+01 +7.140526E+00 +1.258356E+00 +7.917569E-03 +3.062588E+00 +4.689879E-02 +9.775179E+01 +4.777715E+01 +1.147785E+00 +6.587076E-03 +2.793512E+00 +3.901872E-02 +2.117220E+02 +2.241389E+02 +3.230843E-01 +5.219597E-04 +7.994496E-01 +3.195857E-03 +1.125592E+02 +6.335934E+01 +1.526281E+00 +1.165365E-02 +4.245274E+00 +9.015799E-02 +1.132151E+02 +6.408909E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.360531E+01 +1.436778E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.122530E+01 +4.875120E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117195E+01 +8.475734E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.854577E+01 +4.855652E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895122E+02 +1.795802E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.709023E+01 +4.714672E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.910268E+01 +1.746687E+01 +2.186521E+01 +2.391011E+00 +5.321554E+01 +1.416287E+01 +4.090364E+01 +8.365790E+00 +6.080105E+00 +1.848531E-01 +1.479776E+01 +1.094956E+00 +2.920545E+01 +4.264815E+00 +9.467269E-01 +4.481513E-03 +2.304144E+00 +2.654571E-02 +3.713720E+01 +6.895932E+00 +1.237225E+00 +7.653882E-03 +3.011159E+00 +4.533687E-02 +9.783755E+01 +4.786101E+01 +1.149578E+00 +6.607668E-03 +2.797876E+00 +3.914070E-02 +2.160161E+02 +2.333209E+02 +3.295255E-01 +5.429686E-04 +8.153879E-01 +3.324490E-03 +1.143509E+02 +6.539131E+01 +1.546749E+00 +1.196665E-02 +4.302204E+00 +9.257950E-02 +6.837246E+01 +2.337670E+01 +2.545512E+01 +3.240837E+00 +6.195267E+01 +1.919671E+01 +4.348787E+01 +9.456416E+00 +6.485348E+00 +2.103200E-01 +1.578404E+01 +1.245806E+00 +2.962886E+01 +4.389384E+00 +9.624367E-01 +4.631490E-03 +2.342378E+00 +2.743408E-02 +3.777731E+01 +7.135721E+00 +1.261691E+00 +7.959574E-03 +3.070703E+00 +4.714760E-02 +9.776019E+01 +4.778537E+01 +1.151244E+00 +6.626839E-03 +2.801932E+00 +3.925426E-02 +2.118406E+02 +2.243889E+02 +3.241501E-01 +5.254034E-04 +8.020868E-01 +3.216942E-03 +1.125880E+02 +6.338965E+01 +1.530492E+00 +1.171738E-02 +4.256987E+00 +9.065105E-02 tally 2: 3.727213E-01 6.946060E-04 8.048865E-01 -3.239212E-03 +3.239211E-03 3.094674E-01 -4.788505E-04 -2.194469E-01 -2.407847E-04 -1.708606E-01 -1.459668E-04 -2.305197E-02 -2.656966E-06 -8.001084E-03 -3.200867E-07 -1.273400E-03 -8.107735E-09 +4.788503E-04 +2.194468E-01 +2.407845E-04 +1.708604E-01 +1.459664E-04 +2.305191E-02 +2.656953E-06 +8.001035E-03 +3.200829E-07 +1.273383E-03 +8.107528E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -202,35 +202,35 @@ tally 2: 0.000000E+00 0.000000E+00 0.000000E+00 -3.327641E-01 -5.536596E-04 +3.327640E-01 +5.536595E-04 7.185993E-01 2.581925E-03 2.762912E-01 -3.816842E-04 -1.959213E-01 -1.919257E-04 -1.525436E-01 -1.163478E-04 -2.058070E-02 -2.117825E-06 -7.143330E-03 -2.551359E-07 -1.136885E-03 -6.462534E-09 +3.816841E-04 +1.959212E-01 +1.919255E-04 +1.525435E-01 +1.163475E-04 +2.058064E-02 +2.117815E-06 +7.143287E-03 +2.551328E-07 +1.136870E-03 +6.462369E-09 3.721894E-01 -6.926247E-04 -8.037378E-01 -3.229972E-03 +6.926246E-04 +8.037377E-01 +3.229971E-03 3.090257E-01 -4.774846E-04 -2.191337E-01 -2.400979E-04 -1.706168E-01 -1.455504E-04 -2.301907E-02 -2.649387E-06 -7.989664E-03 -3.191736E-07 -1.271582E-03 -8.084606E-09 +4.774844E-04 +2.191336E-01 +2.400976E-04 +1.706166E-01 +1.455501E-04 +2.301901E-02 +2.649374E-06 +7.989616E-03 +3.191698E-07 +1.271566E-03 +8.084399E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat index 12b4941ec4b..b0af9505115 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat @@ -1,191 +1,191 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.857313E+01 -2.351436E+01 -2.545329E+01 -3.240447E+00 -6.194820E+01 -1.919440E+01 -4.357930E+01 -9.496248E+00 -6.479343E+00 -2.099326E-01 -1.576943E+01 -1.243511E+00 -2.967500E+01 -4.403058E+00 -9.610902E-01 -4.618536E-03 -2.339101E+00 -2.735735E-02 -3.783713E+01 -7.158327E+00 -1.259925E+00 -7.937318E-03 -3.066405E+00 -4.701577E-02 -9.787794E+01 -4.790055E+01 -1.149266E+00 -6.604089E-03 -2.797118E+00 -3.911950E-02 -2.120015E+02 -2.247312E+02 -3.235092E-01 -5.233335E-04 -8.005009E-01 -3.204269E-03 -1.127013E+02 -6.351950E+01 -1.528196E+00 -1.168290E-02 -4.250600E+00 -9.038432E-02 -1.133347E+02 -6.422456E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366663E+01 -1.440067E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126452E+01 -4.887375E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122419E+01 -8.497255E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867383E+01 -4.868280E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897631E+02 -1.800561E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721376E+01 -4.726677E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.915985E+01 -1.750068E+01 -2.188655E+01 -2.395681E+00 -5.326748E+01 -1.419053E+01 -4.094945E+01 -8.384540E+00 -6.086929E+00 -1.852683E-01 -1.481437E+01 -1.097415E+00 -2.924165E+01 -4.275395E+00 -9.479013E-01 -4.492638E-03 -2.307002E+00 -2.661161E-02 -3.718322E+01 -6.913032E+00 -1.238760E+00 -7.672882E-03 -3.014894E+00 -4.544942E-02 -9.796347E+01 -4.798428E+01 -1.151057E+00 -6.624691E-03 -2.801478E+00 -3.924154E-02 -2.163011E+02 -2.339368E+02 -3.299585E-01 -5.443962E-04 -8.164591E-01 -3.333231E-03 -1.144952E+02 -6.555646E+01 -1.548688E+00 -1.199666E-02 -4.307596E+00 -9.281167E-02 -6.843986E+01 -2.342281E+01 -2.548043E+01 -3.247284E+00 -6.201426E+01 -1.923491E+01 -4.353660E+01 -9.477620E+00 -6.492628E+00 -2.107925E-01 -1.580176E+01 -1.248604E+00 -2.966568E+01 -4.400301E+00 -9.636332E-01 -4.643013E-03 -2.345290E+00 -2.750234E-02 -3.782436E+01 -7.153506E+00 -1.263263E+00 -7.979424E-03 -3.074529E+00 -4.726518E-02 -9.788634E+01 -4.790877E+01 -1.152730E+00 -6.643953E-03 -2.805547E+00 -3.935564E-02 -2.121203E+02 -2.249818E+02 -3.245765E-01 -5.267864E-04 -8.031417E-01 -3.225410E-03 -1.127302E+02 -6.354990E+01 -1.532413E+00 -1.174680E-02 -4.262329E+00 -9.087866E-02 +6.855888E+01 +2.350460E+01 +2.544800E+01 +3.239101E+00 +6.193534E+01 +1.918643E+01 +4.357029E+01 +9.492325E+00 +6.478005E+00 +2.098459E-01 +1.576617E+01 +1.242997E+00 +2.966889E+01 +4.401246E+00 +9.608924E-01 +4.616635E-03 +2.338620E+00 +2.734609E-02 +3.782934E+01 +7.155380E+00 +1.259665E+00 +7.934050E-03 +3.065773E+00 +4.699641E-02 +9.785778E+01 +4.788082E+01 +1.149029E+00 +6.601370E-03 +2.796542E+00 +3.910339E-02 +2.119579E+02 +2.246387E+02 +3.234426E-01 +5.231181E-04 +8.003362E-01 +3.202950E-03 +1.126780E+02 +6.349319E+01 +1.527880E+00 +1.167806E-02 +4.249720E+00 +9.034688E-02 +1.133111E+02 +6.419784E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.365554E+01 +1.439471E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.125808E+01 +4.885363E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.121570E+01 +8.493756E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.865351E+01 +4.866275E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897240E+02 +1.799819E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.719362E+01 +4.724719E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.914757E+01 +1.749342E+01 +2.188200E+01 +2.394686E+00 +5.325642E+01 +1.418464E+01 +4.094099E+01 +8.381077E+00 +6.085673E+00 +1.851918E-01 +1.481131E+01 +1.096962E+00 +2.923563E+01 +4.273635E+00 +9.477062E-01 +4.490789E-03 +2.306527E+00 +2.660065E-02 +3.717556E+01 +6.910185E+00 +1.238505E+00 +7.669723E-03 +3.014273E+00 +4.543070E-02 +9.794330E+01 +4.796453E+01 +1.150820E+00 +6.621963E-03 +2.800901E+00 +3.922538E-02 +2.162565E+02 +2.338405E+02 +3.298906E-01 +5.441722E-04 +8.162911E-01 +3.331859E-03 +1.144715E+02 +6.552931E+01 +1.548367E+00 +1.199169E-02 +4.306704E+00 +9.277322E-02 +6.842564E+01 +2.341308E+01 +2.547514E+01 +3.245936E+00 +6.200139E+01 +1.922692E+01 +4.352760E+01 +9.473706E+00 +6.491287E+00 +2.107054E-01 +1.579849E+01 +1.248089E+00 +2.965958E+01 +4.398490E+00 +9.634349E-01 +4.641102E-03 +2.344808E+00 +2.749102E-02 +3.781657E+01 +7.150561E+00 +1.263003E+00 +7.976139E-03 +3.073896E+00 +4.724572E-02 +9.786618E+01 +4.788904E+01 +1.152492E+00 +6.641218E-03 +2.804970E+00 +3.933943E-02 +2.120766E+02 +2.248892E+02 +3.245097E-01 +5.265696E-04 +8.029764E-01 +3.224082E-03 +1.127069E+02 +6.352357E+01 +1.532095E+00 +1.174193E-02 +4.261446E+00 +9.084101E-02 tally 2: 3.727215E-01 -6.946067E-04 -8.048874E-01 -3.239219E-03 +6.946066E-04 +8.048873E-01 +3.239218E-03 3.094679E-01 -4.788521E-04 -2.194480E-01 -2.407872E-04 -1.708625E-01 -1.459700E-04 -2.305255E-02 -2.657101E-06 -8.001572E-03 -3.201258E-07 -1.273562E-03 -8.109799E-09 +4.788518E-04 +2.194479E-01 +2.407868E-04 +1.708623E-01 +1.459696E-04 +2.305247E-02 +2.657081E-06 +8.001500E-03 +3.201200E-07 +1.273538E-03 +8.109490E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -204,33 +204,33 @@ tally 2: 0.000000E+00 3.327642E-01 5.536601E-04 -7.186001E-01 -2.581931E-03 -2.762917E-01 -3.816855E-04 -1.959223E-01 -1.919277E-04 -1.525453E-01 -1.163504E-04 -2.058122E-02 -2.117932E-06 -7.143764E-03 -2.551668E-07 -1.137028E-03 -6.464168E-09 -3.721896E-01 -6.926253E-04 -8.037386E-01 -3.229979E-03 -3.090263E-01 -4.774861E-04 -2.191348E-01 -2.401004E-04 -1.706187E-01 -1.455537E-04 -2.301965E-02 -2.649522E-06 -7.990151E-03 -3.192126E-07 -1.271744E-03 -8.086663E-09 +7.186000E-01 +2.581930E-03 +2.762916E-01 +3.816853E-04 +1.959221E-01 +1.919274E-04 +1.525451E-01 +1.163500E-04 +2.058114E-02 +2.117916E-06 +7.143699E-03 +2.551622E-07 +1.137007E-03 +6.463922E-09 +3.721895E-01 +6.926252E-04 +8.037385E-01 +3.229978E-03 +3.090262E-01 +4.774859E-04 +2.191347E-01 +2.401000E-04 +1.706184E-01 +1.455532E-04 +2.301956E-02 +2.649502E-06 +7.990079E-03 +3.192068E-07 +1.271720E-03 +8.086355E-09 From 22a65e753fa6d556c69f894eead051def1b8b11f Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 5 Jan 2026 12:09:58 -0600 Subject: [PATCH 29/64] typo fix in docs --- docs/source/methods/random_ray.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/methods/random_ray.rst b/docs/source/methods/random_ray.rst index 228d134f3d1..318f9aa0484 100644 --- a/docs/source/methods/random_ray.rst +++ b/docs/source/methods/random_ray.rst @@ -1275,7 +1275,7 @@ Applying Equation :eq:`ical-isotropic` to Equation :eq:`moc_td_final_flat` yield .. math:: :label: char-td-isotropic - \Delta \psi(t) = \left(\psi_{r,g}(0, t) - \frac{Q_{i,g}(t)}{\Sigma{t,i,g}(t)} + \frac{1}{4\pi v_g \Sigma_{t,i,g}(t)} \frac{d}{d t} \phi_{i,g}(t)\right) (1 - e^{-\Sigma_t,i,g(t) \ell_r}) + \Delta \psi(t) = \left(\psi_{r,g}(0, t) - \frac{Q_{i,g}(t)}{\Sigma_{t,i,g}(t)} + \frac{1}{4\pi v_g \Sigma_{t,i,g}(t)} \frac{d}{d t} \phi_{i,g}(t)\right) (1 - e^{-\Sigma_{t,i,g}(t) \ell_r}) This approach was first applied to the random ray method by `Kraus From 07049795d2eac89dca46267fc9d9268bd6ff73f5 Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 5 Jan 2026 12:19:04 -0600 Subject: [PATCH 30/64] fix sigma_t division error for sdp T1 term --- src/random_ray/flat_source_domain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 5299dc20faa..b482e175dcb 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -1971,7 +1971,7 @@ void FlatSourceDomain::compute_single_T1(SourceRegionHandle& srh) // Divide by sigma_t to save time during transport srh.T1(g) = - source_time_derivative - scalar_flux_time_derivative_2 / sigma_t; + (source_time_derivative - scalar_flux_time_derivative_2) / sigma_t; } } From 9d62cde8e7459056b7d028604f77d8326096deae Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 5 Jan 2026 12:57:34 -0600 Subject: [PATCH 31/64] adjust TI method for void regions --- .../openmc/random_ray/flat_source_domain.h | 1 + include/openmc/random_ray/source_region.h | 17 +++++- src/random_ray/flat_source_domain.cpp | 58 +++++++++---------- src/random_ray/random_ray.cpp | 56 ++++++++++-------- src/random_ray/source_region.cpp | 31 +++++++--- 5 files changed, 99 insertions(+), 64 deletions(-) diff --git a/include/openmc/random_ray/flat_source_domain.h b/include/openmc/random_ray/flat_source_domain.h index 61e0ab0dd57..2e427ffcad5 100644 --- a/include/openmc/random_ray/flat_source_domain.h +++ b/include/openmc/random_ray/flat_source_domain.h @@ -76,6 +76,7 @@ class FlatSourceDomain { //---------------------------------------------------------------------------- // Methods for kinetic simulations + void compute_single_phi_prime(SourceRegionHandle& srh); void compute_single_T1(SourceRegionHandle& srh); void compute_single_delayed_fission_source(SourceRegionHandle& srh); diff --git a/include/openmc/random_ray/source_region.h b/include/openmc/random_ray/source_region.h index a3f795708bd..5312a42b2de 100644 --- a/include/openmc/random_ray/source_region.h +++ b/include/openmc/random_ray/source_region.h @@ -197,6 +197,7 @@ class SourceRegionHandle { // Public Data Members for kinetic simulations // Energy group-wise 1D time-derivative arrays + double* phi_prime_; double* T1_; // Delay group-wise 1D arrays @@ -342,6 +343,9 @@ class SourceRegionHandle { //--------------------------------------------------------------------------- // Public Accessors for kinetic simulations + double& phi_prime(int g) { return phi_prime_[g]; } + const double phi_prime(int g) const { return phi_prime_[g]; } + double& T1(int g) { return T1_[g]; } const double T1(int g) const { return T1_[g]; } @@ -490,7 +494,9 @@ class SourceRegion { //!< active iterations (used for SDP) // Energy group-wise 1D derivative arrays - vector T1_; //!< The combined sourcetime derivative and 2nd order + vector + phi_prime_; //!< The 1st order scalar flux time derivative (used for TI) + vector T1_; //!< The combined source time derivative and 2nd order //!< scalar flux time derivative (used for SDP) // Delay group-wise 1D arrays vector delayed_fission_source_; //!< The delayed fission source binned @@ -782,6 +788,14 @@ class SourceRegionContainer { //--------------------------------------- // For kinetic simulations + double& phi_prime(int64_t sr, int g) { return phi_prime_[index(sr, g)]; } + const double& phi_prime(int64_t sr, int g) const + { + return phi_prime_[index(sr, g)]; + } + double& phi_prime(int64_t se) { return phi_prime_[se]; } + const double& phi_prime(int64_t se) const { return phi_prime_[se]; } + double& T1(int64_t sr, int g) { return T1_[index(sr, g)]; } const double& T1(int64_t sr, int g) const { return T1_[index(sr, g)]; } double& T1(int64_t se) { return T1_[se]; } @@ -1034,6 +1048,7 @@ class SourceRegionContainer { // Private Data Members for kinetic simulations // SoA energy group-wise 2D derivative arrays flattened to 1D + vector phi_prime_; vector T1_; // SoA delay group-wise 2D arrays flattened to 1D diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index b482e175dcb..6cceffd42bc 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -173,28 +173,6 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) srh.source(g) += srh.external_source(g); } } - - // Add derivative of scalar flux to source (only works for isotropic - // method) - if (settings::kinetic_simulation && !simulation::is_initial_condition && - RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { - int material = srh.material(); - for (int g = 0; g < negroups_; g++) { - double inverse_vbar = inverse_vbar_[material * negroups_ + g]; - double scalar_flux_rhs_bd = srh.scalar_flux_rhs_bd(g); - double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / - settings::dt; - double scalar_flux = srh.scalar_flux_old(g); - double scalar_flux_time_derivative = - A0 * scalar_flux + scalar_flux_rhs_bd; - - double sigma_t = 1.0; - if (material != MATERIAL_VOID) - double sigma_t = sigma_t_[material * negroups_ + g]; - - srh.source(g) -= scalar_flux_time_derivative * inverse_vbar / sigma_t; - } - } } // Compute new estimate of scattering + fission sources in each source region @@ -207,9 +185,11 @@ void FlatSourceDomain::update_all_neutron_sources() for (int64_t sr = 0; sr < n_source_regions(); sr++) { SourceRegionHandle srh = source_regions_.get_source_region_handle(sr); update_single_neutron_source(srh); - if (settings::kinetic_simulation && !simulation::is_initial_condition && - RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - compute_single_T1(srh); + if (settings::kinetic_simulation && !simulation::is_initial_condition) { + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) + compute_single_phi_prime(srh); + else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) + compute_single_T1(srh); } } @@ -262,8 +242,7 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( source_regions_.scalar_flux_new(sr, g) /= (sigma_t * volume); source_regions_.scalar_flux_new(sr, g) += source_regions_.source(sr, g); } - if (settings::kinetic_simulation && !simulation::is_initial_condition && - RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { double inverse_vbar = inverse_vbar_[source_regions_.material(sr) * negroups_ + g]; double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); @@ -1785,9 +1764,11 @@ SourceRegionHandle FlatSourceDomain::get_subdivided_source_region_handle( // Compute the combined source term update_single_neutron_source(handle); - if (settings::kinetic_simulation && !simulation::is_initial_condition && - RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - compute_single_T1(handle); + if (settings::kinetic_simulation && !simulation::is_initial_condition) { + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) + compute_single_phi_prime(handle); + else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) + compute_single_T1(handle); } // Unlock the parallel map. Note: we may be tempted to release @@ -1947,6 +1928,23 @@ int64_t FlatSourceDomain::lookup_mesh_bin(int64_t sr, Position r) const // kinetic simulations) sources in each source region based on the flux // estimate from the previous iteration. +void FlatSourceDomain::compute_single_phi_prime(SourceRegionHandle& srh) +{ + double A0 = + (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; + int material = srh.material(); + for (int g = 0; g < negroups_; g++) { + double inverse_vbar = inverse_vbar_[material * negroups_ + g]; + double sigma_t = 1.0; + if (material != MATERIAL_VOID) + double sigma_t = sigma_t_[material * negroups_ + g]; + + double scalar_flux_time_derivative = + A0 * srh.scalar_flux_old(g) + srh.scalar_flux_rhs_bd(g); + srh.phi_prime(g) = scalar_flux_time_derivative * inverse_vbar / sigma_t; + } +} + // T1 calculation void FlatSourceDomain::compute_single_T1(SourceRegionHandle& srh) { diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index a7ca573efda..f2ebd010c5b 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -452,21 +452,24 @@ void RandomRay::attenuate_flux_flat_source( float tau = sigma_t * distance; float exponential = cjosey_exponential(tau); // exponential = 1 - exp(-tau) float new_delta_psi = (angular_flux_[g] - srh.source(g)) * exponential; - if (settings::kinetic_simulation && !simulation::is_initial_condition && - RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; - float T1 = srh.T1(g); - - // Source Derivative Propogation terms for Characteristic Equation - float new_delta_psi_prime = (angular_flux_prime_[g] - T1); - new_delta_psi += T1 * inverse_vbar * exponential / sigma_t; - new_delta_psi += - distance * inverse_vbar * new_delta_psi_prime * (1 - exponential); - - // Time Derivative Characteristic Equation - new_delta_psi_prime *= exponential; - delta_psi_prime_[g] = new_delta_psi_prime; - angular_flux_prime_[g] -= new_delta_psi_prime; + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + new_delta_psi += srh.phi_prime(g) * exponential; + } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + float T1 = srh.T1(g); + + // Source Derivative Propogation terms for Characteristic Equation + float new_delta_psi_prime = (angular_flux_prime_[g] - T1); + new_delta_psi += T1 * inverse_vbar * exponential / sigma_t; + new_delta_psi += + distance * inverse_vbar * new_delta_psi_prime * (1 - exponential); + + // Time Derivative Characteristic Equation + new_delta_psi_prime *= exponential; + delta_psi_prime_[g] = new_delta_psi_prime; + angular_flux_prime_[g] -= new_delta_psi_prime; + } } delta_psi_[g] = new_delta_psi; angular_flux_[g] -= new_delta_psi; @@ -551,18 +554,21 @@ void RandomRay::attenuate_flux_flat_source_void( } } - if (settings::kinetic_simulation && !simulation::is_initial_condition && - RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + if (settings::kinetic_simulation && !simulation::is_initial_condition) { for (int g = 0; g < negroups_; g++) { - float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; - float T1 = srh.T1(g); - - // Source Derivative Propogation terms for Characteristic Equation - angular_flux_[g] -= inverse_vbar * angular_flux_prime_[g] * distance; - angular_flux_[g] -= distance * distance * 0.5f * T1; - - // Time Derivative Characteristic Equation - angular_flux_prime_[g] += T1 * distance; + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + angular_flux_[g] -= srh.phi_prime(g) * distance; + } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; + float T1 = srh.T1(g); + + // Source Derivative Propogation terms for Characteristic Equation + angular_flux_[g] -= inverse_vbar * angular_flux_prime_[g] * distance; + angular_flux_[g] -= distance * distance * 0.5f * T1; + + // Time Derivative Characteristic Equation + angular_flux_prime_[g] += T1 * distance; + } } } } diff --git a/src/random_ray/source_region.cpp b/src/random_ray/source_region.cpp index 503d8ab2b31..2d22adc0fac 100644 --- a/src/random_ray/source_region.cpp +++ b/src/random_ray/source_region.cpp @@ -31,7 +31,8 @@ SourceRegionHandle::SourceRegionHandle(SourceRegion& sr) flux_moments_old_(sr.flux_moments_old_.data()), flux_moments_new_(sr.flux_moments_new_.data()), flux_moments_t_(sr.flux_moments_t_.data()), - tally_task_(sr.tally_task_.data()), T1_(sr.T1_.data()), + tally_task_(sr.tally_task_.data()), phi_prime_(sr.phi_prime_.data()), + T1_(sr.T1_.data()), delayed_fission_source_(sr.delayed_fission_source_.data()), precursors_old_(sr.precursors_old_.data()), precursors_new_(sr.precursors_new_.data()), @@ -75,8 +76,11 @@ SourceRegion::SourceRegion(int negroups, int ndgroups, bool is_linear) scalar_flux_bd_.resize(negroups); scalar_flux_rhs_bd_.resize(negroups); - // Source Derivative Propogation arrays - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + // Time Isotropic arrays + phi_prime_.assign(negroups, 0.0); + } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + // Source Derivative Propogation arrays source_final_.assign(negroups, 0.0); T1_.assign(negroups, 0.0); @@ -160,8 +164,11 @@ void SourceRegionContainer::push_back(const SourceRegion& sr) scalar_flux_bd_.push_back(sr.scalar_flux_bd_[g]); scalar_flux_rhs_bd_.push_back(sr.scalar_flux_rhs_bd_[g]); - // Source Derivative Propogation arrays - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + // Time Isotropic arrays + phi_prime_.push_back(sr.phi_prime_[g]); + } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + // Source Derivative Propogation arrays source_final_.push_back(sr.source_final_[g]); T1_.push_back(sr.T1_[g]); @@ -237,7 +244,9 @@ void SourceRegionContainer::assign( scalar_flux_bd_.clear(); scalar_flux_rhs_bd_.clear(); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + phi_prime_.clear(); + } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.clear(); T1_.clear(); @@ -320,7 +329,9 @@ SourceRegionHandle SourceRegionContainer::get_source_region_handle(int64_t sr) handle.scalar_flux_bd_ = &scalar_flux_bd(sr, 0); handle.scalar_flux_rhs_bd_ = &scalar_flux_rhs_bd(sr, 0); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + handle.phi_prime_ = &phi_prime(sr, 0); + } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { handle.source_final_ = &source_final(sr, 0); handle.T1_ = &T1(sr, 0); @@ -394,7 +405,9 @@ void SourceRegionContainer::adjoint_reset() // BD Vectors std::fill(scalar_flux_rhs_bd_.begin(), scalar_flux_rhs_bd_.end(), 0.0); - if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { + std::fill(phi_prime_.begin(), phi_prime_.end(), 0.0); + } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { std::fill(T1_.begin(), T1_.end(), 0.0); std::fill(source_rhs_bd_.begin(), source_rhs_bd_.end(), 0.0); @@ -416,6 +429,8 @@ void SourceRegionContainer::time_step_reset() { std::fill(scalar_flux_final_.begin(), scalar_flux_final_.end(), 0.0); std::fill(precursors_final_.begin(), precursors_final_.end(), 0.0); + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) + std::fill(source_final_.begin(), source_final_.end(), 0.0); } } // namespace openmc From b36a045c75d9cda345b6163db1e84c57a5faea3a Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 5 Jan 2026 18:03:40 -0600 Subject: [PATCH 32/64] fix SDP --- src/random_ray/flat_source_domain.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index c606683c645..6ef68c6d3c8 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -1942,11 +1942,12 @@ void FlatSourceDomain::compute_single_neutron_source_time_derivative( { double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; + int material = srh.material(); for (int g = 0; g < negroups_; g++) { float source_rhs_bd = srh.source_rhs_bd(g); float source = srh.source(g); // Multiply out sigma_t to correctly compute the derivative term - double sigma_t = sigma_t_[srh.material() * negroups_ + g]; + double sigma_t = sigma_t_[material * negroups_ + g]; srh.source_time_derivative(g) = A0 * source * sigma_t + source_rhs_bd; // Divide by sigma_t to save time during transport srh.source_time_derivative(g) /= sigma_t; @@ -1958,14 +1959,16 @@ void FlatSourceDomain::compute_single_scalar_flux_time_derivative_2( { double B0 = (bd_coefficients_second_order_.at(RandomRay::bd_order_))[0] / (settings::dt * settings::dt); + int material = srh.material(); for (int g = 0; g < negroups_; g++) { double scalar_flux_rhs_bd_2 = srh.scalar_flux_rhs_bd_2(g); double scalar_flux = srh.scalar_flux_old(g); srh.scalar_flux_time_derivative_2(g) = B0 * scalar_flux + scalar_flux_rhs_bd_2; - double sigma_t = sigma_t_[srh.material() * negroups_ + g]; + double sigma_t = sigma_t_[material * negroups_ + g]; + double inverse_vbar = inverse_vbar_[material * negroups_ + g]; // Divide by sigma_t to save time during transport - srh.scalar_flux_time_derivative_2(g) /= sigma_t; + srh.scalar_flux_time_derivative_2(g) *= inverse_vbar / sigma_t; } } From 928ac8e34b4d9babe194828f74982a9fb4e6a536 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 4 Jan 2026 22:15:50 -0600 Subject: [PATCH 33/64] use T1 variable instead of source_time_derivative and scalar_flux_time_derivative_2 --- .../openmc/random_ray/flat_source_domain.h | 3 +- include/openmc/random_ray/source_region.h | 66 +++---------------- src/random_ray/flat_source_domain.cpp | 48 ++++++-------- src/random_ray/random_ray.cpp | 8 +-- src/random_ray/source_region.cpp | 23 ++----- 5 files changed, 39 insertions(+), 109 deletions(-) diff --git a/include/openmc/random_ray/flat_source_domain.h b/include/openmc/random_ray/flat_source_domain.h index 0362cebf40b..61e0ab0dd57 100644 --- a/include/openmc/random_ray/flat_source_domain.h +++ b/include/openmc/random_ray/flat_source_domain.h @@ -76,8 +76,7 @@ class FlatSourceDomain { //---------------------------------------------------------------------------- // Methods for kinetic simulations - void compute_single_neutron_source_time_derivative(SourceRegionHandle& srh); - void compute_single_scalar_flux_time_derivative_2(SourceRegionHandle& srh); + void compute_single_T1(SourceRegionHandle& srh); void compute_single_delayed_fission_source(SourceRegionHandle& srh); void compute_single_precursors(SourceRegionHandle& srh); diff --git a/include/openmc/random_ray/source_region.h b/include/openmc/random_ray/source_region.h index ab678c2d3c3..a3f795708bd 100644 --- a/include/openmc/random_ray/source_region.h +++ b/include/openmc/random_ray/source_region.h @@ -197,8 +197,7 @@ class SourceRegionHandle { // Public Data Members for kinetic simulations // Energy group-wise 1D time-derivative arrays - float* source_time_derivative_; - double* scalar_flux_time_derivative_2_; + double* T1_; // Delay group-wise 1D arrays double* delayed_fission_source_; @@ -343,20 +342,8 @@ class SourceRegionHandle { //--------------------------------------------------------------------------- // Public Accessors for kinetic simulations - float& source_time_derivative(int g) { return source_time_derivative_[g]; } - const float source_time_derivative(int g) const - { - return source_time_derivative_[g]; - } - - double& scalar_flux_time_derivative_2(int g) - { - return scalar_flux_time_derivative_2_[g]; - } - const double scalar_flux_time_derivative_2(int g) const - { - return scalar_flux_time_derivative_2_[g]; - } + double& T1(int g) { return T1_[g]; } + const double T1(int g) const { return T1_[g]; } double& delayed_fission_source(int dg) { return delayed_fission_source_[dg]; } const double delayed_fission_source(int dg) const @@ -503,11 +490,8 @@ class SourceRegion { //!< active iterations (used for SDP) // Energy group-wise 1D derivative arrays - vector source_time_derivative_; //!< The time derivative of the - //!< source (used for SDP) - vector scalar_flux_time_derivative_2_; //!< The 2nd order time - //!< derivative of the scalar - //!< flux (used for SDP) + vector T1_; //!< The combined sourcetime derivative and 2nd order + //!< scalar flux time derivative (used for SDP) // Delay group-wise 1D arrays vector delayed_fission_source_; //!< The delayed fission source binned //!< by delay group @@ -798,39 +782,10 @@ class SourceRegionContainer { //--------------------------------------- // For kinetic simulations - float& source_time_derivative(int64_t sr, int g) - { - return source_time_derivative_[index(sr, g)]; - } - const float& source_time_derivative(int64_t sr, int g) const - { - return source_time_derivative_[index(sr, g)]; - } - float& source_time_derivative(int64_t se) - { - return source_time_derivative_[se]; - } - const float& source_time_derivative(int64_t se) const - { - return source_time_derivative_[se]; - } - - double& scalar_flux_time_derivative_2(int64_t sr, int g) - { - return scalar_flux_time_derivative_2_[index(sr, g)]; - } - const double& scalar_flux_time_derivative_2(int64_t sr, int g) const - { - return scalar_flux_time_derivative_2_[index(sr, g)]; - } - double& scalar_flux_time_derivative_2(int64_t se) - { - return scalar_flux_time_derivative_2_[se]; - } - const double& scalar_flux_time_derivative_2(int64_t se) const - { - return scalar_flux_time_derivative_2_[se]; - } + double& T1(int64_t sr, int g) { return T1_[index(sr, g)]; } + const double& T1(int64_t sr, int g) const { return T1_[index(sr, g)]; } + double& T1(int64_t se) { return T1_[se]; } + const double& T1(int64_t se) const { return T1_[se]; } double& precursors_old(int64_t sr, int dg) { @@ -1079,8 +1034,7 @@ class SourceRegionContainer { // Private Data Members for kinetic simulations // SoA energy group-wise 2D derivative arrays flattened to 1D - vector source_time_derivative_; - vector scalar_flux_time_derivative_2_; + vector T1_; // SoA delay group-wise 2D arrays flattened to 1D vector delayed_fission_source_; diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 6ef68c6d3c8..df09099c05a 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -150,7 +150,8 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) total_source = (scatter_source + fission_source * inverse_k_eff); if (settings::kinetic_simulation && !simulation::is_initial_condition) { - // Add delayed source + // Add delayed source for kinetic simulation if delayed neutrons are + // turned on if (settings::create_delayed_neutrons) { double delayed_source = 0.0; for (int dg = 0; dg < ndgroups_; dg++) { @@ -201,8 +202,7 @@ void FlatSourceDomain::update_all_neutron_sources() update_single_neutron_source(srh); if (settings::kinetic_simulation && !simulation::is_initial_condition && RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - compute_single_neutron_source_time_derivative(srh); - compute_single_scalar_flux_time_derivative_2(srh); + compute_single_T1(srh); } } @@ -1776,8 +1776,7 @@ SourceRegionHandle FlatSourceDomain::get_subdivided_source_region_handle( update_single_neutron_source(handle); if (settings::kinetic_simulation && !simulation::is_initial_condition && RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - compute_single_neutron_source_time_derivative(handle); - compute_single_scalar_flux_time_derivative_2(handle); + compute_single_T1(handle); } // Unlock the parallel map. Note: we may be tempted to release @@ -1937,38 +1936,31 @@ int64_t FlatSourceDomain::lookup_mesh_bin(int64_t sr, Position r) const // kinetic simulations) sources in each source region based on the flux // estimate from the previous iteration. -void FlatSourceDomain::compute_single_neutron_source_time_derivative( - SourceRegionHandle& srh) +// T1 calculation +void FlatSourceDomain::compute_single_T1(SourceRegionHandle& srh) { double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; - int material = srh.material(); - for (int g = 0; g < negroups_; g++) { - float source_rhs_bd = srh.source_rhs_bd(g); - float source = srh.source(g); - // Multiply out sigma_t to correctly compute the derivative term - double sigma_t = sigma_t_[material * negroups_ + g]; - srh.source_time_derivative(g) = A0 * source * sigma_t + source_rhs_bd; - // Divide by sigma_t to save time during transport - srh.source_time_derivative(g) /= sigma_t; - } -} - -void FlatSourceDomain::compute_single_scalar_flux_time_derivative_2( - SourceRegionHandle& srh) -{ double B0 = (bd_coefficients_second_order_.at(RandomRay::bd_order_))[0] / (settings::dt * settings::dt); int material = srh.material(); for (int g = 0; g < negroups_; g++) { - double scalar_flux_rhs_bd_2 = srh.scalar_flux_rhs_bd_2(g); - double scalar_flux = srh.scalar_flux_old(g); - srh.scalar_flux_time_derivative_2(g) = - B0 * scalar_flux + scalar_flux_rhs_bd_2; - double sigma_t = sigma_t_[material * negroups_ + g]; double inverse_vbar = inverse_vbar_[material * negroups_ + g]; + double sigma_t = 1.0; + if (material != MATERIAL_VOID) + double sigma_t = sigma_t_[material * negroups_ + g]; + + // Multiply out sigma_t to correctly compute the derivative term + float source_time_derivative = + A0 * srh.source(g) * sigma_t + srh.source_rhs_bd(g); + + double scalar_flux_time_derivative_2 = + B0 * srh.scalar_flux_old(g) + srh.scalar_flux_rhs_bd_2(g); + scalar_flux_time_derivative_2 *= inverse_vbar; + // Divide by sigma_t to save time during transport - srh.scalar_flux_time_derivative_2(g) *= inverse_vbar / sigma_t; + srh.T1(g) = + (source_time_derivative - scalar_flux_time_derivative_2) / sigma_t; } } diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index bc0acaeb6cf..c6db7bbaf5f 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -454,9 +454,7 @@ void RandomRay::attenuate_flux_flat_source( float new_delta_psi = (angular_flux_[g] - srh.source(g)) * exponential; if (settings::kinetic_simulation && !simulation::is_initial_condition && RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - float source_derivative = srh.source_time_derivative(g); - float flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); - float T1 = (source_derivative - flux_derivative_2); + float T1 = srh.T1(g); // Source Derivative Propogation terms for Time Derivative // Characteristic Equation @@ -847,10 +845,8 @@ void RandomRay::initialize_ray(uint64_t ray_id, FlatSourceDomain* domain) if (settings::kinetic_simulation && !simulation::is_initial_condition && RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { for (int g = 0; g < negroups_; g++) { - double source_derivative = srh.source_time_derivative(g); - double flux_derivative_2 = srh.scalar_flux_time_derivative_2(g); // T1 - angular_flux_prime_[g] = source_derivative - flux_derivative_2; + angular_flux_prime_[g] = srh.T1(g); } } } diff --git a/src/random_ray/source_region.cpp b/src/random_ray/source_region.cpp index 89d8d71b50f..503d8ab2b31 100644 --- a/src/random_ray/source_region.cpp +++ b/src/random_ray/source_region.cpp @@ -31,9 +31,7 @@ SourceRegionHandle::SourceRegionHandle(SourceRegion& sr) flux_moments_old_(sr.flux_moments_old_.data()), flux_moments_new_(sr.flux_moments_new_.data()), flux_moments_t_(sr.flux_moments_t_.data()), - tally_task_(sr.tally_task_.data()), - source_time_derivative_(sr.source_time_derivative_.data()), - scalar_flux_time_derivative_2_(sr.scalar_flux_time_derivative_2_.data()), + tally_task_(sr.tally_task_.data()), T1_(sr.T1_.data()), delayed_fission_source_(sr.delayed_fission_source_.data()), precursors_old_(sr.precursors_old_.data()), precursors_new_(sr.precursors_new_.data()), @@ -81,8 +79,7 @@ SourceRegion::SourceRegion(int negroups, int ndgroups, bool is_linear) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.assign(negroups, 0.0); - source_time_derivative_.assign(negroups, 0.0); - scalar_flux_time_derivative_2_.assign(negroups, 0.0); + T1_.assign(negroups, 0.0); source_bd_.resize(negroups); source_rhs_bd_.resize(negroups); @@ -167,9 +164,7 @@ void SourceRegionContainer::push_back(const SourceRegion& sr) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.push_back(sr.source_final_[g]); - source_time_derivative_.push_back(sr.source_time_derivative_[g]); - scalar_flux_time_derivative_2_.push_back( - sr.scalar_flux_time_derivative_2_[g]); + T1_.push_back(sr.T1_[g]); source_bd_.push_back(sr.source_bd_[g]); source_rhs_bd_.push_back(sr.source_rhs_bd_[g]); @@ -245,8 +240,7 @@ void SourceRegionContainer::assign( if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { source_final_.clear(); - source_time_derivative_.clear(); - scalar_flux_time_derivative_2_.clear(); + T1_.clear(); source_bd_.clear(); source_rhs_bd_.clear(); @@ -329,9 +323,7 @@ SourceRegionHandle SourceRegionContainer::get_source_region_handle(int64_t sr) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { handle.source_final_ = &source_final(sr, 0); - handle.source_time_derivative_ = &source_time_derivative(sr, 0); - handle.scalar_flux_time_derivative_2_ = - &scalar_flux_time_derivative_2(sr, 0); + handle.T1_ = &T1(sr, 0); handle.source_bd_ = &source_bd(sr, 0); handle.source_rhs_bd_ = &source_rhs_bd(sr, 0); @@ -403,10 +395,7 @@ void SourceRegionContainer::adjoint_reset() std::fill(scalar_flux_rhs_bd_.begin(), scalar_flux_rhs_bd_.end(), 0.0); if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - std::fill( - source_time_derivative_.begin(), source_time_derivative_.end(), 0.0); - std::fill(scalar_flux_time_derivative_2_.begin(), - scalar_flux_time_derivative_2_.end(), 0.0); + std::fill(T1_.begin(), T1_.end(), 0.0); std::fill(source_rhs_bd_.begin(), source_rhs_bd_.end(), 0.0); std::fill( From 9ed3b1ecc1c6216de02a6f488c660b811083edf9 Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 5 Jan 2026 19:54:26 -0600 Subject: [PATCH 34/64] make source_bd type consistent with other source variables --- include/openmc/random_ray/bd_utilities.h | 13 +++++++++++++ include/openmc/random_ray/source_region.h | 18 +++++++++--------- src/random_ray/flat_source_domain.cpp | 16 ++-------------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/include/openmc/random_ray/bd_utilities.h b/include/openmc/random_ray/bd_utilities.h index bca7acc432d..785ea061a75 100644 --- a/include/openmc/random_ray/bd_utilities.h +++ b/include/openmc/random_ray/bd_utilities.h @@ -62,6 +62,19 @@ T rhs_backwards_difference( return rhs_bd; } +template +void add_value_to_bd_vector(std::deque& bd_vector, T& new_value, + bool increment_not_initialize, int initialize_size) +{ + bd_vector.push_front(new_value); + if (increment_not_initialize) { + bd_vector.pop_back(); + } else { + for (int i = 1; i < initialize_size; i++) + bd_vector.push_front(new_value); + } +} + } // namespace openmc #endif // OPENMC_RANDOM_RAY_BD_UTILITIES_H diff --git a/include/openmc/random_ray/source_region.h b/include/openmc/random_ray/source_region.h index a3f795708bd..e9781b2dfa3 100644 --- a/include/openmc/random_ray/source_region.h +++ b/include/openmc/random_ray/source_region.h @@ -210,7 +210,7 @@ class SourceRegionHandle { std::deque* precursors_bd_; // Delay group-wise 2D BD arrays (dg x time step) - std::deque* source_bd_; + std::deque* source_bd_; // Energy group-wise 1D RHS BD arrays double* scalar_flux_rhs_bd_; @@ -372,8 +372,8 @@ class SourceRegionHandle { return precursors_bd_[dg]; } - std::deque& source_bd(int g) { return source_bd_[g]; } - const std::deque& source_bd(int g) const { return source_bd_[g]; } + std::deque& source_bd(int g) { return source_bd_[g]; } + const std::deque& source_bd(int g) const { return source_bd_[g]; } double& scalar_flux_rhs_bd(int g) { return scalar_flux_rhs_bd_[g]; } const double scalar_flux_rhs_bd(int g) const @@ -517,7 +517,7 @@ class SourceRegion { //!< SDP) // Delay group-wise 2D BD arrays (dg x time step) - vector> + vector> source_bd_; //!< The final precursor population in each energy group from a //!< finite number of previous time steps (used for computing //!< the first order precursor time derivative) @@ -868,16 +868,16 @@ class SourceRegionContainer { return precursors_bd_[de]; } - std::deque& source_bd(int64_t sr, int g) + std::deque& source_bd(int64_t sr, int g) { return source_bd_[index(sr, g)]; } - const std::deque& source_bd(int64_t sr, int g) const + const std::deque& source_bd(int64_t sr, int g) const { return source_bd_[index(sr, g)]; } - std::deque& source_bd(int64_t se) { return source_bd_[se]; } - const std::deque& source_bd(int64_t se) const + std::deque& source_bd(int64_t se) { return source_bd_[se]; } + const std::deque& source_bd(int64_t se) const { return source_bd_[se]; } @@ -1045,7 +1045,7 @@ class SourceRegionContainer { // SoA energy group-wise 3D BD arrays (sr x g/dg X timestep) flattened to 2D vector> scalar_flux_bd_; vector> precursors_bd_; - vector> source_bd_; + vector> source_bd_; // SoA energy group-wise 2D RHS BD arrays flattened to 1D vector scalar_flux_rhs_bd_; diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index df09099c05a..5474fa46ce6 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -2119,19 +2119,6 @@ void FlatSourceDomain::propagate_final_quantities() } } -// Helper function for store_time_step_quantities() -void add_value_to_bd_vector(std::deque& bd_vector, double& new_value, - bool increment_not_initialize, int initialize_size) -{ - bd_vector.push_front(new_value); - if (increment_not_initialize) { - bd_vector.pop_back(); - } else { - for (int i = 1; i < initialize_size; i++) - bd_vector.push_front(new_value); - } -} - void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) { #pragma omp parallel for @@ -2144,10 +2131,11 @@ void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) source_regions_.scalar_flux_final(sr, g), increment_not_initialize, RandomRay::bd_order_ + j); if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { + // TODO: add support for void regions // Multiply out sigma_t to store the base source double sigma_t = sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; - double source = source_regions_.source_final(sr, g) * sigma_t; + float source = source_regions_.source_final(sr, g) * sigma_t; add_value_to_bd_vector(source_regions_.source_bd(sr, g), source, increment_not_initialize, RandomRay::bd_order_); } From 997131504ca6d45ec2998414518a141495a2d52c Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 4 Jan 2026 19:27:37 -0600 Subject: [PATCH 35/64] parameterize main random ray function+ - parameterize rename_file function - change base statepoint name used for kinetic simulations (now is closer to the base openmc format) - update corresponding test infrastructure --- .../openmc/random_ray/random_ray_simulation.h | 18 +- src/random_ray/random_ray_simulation.cpp | 391 ++++++++---------- src/simulation.cpp | 15 +- .../random_ray_auto_convert_kinetic/test.py | 2 +- .../test.py | 2 +- .../random_ray_k_eff_kinetic/test.py | 2 +- .../random_ray_k_eff_mesh_kinetic/test.py | 2 +- tests/testing_harness.py | 10 +- 8 files changed, 213 insertions(+), 229 deletions(-) diff --git a/include/openmc/random_ray/random_ray_simulation.h b/include/openmc/random_ray/random_ray_simulation.h index c4becc65818..ff93c9bf93a 100644 --- a/include/openmc/random_ray/random_ray_simulation.h +++ b/include/openmc/random_ray/random_ray_simulation.h @@ -19,9 +19,13 @@ class RandomRaySimulation { //---------------------------------------------------------------------------- // Methods - void compute_segment_correction_factors(); void apply_fixed_sources_and_mesh_domains(); void prepare_fixed_sources_adjoint(); + void print_random_ray_headers(); + void run_single_simulation(); + void random_ray_adjoint(); + void kinetic_initial_condition(); + void kinetic_single_time_step(int i); void simulate(); void output_simulation_results() const; void instability_check( @@ -52,9 +56,16 @@ class RandomRaySimulation { // Number of delay groups int ndgroups_; + // Toggle for first simulation + bool is_first_simulation_; + + // Flag for adjoint simulation; + bool adjoint_needed_; + //---------------------------------------------------------------------------- // Data Members for kinetic simulations + double static_avg_k_eff_; vector static_k_eff_; vector static_fission_rate_; @@ -71,11 +82,12 @@ void openmc_reset_random_ray(); //! Write data related to randaom ray to statepoint //! \param[in] group HDF5 group void write_random_ray_hdf5(hid_t group); +void print_random_ray_headers(bool& adjoint_needed); // Functions for kinetic simulations void set_time_dependent_settings(); -void rename_statepoint_file(int i); -void rename_tallies_file(int i); +void rename_time_step_file( + std::string base_filename, std::string extension, int i); } // namespace openmc diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index 47b61d84f5a..901148ad224 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -28,28 +28,11 @@ void openmc_run_random_ray() // Run forward simulation ////////////////////////////////////////////////////////// - // Check if adjoint calculation is needed. If it is, we will run the forward - // calculation first and then the adjoint calculation later. - bool adjoint_needed = FlatSourceDomain::adjoint_; - - // Check if this simulation is to establish an initial condition - if (settings::kinetic_simulation) { - simulation::is_initial_condition = true; + if (mpi::master) { + bool adjoint_needed = FlatSourceDomain::adjoint_; + print_random_ray_headers(adjoint_needed); } - // Configure the domain for forward simulation - FlatSourceDomain::adjoint_ = false; - - // If we're going to do a kinetic simulation, report that this is - // the initial condition. - if (settings::kinetic_simulation && mpi::master) - header("KINETIC SIMULATION INITIAL CONDITION", 3); - - // If we're going to do an adjoint simulation afterwards, report that this is - // the initial forward flux solve. - if (adjoint_needed && mpi::master) - header("FORWARD FLUX SOLVE", 3); - // Initialize OpenMC general data structures openmc_simulation_init(); @@ -63,187 +46,27 @@ void openmc_run_random_ray() // Initialize fixed sources, if present sim.apply_fixed_sources_and_mesh_domains(); - // Begin main simulation timer - simulation::time_total.start(); - - // Execute random ray simulation - sim.simulate(); - - // End main simulation timer - simulation::time_total.stop(); - - // Normalize and save the final forward quantities - sim.domain()->normalize_final_quantities(); - - // Finalize OpenMC - openmc_simulation_finalize(); - - // Output all simulation results - sim.output_simulation_results(); + // Run initial random ray simulation + sim.run_single_simulation(); if (settings::kinetic_simulation) { - // Now do a second steady state simulation to correct the batch wise k-eff - // estimates - simulation::k_eff_correction = true; - - if (settings::kinetic_simulation && mpi::master) - header("KINETIC SIMULATION INITIAL CONDITION (K-EFF CORRECTION)", 3); - - // If we're going to do an adjoint simulation afterwards, report that this - // is the initial forward flux solve. - if (adjoint_needed && mpi::master) - header("FORWARD FLUX SOLVE", 3); - - // Initialize OpenMC general data structures - openmc_simulation_init(); - - double initial_k_eff = simulation::keff; - - sim.domain()->k_eff_ = initial_k_eff; - sim.domain()->source_regions_.adjoint_reset(); - sim.domain()->propagate_final_quantities(); - sim.domain()->source_regions_.time_step_reset(); - - // Begin main simulation timer - simulation::time_total.start(); - - // Execute random ray simulation - sim.simulate(); - - // End main simulation timer - simulation::time_total.stop(); - - // Normalize and save the final forward quantities - sim.domain()->normalize_final_quantities(); - - // Finalize OpenMC - openmc_simulation_finalize(); - - // Output all simulation results - sim.output_simulation_results(); - - //------------------------------------------------------------------------- - // KINETIC SIMULATION + // Second steady state simulation to correct the batchwise k-eff + sim.kinetic_initial_condition(); warning( "Time-dependent explicit void treatment has not yet been " "implemented. Use caution when interpreting results from models with " "voids, as they may contain large inaccuracies."); - sim.domain()->store_time_step_quantities(false); - rename_statepoint_file(0); - if (settings::output_tallies) { - rename_tallies_file(0); - } - set_time_dependent_settings(); - // Timestepping loop - // TODO: Add support for time-dependent restart - for (int i = 0; i < settings::n_timesteps; i++) { - simulation::current_timestep = i + 1; - - // Print simulation information - if (mpi::master) { - std::string message = fmt::format( - "KINETIC SIMULATION TIME STEP {0}", simulation::current_timestep); - const char* msg = message.c_str(); - header(msg, 3); - } - - // If we're going to do an adjoint simulation afterwards, report that this - // is the initial forward flux solve. - if (adjoint_needed && mpi::master) - header("FORWARD FLUX SOLVE", 3); - - reset_timers(); - - // Initialize OpenMC general data structures - openmc_simulation_init(); - - sim.domain()->k_eff_ = initial_k_eff; - sim.domain()->source_regions_.adjoint_reset(); - sim.domain()->propagate_final_quantities(); - sim.domain()->source_regions_.time_step_reset(); - - // Compute RHS backward differences to be used later - sim.domain()->compute_rhs_bd_quantities(); - - // Update time dependent cross section based on the density - sim.domain()->update_material_density(i); - - // Begin main simulation timer - simulation::time_total.start(); - - // Execute random ray simulation - sim.simulate(); - - // End main simulation timer - simulation::time_total.stop(); - - // Finalize OpenMC - openmc_simulation_finalize(); - - // Output all simulation results - sim.output_simulation_results(); - - // Rename statepoint and tallies file - rename_statepoint_file(simulation::current_timestep); - if (settings::output_tallies) { - rename_tallies_file(simulation::current_timestep); - } - - // Normalize and store final quantities for next time step - sim.domain()->normalize_final_quantities(); - sim.domain()->store_time_step_quantities(); - - // Advance time - simulation::current_time += settings::dt; - } + for (int i = 0; i < settings::n_timesteps; i++) + sim.kinetic_single_time_step(i); } ////////////////////////////////////////////////////////// // Run adjoint simulation (if enabled) ////////////////////////////////////////////////////////// - if (!adjoint_needed) { - return; - } - - reset_timers(); - - // Configure the domain for adjoint simulation - FlatSourceDomain::adjoint_ = true; - - if (mpi::master) - header("ADJOINT FLUX SOLVE", 3); - - sim.domain()->k_eff_ = 1.0; - - // Initialize adjoint fixed sources, if present - sim.prepare_fixed_sources_adjoint(); - - // Transpose scattering matrix - sim.domain()->transpose_scattering_matrix(); - - // Swap nu_sigma_f and chi - sim.domain()->nu_sigma_f_.swap(sim.domain()->chi_); - - // Initialize OpenMC general data structures - openmc_simulation_init(); - - // Begin main simulation timer - simulation::time_total.start(); - - // Execute random ray simulation - sim.simulate(); - - // End main simulation timer - simulation::time_total.stop(); - - // Finalize OpenMC - openmc_simulation_finalize(); - - // Output all simulation results - sim.output_simulation_results(); + sim.random_ray_adjoint(); } // Enforces restrictions on inputs in random ray mode. While there are @@ -494,6 +317,8 @@ void openmc_reset_random_ray() RandomRay::ray_source_.reset(); RandomRay::source_shape_ = RandomRaySourceShape::FLAT; RandomRay::sample_method_ = RandomRaySampleMethod::PRNG; + RandomRay::bd_order_ = 3; + RandomRay::time_method_ = RandomRayTimeMethod::ISOTROPIC; } void write_random_ray_hdf5(hid_t group) @@ -562,41 +387,29 @@ void write_random_ray_hdf5(hid_t group) close_group(random_ray_group); } -//----------------------------------------------------------------------------- -// Non-member functions for kinetic simulations - -void set_time_dependent_settings() +void print_random_ray_headers(bool& adjoint_needed) { - // Reset flags - simulation::is_initial_condition = false; - simulation::k_eff_correction = false; + // If we're going to do an adjoint simulation afterwards, report that this is + // the initial forward flux solve. + if (adjoint_needed && !FlatSourceDomain::adjoint_) + header("FORWARD FLUX SOLVE", 3); - // Set current time - simulation::current_time = settings::dt; + // Otherwise report that we are doing the adjoint simulation + if (adjoint_needed && FlatSourceDomain::adjoint_) + header("ADJOINT FLUX SOLVE", 3); } -// TODO: condense this into one function with rename_tallies_file and use char -// or string arguments -void rename_statepoint_file(int i) -{ - // Rename statepoint file - std::string old_filename_ = fmt::format( - "{0}statepoint.{1}.h5", settings::path_output, settings::n_batches); - std::string new_filename_ = - fmt::format("{0}openmc_td_simulation_{1}.h5", settings::path_output, i); - - const char* old_fname = old_filename_.c_str(); - const char* new_fname = new_filename_.c_str(); - std::rename(old_fname, new_fname); -} +//----------------------------------------------------------------------------- +// Non-member functions for kinetic simulations -void rename_tallies_file(int i) +void rename_time_step_file( + std::string base_filename, std::string extension, int i) { - // Rename tallies file + // Rename file std::string old_filename_ = - fmt::format("{0}tallies.out", settings::path_output); - std::string new_filename_ = - fmt::format("{0}tallies_{1}.out", settings::path_output, i); + fmt::format("{0}{1}{2}", settings::path_output, base_filename, extension); + std::string new_filename_ = fmt::format( + "{0}{1}_{2}{3}", settings::path_output, base_filename, i, extension); const char* old_fname = old_filename_.c_str(); const char* new_fname = new_filename_.c_str(); @@ -635,8 +448,21 @@ RandomRaySimulation::RandomRaySimulation() // internal to the random ray solver domain_->flatten_xs(); - // Initialize vectors used for the steady state + // Check if adjoint calculation is needed. If it is, we will run the forward + // calculation first and then the adjoint calculation later. + adjoint_needed_ = FlatSourceDomain::adjoint_; + + // Adjoint is always false for the forward calculation + FlatSourceDomain::adjoint_ = false; + + // The first simulation is run after initialization + is_first_simulation_ = true; + + // Initialize vectors used for baking in the initial condition during time + // stepping if (settings::kinetic_simulation) { + // Initialize vars used for time-consistent seed approach + static_avg_k_eff_; static_k_eff_; static_fission_rate_; } @@ -660,6 +486,139 @@ void RandomRaySimulation::prepare_fixed_sources_adjoint() } } +void RandomRaySimulation::print_random_ray_headers() +{ + openmc::print_random_ray_headers(adjoint_needed_); +} + +void RandomRaySimulation::run_single_simulation() +{ + if (!is_first_simulation_) { + if (mpi::master) + print_random_ray_headers(); + + // Reset the timers and reinitialize the general OpenMC datastructures if + // this is after the first simulation + reset_timers(); + + // Initialize OpenMC general data structures + openmc_simulation_init(); + } + + // Begin main simulation timer + simulation::time_total.start(); + + // Execute random ray simulation + simulate(); + + // End main simulation timer + simulation::time_total.stop(); + + // Normalize and save the final forward quantities + domain_->normalize_final_quantities(); + + // Finalize OpenMC + openmc_simulation_finalize(); + + // Output all simulation results + output_simulation_results(); + + // Toggle that the simulation object has been initialized after the first + // simulation + if (is_first_simulation_) + is_first_simulation_ = false; +} + +void RandomRaySimulation::random_ray_adjoint() +{ + if (!adjoint_needed_) { + return; + } + + // Configure the domain for adjoint simulation + FlatSourceDomain::adjoint_ = true; + + // Reset k-eff + domain_->k_eff_ = 1.0; + + // Initialize adjoint fixed sources, if present + prepare_fixed_sources_adjoint(); + + // Transpose scattering matrix + domain_->transpose_scattering_matrix(); + + // Swap nu_sigma_f and chi + domain_->nu_sigma_f_.swap(domain_->chi_); + + // Run a single simulation + run_single_simulation(); +} + +void RandomRaySimulation::kinetic_initial_condition() +{ + // Set flag for k_eff correction + simulation::k_eff_correction = true; + + static_avg_k_eff_ = simulation::keff; + domain_->k_eff_ = static_avg_k_eff_; + domain_->source_regions_.adjoint_reset(); + domain_->propagate_final_quantities(); + domain_->source_regions_.time_step_reset(); + + // Run the initial condition + run_single_simulation(); + + // Initialize the BD arrays + domain_->store_time_step_quantities(false); + + // Store k-eff corrected initial condition statepoints + rename_time_step_file( + fmt::format("statepoint.{0}", settings::n_batches), ".h5", 0); + if (settings::output_tallies) { + rename_time_step_file("tallies", ".out", 0); + } + + // Set flags for kinetic simulation + simulation::is_initial_condition = false; + simulation::k_eff_correction = false; + + // Set starting time as zero + simulation::current_time = 0; +} + +// TODO: Add support for time-dependent restart +void RandomRaySimulation::kinetic_single_time_step(int i) +{ + // Increment time step + simulation::current_timestep = i + 1; + simulation::current_time += settings::dt; + + // Propogate results of previous simulation + domain_->k_eff_ = static_avg_k_eff_; + domain_->source_regions_.adjoint_reset(); + domain_->propagate_final_quantities(); + domain_->source_regions_.time_step_reset(); + + // Compute RHS backward differences + domain_->compute_rhs_bd_quantities(); + + // Update time dependent cross section based on the density + domain_->update_material_density(i); + + // Run the simulation for the current time step + run_single_simulation(); + + // Rename statepoint and tallies file for the current time step + rename_time_step_file(fmt::format("statepoint.{0}", settings::n_batches), + ".h5", simulation::current_timestep); + if (settings::output_tallies) { + rename_time_step_file("tallies", ".out", simulation::current_timestep); + } + + // Store final quantities for the current time step + domain_->store_time_step_quantities(); +} + void RandomRaySimulation::simulate() { // Random ray power iteration loop diff --git a/src/simulation.cpp b/src/simulation.cpp index 5eb80789ee5..7fd325593d0 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -139,6 +139,19 @@ int openmc_simulation_init() // Display header if (mpi::master) { + if (settings::kinetic_simulation) { + if (simulation::is_initial_condition) { + if (simulation::k_eff_correction) + header("KINETIC SIMULATION INITIAL CONDITION (K-EFF CORRECTION)", 3); + else + header("KINETIC SIMULATION INITIAL CONDITION", 3); + } else { + std::string message = fmt::format( + "KINETIC SIMULATION TIME STEP {0}", simulation::current_timestep); + const char* msg = message.c_str(); + header(msg, 3); + } + } if (settings::run_mode == RunMode::FIXED_SOURCE) { if (settings::solver_type == SolverType::MONTE_CARLO) { header("FIXED SOURCE TRANSPORT SIMULATION", 3); @@ -323,7 +336,7 @@ const RegularMesh* ufs_mesh {nullptr}; vector k_generation; vector work_index; -bool is_initial_condition {false}; +bool is_initial_condition {true}; int current_timestep; double current_time; bool k_eff_correction {false}; diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py index 3a79c1d2836..dc0a60b51fb 100644 --- a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py @@ -53,5 +53,5 @@ def test_random_ray_auto_convert(method): model.settings.random_ray['source_region_meshes'] = [ (mesh, [model.geometry.root_universe])] - harness = KineticMGXSTestHarness(model, 6) + harness = KineticMGXSTestHarness("statepoint.10", 6, model) harness.main() diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py index 8312e7f6df7..50d4419d479 100644 --- a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py @@ -60,5 +60,5 @@ def test_random_ray_diagonal_stabilization(): model.settings.inactive = 15 model.settings.batches = 20 - harness = KineticMGXSTestHarness(model, 6) + harness = KineticMGXSTestHarness('statepoint.20', 6, model) harness.main() diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_kinetic/test.py index 8f17d6f5412..11a2b30fe87 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_kinetic/test.py @@ -26,5 +26,5 @@ def test_random_ray_time_dependent(time_method): model.settings.random_ray['time_method'] = time_method model.settings.batches = 400 model.settings.inactive = 200 - harness = KineticMGXSTestHarness(model, 6) + harness = KineticMGXSTestHarness('statepoint.400', 6, model) harness.main() diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py index d18951cf3cb..7e330c4257c 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py @@ -35,5 +35,5 @@ def test_random_ray_k_eff_mesh(): model.settings.random_ray['source_region_meshes'] = [(mesh, [root])] - harness = KineticMGXSTestHarness(model, 6) + harness = KineticMGXSTestHarness('statepoint.400', 6, model) harness.main() diff --git a/tests/testing_harness.py b/tests/testing_harness.py index c6ffc2a5cad..0adcc6c2825 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -293,8 +293,8 @@ def _cleanup(self): class KineticTestHarness(TestHarness): """General class for running OpenMC regression tests for kinetic simulations.""" - def __init__(self, n_timesteps): - self._sp_base = "openmc_td_simulation" + def __init__(self, statepoint_base, n_timesteps): + self._sp_base = statepoint_base self._n_timesteps = n_timesteps def main(self): @@ -597,8 +597,8 @@ def _cleanup(self): class KineticPyAPITestHarness(KineticTestHarness, PyAPITestHarness): - def __init__(self, model, n_timesteps, inputs_true=None): - super().__init__(n_timesteps) + def __init__(self, statepoint_base, n_timesteps, model, inputs_true=None): + super().__init__(statepoint_base, n_timesteps) self._model = model self._model.plots = [] @@ -660,7 +660,7 @@ def _compare_files(self, file_test, file_true, tol, index): file_test) print('Result differences:') print(''.join(colorize(diff))) - os.rename(file_test, f'results_error_{i}.dat') + os.rename(file_test, f'results_error_{index}.dat') assert compare, 'Results do not agree' From 8f77d8b3e64f7a58a29a59da45ac86d5f52fb139 Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 5 Jan 2026 22:51:04 -0600 Subject: [PATCH 36/64] formatting + sdp sigma_t fix --- src/random_ray/flat_source_domain.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 5474fa46ce6..e22a34ac607 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -150,8 +150,8 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) total_source = (scatter_source + fission_source * inverse_k_eff); if (settings::kinetic_simulation && !simulation::is_initial_condition) { - // Add delayed source for kinetic simulation if delayed neutrons are - // turned on + // Add delayed source for kinetic simulation if delayed neutrons are + // turned on if (settings::create_delayed_neutrons) { double delayed_source = 0.0; for (int dg = 0; dg < ndgroups_; dg++) { @@ -1948,7 +1948,7 @@ void FlatSourceDomain::compute_single_T1(SourceRegionHandle& srh) double inverse_vbar = inverse_vbar_[material * negroups_ + g]; double sigma_t = 1.0; if (material != MATERIAL_VOID) - double sigma_t = sigma_t_[material * negroups_ + g]; + sigma_t = sigma_t_[material * negroups_ + g]; // Multiply out sigma_t to correctly compute the derivative term float source_time_derivative = From 08d6709bfd5d02cb99e5d720e17b568eb7c8cac6 Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 5 Jan 2026 23:02:36 -0600 Subject: [PATCH 37/64] fix sigma_t division and Q storage --- src/random_ray/flat_source_domain.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 6cceffd42bc..17a4dbe613c 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -1937,7 +1937,7 @@ void FlatSourceDomain::compute_single_phi_prime(SourceRegionHandle& srh) double inverse_vbar = inverse_vbar_[material * negroups_ + g]; double sigma_t = 1.0; if (material != MATERIAL_VOID) - double sigma_t = sigma_t_[material * negroups_ + g]; + sigma_t = sigma_t_[material * negroups_ + g]; double scalar_flux_time_derivative = A0 * srh.scalar_flux_old(g) + srh.scalar_flux_rhs_bd(g); @@ -1957,7 +1957,7 @@ void FlatSourceDomain::compute_single_T1(SourceRegionHandle& srh) double inverse_vbar = inverse_vbar_[material * negroups_ + g]; double sigma_t = 1.0; if (material != MATERIAL_VOID) - double sigma_t = sigma_t_[material * negroups_ + g]; + sigma_t = sigma_t_[material * negroups_ + g]; // Multiply out sigma_t to correctly compute the derivative term double source_time_derivative = @@ -2154,8 +2154,10 @@ void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) RandomRay::bd_order_ + j); if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { // Multiply out sigma_t to store the base source - double sigma_t = sigma_t = - sigma_t_[source_regions_.material(sr) * negroups_ + g]; + int material = source_regions_.material(sr); + double sigma_t = 1.0; + if (material != MATERIAL_VOID) + sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; double source = source_regions_.source_final(sr, g) * sigma_t; add_value_to_bd_vector(source_regions_.source_bd(sr, g), source, increment_not_initialize, RandomRay::bd_order_); From 22474d132b00d8ea89c4f0769ac7a7b28e134ea7 Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 5 Jan 2026 23:05:59 -0600 Subject: [PATCH 38/64] remove unneeded delta_psi_prime --- include/openmc/random_ray/random_ray.h | 4 ---- src/random_ray/random_ray.cpp | 10 +++------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/include/openmc/random_ray/random_ray.h b/include/openmc/random_ray/random_ray.h index eb879585e3e..0d28aef2fd8 100644 --- a/include/openmc/random_ray/random_ray.h +++ b/include/openmc/random_ray/random_ray.h @@ -91,10 +91,6 @@ class RandomRay : public Particle { bool is_active_ {false}; bool is_alive_ {true}; - //--------------------------------------------------------------------------- - // Private data members for kinetic simulations - vector delta_psi_prime_; - }; // class RandomRay } // namespace openmc diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index c6db7bbaf5f..4ab73d7c156 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -252,8 +252,7 @@ RandomRay::RandomRay() : angular_flux_(data::mg.num_energy_groups_), delta_psi_(data::mg.num_energy_groups_), negroups_(data::mg.num_energy_groups_), - angular_flux_prime_(data::mg.num_energy_groups_), - delta_psi_prime_(data::mg.num_energy_groups_) + angular_flux_prime_(data::mg.num_energy_groups_) { if (source_shape_ == RandomRaySourceShape::LINEAR || @@ -456,17 +455,14 @@ void RandomRay::attenuate_flux_flat_source( RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { float T1 = srh.T1(g); - // Source Derivative Propogation terms for Time Derivative - // Characteristic Equation + // Source Derivative Propogation terms for Characteristic Equation float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; new_delta_psi += T1 * inverse_vbar * exponential / sigma_t; new_delta_psi += distance * inverse_vbar * (angular_flux_prime_[g] - T1) * (1 - exponential); // Time Derivative Characteristic Equation - float new_delta_psi_prime = (angular_flux_prime_[g] - T1) * exponential; - delta_psi_prime_[g] = new_delta_psi_prime; - angular_flux_prime_[g] -= new_delta_psi_prime; + angular_flux_prime_[g] -= (angular_flux_prime_[g] - T1) * exponential; } delta_psi_[g] = new_delta_psi; angular_flux_[g] -= new_delta_psi; From 3fdf3c57a0d89f64f5ebf5f24ee35b98a9fd983c Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 5 Jan 2026 23:31:07 -0600 Subject: [PATCH 39/64] fix tests?? --- .../isotropic/results_error_1.dat | 26 -- .../isotropic/results_true_1.dat | 16 +- .../isotropic/results_true_2.dat | 20 +- .../isotropic/results_true_3.dat | 24 +- .../isotropic/results_true_4.dat | 30 +- .../isotropic/results_true_5.dat | 30 +- .../propagation/results_error_1.dat | 26 -- .../propagation/results_true_1.dat | 16 +- .../propagation/results_true_2.dat | 20 +- .../propagation/results_true_3.dat | 24 +- .../propagation/results_true_4.dat | 30 +- .../propagation/results_true_5.dat | 30 +- .../random_ray_k_eff_mesh/results_true.dat | 2 +- .../results_error_1.dat | 236 ---------- .../results_true_1.dat | 374 +++++++-------- .../results_true_2.dat | 392 ++++++++-------- .../results_true_3.dat | 408 ++++++++--------- .../results_true_4.dat | 414 ++++++++--------- .../results_true_5.dat | 424 +++++++++--------- 19 files changed, 1127 insertions(+), 1415 deletions(-) delete mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_error_1.dat delete mode 100644 tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_error_1.dat delete mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_error_1.dat diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_error_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_error_1.dat deleted file mode 100644 index 724fc7d4d34..00000000000 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_error_1.dat +++ /dev/null @@ -1,26 +0,0 @@ -k-combined: -1.325787E+00 5.102917E-04 -tally 1: -2.630159E+03 -3.458870E+04 -1.079877E+02 -5.830849E+01 -2.651400E+02 -3.515064E+02 -tally 2: -1.077582E+00 -5.805916E-03 -2.327021E+00 -2.707513E-02 -8.947056E-01 -4.002491E-03 -6.344421E-01 -2.012584E-03 -4.939691E-01 -1.220027E-03 -6.664304E-02 -2.220648E-05 -2.312958E-02 -2.674887E-06 -3.680700E-03 -6.773776E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat index 724fc7d4d34..a92843c016e 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.630159E+03 -3.458870E+04 -1.079877E+02 -5.830849E+01 -2.651400E+02 -3.515064E+02 +2.630191E+03 +3.458954E+04 +1.079890E+02 +5.830990E+01 +2.651432E+02 +3.515149E+02 tally 2: 1.077582E+00 5.805916E-03 @@ -22,5 +22,5 @@ tally 2: 2.220648E-05 2.312958E-02 2.674887E-06 -3.680700E-03 -6.773776E-08 +3.680701E-03 +6.773779E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat index fb51d52e79c..1593f2550e3 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628805E+03 -3.455310E+04 -1.078930E+02 -5.820630E+01 -2.649083E+02 -3.508923E+02 +2.628844E+03 +3.455412E+04 +1.078946E+02 +5.820797E+01 +2.649121E+02 +3.509024E+02 tally 2: 1.077582E+00 5.805915E-03 @@ -17,10 +17,10 @@ tally 2: 6.344416E-01 2.012581E-03 4.939683E-01 -1.220023E-03 +1.220024E-03 6.664281E-02 2.220632E-05 2.312938E-02 -2.674841E-06 -3.680631E-03 -6.773523E-08 +2.674842E-06 +3.680634E-03 +6.773532E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat index 7138bda0c59..b51d718be21 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.625967E+03 -3.447853E+04 -1.077372E+02 -5.803829E+01 -2.645264E+02 -3.498813E+02 +2.626023E+03 +3.447999E+04 +1.077395E+02 +5.804071E+01 +2.645319E+02 +3.498959E+02 tally 2: 1.077582E+00 5.805913E-03 @@ -18,9 +18,9 @@ tally 2: 2.012572E-03 4.939660E-01 1.220012E-03 -6.664208E-02 -2.220584E-05 -2.312877E-02 -2.674700E-06 -3.680424E-03 -6.772761E-08 +6.664210E-02 +2.220585E-05 +2.312878E-02 +2.674703E-06 +3.680429E-03 +6.772778E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat index 47573c06fbd..397a03896ad 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat @@ -1,26 +1,26 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621830E+03 -3.436997E+04 -1.075280E+02 -5.781316E+01 -2.640135E+02 -3.485261E+02 +2.621898E+03 +3.437177E+04 +1.075308E+02 +5.781614E+01 +2.640203E+02 +3.485440E+02 tally 2: 1.077581E+00 5.805908E-03 2.327017E+00 2.707505E-02 -8.947035E-01 +8.947036E-01 4.002472E-03 6.344375E-01 2.012555E-03 -4.939612E-01 -1.219988E-03 -6.664063E-02 -2.220487E-05 -2.312755E-02 -2.674417E-06 -3.680010E-03 -6.771238E-08 +4.939613E-01 +1.219989E-03 +6.664066E-02 +2.220489E-05 +2.312757E-02 +2.674422E-06 +3.680018E-03 +6.771265E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat index e60cc8f7d0d..45797f0de66 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616508E+03 -3.423058E+04 -1.072703E+02 -5.753634E+01 -2.633814E+02 -3.468591E+02 +2.616587E+03 +3.423265E+04 +1.072735E+02 +5.753976E+01 +2.633892E+02 +3.468797E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -14,13 +14,13 @@ tally 2: 2.707497E-02 8.947015E-01 4.002454E-03 -6.344329E-01 -2.012525E-03 -4.939534E-01 +6.344330E-01 +2.012526E-03 +4.939535E-01 1.219950E-03 -6.663823E-02 -2.220327E-05 -2.312553E-02 -2.673952E-06 -3.679333E-03 -6.768747E-08 +6.663827E-02 +2.220330E-05 +2.312557E-02 +2.673959E-06 +3.679344E-03 +6.768786E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_error_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_error_1.dat deleted file mode 100644 index 724fc7d4d34..00000000000 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_error_1.dat +++ /dev/null @@ -1,26 +0,0 @@ -k-combined: -1.325787E+00 5.102917E-04 -tally 1: -2.630159E+03 -3.458870E+04 -1.079877E+02 -5.830849E+01 -2.651400E+02 -3.515064E+02 -tally 2: -1.077582E+00 -5.805916E-03 -2.327021E+00 -2.707513E-02 -8.947056E-01 -4.002491E-03 -6.344421E-01 -2.012584E-03 -4.939691E-01 -1.220027E-03 -6.664304E-02 -2.220648E-05 -2.312958E-02 -2.674887E-06 -3.680700E-03 -6.773776E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat index 724fc7d4d34..a92843c016e 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.630159E+03 -3.458870E+04 -1.079877E+02 -5.830849E+01 -2.651400E+02 -3.515064E+02 +2.630191E+03 +3.458954E+04 +1.079890E+02 +5.830990E+01 +2.651432E+02 +3.515149E+02 tally 2: 1.077582E+00 5.805916E-03 @@ -22,5 +22,5 @@ tally 2: 2.220648E-05 2.312958E-02 2.674887E-06 -3.680700E-03 -6.773776E-08 +3.680701E-03 +6.773779E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat index fb51d52e79c..1593f2550e3 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628805E+03 -3.455310E+04 -1.078930E+02 -5.820630E+01 -2.649083E+02 -3.508923E+02 +2.628844E+03 +3.455412E+04 +1.078946E+02 +5.820797E+01 +2.649121E+02 +3.509024E+02 tally 2: 1.077582E+00 5.805915E-03 @@ -17,10 +17,10 @@ tally 2: 6.344416E-01 2.012581E-03 4.939683E-01 -1.220023E-03 +1.220024E-03 6.664281E-02 2.220632E-05 2.312938E-02 -2.674841E-06 -3.680631E-03 -6.773523E-08 +2.674842E-06 +3.680634E-03 +6.773532E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat index 7138bda0c59..b51d718be21 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.625967E+03 -3.447853E+04 -1.077372E+02 -5.803829E+01 -2.645264E+02 -3.498813E+02 +2.626023E+03 +3.447999E+04 +1.077395E+02 +5.804071E+01 +2.645319E+02 +3.498959E+02 tally 2: 1.077582E+00 5.805913E-03 @@ -18,9 +18,9 @@ tally 2: 2.012572E-03 4.939660E-01 1.220012E-03 -6.664208E-02 -2.220584E-05 -2.312877E-02 -2.674700E-06 -3.680424E-03 -6.772761E-08 +6.664210E-02 +2.220585E-05 +2.312878E-02 +2.674703E-06 +3.680429E-03 +6.772778E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat index 47573c06fbd..397a03896ad 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat @@ -1,26 +1,26 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621830E+03 -3.436997E+04 -1.075280E+02 -5.781316E+01 -2.640135E+02 -3.485261E+02 +2.621898E+03 +3.437177E+04 +1.075308E+02 +5.781614E+01 +2.640203E+02 +3.485440E+02 tally 2: 1.077581E+00 5.805908E-03 2.327017E+00 2.707505E-02 -8.947035E-01 +8.947036E-01 4.002472E-03 6.344375E-01 2.012555E-03 -4.939612E-01 -1.219988E-03 -6.664063E-02 -2.220487E-05 -2.312755E-02 -2.674417E-06 -3.680010E-03 -6.771238E-08 +4.939613E-01 +1.219989E-03 +6.664066E-02 +2.220489E-05 +2.312757E-02 +2.674422E-06 +3.680018E-03 +6.771265E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat index e60cc8f7d0d..45797f0de66 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616508E+03 -3.423058E+04 -1.072703E+02 -5.753634E+01 -2.633814E+02 -3.468591E+02 +2.616587E+03 +3.423265E+04 +1.072735E+02 +5.753976E+01 +2.633892E+02 +3.468797E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -14,13 +14,13 @@ tally 2: 2.707497E-02 8.947015E-01 4.002454E-03 -6.344329E-01 -2.012525E-03 -4.939534E-01 +6.344330E-01 +2.012526E-03 +4.939535E-01 1.219950E-03 -6.663823E-02 -2.220327E-05 -2.312553E-02 -2.673952E-06 -3.679333E-03 -6.768747E-08 +6.663827E-02 +2.220330E-05 +2.312557E-02 +2.673959E-06 +3.679344E-03 +6.768786E-08 diff --git a/tests/regression_tests/random_ray_k_eff_mesh/results_true.dat b/tests/regression_tests/random_ray_k_eff_mesh/results_true.dat index 2ae8fad85fb..2976d169b63 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh/results_true.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh/results_true.dat @@ -1,5 +1,5 @@ k-combined: -8.379203E-01 8.057199E-03 +8.379203E-01 8.057198E-03 tally 1: 1.073897E+00 2.309328E-01 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_error_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_error_1.dat deleted file mode 100644 index 5998849c911..00000000000 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_error_1.dat +++ /dev/null @@ -1,236 +0,0 @@ -k-combined: -1.311387E+00 6.434473E-04 -tally 1: -6.835334E+01 -2.336386E+01 -2.537083E+01 -3.219486E+00 -6.174753E+01 -1.907024E+01 -4.341616E+01 -9.425285E+00 -6.455038E+00 -2.083605E-01 -1.571027E+01 -1.234199E+00 -2.954946E+01 -4.365884E+00 -9.570224E-01 -4.579522E-03 -2.329201E+00 -2.712626E-02 -3.767664E+01 -7.097731E+00 -1.254577E+00 -7.870084E-03 -3.053390E+00 -4.661752E-02 -9.744533E+01 -4.747806E+01 -1.144186E+00 -6.545836E-03 -2.784754E+00 -3.877444E-02 -2.110393E+02 -2.226958E+02 -3.220474E-01 -5.186148E-04 -7.968838E-01 -3.175377E-03 -1.122158E+02 -6.297343E+01 -1.521665E+00 -1.158327E-02 -4.232435E+00 -8.961352E-02 -1.129400E+02 -6.377795E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.346085E+01 -1.429044E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.113062E+01 -4.845602E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.104556E+01 -8.423776E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.823418E+01 -4.824994E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.888989E+02 -1.784199E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.679142E+01 -4.685698E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.897467E+01 -1.739130E+01 -2.181728E+01 -2.380541E+00 -5.309890E+01 -1.410086E+01 -4.079630E+01 -8.321943E+00 -6.064107E+00 -1.838816E-01 -1.475882E+01 -1.089201E+00 -2.911833E+01 -4.239410E+00 -9.439005E-01 -4.454794E-03 -2.297265E+00 -2.638745E-02 -3.702648E+01 -6.854874E+00 -1.233532E+00 -7.608250E-03 -3.002169E+00 -4.506658E-02 -9.753183E+01 -4.756237E+01 -1.145985E+00 -6.566429E-03 -2.789132E+00 -3.889642E-02 -2.153203E+02 -2.318201E+02 -3.284693E-01 -5.394933E-04 -8.127742E-01 -3.303212E-03 -1.140024E+02 -6.499342E+01 -1.542077E+00 -1.189447E-02 -4.289209E+00 -9.202110E-02 -6.822066E+01 -2.327301E+01 -2.539795E+01 -3.226296E+00 -6.181353E+01 -1.911058E+01 -4.337368E+01 -9.406821E+00 -6.468280E+00 -2.092145E-01 -1.574250E+01 -1.239257E+00 -2.954020E+01 -4.363155E+00 -9.595552E-01 -4.603798E-03 -2.335365E+00 -2.727005E-02 -3.766396E+01 -7.092965E+00 -1.257902E+00 -7.911849E-03 -3.061483E+00 -4.686491E-02 -9.745374E+01 -4.748626E+01 -1.147635E+00 -6.585354E-03 -2.793148E+00 -3.900853E-02 -2.111575E+02 -2.229440E+02 -3.231097E-01 -5.220360E-04 -7.995123E-01 -3.196324E-03 -1.122446E+02 -6.300353E+01 -1.525862E+00 -1.164660E-02 -4.244109E+00 -9.010346E-02 -tally 2: -3.727210E-01 -6.946049E-04 -8.048851E-01 -3.239200E-03 -3.094666E-01 -4.788479E-04 -2.194451E-01 -2.407807E-04 -1.708574E-01 -1.459613E-04 -2.305100E-02 -2.656743E-06 -8.000270E-03 -3.200217E-07 -1.273126E-03 -8.104247E-09 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.327638E-01 -5.536587E-04 -7.185980E-01 -2.581916E-03 -2.762905E-01 -3.816822E-04 -1.959196E-01 -1.919225E-04 -1.525408E-01 -1.163435E-04 -2.057984E-02 -2.117648E-06 -7.142608E-03 -2.550842E-07 -1.136641E-03 -6.459768E-09 -3.721891E-01 -6.926236E-04 -8.037363E-01 -3.229960E-03 -3.090249E-01 -4.774820E-04 -2.191318E-01 -2.400938E-04 -1.706136E-01 -1.455450E-04 -2.301810E-02 -2.649164E-06 -7.988852E-03 -3.191088E-07 -1.271309E-03 -8.081129E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat index 5998849c911..3b5aea51fd9 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835334E+01 -2.336386E+01 -2.537083E+01 -3.219486E+00 -6.174753E+01 -1.907024E+01 -4.341616E+01 -9.425285E+00 -6.455038E+00 -2.083605E-01 -1.571027E+01 -1.234199E+00 -2.954946E+01 -4.365884E+00 -9.570224E-01 -4.579522E-03 -2.329201E+00 -2.712626E-02 -3.767664E+01 -7.097731E+00 -1.254577E+00 -7.870084E-03 -3.053390E+00 -4.661752E-02 -9.744533E+01 -4.747806E+01 -1.144186E+00 -6.545836E-03 -2.784754E+00 -3.877444E-02 -2.110393E+02 -2.226958E+02 -3.220474E-01 -5.186148E-04 -7.968838E-01 -3.175377E-03 -1.122158E+02 -6.297343E+01 -1.521665E+00 -1.158327E-02 -4.232435E+00 -8.961352E-02 -1.129400E+02 -6.377795E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.346085E+01 -1.429044E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.113062E+01 -4.845602E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.104556E+01 -8.423776E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.823418E+01 -4.824994E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.888989E+02 -1.784199E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.679142E+01 -4.685698E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.897467E+01 -1.739130E+01 -2.181728E+01 -2.380541E+00 -5.309890E+01 -1.410086E+01 -4.079630E+01 -8.321943E+00 -6.064107E+00 -1.838816E-01 -1.475882E+01 -1.089201E+00 -2.911833E+01 -4.239410E+00 -9.439005E-01 -4.454794E-03 -2.297265E+00 -2.638745E-02 -3.702648E+01 -6.854874E+00 -1.233532E+00 -7.608250E-03 -3.002169E+00 -4.506658E-02 -9.753183E+01 -4.756237E+01 -1.145985E+00 -6.566429E-03 -2.789132E+00 -3.889642E-02 -2.153203E+02 -2.318201E+02 -3.284693E-01 -5.394933E-04 -8.127742E-01 -3.303212E-03 -1.140024E+02 -6.499342E+01 -1.542077E+00 -1.189447E-02 -4.289209E+00 -9.202110E-02 -6.822066E+01 -2.327301E+01 -2.539795E+01 -3.226296E+00 -6.181353E+01 -1.911058E+01 -4.337368E+01 -9.406821E+00 -6.468280E+00 -2.092145E-01 -1.574250E+01 -1.239257E+00 -2.954020E+01 -4.363155E+00 -9.595552E-01 -4.603798E-03 -2.335365E+00 -2.727005E-02 -3.766396E+01 -7.092965E+00 -1.257902E+00 -7.911849E-03 -3.061483E+00 -4.686491E-02 -9.745374E+01 -4.748626E+01 -1.147635E+00 -6.585354E-03 -2.793148E+00 -3.900853E-02 -2.111575E+02 -2.229440E+02 -3.231097E-01 -5.220360E-04 -7.995123E-01 -3.196324E-03 -1.122446E+02 -6.300353E+01 -1.525862E+00 -1.164660E-02 -4.244109E+00 -9.010346E-02 +6.835753E+01 +2.336672E+01 +2.537239E+01 +3.219878E+00 +6.175132E+01 +1.907257E+01 +4.341877E+01 +9.426414E+00 +6.455425E+00 +2.083854E-01 +1.571121E+01 +1.234347E+00 +2.955121E+01 +4.366402E+00 +9.570792E-01 +4.580066E-03 +2.329339E+00 +2.712948E-02 +3.767888E+01 +7.098576E+00 +1.254652E+00 +7.871022E-03 +3.053572E+00 +4.662307E-02 +9.745115E+01 +4.748373E+01 +1.144254E+00 +6.546618E-03 +2.784920E+00 +3.877907E-02 +2.110520E+02 +2.227225E+02 +3.220667E-01 +5.186770E-04 +7.969316E-01 +3.175758E-03 +1.122226E+02 +6.298107E+01 +1.521758E+00 +1.158468E-02 +4.232692E+00 +8.962439E-02 +1.129470E+02 +6.378585E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.346407E+01 +1.429216E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.113247E+01 +4.846178E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.104801E+01 +8.424780E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.824005E+01 +4.825571E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.889103E+02 +1.784413E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.679730E+01 +4.686267E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.897828E+01 +1.739342E+01 +2.181862E+01 +2.380831E+00 +5.310215E+01 +1.410257E+01 +4.079874E+01 +8.322938E+00 +6.064469E+00 +1.839035E-01 +1.475971E+01 +1.089331E+00 +2.912006E+01 +4.239913E+00 +9.439565E-01 +4.455323E-03 +2.297401E+00 +2.639057E-02 +3.702869E+01 +6.855691E+00 +1.233605E+00 +7.609156E-03 +3.002348E+00 +4.507194E-02 +9.753766E+01 +4.756805E+01 +1.146053E+00 +6.567213E-03 +2.789298E+00 +3.890107E-02 +2.153332E+02 +2.318479E+02 +3.284890E-01 +5.395580E-04 +8.128230E-01 +3.303608E-03 +1.140093E+02 +6.500131E+01 +1.542171E+00 +1.189591E-02 +4.289470E+00 +9.203227E-02 +6.822486E+01 +2.327587E+01 +2.539951E+01 +3.226691E+00 +6.181733E+01 +1.911292E+01 +4.337628E+01 +9.407949E+00 +6.468668E+00 +2.092395E-01 +1.574344E+01 +1.239406E+00 +2.954196E+01 +4.363673E+00 +9.596121E-01 +4.604345E-03 +2.335504E+00 +2.727329E-02 +3.766621E+01 +7.093810E+00 +1.257977E+00 +7.912792E-03 +3.061665E+00 +4.687049E-02 +9.745956E+01 +4.749193E+01 +1.147703E+00 +6.586141E-03 +2.793315E+00 +3.901318E-02 +2.111701E+02 +2.229708E+02 +3.231290E-01 +5.220986E-04 +7.995602E-01 +3.196707E-03 +1.122514E+02 +6.301118E+01 +1.525955E+00 +1.164801E-02 +4.244367E+00 +9.011440E-02 tally 2: 3.727210E-01 6.946049E-04 @@ -178,14 +178,14 @@ tally 2: 4.788479E-04 2.194451E-01 2.407807E-04 -1.708574E-01 -1.459613E-04 +1.708575E-01 +1.459614E-04 2.305100E-02 -2.656743E-06 -8.000270E-03 -3.200217E-07 -1.273126E-03 -8.104247E-09 +2.656744E-06 +8.000275E-03 +3.200220E-07 +1.273127E-03 +8.104266E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -213,24 +213,24 @@ tally 2: 1.525408E-01 1.163435E-04 2.057984E-02 -2.117648E-06 -7.142608E-03 -2.550842E-07 -1.136641E-03 -6.459768E-09 +2.117649E-06 +7.142612E-03 +2.550845E-07 +1.136643E-03 +6.459783E-09 3.721891E-01 6.926236E-04 8.037363E-01 3.229960E-03 3.090249E-01 4.774820E-04 -2.191318E-01 -2.400938E-04 +2.191319E-01 +2.400939E-04 1.706136E-01 1.455450E-04 2.301810E-02 -2.649164E-06 -7.988852E-03 -3.191088E-07 -1.271309E-03 -8.081129E-09 +2.649166E-06 +7.988856E-03 +3.191091E-07 +1.271310E-03 +8.081148E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat index 96983433132..db723684684 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat @@ -1,191 +1,191 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.840334E+01 -2.339806E+01 -2.538961E+01 -3.224253E+00 -6.179323E+01 -1.909848E+01 -4.345373E+01 -9.441604E+00 -6.460636E+00 -2.087221E-01 -1.572390E+01 -1.236341E+00 -2.957863E+01 -4.374507E+00 -9.579675E-01 -4.588572E-03 -2.331501E+00 -2.717986E-02 -3.771394E+01 -7.111791E+00 -1.255820E+00 -7.885686E-03 -3.056415E+00 -4.670993E-02 -9.754619E+01 -4.757639E+01 -1.145370E+00 -6.559394E-03 -2.787636E+00 -3.885475E-02 -2.112642E+02 -2.231706E+02 -3.223889E-01 -5.197153E-04 -7.977288E-01 -3.182115E-03 -1.123289E+02 -6.310040E+01 -1.523185E+00 -1.160642E-02 -4.236663E+00 -8.979264E-02 -1.130304E+02 -6.388017E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.350834E+01 -1.431584E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.116176E+01 -4.855301E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.108714E+01 -8.440852E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.833674E+01 -4.835074E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.891009E+02 -1.788017E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.688985E+01 -4.695232E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.901670E+01 -1.741609E+01 -2.183302E+01 -2.383977E+00 -5.313721E+01 -1.412121E+01 -4.083157E+01 -8.336336E+00 -6.069364E+00 -1.842005E-01 -1.477162E+01 -1.091090E+00 -2.914697E+01 -4.247755E+00 -9.448299E-01 -4.463571E-03 -2.299527E+00 -2.643943E-02 -3.706289E+01 -6.868362E+00 -1.234746E+00 -7.623242E-03 -3.005125E+00 -4.515537E-02 -9.763244E+01 -4.766055E+01 -1.147167E+00 -6.579986E-03 -2.792009E+00 -3.897673E-02 -2.155494E+02 -2.323139E+02 -3.288171E-01 -5.406366E-04 -8.136350E-01 -3.310212E-03 -1.141172E+02 -6.512433E+01 -1.543616E+00 -1.191822E-02 -4.293489E+00 -9.220481E-02 -6.827052E+01 -2.330704E+01 -2.541673E+01 -3.231069E+00 -6.185924E+01 -1.913885E+01 -4.341120E+01 -9.423102E+00 -6.473888E+00 -2.095774E-01 -1.575615E+01 -1.241407E+00 -2.956936E+01 -4.371772E+00 -9.605027E-01 -4.612895E-03 -2.337671E+00 -2.732394E-02 -3.770124E+01 -7.107012E+00 -1.259148E+00 -7.927529E-03 -3.064515E+00 -4.695779E-02 -9.755460E+01 -4.758459E+01 -1.148823E+00 -6.598993E-03 -2.796039E+00 -3.908931E-02 -2.113825E+02 -2.234194E+02 -3.234523E-01 -5.231438E-04 -8.003602E-01 -3.203107E-03 -1.123577E+02 -6.313057E+01 -1.527387E+00 -1.166989E-02 -4.248351E+00 -9.028362E-02 +6.841005E+01 +2.340265E+01 +2.539210E+01 +3.224885E+00 +6.179930E+01 +1.910222E+01 +4.345797E+01 +9.443447E+00 +6.461267E+00 +2.087628E-01 +1.572543E+01 +1.236582E+00 +2.958150E+01 +4.375358E+00 +9.580607E-01 +4.589465E-03 +2.331728E+00 +2.718515E-02 +3.771761E+01 +7.113176E+00 +1.255942E+00 +7.887221E-03 +3.056712E+00 +4.671902E-02 +9.755568E+01 +4.758565E+01 +1.145482E+00 +6.560671E-03 +2.787908E+00 +3.886231E-02 +2.112847E+02 +2.232140E+02 +3.224203E-01 +5.198164E-04 +7.978065E-01 +3.182734E-03 +1.123399E+02 +6.311276E+01 +1.523335E+00 +1.160870E-02 +4.237078E+00 +8.981024E-02 +1.130416E+02 +6.389274E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.351357E+01 +1.431864E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116479E+01 +4.856246E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.109114E+01 +8.442495E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.834631E+01 +4.836016E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891193E+02 +1.788365E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.689934E+01 +4.696152E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.902249E+01 +1.741951E+01 +2.183516E+01 +2.384444E+00 +5.314242E+01 +1.412397E+01 +4.083555E+01 +8.337963E+00 +6.069956E+00 +1.842364E-01 +1.477306E+01 +1.091303E+00 +2.914981E+01 +4.248581E+00 +9.449218E-01 +4.464439E-03 +2.299750E+00 +2.644457E-02 +3.706650E+01 +6.869699E+00 +1.234866E+00 +7.624725E-03 +3.005418E+00 +4.516416E-02 +9.764194E+01 +4.766982E+01 +1.147279E+00 +6.581267E-03 +2.792281E+00 +3.898431E-02 +2.155704E+02 +2.323591E+02 +3.288491E-01 +5.407419E-04 +8.137142E-01 +3.310856E-03 +1.141284E+02 +6.513710E+01 +1.543767E+00 +1.192055E-02 +4.293910E+00 +9.222288E-02 +6.827724E+01 +2.331163E+01 +2.541923E+01 +3.231703E+00 +6.186532E+01 +1.914261E+01 +4.341544E+01 +9.424942E+00 +6.474521E+00 +2.096183E-01 +1.575769E+01 +1.241649E+00 +2.957223E+01 +4.372622E+00 +9.605961E-01 +4.613792E-03 +2.337899E+00 +2.732925E-02 +3.770491E+01 +7.108396E+00 +1.259271E+00 +7.929072E-03 +3.064813E+00 +4.696693E-02 +9.756409E+01 +4.759386E+01 +1.148934E+00 +6.600277E-03 +2.796311E+00 +3.909692E-02 +2.114030E+02 +2.234629E+02 +3.234838E-01 +5.232457E-04 +8.004381E-01 +3.203731E-03 +1.123687E+02 +6.314294E+01 +1.527537E+00 +1.167217E-02 +4.248767E+00 +9.030131E-02 tally 2: 3.727211E-01 -6.946051E-04 +6.946052E-04 8.048854E-01 -3.239202E-03 +3.239203E-03 3.094668E-01 4.788484E-04 2.194454E-01 -2.407814E-04 -1.708580E-01 -1.459623E-04 -2.305118E-02 -2.656784E-06 -8.000421E-03 -3.200337E-07 -1.273177E-03 -8.104900E-09 +2.407815E-04 +1.708581E-01 +1.459624E-04 +2.305119E-02 +2.656788E-06 +8.000435E-03 +3.200348E-07 +1.273182E-03 +8.104960E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -208,29 +208,29 @@ tally 2: 2.581918E-03 2.762906E-01 3.816826E-04 -1.959199E-01 +1.959200E-01 1.919231E-04 -1.525413E-01 -1.163443E-04 -2.057999E-02 -2.117681E-06 -7.142742E-03 -2.550938E-07 -1.136687E-03 -6.460287E-09 +1.525414E-01 +1.163444E-04 +2.058001E-02 +2.117684E-06 +7.142754E-03 +2.550947E-07 +1.136691E-03 +6.460335E-09 3.721891E-01 6.926238E-04 8.037366E-01 -3.229962E-03 +3.229963E-03 3.090251E-01 4.774825E-04 2.191322E-01 2.400946E-04 1.706142E-01 -1.455460E-04 -2.301828E-02 -2.649205E-06 -7.989002E-03 -3.191208E-07 -1.271360E-03 -8.081780E-09 +1.455461E-04 +2.301829E-02 +2.649209E-06 +7.989016E-03 +3.191219E-07 +1.271365E-03 +8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat index 77d63f0fe88..bac8902424a 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat @@ -1,191 +1,191 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.845368E+01 -2.343251E+01 -2.540851E+01 -3.229056E+00 -6.183923E+01 -1.912693E+01 -4.349163E+01 -9.458082E+00 -6.466284E+00 -2.090872E-01 -1.573764E+01 -1.238504E+00 -2.960807E+01 -4.383219E+00 -9.589215E-01 -4.597715E-03 -2.333823E+00 -2.723402E-02 -3.775158E+01 -7.125993E+00 -1.257074E+00 -7.901443E-03 -3.059467E+00 -4.680327E-02 -9.764789E+01 -4.767565E+01 -1.146565E+00 -6.573080E-03 -2.790543E+00 -3.893582E-02 -2.114907E+02 -2.236494E+02 -3.227330E-01 -5.208251E-04 -7.985801E-01 -3.188910E-03 -1.124427E+02 -6.322836E+01 -1.524716E+00 -1.162976E-02 -4.240920E+00 -8.997317E-02 -1.131215E+02 -6.398314E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.355623E+01 -1.434148E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.119318E+01 -4.865097E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.112909E+01 -8.458095E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.844015E+01 -4.845249E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.893044E+02 -1.791866E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.698893E+01 -4.704839E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.905902E+01 -1.744108E+01 -2.184887E+01 -2.387439E+00 -5.317577E+01 -1.414171E+01 -4.086715E+01 -8.350871E+00 -6.074667E+00 -1.845226E-01 -1.478452E+01 -1.092998E+00 -2.917589E+01 -4.256186E+00 -9.457679E-01 -4.472438E-03 -2.301810E+00 -2.649196E-02 -3.709963E+01 -6.881987E+00 -1.235972E+00 -7.638384E-03 -3.008108E+00 -4.524507E-02 -9.773390E+01 -4.775965E+01 -1.148359E+00 -6.593672E-03 -2.794911E+00 -3.905779E-02 -2.157803E+02 -2.328118E+02 -3.291676E-01 -5.417897E-04 -8.145022E-01 -3.317272E-03 -1.142327E+02 -6.525626E+01 -1.545165E+00 -1.194215E-02 -4.297798E+00 -9.238995E-02 -6.832072E+01 -2.334133E+01 -2.543564E+01 -3.235878E+00 -6.190525E+01 -1.916734E+01 -4.344905E+01 -9.439542E+00 -6.479546E+00 -2.099439E-01 -1.576992E+01 -1.243578E+00 -2.959878E+01 -4.380476E+00 -9.614590E-01 -4.622085E-03 -2.339999E+00 -2.737837E-02 -3.773886E+01 -7.121201E+00 -1.260405E+00 -7.943367E-03 -3.067575E+00 -4.705160E-02 -9.765630E+01 -4.768386E+01 -1.150020E+00 -6.612760E-03 -2.798954E+00 -3.917086E-02 -2.116091E+02 -2.238988E+02 -3.237976E-01 -5.242611E-04 -8.012144E-01 -3.209948E-03 -1.124716E+02 -6.325860E+01 -1.528922E+00 -1.169335E-02 -4.252620E+00 -9.046517E-02 +6.846312E+01 +2.343897E+01 +2.541202E+01 +3.229945E+00 +6.184776E+01 +1.913220E+01 +4.349759E+01 +9.460674E+00 +6.467170E+00 +2.091445E-01 +1.573980E+01 +1.238843E+00 +2.961211E+01 +4.384415E+00 +9.590524E-01 +4.598971E-03 +2.334141E+00 +2.724146E-02 +3.775673E+01 +7.127940E+00 +1.257246E+00 +7.903602E-03 +3.059885E+00 +4.681606E-02 +9.766123E+01 +4.768868E+01 +1.146721E+00 +6.574876E-03 +2.790924E+00 +3.894646E-02 +2.115196E+02 +2.237105E+02 +3.227770E-01 +5.209674E-04 +7.986892E-01 +3.189781E-03 +1.124582E+02 +6.324576E+01 +1.524926E+00 +1.163296E-02 +4.241504E+00 +8.999793E-02 +1.131371E+02 +6.400083E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.356358E+01 +1.434541E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.119744E+01 +4.866426E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.113471E+01 +8.460406E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.845360E+01 +4.846573E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.893303E+02 +1.792356E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.700227E+01 +4.706134E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.906717E+01 +1.744589E+01 +2.185188E+01 +2.388096E+00 +5.318310E+01 +1.414560E+01 +4.087275E+01 +8.353159E+00 +6.075499E+00 +1.845731E-01 +1.478655E+01 +1.093297E+00 +2.917987E+01 +4.257348E+00 +9.458970E-01 +4.473659E-03 +2.302124E+00 +2.649919E-02 +3.710470E+01 +6.883867E+00 +1.236141E+00 +7.640471E-03 +3.008519E+00 +4.525743E-02 +9.774725E+01 +4.777270E+01 +1.148516E+00 +6.595474E-03 +2.795293E+00 +3.906847E-02 +2.158098E+02 +2.328754E+02 +3.292126E-01 +5.419377E-04 +8.146135E-01 +3.318178E-03 +1.142484E+02 +6.527422E+01 +1.545377E+00 +1.194543E-02 +4.298389E+00 +9.241537E-02 +6.833016E+01 +2.334778E+01 +2.543915E+01 +3.236770E+00 +6.191381E+01 +1.917263E+01 +4.345500E+01 +9.442129E+00 +6.480434E+00 +2.100014E-01 +1.577208E+01 +1.243919E+00 +2.960282E+01 +4.381672E+00 +9.615903E-01 +4.623347E-03 +2.340318E+00 +2.738585E-02 +3.774401E+01 +7.123146E+00 +1.260578E+00 +7.945537E-03 +3.067994E+00 +4.706446E-02 +9.766964E+01 +4.769689E+01 +1.150177E+00 +6.614567E-03 +2.799336E+00 +3.918157E-02 +2.116380E+02 +2.239600E+02 +3.238418E-01 +5.244043E-04 +8.013238E-01 +3.210825E-03 +1.124870E+02 +6.327601E+01 +1.529133E+00 +1.169657E-02 +4.253205E+00 +9.049007E-02 tally 2: 3.727212E-01 6.946055E-04 -8.048858E-01 +8.048859E-01 3.239206E-03 3.094670E-01 -4.788492E-04 +4.788493E-04 2.194460E-01 -2.407827E-04 -1.708590E-01 -1.459640E-04 -2.305148E-02 -2.656854E-06 -8.000676E-03 -3.200541E-07 -1.273263E-03 -8.105994E-09 +2.407828E-04 +1.708591E-01 +1.459642E-04 +2.305151E-02 +2.656862E-06 +8.000705E-03 +3.200564E-07 +1.273273E-03 +8.106118E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -205,32 +205,32 @@ tally 2: 3.327639E-01 5.536592E-04 7.185987E-01 -2.581920E-03 +2.581921E-03 2.762909E-01 -3.816832E-04 -1.959204E-01 -1.919241E-04 -1.525422E-01 -1.163456E-04 -2.058026E-02 -2.117736E-06 -7.142968E-03 -2.551100E-07 -1.136763E-03 -6.461154E-09 +3.816833E-04 +1.959205E-01 +1.919242E-04 +1.525423E-01 +1.163458E-04 +2.058029E-02 +2.117742E-06 +7.142994E-03 +2.551118E-07 +1.136772E-03 +6.461253E-09 3.721892E-01 6.926241E-04 -8.037370E-01 -3.229966E-03 -3.090253E-01 -4.774833E-04 +8.037371E-01 +3.229967E-03 +3.090254E-01 +4.774834E-04 2.191328E-01 -2.400958E-04 -1.706152E-01 -1.455477E-04 -2.301858E-02 -2.649275E-06 -7.989256E-03 -3.191411E-07 -1.271446E-03 -8.082870E-09 +2.400960E-04 +1.706153E-01 +1.455479E-04 +2.301861E-02 +2.649283E-06 +7.989285E-03 +3.191434E-07 +1.271455E-03 +8.082995E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat index 5cde6dffcdc..2625ac2a347 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat @@ -1,191 +1,191 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.850556E+01 -2.346805E+01 -2.542799E+01 -3.234009E+00 -6.188664E+01 -1.915627E+01 -4.353050E+01 -9.474995E+00 -6.472076E+00 -2.094619E-01 -1.575174E+01 -1.240723E+00 -2.963816E+01 -4.392134E+00 -9.598967E-01 -4.607072E-03 -2.336196E+00 -2.728944E-02 -3.779005E+01 -7.140526E+00 -1.258356E+00 -7.917569E-03 -3.062588E+00 -4.689879E-02 -9.775179E+01 -4.777715E+01 -1.147785E+00 -6.587076E-03 -2.793512E+00 -3.901872E-02 -2.117220E+02 -2.241389E+02 -3.230843E-01 -5.219597E-04 -7.994496E-01 -3.195857E-03 -1.125592E+02 -6.335934E+01 -1.526281E+00 -1.165365E-02 -4.245274E+00 -9.015799E-02 -1.132151E+02 -6.408909E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.360531E+01 -1.436778E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.122530E+01 -4.875120E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117195E+01 -8.475734E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.854577E+01 -4.855652E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895122E+02 -1.795802E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.709023E+01 -4.714672E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.910268E+01 -1.746687E+01 -2.186521E+01 -2.391011E+00 -5.321554E+01 -1.416287E+01 -4.090364E+01 -8.365790E+00 -6.080105E+00 -1.848531E-01 -1.479776E+01 -1.094956E+00 -2.920545E+01 -4.264815E+00 -9.467269E-01 -4.481513E-03 -2.304144E+00 -2.654571E-02 -3.713720E+01 -6.895932E+00 -1.237225E+00 -7.653882E-03 -3.011159E+00 -4.533687E-02 -9.783755E+01 -4.786101E+01 -1.149578E+00 -6.607668E-03 -2.797876E+00 -3.914070E-02 -2.160161E+02 -2.333209E+02 -3.295255E-01 -5.429686E-04 -8.153879E-01 -3.324490E-03 -1.143509E+02 -6.539131E+01 -1.546749E+00 -1.196665E-02 -4.302204E+00 -9.257950E-02 -6.837246E+01 -2.337670E+01 -2.545512E+01 -3.240837E+00 -6.195267E+01 -1.919671E+01 -4.348787E+01 -9.456416E+00 -6.485348E+00 -2.103200E-01 -1.578404E+01 -1.245806E+00 -2.962886E+01 -4.389384E+00 -9.624367E-01 -4.631490E-03 -2.342378E+00 -2.743408E-02 -3.777731E+01 -7.135721E+00 -1.261691E+00 -7.959574E-03 -3.070703E+00 -4.714760E-02 -9.776019E+01 -4.778537E+01 -1.151244E+00 -6.626839E-03 -2.801932E+00 -3.925426E-02 -2.118406E+02 -2.243889E+02 -3.241501E-01 -5.254034E-04 -8.020868E-01 -3.216942E-03 -1.125880E+02 -6.338965E+01 -1.530492E+00 -1.171738E-02 -4.256987E+00 -9.065105E-02 +6.851755E+01 +2.347625E+01 +2.543244E+01 +3.235138E+00 +6.189746E+01 +1.916296E+01 +4.353807E+01 +9.478290E+00 +6.473201E+00 +2.095347E-01 +1.575448E+01 +1.241154E+00 +2.964329E+01 +4.393655E+00 +9.600630E-01 +4.608668E-03 +2.336601E+00 +2.729890E-02 +3.779660E+01 +7.143001E+00 +1.258574E+00 +7.920313E-03 +3.063118E+00 +4.691505E-02 +9.776873E+01 +4.779372E+01 +1.147984E+00 +6.589359E-03 +2.793996E+00 +3.903225E-02 +2.117587E+02 +2.242166E+02 +3.231403E-01 +5.221406E-04 +7.995881E-01 +3.196965E-03 +1.125788E+02 +6.338145E+01 +1.526548E+00 +1.165771E-02 +4.246015E+00 +9.018945E-02 +1.132350E+02 +6.411155E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361464E+01 +1.437278E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123071E+01 +4.876810E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117909E+01 +8.478672E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856285E+01 +4.857335E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895450E+02 +1.796425E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710717E+01 +4.716318E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911301E+01 +1.747298E+01 +2.186903E+01 +2.391846E+00 +5.322484E+01 +1.416782E+01 +4.091074E+01 +8.368698E+00 +6.081162E+00 +1.849173E-01 +1.480033E+01 +1.095336E+00 +2.921050E+01 +4.266292E+00 +9.468909E-01 +4.483065E-03 +2.304543E+00 +2.655491E-02 +3.714364E+01 +6.898322E+00 +1.237440E+00 +7.656535E-03 +3.011680E+00 +4.535258E-02 +9.785450E+01 +4.787760E+01 +1.149777E+00 +6.609958E-03 +2.798361E+00 +3.915427E-02 +2.160535E+02 +2.334017E+02 +3.295826E-01 +5.431567E-04 +8.155291E-01 +3.325642E-03 +1.143708E+02 +6.541413E+01 +1.547019E+00 +1.197082E-02 +4.302955E+00 +9.261180E-02 +6.838444E+01 +2.338489E+01 +2.545958E+01 +3.241970E+00 +6.196352E+01 +1.920343E+01 +4.349543E+01 +9.459705E+00 +6.486476E+00 +2.103931E-01 +1.578678E+01 +1.246239E+00 +2.963399E+01 +4.390905E+00 +9.626034E-01 +4.633094E-03 +2.342784E+00 +2.744358E-02 +3.778386E+01 +7.138194E+00 +1.261909E+00 +7.962333E-03 +3.071235E+00 +4.716395E-02 +9.777713E+01 +4.780194E+01 +1.151443E+00 +6.629136E-03 +2.802417E+00 +3.926787E-02 +2.118773E+02 +2.244667E+02 +3.242063E-01 +5.255855E-04 +8.022257E-01 +3.218057E-03 +1.126076E+02 +6.341177E+01 +1.530759E+00 +1.172147E-02 +4.257730E+00 +9.068268E-02 tally 2: 3.727213E-01 6.946060E-04 8.048865E-01 -3.239211E-03 +3.239212E-03 3.094674E-01 -4.788503E-04 -2.194468E-01 -2.407845E-04 -1.708604E-01 -1.459664E-04 -2.305191E-02 -2.656953E-06 -8.001035E-03 -3.200829E-07 -1.273383E-03 -8.107528E-09 +4.788505E-04 +2.194469E-01 +2.407847E-04 +1.708606E-01 +1.459668E-04 +2.305197E-02 +2.656966E-06 +8.001084E-03 +3.200868E-07 +1.273400E-03 +8.107736E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -202,35 +202,35 @@ tally 2: 0.000000E+00 0.000000E+00 0.000000E+00 -3.327640E-01 -5.536595E-04 +3.327641E-01 +5.536596E-04 7.185993E-01 2.581925E-03 2.762912E-01 -3.816841E-04 -1.959212E-01 -1.919255E-04 -1.525435E-01 -1.163475E-04 -2.058064E-02 -2.117815E-06 -7.143287E-03 -2.551328E-07 -1.136870E-03 -6.462369E-09 +3.816842E-04 +1.959213E-01 +1.919257E-04 +1.525436E-01 +1.163478E-04 +2.058070E-02 +2.117825E-06 +7.143331E-03 +2.551359E-07 +1.136885E-03 +6.462535E-09 3.721894E-01 -6.926246E-04 -8.037377E-01 -3.229971E-03 +6.926247E-04 +8.037378E-01 +3.229972E-03 3.090257E-01 -4.774844E-04 -2.191336E-01 -2.400976E-04 -1.706166E-01 -1.455501E-04 -2.301901E-02 -2.649374E-06 -7.989616E-03 -3.191698E-07 -1.271566E-03 -8.084399E-09 +4.774846E-04 +2.191337E-01 +2.400979E-04 +1.706168E-01 +1.455504E-04 +2.301907E-02 +2.649387E-06 +7.989664E-03 +3.191737E-07 +1.271582E-03 +8.084607E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat index b0af9505115..5d21c6febfc 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat @@ -1,191 +1,191 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.855888E+01 -2.350460E+01 -2.544800E+01 -3.239101E+00 -6.193534E+01 -1.918643E+01 -4.357029E+01 -9.492325E+00 -6.478005E+00 -2.098459E-01 -1.576617E+01 -1.242997E+00 -2.966889E+01 -4.401246E+00 -9.608924E-01 -4.616635E-03 -2.338620E+00 -2.734609E-02 -3.782934E+01 -7.155380E+00 -1.259665E+00 -7.934050E-03 -3.065773E+00 -4.699641E-02 -9.785778E+01 -4.788082E+01 -1.149029E+00 -6.601370E-03 -2.796542E+00 -3.910339E-02 -2.119579E+02 -2.246387E+02 -3.234426E-01 -5.231181E-04 -8.003362E-01 -3.202950E-03 -1.126780E+02 -6.349319E+01 -1.527880E+00 -1.167806E-02 -4.249720E+00 -9.034688E-02 -1.133111E+02 -6.419784E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.365554E+01 -1.439471E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.125808E+01 -4.885363E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.121570E+01 -8.493756E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.865351E+01 -4.866275E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897240E+02 -1.799819E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.719362E+01 -4.724719E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.914757E+01 -1.749342E+01 -2.188200E+01 -2.394686E+00 -5.325642E+01 -1.418464E+01 -4.094099E+01 -8.381077E+00 -6.085673E+00 -1.851918E-01 -1.481131E+01 -1.096962E+00 -2.923563E+01 -4.273635E+00 -9.477062E-01 -4.490789E-03 -2.306527E+00 -2.660065E-02 -3.717556E+01 -6.910185E+00 -1.238505E+00 -7.669723E-03 -3.014273E+00 -4.543070E-02 -9.794330E+01 -4.796453E+01 -1.150820E+00 -6.621963E-03 -2.800901E+00 -3.922538E-02 -2.162565E+02 -2.338405E+02 -3.298906E-01 -5.441722E-04 -8.162911E-01 -3.331859E-03 -1.144715E+02 -6.552931E+01 -1.548367E+00 -1.199169E-02 -4.306704E+00 -9.277322E-02 -6.842564E+01 -2.341308E+01 -2.547514E+01 -3.245936E+00 -6.200139E+01 -1.922692E+01 -4.352760E+01 -9.473706E+00 -6.491287E+00 -2.107054E-01 -1.579849E+01 -1.248089E+00 -2.965958E+01 -4.398490E+00 -9.634349E-01 -4.641102E-03 -2.344808E+00 -2.749102E-02 -3.781657E+01 -7.150561E+00 -1.263003E+00 -7.976139E-03 -3.073896E+00 -4.724572E-02 -9.786618E+01 -4.788904E+01 -1.152492E+00 -6.641218E-03 -2.804970E+00 -3.933943E-02 -2.120766E+02 -2.248892E+02 -3.245097E-01 -5.265696E-04 -8.029764E-01 -3.224082E-03 -1.127069E+02 -6.352357E+01 -1.532095E+00 -1.174193E-02 -4.261446E+00 -9.084101E-02 +6.857321E+01 +2.351441E+01 +2.545331E+01 +3.240452E+00 +6.194827E+01 +1.919443E+01 +4.357935E+01 +9.496270E+00 +6.479351E+00 +2.099331E-01 +1.576944E+01 +1.243514E+00 +2.967503E+01 +4.403069E+00 +9.610914E-01 +4.618547E-03 +2.339104E+00 +2.735741E-02 +3.783717E+01 +7.158344E+00 +1.259926E+00 +7.937337E-03 +3.066408E+00 +4.701588E-02 +9.787805E+01 +4.790066E+01 +1.149267E+00 +6.604105E-03 +2.797121E+00 +3.911960E-02 +2.120018E+02 +2.247317E+02 +3.235096E-01 +5.233348E-04 +8.005019E-01 +3.204276E-03 +1.127015E+02 +6.351966E+01 +1.528198E+00 +1.168293E-02 +4.250605E+00 +9.038454E-02 +1.133348E+02 +6.422471E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366670E+01 +1.440070E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126455E+01 +4.887386E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122424E+01 +8.497275E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867395E+01 +4.868292E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897633E+02 +1.800565E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721388E+01 +4.726689E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915992E+01 +1.750072E+01 +2.188657E+01 +2.395685E+00 +5.326754E+01 +1.419056E+01 +4.094949E+01 +8.384559E+00 +6.086937E+00 +1.852687E-01 +1.481439E+01 +1.097417E+00 +2.924168E+01 +4.275405E+00 +9.479024E-01 +4.492648E-03 +2.307005E+00 +2.661167E-02 +3.718326E+01 +6.913048E+00 +1.238761E+00 +7.672900E-03 +3.014897E+00 +4.544952E-02 +9.796358E+01 +4.798440E+01 +1.151059E+00 +6.624706E-03 +2.801481E+00 +3.924163E-02 +2.163013E+02 +2.339374E+02 +3.299589E-01 +5.443975E-04 +8.164601E-01 +3.333239E-03 +1.144953E+02 +6.555663E+01 +1.548689E+00 +1.199669E-02 +4.307601E+00 +9.281190E-02 +6.843995E+01 +2.342287E+01 +2.548046E+01 +3.247292E+00 +6.201435E+01 +1.923495E+01 +4.353665E+01 +9.477643E+00 +6.492636E+00 +2.107930E-01 +1.580178E+01 +1.248607E+00 +2.966572E+01 +4.400311E+00 +9.636344E-01 +4.643024E-03 +2.345293E+00 +2.750240E-02 +3.782441E+01 +7.153523E+00 +1.263264E+00 +7.979443E-03 +3.074533E+00 +4.726529E-02 +9.788645E+01 +4.790889E+01 +1.152731E+00 +6.643969E-03 +2.805551E+00 +3.935573E-02 +2.121205E+02 +2.249823E+02 +3.245768E-01 +5.267876E-04 +8.031427E-01 +3.225417E-03 +1.127304E+02 +6.355006E+01 +1.532415E+00 +1.174683E-02 +4.262334E+00 +9.087889E-02 tally 2: 3.727215E-01 -6.946066E-04 -8.048873E-01 -3.239218E-03 +6.946067E-04 +8.048874E-01 +3.239219E-03 3.094679E-01 -4.788518E-04 -2.194479E-01 -2.407868E-04 -1.708623E-01 -1.459696E-04 -2.305247E-02 -2.657081E-06 -8.001500E-03 -3.201200E-07 -1.273538E-03 -8.109490E-09 +4.788521E-04 +2.194480E-01 +2.407872E-04 +1.708625E-01 +1.459700E-04 +2.305255E-02 +2.657101E-06 +8.001573E-03 +3.201259E-07 +1.273562E-03 +8.109801E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -204,33 +204,33 @@ tally 2: 0.000000E+00 3.327642E-01 5.536601E-04 -7.186000E-01 -2.581930E-03 -2.762916E-01 -3.816853E-04 -1.959221E-01 -1.919274E-04 -1.525451E-01 -1.163500E-04 -2.058114E-02 -2.117916E-06 -7.143699E-03 -2.551622E-07 -1.137007E-03 -6.463922E-09 -3.721895E-01 -6.926252E-04 -8.037385E-01 -3.229978E-03 -3.090262E-01 -4.774859E-04 -2.191347E-01 -2.401000E-04 -1.706184E-01 -1.455532E-04 -2.301956E-02 -2.649502E-06 -7.990079E-03 -3.192068E-07 -1.271720E-03 -8.086355E-09 +7.186001E-01 +2.581931E-03 +2.762917E-01 +3.816855E-04 +1.959223E-01 +1.919277E-04 +1.525453E-01 +1.163504E-04 +2.058122E-02 +2.117932E-06 +7.143764E-03 +2.551668E-07 +1.137029E-03 +6.464170E-09 +3.721896E-01 +6.926253E-04 +8.037386E-01 +3.229979E-03 +3.090263E-01 +4.774861E-04 +2.191348E-01 +2.401004E-04 +1.706187E-01 +1.455537E-04 +2.301965E-02 +2.649522E-06 +7.990152E-03 +3.192126E-07 +1.271744E-03 +8.086665E-09 From e29189934442b6d0b875596ca6f33c5824f62e13 Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 6 Jan 2026 08:40:44 -0600 Subject: [PATCH 40/64] reset test results --- src/random_ray/random_ray.cpp | 2 +- .../isotropic/results_true_1.dat | 10 +- .../isotropic/results_true_2.dat | 12 +- .../isotropic/results_true_3.dat | 16 +- .../isotropic/results_true_4.dat | 16 +- .../isotropic/results_true_5.dat | 18 +- .../propagation/results_true_1.dat | 10 +- .../propagation/results_true_2.dat | 12 +- .../propagation/results_true_3.dat | 16 +- .../propagation/results_true_4.dat | 16 +- .../propagation/results_true_5.dat | 18 +- .../random_ray_k_eff_mesh/results_true.dat | 2 +- .../results_true_1.dat | 226 +++++------ .../results_true_2.dat | 270 +++++++------- .../results_true_3.dat | 282 +++++++------- .../results_true_4.dat | 348 ++++++++--------- .../results_true_5.dat | 350 +++++++++--------- 17 files changed, 812 insertions(+), 812 deletions(-) diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index 780090a6748..8b4d9e43644 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -452,11 +452,11 @@ void RandomRay::attenuate_flux_flat_source( float exponential = cjosey_exponential(tau); // exponential = 1 - exp(-tau) float new_delta_psi = (angular_flux_[g] - srh.source(g)) * exponential; if (settings::kinetic_simulation && !simulation::is_initial_condition) { - float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { new_delta_psi += srh.phi_prime(g) * exponential; } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { // Source Derivative Propogation terms for Characteristic Equation + float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; float T1 = srh.T1(g); float new_delta_psi_prime = (angular_flux_prime_[g] - T1); new_delta_psi += T1 * inverse_vbar * exponential / sigma_t; diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat index a92843c016e..46dba4d56f4 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.630191E+03 -3.458954E+04 +2.630190E+03 +3.458951E+04 1.079890E+02 -5.830990E+01 -2.651432E+02 -3.515149E+02 +5.830986E+01 +2.651431E+02 +3.515147E+02 tally 2: 1.077582E+00 5.805916E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat index 1593f2550e3..59ce5cb6cf3 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628844E+03 -3.455412E+04 -1.078946E+02 -5.820797E+01 -2.649121E+02 -3.509024E+02 +2.628842E+03 +3.455405E+04 +1.078945E+02 +5.820788E+01 +2.649118E+02 +3.509018E+02 tally 2: 1.077582E+00 5.805915E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat index b51d718be21..c237ebd2591 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.626023E+03 -3.447999E+04 -1.077395E+02 -5.804071E+01 -2.645319E+02 -3.498959E+02 +2.626019E+03 +3.447990E+04 +1.077393E+02 +5.804055E+01 +2.645315E+02 +3.498950E+02 tally 2: 1.077582E+00 5.805913E-03 @@ -22,5 +22,5 @@ tally 2: 2.220585E-05 2.312878E-02 2.674703E-06 -3.680429E-03 -6.772778E-08 +3.680428E-03 +6.772777E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat index 397a03896ad..2a14986689a 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621898E+03 -3.437177E+04 -1.075308E+02 -5.781614E+01 -2.640203E+02 -3.485440E+02 +2.621893E+03 +3.437163E+04 +1.075306E+02 +5.781591E+01 +2.640198E+02 +3.485426E+02 tally 2: 1.077581E+00 5.805908E-03 @@ -22,5 +22,5 @@ tally 2: 2.220489E-05 2.312757E-02 2.674422E-06 -3.680018E-03 -6.771265E-08 +3.680017E-03 +6.771264E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat index 45797f0de66..e66542145b7 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616587E+03 -3.423265E+04 -1.072735E+02 -5.753976E+01 -2.633892E+02 -3.468797E+02 +2.616580E+03 +3.423247E+04 +1.072732E+02 +5.753947E+01 +2.633886E+02 +3.468780E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -20,7 +20,7 @@ tally 2: 1.219950E-03 6.663827E-02 2.220330E-05 -2.312557E-02 +2.312556E-02 2.673959E-06 -3.679344E-03 -6.768786E-08 +3.679343E-03 +6.768783E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat index a92843c016e..46dba4d56f4 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.630191E+03 -3.458954E+04 +2.630190E+03 +3.458951E+04 1.079890E+02 -5.830990E+01 -2.651432E+02 -3.515149E+02 +5.830986E+01 +2.651431E+02 +3.515147E+02 tally 2: 1.077582E+00 5.805916E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat index 1593f2550e3..59ce5cb6cf3 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628844E+03 -3.455412E+04 -1.078946E+02 -5.820797E+01 -2.649121E+02 -3.509024E+02 +2.628842E+03 +3.455405E+04 +1.078945E+02 +5.820788E+01 +2.649118E+02 +3.509018E+02 tally 2: 1.077582E+00 5.805915E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat index b51d718be21..c237ebd2591 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.626023E+03 -3.447999E+04 -1.077395E+02 -5.804071E+01 -2.645319E+02 -3.498959E+02 +2.626019E+03 +3.447990E+04 +1.077393E+02 +5.804055E+01 +2.645315E+02 +3.498950E+02 tally 2: 1.077582E+00 5.805913E-03 @@ -22,5 +22,5 @@ tally 2: 2.220585E-05 2.312878E-02 2.674703E-06 -3.680429E-03 -6.772778E-08 +3.680428E-03 +6.772777E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat index 397a03896ad..99def7858bf 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621898E+03 -3.437177E+04 -1.075308E+02 -5.781614E+01 -2.640203E+02 -3.485440E+02 +2.621893E+03 +3.437163E+04 +1.075306E+02 +5.781591E+01 +2.640198E+02 +3.485427E+02 tally 2: 1.077581E+00 5.805908E-03 @@ -22,5 +22,5 @@ tally 2: 2.220489E-05 2.312757E-02 2.674422E-06 -3.680018E-03 -6.771265E-08 +3.680017E-03 +6.771264E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat index 45797f0de66..e66542145b7 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616587E+03 -3.423265E+04 -1.072735E+02 -5.753976E+01 -2.633892E+02 -3.468797E+02 +2.616580E+03 +3.423247E+04 +1.072732E+02 +5.753947E+01 +2.633886E+02 +3.468780E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -20,7 +20,7 @@ tally 2: 1.219950E-03 6.663827E-02 2.220330E-05 -2.312557E-02 +2.312556E-02 2.673959E-06 -3.679344E-03 -6.768786E-08 +3.679343E-03 +6.768783E-08 diff --git a/tests/regression_tests/random_ray_k_eff_mesh/results_true.dat b/tests/regression_tests/random_ray_k_eff_mesh/results_true.dat index 2976d169b63..2ae8fad85fb 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh/results_true.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh/results_true.dat @@ -1,5 +1,5 @@ k-combined: -8.379203E-01 8.057198E-03 +8.379203E-01 8.057199E-03 tally 1: 1.073897E+00 2.309328E-01 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat index 3b5aea51fd9..53b4b39f8df 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835753E+01 +6.835752E+01 2.336672E+01 -2.537239E+01 -3.219878E+00 -6.175132E+01 +2.537238E+01 +3.219879E+00 +6.175130E+01 1.907257E+01 -4.341877E+01 -9.426414E+00 -6.455425E+00 +4.341875E+01 +9.426410E+00 +6.455423E+00 2.083854E-01 1.571121E+01 -1.234347E+00 +1.234346E+00 2.955121E+01 -4.366402E+00 -9.570792E-01 -4.580066E-03 -2.329339E+00 -2.712948E-02 -3.767888E+01 -7.098576E+00 +4.366400E+00 +9.570789E-01 +4.580063E-03 +2.329338E+00 +2.712946E-02 +3.767887E+01 +7.098573E+00 1.254652E+00 -7.871022E-03 -3.053572E+00 -4.662307E-02 -9.745115E+01 -4.748373E+01 +7.871018E-03 +3.053571E+00 +4.662305E-02 +9.745113E+01 +4.748370E+01 1.144254E+00 -6.546618E-03 -2.784920E+00 -3.877907E-02 -2.110520E+02 -2.227225E+02 +6.546615E-03 +2.784919E+00 +3.877905E-02 +2.110519E+02 +2.227224E+02 3.220667E-01 -5.186770E-04 -7.969316E-01 -3.175758E-03 +5.186767E-04 +7.969314E-01 +3.175756E-03 1.122226E+02 -6.298107E+01 -1.521758E+00 -1.158468E-02 -4.232692E+00 -8.962439E-02 -1.129470E+02 -6.378585E+01 +6.298103E+01 +1.521757E+00 +1.158467E-02 +4.232690E+00 +8.962434E-02 +1.129469E+02 +6.378582E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.346407E+01 +5.346406E+01 1.429216E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.113247E+01 -4.846178E+00 +3.113246E+01 +4.846176E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.104801E+01 -8.424780E+00 +4.104800E+01 +8.424776E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.824005E+01 -4.825571E+01 +9.824002E+01 +4.825568E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.889103E+02 -1.784413E+02 +1.889102E+02 +1.784412E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.679730E+01 -4.686267E+01 +9.679727E+01 +4.686264E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.897828E+01 +5.897826E+01 1.739342E+01 -2.181862E+01 +2.181861E+01 2.380831E+00 -5.310215E+01 +5.310214E+01 1.410257E+01 -4.079874E+01 -8.322938E+00 -6.064469E+00 +4.079873E+01 +8.322934E+00 +6.064468E+00 1.839035E-01 -1.475971E+01 +1.475970E+01 1.089331E+00 -2.912006E+01 -4.239913E+00 -9.439565E-01 -4.455323E-03 +2.912005E+01 +4.239911E+00 +9.439562E-01 +4.455320E-03 2.297401E+00 -2.639057E-02 -3.702869E+01 -6.855691E+00 +2.639056E-02 +3.702868E+01 +6.855687E+00 1.233605E+00 -7.609156E-03 -3.002348E+00 -4.507194E-02 -9.753766E+01 -4.756805E+01 +7.609153E-03 +3.002347E+00 +4.507192E-02 +9.753763E+01 +4.756803E+01 1.146053E+00 -6.567213E-03 -2.789298E+00 -3.890107E-02 -2.153332E+02 -2.318479E+02 -3.284890E-01 -5.395580E-04 -8.128230E-01 -3.303608E-03 +6.567210E-03 +2.789297E+00 +3.890105E-02 +2.153331E+02 +2.318478E+02 +3.284889E-01 +5.395577E-04 +8.128227E-01 +3.303606E-03 1.140093E+02 -6.500131E+01 -1.542171E+00 +6.500127E+01 +1.542170E+00 1.189591E-02 -4.289470E+00 -9.203227E-02 -6.822486E+01 -2.327587E+01 -2.539951E+01 -3.226691E+00 -6.181733E+01 -1.911292E+01 -4.337628E+01 -9.407949E+00 -6.468668E+00 -2.092395E-01 +4.289468E+00 +9.203222E-02 +6.822483E+01 +2.327586E+01 +2.539950E+01 +3.226689E+00 +6.181730E+01 +1.911291E+01 +4.337627E+01 +9.407943E+00 +6.468666E+00 +2.092394E-01 1.574344E+01 -1.239406E+00 -2.954196E+01 -4.363673E+00 -9.596121E-01 -4.604345E-03 -2.335504E+00 -2.727329E-02 -3.766621E+01 -7.093810E+00 +1.239405E+00 +2.954195E+01 +4.363671E+00 +9.596119E-01 +4.604342E-03 +2.335503E+00 +2.727327E-02 +3.766620E+01 +7.093806E+00 1.257977E+00 -7.912792E-03 -3.061665E+00 -4.687049E-02 -9.745956E+01 -4.749193E+01 +7.912788E-03 +3.061664E+00 +4.687047E-02 +9.745954E+01 +4.749190E+01 1.147703E+00 -6.586141E-03 -2.793315E+00 -3.901318E-02 +6.586138E-03 +2.793314E+00 +3.901316E-02 2.111701E+02 -2.229708E+02 +2.229707E+02 3.231290E-01 -5.220986E-04 -7.995602E-01 -3.196707E-03 -1.122514E+02 -6.301118E+01 +5.220983E-04 +7.995600E-01 +3.196706E-03 +1.122513E+02 +6.301114E+01 1.525955E+00 1.164801E-02 -4.244367E+00 -9.011440E-02 +4.244366E+00 +9.011434E-02 tally 2: 3.727210E-01 6.946049E-04 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat index db723684684..23ac3db9a86 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.841005E+01 -2.340265E+01 -2.539210E+01 -3.224885E+00 -6.179930E+01 +6.841002E+01 +2.340263E+01 +2.539209E+01 +3.224884E+00 +6.179927E+01 1.910222E+01 -4.345797E+01 -9.443447E+00 -6.461267E+00 -2.087628E-01 -1.572543E+01 -1.236582E+00 -2.958150E+01 -4.375358E+00 -9.580607E-01 -4.589465E-03 -2.331728E+00 -2.718515E-02 -3.771761E+01 -7.113176E+00 +4.345795E+01 +9.443438E+00 +6.461264E+00 +2.087626E-01 +1.572542E+01 +1.236581E+00 +2.958149E+01 +4.375353E+00 +9.580602E-01 +4.589460E-03 +2.331727E+00 +2.718512E-02 +3.771759E+01 +7.113168E+00 1.255942E+00 -7.887221E-03 -3.056712E+00 -4.671902E-02 -9.755568E+01 -4.758565E+01 -1.145482E+00 -6.560671E-03 -2.787908E+00 -3.886231E-02 -2.112847E+02 -2.232140E+02 -3.224203E-01 -5.198164E-04 -7.978065E-01 -3.182734E-03 -1.123399E+02 -6.311276E+01 -1.523335E+00 -1.160870E-02 -4.237078E+00 -8.981024E-02 -1.130416E+02 -6.389274E+01 +7.887213E-03 +3.056711E+00 +4.671898E-02 +9.755563E+01 +4.758560E+01 +1.145481E+00 +6.560664E-03 +2.787906E+00 +3.886227E-02 +2.112846E+02 +2.232138E+02 +3.224201E-01 +5.198158E-04 +7.978060E-01 +3.182731E-03 +1.123398E+02 +6.311269E+01 +1.523334E+00 +1.160868E-02 +4.237076E+00 +8.981014E-02 +1.130415E+02 +6.389267E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.351357E+01 -1.431864E+01 +5.351354E+01 +1.431862E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.116479E+01 -4.856246E+00 +3.116478E+01 +4.856241E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.109114E+01 -8.442495E+00 +4.109112E+01 +8.442486E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.834631E+01 -4.836016E+01 +9.834626E+01 +4.836011E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.891193E+02 -1.788365E+02 +1.891192E+02 +1.788363E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.689934E+01 -4.696152E+01 +9.689929E+01 +4.696147E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.902249E+01 -1.741951E+01 +5.902247E+01 +1.741950E+01 2.183516E+01 -2.384444E+00 -5.314242E+01 +2.384443E+00 +5.314240E+01 1.412397E+01 -4.083555E+01 -8.337963E+00 -6.069956E+00 -1.842364E-01 -1.477306E+01 -1.091303E+00 -2.914981E+01 -4.248581E+00 -9.449218E-01 -4.464439E-03 -2.299750E+00 -2.644457E-02 -3.706650E+01 -6.869699E+00 +4.083553E+01 +8.337955E+00 +6.069953E+00 +1.842363E-01 +1.477305E+01 +1.091302E+00 +2.914979E+01 +4.248577E+00 +9.449213E-01 +4.464434E-03 +2.299749E+00 +2.644455E-02 +3.706648E+01 +6.869692E+00 1.234866E+00 -7.624725E-03 -3.005418E+00 -4.516416E-02 -9.764194E+01 -4.766982E+01 -1.147279E+00 -6.581267E-03 -2.792281E+00 -3.898431E-02 -2.155704E+02 -2.323591E+02 -3.288491E-01 -5.407419E-04 -8.137142E-01 -3.310856E-03 -1.141284E+02 -6.513710E+01 -1.543767E+00 -1.192055E-02 -4.293910E+00 -9.222288E-02 -6.827724E+01 -2.331163E+01 -2.541923E+01 -3.231703E+00 -6.186532E+01 -1.914261E+01 -4.341544E+01 -9.424942E+00 -6.474521E+00 -2.096183E-01 -1.575769E+01 -1.241649E+00 -2.957223E+01 -4.372622E+00 -9.605961E-01 -4.613792E-03 -2.337899E+00 -2.732925E-02 -3.770491E+01 -7.108396E+00 -1.259271E+00 -7.929072E-03 -3.064813E+00 -4.696693E-02 -9.756409E+01 -4.759386E+01 +7.624718E-03 +3.005416E+00 +4.516412E-02 +9.764189E+01 +4.766977E+01 +1.147278E+00 +6.581260E-03 +2.792280E+00 +3.898427E-02 +2.155703E+02 +2.323588E+02 +3.288490E-01 +5.407413E-04 +8.137137E-01 +3.310853E-03 +1.141283E+02 +6.513702E+01 +1.543766E+00 +1.192054E-02 +4.293907E+00 +9.222278E-02 +6.827719E+01 +2.331160E+01 +2.541921E+01 +3.231700E+00 +6.186528E+01 +1.914259E+01 +4.341541E+01 +9.424932E+00 +6.474517E+00 +2.096181E-01 +1.575768E+01 +1.241648E+00 +2.957222E+01 +4.372617E+00 +9.605956E-01 +4.613787E-03 +2.337897E+00 +2.732922E-02 +3.770489E+01 +7.108388E+00 +1.259270E+00 +7.929064E-03 +3.064812E+00 +4.696688E-02 +9.756404E+01 +4.759381E+01 1.148934E+00 -6.600277E-03 -2.796311E+00 -3.909692E-02 -2.114030E+02 -2.234629E+02 -3.234838E-01 -5.232457E-04 -8.004381E-01 -3.203731E-03 -1.123687E+02 -6.314294E+01 -1.527537E+00 -1.167217E-02 -4.248767E+00 -9.030131E-02 +6.600271E-03 +2.796309E+00 +3.909688E-02 +2.114029E+02 +2.234627E+02 +3.234836E-01 +5.232451E-04 +8.004376E-01 +3.203727E-03 +1.123686E+02 +6.314287E+01 +1.527536E+00 +1.167216E-02 +4.248764E+00 +9.030121E-02 tally 2: 3.727211E-01 6.946052E-04 @@ -217,7 +217,7 @@ tally 2: 7.142754E-03 2.550947E-07 1.136691E-03 -6.460335E-09 +6.460334E-09 3.721891E-01 6.926238E-04 8.037366E-01 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat index bac8902424a..e808b21c1bd 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.846312E+01 -2.343897E+01 -2.541202E+01 -3.229945E+00 -6.184776E+01 -1.913220E+01 -4.349759E+01 -9.460674E+00 -6.467170E+00 -2.091445E-01 -1.573980E+01 -1.238843E+00 -2.961211E+01 -4.384415E+00 -9.590524E-01 -4.598971E-03 -2.334141E+00 -2.724146E-02 -3.775673E+01 -7.127940E+00 -1.257246E+00 -7.903602E-03 -3.059885E+00 -4.681606E-02 -9.766123E+01 -4.768868E+01 -1.146721E+00 -6.574876E-03 -2.790924E+00 -3.894646E-02 -2.115196E+02 -2.237105E+02 -3.227770E-01 -5.209674E-04 -7.986892E-01 -3.189781E-03 -1.124582E+02 -6.324576E+01 -1.524926E+00 -1.163296E-02 -4.241504E+00 -8.999793E-02 +6.846307E+01 +2.343894E+01 +2.541200E+01 +3.229943E+00 +6.184772E+01 +1.913218E+01 +4.349756E+01 +9.460661E+00 +6.467166E+00 +2.091442E-01 +1.573979E+01 +1.238841E+00 +2.961208E+01 +4.384409E+00 +9.590517E-01 +4.598964E-03 +2.334140E+00 +2.724142E-02 +3.775670E+01 +7.127929E+00 +1.257245E+00 +7.903591E-03 +3.059883E+00 +4.681599E-02 +9.766116E+01 +4.768861E+01 +1.146720E+00 +6.574867E-03 +2.790922E+00 +3.894640E-02 +2.115194E+02 +2.237102E+02 +3.227768E-01 +5.209666E-04 +7.986886E-01 +3.189776E-03 +1.124581E+02 +6.324566E+01 +1.524925E+00 +1.163294E-02 +4.241501E+00 +8.999778E-02 1.131371E+02 -6.400083E+01 +6.400074E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.356358E+01 -1.434541E+01 +5.356354E+01 +1.434539E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.119744E+01 -4.866426E+00 +3.119742E+01 +4.866419E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.113471E+01 -8.460406E+00 +4.113468E+01 +8.460394E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.845360E+01 -4.846573E+01 +9.845352E+01 +4.846566E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.893303E+02 -1.792356E+02 +1.893301E+02 +1.792354E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.700227E+01 -4.706134E+01 +9.700220E+01 +4.706127E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.906717E+01 -1.744589E+01 -2.185188E+01 -2.388096E+00 -5.318310E+01 -1.414560E+01 -4.087275E+01 -8.353159E+00 -6.075499E+00 -1.845731E-01 -1.478655E+01 -1.093297E+00 -2.917987E+01 -4.257348E+00 -9.458970E-01 -4.473659E-03 -2.302124E+00 -2.649919E-02 -3.710470E+01 -6.883867E+00 -1.236141E+00 -7.640471E-03 -3.008519E+00 -4.525743E-02 -9.774725E+01 -4.777270E+01 -1.148516E+00 -6.595474E-03 -2.795293E+00 -3.906847E-02 -2.158098E+02 -2.328754E+02 -3.292126E-01 -5.419377E-04 -8.146135E-01 -3.318178E-03 -1.142484E+02 -6.527422E+01 -1.545377E+00 -1.194543E-02 -4.298389E+00 -9.241537E-02 -6.833016E+01 -2.334778E+01 -2.543915E+01 -3.236770E+00 -6.191381E+01 -1.917263E+01 -4.345500E+01 -9.442129E+00 -6.480434E+00 -2.100014E-01 -1.577208E+01 -1.243919E+00 -2.960282E+01 -4.381672E+00 -9.615903E-01 -4.623347E-03 -2.340318E+00 -2.738585E-02 -3.774401E+01 -7.123146E+00 -1.260578E+00 -7.945537E-03 -3.067994E+00 -4.706446E-02 -9.766964E+01 -4.769689E+01 +5.906713E+01 +1.744587E+01 +2.185187E+01 +2.388094E+00 +5.318307E+01 +1.414559E+01 +4.087271E+01 +8.353147E+00 +6.075495E+00 +1.845728E-01 +1.478654E+01 +1.093296E+00 +2.917985E+01 +4.257342E+00 +9.458963E-01 +4.473653E-03 +2.302122E+00 +2.649915E-02 +3.710467E+01 +6.883857E+00 +1.236140E+00 +7.640460E-03 +3.008517E+00 +4.525737E-02 +9.774718E+01 +4.777263E+01 +1.148515E+00 +6.595464E-03 +2.795291E+00 +3.906841E-02 +2.158096E+02 +2.328751E+02 +3.292123E-01 +5.419369E-04 +8.146128E-01 +3.318173E-03 +1.142483E+02 +6.527411E+01 +1.545376E+00 +1.194541E-02 +4.298386E+00 +9.241523E-02 +6.833010E+01 +2.334774E+01 +2.543913E+01 +3.236766E+00 +6.191375E+01 +1.917260E+01 +4.345497E+01 +9.442115E+00 +6.480429E+00 +2.100011E-01 +1.577207E+01 +1.243917E+00 +2.960280E+01 +4.381666E+00 +9.615896E-01 +4.623340E-03 +2.340316E+00 +2.738581E-02 +3.774398E+01 +7.123136E+00 +1.260577E+00 +7.945526E-03 +3.067991E+00 +4.706439E-02 +9.766957E+01 +4.769682E+01 1.150177E+00 -6.614567E-03 -2.799336E+00 -3.918157E-02 -2.116380E+02 -2.239600E+02 -3.238418E-01 -5.244043E-04 -8.013238E-01 -3.210825E-03 -1.124870E+02 -6.327601E+01 -1.529133E+00 -1.169657E-02 -4.253205E+00 -9.049007E-02 +6.614557E-03 +2.799334E+00 +3.918151E-02 +2.116379E+02 +2.239597E+02 +3.238415E-01 +5.244036E-04 +8.013232E-01 +3.210820E-03 +1.124869E+02 +6.327591E+01 +1.529132E+00 +1.169655E-02 +4.253202E+00 +9.048993E-02 tally 2: 3.727212E-01 6.946055E-04 @@ -182,7 +182,7 @@ tally 2: 1.459642E-04 2.305151E-02 2.656862E-06 -8.000705E-03 +8.000704E-03 3.200564E-07 1.273273E-03 8.106118E-09 @@ -223,7 +223,7 @@ tally 2: 8.037371E-01 3.229967E-03 3.090254E-01 -4.774834E-04 +4.774833E-04 2.191328E-01 2.400960E-04 1.706153E-01 @@ -233,4 +233,4 @@ tally 2: 7.989285E-03 3.191434E-07 1.271455E-03 -8.082995E-09 +8.082994E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat index 2625ac2a347..4e969c448a1 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.851755E+01 -2.347625E+01 -2.543244E+01 -3.235138E+00 -6.189746E+01 -1.916296E+01 -4.353807E+01 -9.478290E+00 -6.473201E+00 -2.095347E-01 -1.575448E+01 -1.241154E+00 -2.964329E+01 -4.393655E+00 -9.600630E-01 -4.608668E-03 -2.336601E+00 -2.729890E-02 -3.779660E+01 -7.143001E+00 -1.258574E+00 -7.920313E-03 -3.063118E+00 -4.691505E-02 -9.776873E+01 -4.779372E+01 -1.147984E+00 -6.589359E-03 -2.793996E+00 -3.903225E-02 -2.117587E+02 -2.242166E+02 -3.231403E-01 -5.221406E-04 -7.995881E-01 -3.196965E-03 -1.125788E+02 -6.338145E+01 -1.526548E+00 -1.165771E-02 -4.246015E+00 -9.018945E-02 -1.132350E+02 -6.411155E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361464E+01 -1.437278E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123071E+01 -4.876810E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117909E+01 -8.478672E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856285E+01 -4.857335E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895450E+02 -1.796425E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710717E+01 -4.716318E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911301E+01 -1.747298E+01 -2.186903E+01 -2.391846E+00 -5.322484E+01 -1.416782E+01 -4.091074E+01 -8.368698E+00 -6.081162E+00 -1.849173E-01 -1.480033E+01 -1.095336E+00 -2.921050E+01 -4.266292E+00 -9.468909E-01 -4.483065E-03 -2.304543E+00 -2.655491E-02 -3.714364E+01 -6.898322E+00 -1.237440E+00 -7.656535E-03 -3.011680E+00 -4.535258E-02 -9.785450E+01 -4.787760E+01 -1.149777E+00 -6.609958E-03 -2.798361E+00 -3.915427E-02 -2.160535E+02 -2.334017E+02 -3.295826E-01 -5.431567E-04 -8.155291E-01 -3.325642E-03 -1.143708E+02 -6.541413E+01 -1.547019E+00 -1.197082E-02 -4.302955E+00 -9.261180E-02 -6.838444E+01 -2.338489E+01 -2.545958E+01 -3.241970E+00 -6.196352E+01 -1.920343E+01 -4.349543E+01 -9.459705E+00 -6.486476E+00 -2.103931E-01 -1.578678E+01 -1.246239E+00 -2.963399E+01 -4.390905E+00 -9.626034E-01 -4.633094E-03 -2.342784E+00 -2.744358E-02 -3.778386E+01 -7.138194E+00 -1.261909E+00 -7.962333E-03 -3.071235E+00 -4.716395E-02 -9.777713E+01 -4.780194E+01 -1.151443E+00 -6.629136E-03 -2.802417E+00 -3.926787E-02 -2.118773E+02 -2.244667E+02 -3.242063E-01 -5.255855E-04 -8.022257E-01 -3.218057E-03 -1.126076E+02 -6.341177E+01 -1.530759E+00 -1.172147E-02 -4.257730E+00 -9.068268E-02 +6.851748E+01 +2.347622E+01 +2.543241E+01 +3.235134E+00 +6.189740E+01 +1.916293E+01 +4.353803E+01 +9.478272E+00 +6.473195E+00 +2.095344E-01 +1.575446E+01 +1.241152E+00 +2.964326E+01 +4.393647E+00 +9.600620E-01 +4.608659E-03 +2.336599E+00 +2.729884E-02 +3.779657E+01 +7.142988E+00 +1.258573E+00 +7.920298E-03 +3.063115E+00 +4.691496E-02 +9.776864E+01 +4.779362E+01 +1.147982E+00 +6.589347E-03 +2.793994E+00 +3.903217E-02 +2.117585E+02 +2.242162E+02 +3.231400E-01 +5.221396E-04 +7.995873E-01 +3.196958E-03 +1.125787E+02 +6.338132E+01 +1.526546E+00 +1.165769E-02 +4.246011E+00 +9.018927E-02 +1.132349E+02 +6.411143E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361459E+01 +1.437275E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123068E+01 +4.876800E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117905E+01 +8.478656E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856275E+01 +4.857326E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895448E+02 +1.796421E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710707E+01 +4.716308E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911296E+01 +1.747295E+01 +2.186901E+01 +2.391843E+00 +5.322479E+01 +1.416780E+01 +4.091071E+01 +8.368683E+00 +6.081156E+00 +1.849170E-01 +1.480032E+01 +1.095334E+00 +2.921048E+01 +4.266284E+00 +9.468900E-01 +4.483057E-03 +2.304541E+00 +2.655486E-02 +3.714360E+01 +6.898309E+00 +1.237438E+00 +7.656520E-03 +3.011677E+00 +4.535250E-02 +9.785441E+01 +4.787751E+01 +1.149776E+00 +6.609946E-03 +2.798358E+00 +3.915419E-02 +2.160533E+02 +2.334013E+02 +3.295823E-01 +5.431557E-04 +8.155283E-01 +3.325636E-03 +1.143707E+02 +6.541399E+01 +1.547017E+00 +1.197080E-02 +4.302951E+00 +9.261162E-02 +6.838436E+01 +2.338484E+01 +2.545955E+01 +3.241965E+00 +6.196345E+01 +1.920339E+01 +4.349538E+01 +9.459686E+00 +6.486469E+00 +2.103927E-01 +1.578677E+01 +1.246237E+00 +2.963397E+01 +4.390897E+00 +9.626024E-01 +4.633085E-03 +2.342782E+00 +2.744353E-02 +3.778382E+01 +7.138180E+00 +1.261908E+00 +7.962318E-03 +3.071232E+00 +4.716385E-02 +9.777704E+01 +4.780184E+01 +1.151442E+00 +6.629123E-03 +2.802415E+00 +3.926779E-02 +2.118771E+02 +2.244662E+02 +3.242060E-01 +5.255844E-04 +8.022250E-01 +3.218050E-03 +1.126075E+02 +6.341165E+01 +1.530758E+00 +1.172144E-02 +4.257726E+00 +9.068250E-02 tally 2: 3.727213E-01 6.946060E-04 @@ -183,9 +183,9 @@ tally 2: 2.305197E-02 2.656966E-06 8.001084E-03 -3.200868E-07 +3.200867E-07 1.273400E-03 -8.107736E-09 +8.107735E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -214,10 +214,10 @@ tally 2: 1.163478E-04 2.058070E-02 2.117825E-06 -7.143331E-03 +7.143330E-03 2.551359E-07 1.136885E-03 -6.462535E-09 +6.462534E-09 3.721894E-01 6.926247E-04 8.037378E-01 @@ -231,6 +231,6 @@ tally 2: 2.301907E-02 2.649387E-06 7.989664E-03 -3.191737E-07 +3.191736E-07 1.271582E-03 -8.084607E-09 +8.084606E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat index 5d21c6febfc..12b4941ec4b 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.857321E+01 -2.351441E+01 -2.545331E+01 -3.240452E+00 -6.194827E+01 -1.919443E+01 -4.357935E+01 -9.496270E+00 -6.479351E+00 -2.099331E-01 -1.576944E+01 -1.243514E+00 -2.967503E+01 -4.403069E+00 -9.610914E-01 -4.618547E-03 -2.339104E+00 -2.735741E-02 -3.783717E+01 -7.158344E+00 -1.259926E+00 -7.937337E-03 -3.066408E+00 -4.701588E-02 -9.787805E+01 -4.790066E+01 -1.149267E+00 -6.604105E-03 -2.797121E+00 -3.911960E-02 -2.120018E+02 -2.247317E+02 -3.235096E-01 -5.233348E-04 -8.005019E-01 -3.204276E-03 -1.127015E+02 -6.351966E+01 -1.528198E+00 -1.168293E-02 -4.250605E+00 -9.038454E-02 -1.133348E+02 -6.422471E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366670E+01 -1.440070E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126455E+01 -4.887386E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122424E+01 -8.497275E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867395E+01 -4.868292E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897633E+02 -1.800565E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721388E+01 -4.726689E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.915992E+01 -1.750072E+01 -2.188657E+01 -2.395685E+00 -5.326754E+01 -1.419056E+01 -4.094949E+01 -8.384559E+00 -6.086937E+00 -1.852687E-01 -1.481439E+01 -1.097417E+00 -2.924168E+01 -4.275405E+00 -9.479024E-01 -4.492648E-03 -2.307005E+00 -2.661167E-02 -3.718326E+01 -6.913048E+00 -1.238761E+00 -7.672900E-03 -3.014897E+00 -4.544952E-02 -9.796358E+01 -4.798440E+01 -1.151059E+00 -6.624706E-03 -2.801481E+00 -3.924163E-02 -2.163013E+02 -2.339374E+02 -3.299589E-01 -5.443975E-04 -8.164601E-01 -3.333239E-03 -1.144953E+02 -6.555663E+01 -1.548689E+00 -1.199669E-02 -4.307601E+00 -9.281190E-02 -6.843995E+01 -2.342287E+01 -2.548046E+01 -3.247292E+00 -6.201435E+01 -1.923495E+01 -4.353665E+01 -9.477643E+00 -6.492636E+00 -2.107930E-01 -1.580178E+01 -1.248607E+00 -2.966572E+01 -4.400311E+00 -9.636344E-01 -4.643024E-03 -2.345293E+00 -2.750240E-02 -3.782441E+01 -7.153523E+00 -1.263264E+00 -7.979443E-03 -3.074533E+00 -4.726529E-02 -9.788645E+01 -4.790889E+01 -1.152731E+00 -6.643969E-03 -2.805551E+00 -3.935573E-02 -2.121205E+02 -2.249823E+02 -3.245768E-01 -5.267876E-04 -8.031427E-01 -3.225417E-03 -1.127304E+02 -6.355006E+01 -1.532415E+00 -1.174683E-02 -4.262334E+00 -9.087889E-02 +6.857313E+01 +2.351436E+01 +2.545329E+01 +3.240447E+00 +6.194820E+01 +1.919440E+01 +4.357930E+01 +9.496248E+00 +6.479343E+00 +2.099326E-01 +1.576943E+01 +1.243511E+00 +2.967500E+01 +4.403058E+00 +9.610902E-01 +4.618536E-03 +2.339101E+00 +2.735735E-02 +3.783713E+01 +7.158327E+00 +1.259925E+00 +7.937318E-03 +3.066405E+00 +4.701577E-02 +9.787794E+01 +4.790055E+01 +1.149266E+00 +6.604089E-03 +2.797118E+00 +3.911950E-02 +2.120015E+02 +2.247312E+02 +3.235092E-01 +5.233335E-04 +8.005009E-01 +3.204269E-03 +1.127013E+02 +6.351950E+01 +1.528196E+00 +1.168290E-02 +4.250600E+00 +9.038432E-02 +1.133347E+02 +6.422456E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366663E+01 +1.440067E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126452E+01 +4.887375E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122419E+01 +8.497255E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867383E+01 +4.868280E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897631E+02 +1.800561E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721376E+01 +4.726677E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915985E+01 +1.750068E+01 +2.188655E+01 +2.395681E+00 +5.326748E+01 +1.419053E+01 +4.094945E+01 +8.384540E+00 +6.086929E+00 +1.852683E-01 +1.481437E+01 +1.097415E+00 +2.924165E+01 +4.275395E+00 +9.479013E-01 +4.492638E-03 +2.307002E+00 +2.661161E-02 +3.718322E+01 +6.913032E+00 +1.238760E+00 +7.672882E-03 +3.014894E+00 +4.544942E-02 +9.796347E+01 +4.798428E+01 +1.151057E+00 +6.624691E-03 +2.801478E+00 +3.924154E-02 +2.163011E+02 +2.339368E+02 +3.299585E-01 +5.443962E-04 +8.164591E-01 +3.333231E-03 +1.144952E+02 +6.555646E+01 +1.548688E+00 +1.199666E-02 +4.307596E+00 +9.281167E-02 +6.843986E+01 +2.342281E+01 +2.548043E+01 +3.247284E+00 +6.201426E+01 +1.923491E+01 +4.353660E+01 +9.477620E+00 +6.492628E+00 +2.107925E-01 +1.580176E+01 +1.248604E+00 +2.966568E+01 +4.400301E+00 +9.636332E-01 +4.643013E-03 +2.345290E+00 +2.750234E-02 +3.782436E+01 +7.153506E+00 +1.263263E+00 +7.979424E-03 +3.074529E+00 +4.726518E-02 +9.788634E+01 +4.790877E+01 +1.152730E+00 +6.643953E-03 +2.805547E+00 +3.935564E-02 +2.121203E+02 +2.249818E+02 +3.245765E-01 +5.267864E-04 +8.031417E-01 +3.225410E-03 +1.127302E+02 +6.354990E+01 +1.532413E+00 +1.174680E-02 +4.262329E+00 +9.087866E-02 tally 2: 3.727215E-01 6.946067E-04 @@ -182,10 +182,10 @@ tally 2: 1.459700E-04 2.305255E-02 2.657101E-06 -8.001573E-03 -3.201259E-07 +8.001572E-03 +3.201258E-07 1.273562E-03 -8.109801E-09 +8.109799E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -216,8 +216,8 @@ tally 2: 2.117932E-06 7.143764E-03 2.551668E-07 -1.137029E-03 -6.464170E-09 +1.137028E-03 +6.464168E-09 3.721896E-01 6.926253E-04 8.037386E-01 @@ -230,7 +230,7 @@ tally 2: 1.455537E-04 2.301965E-02 2.649522E-06 -7.990152E-03 +7.990151E-03 3.192126E-07 1.271744E-03 -8.086665E-09 +8.086663E-09 From 93792a96df4dc7fcdc97b3a0216edd64e5d61189 Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 6 Jan 2026 09:18:18 -0600 Subject: [PATCH 41/64] minor fix for time_step_reset --- src/random_ray/source_region.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/random_ray/source_region.cpp b/src/random_ray/source_region.cpp index 503d8ab2b31..99143eab87e 100644 --- a/src/random_ray/source_region.cpp +++ b/src/random_ray/source_region.cpp @@ -416,6 +416,8 @@ void SourceRegionContainer::time_step_reset() { std::fill(scalar_flux_final_.begin(), scalar_flux_final_.end(), 0.0); std::fill(precursors_final_.begin(), precursors_final_.end(), 0.0); + if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) + std::fill(source_final_.begin(), source_final_.end(), 0.0); } } // namespace openmc From 4bad23b10d5bdd858292e5730c2504b806aca592 Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 6 Jan 2026 12:18:20 -0600 Subject: [PATCH 42/64] add full kinetic test coverage --- .../{ => isotropic}/inputs_true.dat | 1 + .../{ => isotropic}/results_true_0.dat | 0 .../{ => isotropic}/results_true_1.dat | 0 .../{ => isotropic}/results_true_2.dat | 0 .../{ => isotropic}/results_true_3.dat | 0 .../{ => isotropic}/results_true_4.dat | 0 .../{ => isotropic}/results_true_5.dat | 0 .../propagation/inputs_true.dat | 70 ++++++ .../propagation/results_true_0.dat | 2 + .../propagation/results_true_1.dat | 2 + .../propagation/results_true_2.dat | 2 + .../propagation/results_true_3.dat | 2 + .../propagation/results_true_4.dat | 2 + .../propagation/results_true_5.dat | 2 + .../{ => isotropic}/inputs_true.dat | 1 + .../{ => isotropic}/results_true_0.dat | 0 .../{ => isotropic}/results_true_1.dat | 0 .../{ => isotropic}/results_true_2.dat | 0 .../{ => isotropic}/results_true_3.dat | 0 .../{ => isotropic}/results_true_4.dat | 0 .../{ => isotropic}/results_true_5.dat | 0 .../material_wise/propagation/inputs_true.dat | 70 ++++++ .../propagation/results_true_0.dat | 2 + .../propagation/results_true_1.dat | 2 + .../propagation/results_true_2.dat | 2 + .../propagation/results_true_3.dat | 2 + .../propagation/results_true_4.dat | 2 + .../propagation/results_true_5.dat | 2 + .../{ => isotropic}/inputs_true.dat | 1 + .../{ => isotropic}/results_true_0.dat | 0 .../{ => isotropic}/results_true_1.dat | 0 .../{ => isotropic}/results_true_2.dat | 0 .../{ => isotropic}/results_true_3.dat | 0 .../{ => isotropic}/results_true_4.dat | 0 .../{ => isotropic}/results_true_5.dat | 0 .../propagation/inputs_true.dat | 70 ++++++ .../propagation/results_true_0.dat | 2 + .../propagation/results_true_1.dat | 2 + .../propagation/results_true_2.dat | 2 + .../propagation/results_true_3.dat | 2 + .../propagation/results_true_4.dat | 2 + .../propagation/results_true_5.dat | 2 + .../random_ray_auto_convert_kinetic/test.py | 15 +- .../{ => isotropic}/inputs_true.dat | 1 + .../{ => isotropic}/results_true_0.dat | 0 .../{ => isotropic}/results_true_1.dat | 0 .../{ => isotropic}/results_true_2.dat | 0 .../{ => isotropic}/results_true_3.dat | 0 .../{ => isotropic}/results_true_4.dat | 0 .../{ => isotropic}/results_true_5.dat | 0 .../propagation/inputs_true.dat | 71 ++++++ .../propagation/results_true_0.dat | 2 + .../propagation/results_true_1.dat | 2 + .../propagation/results_true_2.dat | 2 + .../propagation/results_true_3.dat | 2 + .../propagation/results_true_4.dat | 2 + .../propagation/results_true_5.dat | 2 + .../test.py | 86 ++++--- .../{ => isotropic}/inputs_true.dat | 1 + .../{ => isotropic}/results_true_0.dat | 0 .../{ => isotropic}/results_true_1.dat | 226 ++++++++--------- .../isotropic/results_true_2.dat | 236 ++++++++++++++++++ .../isotropic/results_true_3.dat | 236 ++++++++++++++++++ .../isotropic/results_true_4.dat | 236 ++++++++++++++++++ .../isotropic/results_true_5.dat | 236 ++++++++++++++++++ .../propagation/inputs_true.dat | 138 ++++++++++ .../propagation/results_true_0.dat | 236 ++++++++++++++++++ .../propagation/results_true_1.dat | 236 ++++++++++++++++++ .../propagation/results_true_2.dat | 236 ++++++++++++++++++ .../propagation/results_true_3.dat | 236 ++++++++++++++++++ .../propagation/results_true_4.dat | 236 ++++++++++++++++++ .../propagation/results_true_5.dat | 236 ++++++++++++++++++ .../results_true_2.dat | 236 ------------------ .../results_true_3.dat | 236 ------------------ .../results_true_4.dat | 236 ------------------ .../results_true_5.dat | 236 ------------------ .../random_ray_k_eff_mesh_kinetic/test.py | 47 ++-- 77 files changed, 3029 insertions(+), 1121 deletions(-) rename tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/{ => isotropic}/inputs_true.dat (98%) rename tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/{ => isotropic}/results_true_0.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/{ => isotropic}/results_true_1.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/{ => isotropic}/results_true_2.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/{ => isotropic}/results_true_3.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/{ => isotropic}/results_true_4.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/{ => isotropic}/results_true_5.dat (100%) create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_5.dat rename tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/{ => isotropic}/inputs_true.dat (98%) rename tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/{ => isotropic}/results_true_0.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/{ => isotropic}/results_true_1.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/{ => isotropic}/results_true_2.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/{ => isotropic}/results_true_3.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/{ => isotropic}/results_true_4.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/{ => isotropic}/results_true_5.dat (100%) create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_5.dat rename tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/{ => isotropic}/inputs_true.dat (98%) rename tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/{ => isotropic}/results_true_0.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/{ => isotropic}/results_true_1.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/{ => isotropic}/results_true_2.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/{ => isotropic}/results_true_3.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/{ => isotropic}/results_true_4.dat (100%) rename tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/{ => isotropic}/results_true_5.dat (100%) create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_5.dat rename tests/regression_tests/random_ray_diagonal_stabilization_kinetic/{ => isotropic}/inputs_true.dat (98%) rename tests/regression_tests/random_ray_diagonal_stabilization_kinetic/{ => isotropic}/results_true_0.dat (100%) rename tests/regression_tests/random_ray_diagonal_stabilization_kinetic/{ => isotropic}/results_true_1.dat (100%) rename tests/regression_tests/random_ray_diagonal_stabilization_kinetic/{ => isotropic}/results_true_2.dat (100%) rename tests/regression_tests/random_ray_diagonal_stabilization_kinetic/{ => isotropic}/results_true_3.dat (100%) rename tests/regression_tests/random_ray_diagonal_stabilization_kinetic/{ => isotropic}/results_true_4.dat (100%) rename tests/regression_tests/random_ray_diagonal_stabilization_kinetic/{ => isotropic}/results_true_5.dat (100%) create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_5.dat rename tests/regression_tests/random_ray_k_eff_mesh_kinetic/{ => isotropic}/inputs_true.dat (99%) rename tests/regression_tests/random_ray_k_eff_mesh_kinetic/{ => isotropic}/results_true_0.dat (100%) rename tests/regression_tests/random_ray_k_eff_mesh_kinetic/{ => isotropic}/results_true_1.dat (52%) create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/inputs_true.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_0.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat delete mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat delete mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat delete mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat delete mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/inputs_true.dat similarity index 98% rename from tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/inputs_true.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/inputs_true.dat index 4e68307d0a7..e048a7d4dc1 100644 --- a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/inputs_true.dat +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/inputs_true.dat @@ -59,6 +59,7 @@
+ isotropic
8 8 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_0.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_0.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_0.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_0.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_1.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_1.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_1.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_1.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_2.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_2.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_2.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_2.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_3.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_3.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_3.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_3.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_4.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_4.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_4.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_4.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_5.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_5.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/results_true_5.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/isotropic/results_true_5.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/inputs_true.dat new file mode 100644 index 00000000000..092e3952f5e --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/inputs_true.dat @@ -0,0 +1,70 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + true + +
0.01
+ s + 5 +
+ + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + propagation + + + 8 8 + -0.63 -0.63 + 0.63 0.63 + +
+
diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_0.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_0.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_0.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_1.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_1.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_1.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_2.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_2.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_2.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_3.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_3.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_3.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_4.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_4.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_4.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_5.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_5.dat new file mode 100644 index 00000000000..3c8808a0c82 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/infinite_medium/propagation/results_true_5.dat @@ -0,0 +1,2 @@ +k-combined: +5.824689E-01 1.309494E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/inputs_true.dat similarity index 98% rename from tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/inputs_true.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/inputs_true.dat index 4e68307d0a7..e048a7d4dc1 100644 --- a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/inputs_true.dat +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/inputs_true.dat @@ -59,6 +59,7 @@
+ isotropic 8 8 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_0.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_0.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_0.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_0.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_1.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_1.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_1.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_1.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_2.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_2.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_2.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_2.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_3.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_3.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_3.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_3.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_4.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_4.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_4.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_4.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_5.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_5.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/results_true_5.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/isotropic/results_true_5.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/inputs_true.dat new file mode 100644 index 00000000000..092e3952f5e --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/inputs_true.dat @@ -0,0 +1,70 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + true + +
0.01
+ s + 5 +
+ + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + propagation + + + 8 8 + -0.63 -0.63 + 0.63 0.63 + +
+
diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_0.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_0.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_0.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_1.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_1.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_1.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_2.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_2.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_2.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_3.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_3.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_3.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_4.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_4.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_4.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_5.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_5.dat new file mode 100644 index 00000000000..df7374c145b --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/material_wise/propagation/results_true_5.dat @@ -0,0 +1,2 @@ +k-combined: +7.247257E-01 3.323600E-03 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/inputs_true.dat similarity index 98% rename from tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/inputs_true.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/inputs_true.dat index 4e68307d0a7..e048a7d4dc1 100644 --- a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/inputs_true.dat +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/inputs_true.dat @@ -59,6 +59,7 @@
+ isotropic 8 8 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_0.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_0.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_0.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_0.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_1.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_1.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_1.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_1.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_2.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_2.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_2.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_2.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_3.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_3.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_3.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_3.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_4.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_4.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_4.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_4.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_5.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_5.dat similarity index 100% rename from tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/results_true_5.dat rename to tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/isotropic/results_true_5.dat diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/inputs_true.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/inputs_true.dat new file mode 100644 index 00000000000..092e3952f5e --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/inputs_true.dat @@ -0,0 +1,70 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + true + +
0.01
+ s + 5 +
+ + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + propagation + + + 8 8 + -0.63 -0.63 + 0.63 0.63 + +
+
diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_0.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_0.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_0.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_1.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_1.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_1.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_2.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_2.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_2.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_3.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_3.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_3.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_4.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_4.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_4.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_5.dat b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_5.dat new file mode 100644 index 00000000000..718ed9f63b2 --- /dev/null +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/stochastic_slab/propagation/results_true_5.dat @@ -0,0 +1,2 @@ +k-combined: +4.474813E-01 1.434056E-02 diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py index dc0a60b51fb..215fe8e6915 100644 --- a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py @@ -18,9 +18,15 @@ def _cleanup(self): os.remove(f) -@pytest.mark.parametrize("method", ["material_wise", "stochastic_slab", "infinite_medium"]) -def test_random_ray_auto_convert(method): - with change_directory(method): +@pytest.mark.parametrize("generation_method, time_method", [("material_wise","isotropic"), + ("stochastic_slab","isotropic"), + ("infinite_medium","isotropic"), + ("material_wise","propagation"), + ("stochastic_slab","propagation"), + ("infinite_medium","propagation"), + ]) +def test_random_ray_auto_convert(generation_method, time_method): + with change_directory(f'{generation_method}/{time_method}'): openmc.reset_auto_ids() # Start with a normal continuous energy model @@ -28,7 +34,7 @@ def test_random_ray_auto_convert(method): # Convert to a multi-group model model.convert_to_multigroup( - method=method, energy_groups='CASMO-2', nparticles=30, + method=generation_method, energy_groups='CASMO-2', nparticles=30, overwrite_mgxs_library=False, mgxs_path="mgxs.h5", kinetic=True, num_delayed_groups=6 ) @@ -52,6 +58,7 @@ def test_random_ray_auto_convert(method): mesh.upper_right = (bbox.upper_right[0], bbox.upper_right[1]) model.settings.random_ray['source_region_meshes'] = [ (mesh, [model.geometry.root_universe])] + model.settings.random_ray['time_derivative_method'] = time_method harness = KineticMGXSTestHarness("statepoint.10", 6, model) harness.main() diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/inputs_true.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/inputs_true.dat similarity index 98% rename from tests/regression_tests/random_ray_diagonal_stabilization_kinetic/inputs_true.dat rename to tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/inputs_true.dat index 69627bcfb0e..3a4b82d3d00 100644 --- a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/inputs_true.dat +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/inputs_true.dat @@ -59,6 +59,7 @@
+ isotropic 0.5 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_0.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_0.dat similarity index 100% rename from tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_0.dat rename to tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_0.dat diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_1.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_1.dat similarity index 100% rename from tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_1.dat rename to tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_1.dat diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_2.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_2.dat similarity index 100% rename from tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_2.dat rename to tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_2.dat diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_3.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_3.dat similarity index 100% rename from tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_3.dat rename to tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_3.dat diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_4.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_4.dat similarity index 100% rename from tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_4.dat rename to tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_4.dat diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_5.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_5.dat similarity index 100% rename from tests/regression_tests/random_ray_diagonal_stabilization_kinetic/results_true_5.dat rename to tests/regression_tests/random_ray_diagonal_stabilization_kinetic/isotropic/results_true_5.dat diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/inputs_true.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/inputs_true.dat new file mode 100644 index 00000000000..e85b97b2685 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/inputs_true.dat @@ -0,0 +1,71 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 20 + 15 + true + +
0.01
+ s + 5 +
+ + + -0.63 -0.63 -1 0.63 0.63 1 + + + true + + + multi-group + + + + -0.63 -0.63 -1.0 0.63 0.63 1.0 + + + 30.0 + 150.0 + + + + + + propagation + 0.5 + + + 8 8 + -0.63 -0.63 + 0.63 0.63 + +
+
diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_0.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_0.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_0.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_1.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_1.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_2.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_2.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_3.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_3.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_4.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_4.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_5.dat new file mode 100644 index 00000000000..ccadbb12596 --- /dev/null +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/propagation/results_true_5.dat @@ -0,0 +1,2 @@ +k-combined: +1.072871E+00 6.955844E-03 diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py index 50d4419d479..1acc1b0196f 100644 --- a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py @@ -1,8 +1,11 @@ import os +import openmc from openmc.examples import pwr_pin_cell from openmc import RegularMesh +from openmc.utility_funcs import change_directory import numpy as np +import pytest from tests.testing_harness import KineticTolerantPyAPITestHarness @@ -14,51 +17,56 @@ def _cleanup(self): if os.path.exists(f): os.remove(f) +@pytest.mark.parametrize("time_method", ["isotropic", + "propagation"]) +def test_random_ray_diagonal_stabilization(time_method): + with change_directory(time_method): + openmc.reset_auto_ids() -def test_random_ray_diagonal_stabilization(): - # Start with a normal continuous energy model - model = pwr_pin_cell() + # Start with a normal continuous energy model + model = pwr_pin_cell() - # Convert to a multi-group model, with 70 group XS - # and transport correction enabled. This will generate - # MGXS data with some negatives on the diagonal, in order - # to trigger diagonal correction. - model.convert_to_multigroup( - method='material_wise', energy_groups='CASMO-70', nparticles=30, - overwrite_mgxs_library=True, mgxs_path="mgxs.h5", correction='P0', - kinetic=True, num_delayed_groups=6 - ) + # Convert to a multi-group model, with 70 group XS + # and transport correction enabled. This will generate + # MGXS data with some negatives on the diagonal, in order + # to trigger diagonal correction. + model.convert_to_multigroup( + method='material_wise', energy_groups='CASMO-70', nparticles=30, + overwrite_mgxs_library=True, mgxs_path="mgxs.h5", correction='P0', + kinetic=True, num_delayed_groups=6 + ) - model.settings.timestep_parameters['n_timesteps'] = 5 - density_timeseries = np.linspace(1, 0.95, 100) - model.materials[2].set_density('macro', density=1.0, density_timeseries=density_timeseries) + model.settings.timestep_parameters['n_timesteps'] = 5 + density_timeseries = np.linspace(1, 0.95, 100) + model.materials[2].set_density('macro', density=1.0, density_timeseries=density_timeseries) - # Convert to a random ray model - model.convert_to_random_ray() + # Convert to a random ray model + model.convert_to_random_ray() - # Set the number of particles - model.settings.particles = 100 + # Set the number of particles + model.settings.particles = 100 - # Overlay an 8x8 mesh - n = 8 - mesh = RegularMesh() - mesh.dimension = (n, n) - bbox = model.geometry.bounding_box - mesh.lower_left = (bbox.lower_left[0], bbox.lower_left[1]) - mesh.upper_right = (bbox.upper_right[0], bbox.upper_right[1]) - model.settings.random_ray['source_region_meshes'] = [ - (mesh, [model.geometry.root_universe])] + # Overlay an 8x8 mesh + n = 8 + mesh = RegularMesh() + mesh.dimension = (n, n) + bbox = model.geometry.bounding_box + mesh.lower_left = (bbox.lower_left[0], bbox.lower_left[1]) + mesh.upper_right = (bbox.upper_right[0], bbox.upper_right[1]) + model.settings.random_ray['source_region_meshes'] = [ + (mesh, [model.geometry.root_universe])] + model.settings.random_ray['time_derivative_method'] = time_method - # Explicitly set the diagonal stabilization rho (default is otherwise 1.0). - # Note that if we set this to 0.0 (thus distabling stabilization), the - # problem should fail due to instability, so this is actually a good test - # problem. - model.settings.random_ray['diagonal_stabilization_rho'] = 0.5 + # Explicitly set the diagonal stabilization rho (default is otherwise 1.0). + # Note that if we set this to 0.0 (thus distabling stabilization), the + # problem should fail due to instability, so this is actually a good test + # problem. + model.settings.random_ray['diagonal_stabilization_rho'] = 0.5 - # If rho was 0.0, the instability would cause failure after iteration 14, - # so we go a little past that. - model.settings.inactive = 15 - model.settings.batches = 20 + # If rho was 0.0, the instability would cause failure after iteration 14, + # so we go a little past that. + model.settings.inactive = 15 + model.settings.batches = 20 - harness = KineticMGXSTestHarness('statepoint.20', 6, model) - harness.main() + harness = KineticMGXSTestHarness('statepoint.20', 6, model) + harness.main() diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/inputs_true.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/inputs_true.dat similarity index 99% rename from tests/regression_tests/random_ray_k_eff_mesh_kinetic/inputs_true.dat rename to tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/inputs_true.dat index 2b3fe3bc8c0..1790a1edbeb 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/inputs_true.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/inputs_true.dat @@ -97,6 +97,7 @@ true 3 + isotropic diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_0.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_0.dat similarity index 100% rename from tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_0.dat rename to tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_0.dat diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat similarity index 52% rename from tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat rename to tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat index 53b4b39f8df..3b5aea51fd9 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835752E+01 +6.835753E+01 2.336672E+01 -2.537238E+01 -3.219879E+00 -6.175130E+01 +2.537239E+01 +3.219878E+00 +6.175132E+01 1.907257E+01 -4.341875E+01 -9.426410E+00 -6.455423E+00 +4.341877E+01 +9.426414E+00 +6.455425E+00 2.083854E-01 1.571121E+01 -1.234346E+00 +1.234347E+00 2.955121E+01 -4.366400E+00 -9.570789E-01 -4.580063E-03 -2.329338E+00 -2.712946E-02 -3.767887E+01 -7.098573E+00 +4.366402E+00 +9.570792E-01 +4.580066E-03 +2.329339E+00 +2.712948E-02 +3.767888E+01 +7.098576E+00 1.254652E+00 -7.871018E-03 -3.053571E+00 -4.662305E-02 -9.745113E+01 -4.748370E+01 +7.871022E-03 +3.053572E+00 +4.662307E-02 +9.745115E+01 +4.748373E+01 1.144254E+00 -6.546615E-03 -2.784919E+00 -3.877905E-02 -2.110519E+02 -2.227224E+02 +6.546618E-03 +2.784920E+00 +3.877907E-02 +2.110520E+02 +2.227225E+02 3.220667E-01 -5.186767E-04 -7.969314E-01 -3.175756E-03 +5.186770E-04 +7.969316E-01 +3.175758E-03 1.122226E+02 -6.298103E+01 -1.521757E+00 -1.158467E-02 -4.232690E+00 -8.962434E-02 -1.129469E+02 -6.378582E+01 +6.298107E+01 +1.521758E+00 +1.158468E-02 +4.232692E+00 +8.962439E-02 +1.129470E+02 +6.378585E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.346406E+01 +5.346407E+01 1.429216E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.113246E+01 -4.846176E+00 +3.113247E+01 +4.846178E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.104800E+01 -8.424776E+00 +4.104801E+01 +8.424780E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.824002E+01 -4.825568E+01 +9.824005E+01 +4.825571E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.889102E+02 -1.784412E+02 +1.889103E+02 +1.784413E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.679727E+01 -4.686264E+01 +9.679730E+01 +4.686267E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.897826E+01 +5.897828E+01 1.739342E+01 -2.181861E+01 +2.181862E+01 2.380831E+00 -5.310214E+01 +5.310215E+01 1.410257E+01 -4.079873E+01 -8.322934E+00 -6.064468E+00 +4.079874E+01 +8.322938E+00 +6.064469E+00 1.839035E-01 -1.475970E+01 +1.475971E+01 1.089331E+00 -2.912005E+01 -4.239911E+00 -9.439562E-01 -4.455320E-03 +2.912006E+01 +4.239913E+00 +9.439565E-01 +4.455323E-03 2.297401E+00 -2.639056E-02 -3.702868E+01 -6.855687E+00 +2.639057E-02 +3.702869E+01 +6.855691E+00 1.233605E+00 -7.609153E-03 -3.002347E+00 -4.507192E-02 -9.753763E+01 -4.756803E+01 +7.609156E-03 +3.002348E+00 +4.507194E-02 +9.753766E+01 +4.756805E+01 1.146053E+00 -6.567210E-03 -2.789297E+00 -3.890105E-02 -2.153331E+02 -2.318478E+02 -3.284889E-01 -5.395577E-04 -8.128227E-01 -3.303606E-03 +6.567213E-03 +2.789298E+00 +3.890107E-02 +2.153332E+02 +2.318479E+02 +3.284890E-01 +5.395580E-04 +8.128230E-01 +3.303608E-03 1.140093E+02 -6.500127E+01 -1.542170E+00 +6.500131E+01 +1.542171E+00 1.189591E-02 -4.289468E+00 -9.203222E-02 -6.822483E+01 -2.327586E+01 -2.539950E+01 -3.226689E+00 -6.181730E+01 -1.911291E+01 -4.337627E+01 -9.407943E+00 -6.468666E+00 -2.092394E-01 +4.289470E+00 +9.203227E-02 +6.822486E+01 +2.327587E+01 +2.539951E+01 +3.226691E+00 +6.181733E+01 +1.911292E+01 +4.337628E+01 +9.407949E+00 +6.468668E+00 +2.092395E-01 1.574344E+01 -1.239405E+00 -2.954195E+01 -4.363671E+00 -9.596119E-01 -4.604342E-03 -2.335503E+00 -2.727327E-02 -3.766620E+01 -7.093806E+00 +1.239406E+00 +2.954196E+01 +4.363673E+00 +9.596121E-01 +4.604345E-03 +2.335504E+00 +2.727329E-02 +3.766621E+01 +7.093810E+00 1.257977E+00 -7.912788E-03 -3.061664E+00 -4.687047E-02 -9.745954E+01 -4.749190E+01 +7.912792E-03 +3.061665E+00 +4.687049E-02 +9.745956E+01 +4.749193E+01 1.147703E+00 -6.586138E-03 -2.793314E+00 -3.901316E-02 +6.586141E-03 +2.793315E+00 +3.901318E-02 2.111701E+02 -2.229707E+02 +2.229708E+02 3.231290E-01 -5.220983E-04 -7.995600E-01 -3.196706E-03 -1.122513E+02 -6.301114E+01 +5.220986E-04 +7.995602E-01 +3.196707E-03 +1.122514E+02 +6.301118E+01 1.525955E+00 1.164801E-02 -4.244366E+00 -9.011434E-02 +4.244367E+00 +9.011440E-02 tally 2: 3.727210E-01 6.946049E-04 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat new file mode 100644 index 00000000000..db723684684 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.841005E+01 +2.340265E+01 +2.539210E+01 +3.224885E+00 +6.179930E+01 +1.910222E+01 +4.345797E+01 +9.443447E+00 +6.461267E+00 +2.087628E-01 +1.572543E+01 +1.236582E+00 +2.958150E+01 +4.375358E+00 +9.580607E-01 +4.589465E-03 +2.331728E+00 +2.718515E-02 +3.771761E+01 +7.113176E+00 +1.255942E+00 +7.887221E-03 +3.056712E+00 +4.671902E-02 +9.755568E+01 +4.758565E+01 +1.145482E+00 +6.560671E-03 +2.787908E+00 +3.886231E-02 +2.112847E+02 +2.232140E+02 +3.224203E-01 +5.198164E-04 +7.978065E-01 +3.182734E-03 +1.123399E+02 +6.311276E+01 +1.523335E+00 +1.160870E-02 +4.237078E+00 +8.981024E-02 +1.130416E+02 +6.389274E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.351357E+01 +1.431864E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116479E+01 +4.856246E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.109114E+01 +8.442495E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.834631E+01 +4.836016E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891193E+02 +1.788365E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.689934E+01 +4.696152E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.902249E+01 +1.741951E+01 +2.183516E+01 +2.384444E+00 +5.314242E+01 +1.412397E+01 +4.083555E+01 +8.337963E+00 +6.069956E+00 +1.842364E-01 +1.477306E+01 +1.091303E+00 +2.914981E+01 +4.248581E+00 +9.449218E-01 +4.464439E-03 +2.299750E+00 +2.644457E-02 +3.706650E+01 +6.869699E+00 +1.234866E+00 +7.624725E-03 +3.005418E+00 +4.516416E-02 +9.764194E+01 +4.766982E+01 +1.147279E+00 +6.581267E-03 +2.792281E+00 +3.898431E-02 +2.155704E+02 +2.323591E+02 +3.288491E-01 +5.407419E-04 +8.137142E-01 +3.310856E-03 +1.141284E+02 +6.513710E+01 +1.543767E+00 +1.192055E-02 +4.293910E+00 +9.222288E-02 +6.827724E+01 +2.331163E+01 +2.541923E+01 +3.231703E+00 +6.186532E+01 +1.914261E+01 +4.341544E+01 +9.424942E+00 +6.474521E+00 +2.096183E-01 +1.575769E+01 +1.241649E+00 +2.957223E+01 +4.372622E+00 +9.605961E-01 +4.613792E-03 +2.337899E+00 +2.732925E-02 +3.770491E+01 +7.108396E+00 +1.259271E+00 +7.929072E-03 +3.064813E+00 +4.696693E-02 +9.756409E+01 +4.759386E+01 +1.148934E+00 +6.600277E-03 +2.796311E+00 +3.909692E-02 +2.114030E+02 +2.234629E+02 +3.234838E-01 +5.232457E-04 +8.004381E-01 +3.203731E-03 +1.123687E+02 +6.314294E+01 +1.527537E+00 +1.167217E-02 +4.248767E+00 +9.030131E-02 +tally 2: +3.727211E-01 +6.946052E-04 +8.048854E-01 +3.239203E-03 +3.094668E-01 +4.788484E-04 +2.194454E-01 +2.407815E-04 +1.708581E-01 +1.459624E-04 +2.305119E-02 +2.656788E-06 +8.000435E-03 +3.200348E-07 +1.273182E-03 +8.104960E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327638E-01 +5.536589E-04 +7.185983E-01 +2.581918E-03 +2.762906E-01 +3.816826E-04 +1.959200E-01 +1.919231E-04 +1.525414E-01 +1.163444E-04 +2.058001E-02 +2.117684E-06 +7.142754E-03 +2.550947E-07 +1.136691E-03 +6.460335E-09 +3.721891E-01 +6.926238E-04 +8.037366E-01 +3.229963E-03 +3.090251E-01 +4.774825E-04 +2.191322E-01 +2.400946E-04 +1.706142E-01 +1.455461E-04 +2.301829E-02 +2.649209E-06 +7.989016E-03 +3.191219E-07 +1.271365E-03 +8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat new file mode 100644 index 00000000000..bac8902424a --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.846312E+01 +2.343897E+01 +2.541202E+01 +3.229945E+00 +6.184776E+01 +1.913220E+01 +4.349759E+01 +9.460674E+00 +6.467170E+00 +2.091445E-01 +1.573980E+01 +1.238843E+00 +2.961211E+01 +4.384415E+00 +9.590524E-01 +4.598971E-03 +2.334141E+00 +2.724146E-02 +3.775673E+01 +7.127940E+00 +1.257246E+00 +7.903602E-03 +3.059885E+00 +4.681606E-02 +9.766123E+01 +4.768868E+01 +1.146721E+00 +6.574876E-03 +2.790924E+00 +3.894646E-02 +2.115196E+02 +2.237105E+02 +3.227770E-01 +5.209674E-04 +7.986892E-01 +3.189781E-03 +1.124582E+02 +6.324576E+01 +1.524926E+00 +1.163296E-02 +4.241504E+00 +8.999793E-02 +1.131371E+02 +6.400083E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.356358E+01 +1.434541E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.119744E+01 +4.866426E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.113471E+01 +8.460406E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.845360E+01 +4.846573E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.893303E+02 +1.792356E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.700227E+01 +4.706134E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.906717E+01 +1.744589E+01 +2.185188E+01 +2.388096E+00 +5.318310E+01 +1.414560E+01 +4.087275E+01 +8.353159E+00 +6.075499E+00 +1.845731E-01 +1.478655E+01 +1.093297E+00 +2.917987E+01 +4.257348E+00 +9.458970E-01 +4.473659E-03 +2.302124E+00 +2.649919E-02 +3.710470E+01 +6.883867E+00 +1.236141E+00 +7.640471E-03 +3.008519E+00 +4.525743E-02 +9.774725E+01 +4.777270E+01 +1.148516E+00 +6.595474E-03 +2.795293E+00 +3.906847E-02 +2.158098E+02 +2.328754E+02 +3.292126E-01 +5.419377E-04 +8.146135E-01 +3.318178E-03 +1.142484E+02 +6.527422E+01 +1.545377E+00 +1.194543E-02 +4.298389E+00 +9.241537E-02 +6.833016E+01 +2.334778E+01 +2.543915E+01 +3.236770E+00 +6.191381E+01 +1.917263E+01 +4.345500E+01 +9.442129E+00 +6.480434E+00 +2.100014E-01 +1.577208E+01 +1.243919E+00 +2.960282E+01 +4.381672E+00 +9.615903E-01 +4.623347E-03 +2.340318E+00 +2.738585E-02 +3.774401E+01 +7.123146E+00 +1.260578E+00 +7.945537E-03 +3.067994E+00 +4.706446E-02 +9.766964E+01 +4.769689E+01 +1.150177E+00 +6.614567E-03 +2.799336E+00 +3.918157E-02 +2.116380E+02 +2.239600E+02 +3.238418E-01 +5.244043E-04 +8.013238E-01 +3.210825E-03 +1.124870E+02 +6.327601E+01 +1.529133E+00 +1.169657E-02 +4.253205E+00 +9.049007E-02 +tally 2: +3.727212E-01 +6.946055E-04 +8.048859E-01 +3.239206E-03 +3.094670E-01 +4.788493E-04 +2.194460E-01 +2.407828E-04 +1.708591E-01 +1.459642E-04 +2.305151E-02 +2.656862E-06 +8.000705E-03 +3.200564E-07 +1.273273E-03 +8.106118E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327639E-01 +5.536592E-04 +7.185987E-01 +2.581921E-03 +2.762909E-01 +3.816833E-04 +1.959205E-01 +1.919242E-04 +1.525423E-01 +1.163458E-04 +2.058029E-02 +2.117742E-06 +7.142994E-03 +2.551118E-07 +1.136772E-03 +6.461253E-09 +3.721892E-01 +6.926241E-04 +8.037371E-01 +3.229967E-03 +3.090254E-01 +4.774834E-04 +2.191328E-01 +2.400960E-04 +1.706153E-01 +1.455479E-04 +2.301861E-02 +2.649283E-06 +7.989285E-03 +3.191434E-07 +1.271455E-03 +8.082995E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat new file mode 100644 index 00000000000..2625ac2a347 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.851755E+01 +2.347625E+01 +2.543244E+01 +3.235138E+00 +6.189746E+01 +1.916296E+01 +4.353807E+01 +9.478290E+00 +6.473201E+00 +2.095347E-01 +1.575448E+01 +1.241154E+00 +2.964329E+01 +4.393655E+00 +9.600630E-01 +4.608668E-03 +2.336601E+00 +2.729890E-02 +3.779660E+01 +7.143001E+00 +1.258574E+00 +7.920313E-03 +3.063118E+00 +4.691505E-02 +9.776873E+01 +4.779372E+01 +1.147984E+00 +6.589359E-03 +2.793996E+00 +3.903225E-02 +2.117587E+02 +2.242166E+02 +3.231403E-01 +5.221406E-04 +7.995881E-01 +3.196965E-03 +1.125788E+02 +6.338145E+01 +1.526548E+00 +1.165771E-02 +4.246015E+00 +9.018945E-02 +1.132350E+02 +6.411155E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361464E+01 +1.437278E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123071E+01 +4.876810E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117909E+01 +8.478672E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856285E+01 +4.857335E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895450E+02 +1.796425E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710717E+01 +4.716318E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911301E+01 +1.747298E+01 +2.186903E+01 +2.391846E+00 +5.322484E+01 +1.416782E+01 +4.091074E+01 +8.368698E+00 +6.081162E+00 +1.849173E-01 +1.480033E+01 +1.095336E+00 +2.921050E+01 +4.266292E+00 +9.468909E-01 +4.483065E-03 +2.304543E+00 +2.655491E-02 +3.714364E+01 +6.898322E+00 +1.237440E+00 +7.656535E-03 +3.011680E+00 +4.535258E-02 +9.785450E+01 +4.787760E+01 +1.149777E+00 +6.609958E-03 +2.798361E+00 +3.915427E-02 +2.160535E+02 +2.334017E+02 +3.295826E-01 +5.431567E-04 +8.155291E-01 +3.325642E-03 +1.143708E+02 +6.541413E+01 +1.547019E+00 +1.197082E-02 +4.302955E+00 +9.261180E-02 +6.838444E+01 +2.338489E+01 +2.545958E+01 +3.241970E+00 +6.196352E+01 +1.920343E+01 +4.349543E+01 +9.459705E+00 +6.486476E+00 +2.103931E-01 +1.578678E+01 +1.246239E+00 +2.963399E+01 +4.390905E+00 +9.626034E-01 +4.633094E-03 +2.342784E+00 +2.744358E-02 +3.778386E+01 +7.138194E+00 +1.261909E+00 +7.962333E-03 +3.071235E+00 +4.716395E-02 +9.777713E+01 +4.780194E+01 +1.151443E+00 +6.629136E-03 +2.802417E+00 +3.926787E-02 +2.118773E+02 +2.244667E+02 +3.242063E-01 +5.255855E-04 +8.022257E-01 +3.218057E-03 +1.126076E+02 +6.341177E+01 +1.530759E+00 +1.172147E-02 +4.257730E+00 +9.068268E-02 +tally 2: +3.727213E-01 +6.946060E-04 +8.048865E-01 +3.239212E-03 +3.094674E-01 +4.788505E-04 +2.194469E-01 +2.407847E-04 +1.708606E-01 +1.459668E-04 +2.305197E-02 +2.656966E-06 +8.001084E-03 +3.200868E-07 +1.273400E-03 +8.107736E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327641E-01 +5.536596E-04 +7.185993E-01 +2.581925E-03 +2.762912E-01 +3.816842E-04 +1.959213E-01 +1.919257E-04 +1.525436E-01 +1.163478E-04 +2.058070E-02 +2.117825E-06 +7.143331E-03 +2.551359E-07 +1.136885E-03 +6.462535E-09 +3.721894E-01 +6.926247E-04 +8.037378E-01 +3.229972E-03 +3.090257E-01 +4.774846E-04 +2.191337E-01 +2.400979E-04 +1.706168E-01 +1.455504E-04 +2.301907E-02 +2.649387E-06 +7.989664E-03 +3.191737E-07 +1.271582E-03 +8.084607E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat new file mode 100644 index 00000000000..5d21c6febfc --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.857321E+01 +2.351441E+01 +2.545331E+01 +3.240452E+00 +6.194827E+01 +1.919443E+01 +4.357935E+01 +9.496270E+00 +6.479351E+00 +2.099331E-01 +1.576944E+01 +1.243514E+00 +2.967503E+01 +4.403069E+00 +9.610914E-01 +4.618547E-03 +2.339104E+00 +2.735741E-02 +3.783717E+01 +7.158344E+00 +1.259926E+00 +7.937337E-03 +3.066408E+00 +4.701588E-02 +9.787805E+01 +4.790066E+01 +1.149267E+00 +6.604105E-03 +2.797121E+00 +3.911960E-02 +2.120018E+02 +2.247317E+02 +3.235096E-01 +5.233348E-04 +8.005019E-01 +3.204276E-03 +1.127015E+02 +6.351966E+01 +1.528198E+00 +1.168293E-02 +4.250605E+00 +9.038454E-02 +1.133348E+02 +6.422471E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366670E+01 +1.440070E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126455E+01 +4.887386E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122424E+01 +8.497275E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867395E+01 +4.868292E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897633E+02 +1.800565E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721388E+01 +4.726689E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915992E+01 +1.750072E+01 +2.188657E+01 +2.395685E+00 +5.326754E+01 +1.419056E+01 +4.094949E+01 +8.384559E+00 +6.086937E+00 +1.852687E-01 +1.481439E+01 +1.097417E+00 +2.924168E+01 +4.275405E+00 +9.479024E-01 +4.492648E-03 +2.307005E+00 +2.661167E-02 +3.718326E+01 +6.913048E+00 +1.238761E+00 +7.672900E-03 +3.014897E+00 +4.544952E-02 +9.796358E+01 +4.798440E+01 +1.151059E+00 +6.624706E-03 +2.801481E+00 +3.924163E-02 +2.163013E+02 +2.339374E+02 +3.299589E-01 +5.443975E-04 +8.164601E-01 +3.333239E-03 +1.144953E+02 +6.555663E+01 +1.548689E+00 +1.199669E-02 +4.307601E+00 +9.281190E-02 +6.843995E+01 +2.342287E+01 +2.548046E+01 +3.247292E+00 +6.201435E+01 +1.923495E+01 +4.353665E+01 +9.477643E+00 +6.492636E+00 +2.107930E-01 +1.580178E+01 +1.248607E+00 +2.966572E+01 +4.400311E+00 +9.636344E-01 +4.643024E-03 +2.345293E+00 +2.750240E-02 +3.782441E+01 +7.153523E+00 +1.263264E+00 +7.979443E-03 +3.074533E+00 +4.726529E-02 +9.788645E+01 +4.790889E+01 +1.152731E+00 +6.643969E-03 +2.805551E+00 +3.935573E-02 +2.121205E+02 +2.249823E+02 +3.245768E-01 +5.267876E-04 +8.031427E-01 +3.225417E-03 +1.127304E+02 +6.355006E+01 +1.532415E+00 +1.174683E-02 +4.262334E+00 +9.087889E-02 +tally 2: +3.727215E-01 +6.946067E-04 +8.048874E-01 +3.239219E-03 +3.094679E-01 +4.788521E-04 +2.194480E-01 +2.407872E-04 +1.708625E-01 +1.459700E-04 +2.305255E-02 +2.657101E-06 +8.001573E-03 +3.201259E-07 +1.273562E-03 +8.109801E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327642E-01 +5.536601E-04 +7.186001E-01 +2.581931E-03 +2.762917E-01 +3.816855E-04 +1.959223E-01 +1.919277E-04 +1.525453E-01 +1.163504E-04 +2.058122E-02 +2.117932E-06 +7.143764E-03 +2.551668E-07 +1.137029E-03 +6.464170E-09 +3.721896E-01 +6.926253E-04 +8.037386E-01 +3.229979E-03 +3.090263E-01 +4.774861E-04 +2.191348E-01 +2.401004E-04 +1.706187E-01 +1.455537E-04 +2.301965E-02 +2.649522E-06 +7.990152E-03 +3.192126E-07 +1.271744E-03 +8.086665E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/inputs_true.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/inputs_true.dat new file mode 100644 index 00000000000..4040f8f18be --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/inputs_true.dat @@ -0,0 +1,138 @@ + + + + mgxs.h5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.126 0.126 + 10 10 + -0.63 -0.63 + +10 10 10 10 10 10 10 10 10 10 +10 10 10 10 10 10 10 10 10 10 +10 10 10 10 10 10 10 10 10 10 +10 10 10 10 10 10 10 10 10 10 +10 10 10 10 10 10 10 10 10 10 +10 10 10 10 10 10 10 10 10 10 +10 10 10 10 10 10 10 10 10 10 +10 10 10 10 10 10 10 10 10 10 +10 10 10 10 10 10 10 10 10 10 +10 10 10 10 10 10 10 10 10 10 + + + 1.26 1.26 + 2 2 + -1.26 -1.26 + +9 9 +9 12 + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 400 + 200 + true + +
0.01
+ 5 + s +
+ multi-group + + 100.0 + 20.0 + + + -1.26 -1.26 -1 1.26 1.26 1 + + + true + 3 + propagation + + + + + + + + 40 40 + -1.26 -1.26 + 1.26 1.26 + +
+ + + 2 2 + -1.26 -1.26 + 1.26 1.26 + + + 3 + + + 1e-05 0.0635 10.0 100.0 1000.0 500000.0 1000000.0 20000000.0 + + + 1 2 3 4 5 6 7 8 + + + 4 5 + flux fission nu-fission + analog + + + 4 6 + precursors + + +
diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_0.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_0.dat new file mode 100644 index 00000000000..b7863f78005 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_0.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.829734E+01 +2.332560E+01 +2.535005E+01 +3.214213E+00 +6.169695E+01 +1.903901E+01 +4.338057E+01 +9.409840E+00 +6.449747E+00 +2.080191E-01 +1.569739E+01 +1.232177E+00 +2.952526E+01 +4.358735E+00 +9.562385E-01 +4.572024E-03 +2.327293E+00 +2.708184E-02 +3.764580E+01 +7.086116E+00 +1.253550E+00 +7.857205E-03 +3.050891E+00 +4.654123E-02 +9.736564E+01 +4.740043E+01 +1.143250E+00 +6.535133E-03 +2.782476E+00 +3.871104E-02 +2.108671E+02 +2.223325E+02 +3.217847E-01 +5.177688E-04 +7.962336E-01 +3.170197E-03 +1.121239E+02 +6.287031E+01 +1.520419E+00 +1.156430E-02 +4.228968E+00 +8.946678E-02 +1.128474E+02 +6.367345E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.341703E+01 +1.426702E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.110513E+01 +4.837669E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.101197E+01 +8.409994E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.815385E+01 +4.817107E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.887447E+02 +1.781287E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.671216E+01 +4.678026E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.892637E+01 +1.736282E+01 +2.179942E+01 +2.376644E+00 +5.305542E+01 +1.407777E+01 +4.076286E+01 +8.308305E+00 +6.059136E+00 +1.835802E-01 +1.474673E+01 +1.087416E+00 +2.909448E+01 +4.232468E+00 +9.431274E-01 +4.447499E-03 +2.295383E+00 +2.634424E-02 +3.699617E+01 +6.843656E+00 +1.232522E+00 +7.595798E-03 +2.999711E+00 +4.499282E-02 +9.745207E+01 +4.748461E+01 +1.145047E+00 +6.555693E-03 +2.786851E+00 +3.883283E-02 +2.151446E+02 +2.314420E+02 +3.282013E-01 +5.386136E-04 +8.121113E-01 +3.297825E-03 +1.139091E+02 +6.488702E+01 +1.540814E+00 +1.187500E-02 +4.285697E+00 +9.187046E-02 +6.816479E+01 +2.323491E+01 +2.537715E+01 +3.221014E+00 +6.176291E+01 +1.907929E+01 +4.333813E+01 +9.391406E+00 +6.462978E+00 +2.088716E-01 +1.572960E+01 +1.237227E+00 +2.951601E+01 +4.356011E+00 +9.587693E-01 +4.596260E-03 +2.333452E+00 +2.722540E-02 +3.763313E+01 +7.081357E+00 +1.256873E+00 +7.898901E-03 +3.058977E+00 +4.678821E-02 +9.737405E+01 +4.740862E+01 +1.146696E+00 +6.574588E-03 +2.790864E+00 +3.894475E-02 +2.109852E+02 +2.225806E+02 +3.228462E-01 +5.211850E-04 +7.988604E-01 +3.191114E-03 +1.121527E+02 +6.290039E+01 +1.524613E+00 +1.162754E-02 +4.240634E+00 +8.995597E-02 +tally 2: +3.727239E-01 +6.947125E-04 +8.048913E-01 +3.239702E-03 +3.094690E-01 +4.789219E-04 +2.194466E-01 +2.408177E-04 +1.708586E-01 +1.459836E-04 +2.305111E-02 +2.657139E-06 +8.000274E-03 +3.200666E-07 +1.273116E-03 +8.105247E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327663E-01 +5.537155E-04 +7.186034E-01 +2.582180E-03 +2.762925E-01 +3.817212E-04 +1.959210E-01 +1.919420E-04 +1.525418E-01 +1.163551E-04 +2.057993E-02 +2.117853E-06 +7.142610E-03 +2.551067E-07 +1.136632E-03 +6.460228E-09 +3.721919E-01 +6.927141E-04 +8.037423E-01 +3.230382E-03 +3.090272E-01 +4.775443E-04 +2.191334E-01 +2.401250E-04 +1.706146E-01 +1.455636E-04 +2.301820E-02 +2.649495E-06 +7.988854E-03 +3.191459E-07 +1.271298E-03 +8.081932E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat new file mode 100644 index 00000000000..3b5aea51fd9 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.835753E+01 +2.336672E+01 +2.537239E+01 +3.219878E+00 +6.175132E+01 +1.907257E+01 +4.341877E+01 +9.426414E+00 +6.455425E+00 +2.083854E-01 +1.571121E+01 +1.234347E+00 +2.955121E+01 +4.366402E+00 +9.570792E-01 +4.580066E-03 +2.329339E+00 +2.712948E-02 +3.767888E+01 +7.098576E+00 +1.254652E+00 +7.871022E-03 +3.053572E+00 +4.662307E-02 +9.745115E+01 +4.748373E+01 +1.144254E+00 +6.546618E-03 +2.784920E+00 +3.877907E-02 +2.110520E+02 +2.227225E+02 +3.220667E-01 +5.186770E-04 +7.969316E-01 +3.175758E-03 +1.122226E+02 +6.298107E+01 +1.521758E+00 +1.158468E-02 +4.232692E+00 +8.962439E-02 +1.129470E+02 +6.378585E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.346407E+01 +1.429216E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.113247E+01 +4.846178E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.104801E+01 +8.424780E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.824005E+01 +4.825571E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.889103E+02 +1.784413E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.679730E+01 +4.686267E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.897828E+01 +1.739342E+01 +2.181862E+01 +2.380831E+00 +5.310215E+01 +1.410257E+01 +4.079874E+01 +8.322938E+00 +6.064469E+00 +1.839035E-01 +1.475971E+01 +1.089331E+00 +2.912006E+01 +4.239913E+00 +9.439565E-01 +4.455323E-03 +2.297401E+00 +2.639057E-02 +3.702869E+01 +6.855691E+00 +1.233605E+00 +7.609156E-03 +3.002348E+00 +4.507194E-02 +9.753766E+01 +4.756805E+01 +1.146053E+00 +6.567213E-03 +2.789298E+00 +3.890107E-02 +2.153332E+02 +2.318479E+02 +3.284890E-01 +5.395580E-04 +8.128230E-01 +3.303608E-03 +1.140093E+02 +6.500131E+01 +1.542171E+00 +1.189591E-02 +4.289470E+00 +9.203227E-02 +6.822486E+01 +2.327587E+01 +2.539951E+01 +3.226691E+00 +6.181733E+01 +1.911292E+01 +4.337628E+01 +9.407949E+00 +6.468668E+00 +2.092395E-01 +1.574344E+01 +1.239406E+00 +2.954196E+01 +4.363673E+00 +9.596121E-01 +4.604345E-03 +2.335504E+00 +2.727329E-02 +3.766621E+01 +7.093810E+00 +1.257977E+00 +7.912792E-03 +3.061665E+00 +4.687049E-02 +9.745956E+01 +4.749193E+01 +1.147703E+00 +6.586141E-03 +2.793315E+00 +3.901318E-02 +2.111701E+02 +2.229708E+02 +3.231290E-01 +5.220986E-04 +7.995602E-01 +3.196707E-03 +1.122514E+02 +6.301118E+01 +1.525955E+00 +1.164801E-02 +4.244367E+00 +9.011440E-02 +tally 2: +3.727210E-01 +6.946049E-04 +8.048851E-01 +3.239200E-03 +3.094666E-01 +4.788479E-04 +2.194451E-01 +2.407807E-04 +1.708575E-01 +1.459614E-04 +2.305100E-02 +2.656744E-06 +8.000275E-03 +3.200220E-07 +1.273127E-03 +8.104266E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327638E-01 +5.536587E-04 +7.185980E-01 +2.581916E-03 +2.762905E-01 +3.816822E-04 +1.959196E-01 +1.919225E-04 +1.525408E-01 +1.163435E-04 +2.057984E-02 +2.117649E-06 +7.142612E-03 +2.550845E-07 +1.136643E-03 +6.459783E-09 +3.721891E-01 +6.926236E-04 +8.037363E-01 +3.229960E-03 +3.090249E-01 +4.774820E-04 +2.191319E-01 +2.400939E-04 +1.706136E-01 +1.455450E-04 +2.301810E-02 +2.649166E-06 +7.988856E-03 +3.191091E-07 +1.271310E-03 +8.081148E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat new file mode 100644 index 00000000000..db723684684 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.841005E+01 +2.340265E+01 +2.539210E+01 +3.224885E+00 +6.179930E+01 +1.910222E+01 +4.345797E+01 +9.443447E+00 +6.461267E+00 +2.087628E-01 +1.572543E+01 +1.236582E+00 +2.958150E+01 +4.375358E+00 +9.580607E-01 +4.589465E-03 +2.331728E+00 +2.718515E-02 +3.771761E+01 +7.113176E+00 +1.255942E+00 +7.887221E-03 +3.056712E+00 +4.671902E-02 +9.755568E+01 +4.758565E+01 +1.145482E+00 +6.560671E-03 +2.787908E+00 +3.886231E-02 +2.112847E+02 +2.232140E+02 +3.224203E-01 +5.198164E-04 +7.978065E-01 +3.182734E-03 +1.123399E+02 +6.311276E+01 +1.523335E+00 +1.160870E-02 +4.237078E+00 +8.981024E-02 +1.130416E+02 +6.389274E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.351357E+01 +1.431864E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116479E+01 +4.856246E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.109114E+01 +8.442495E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.834631E+01 +4.836016E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891193E+02 +1.788365E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.689934E+01 +4.696152E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.902249E+01 +1.741951E+01 +2.183516E+01 +2.384444E+00 +5.314242E+01 +1.412397E+01 +4.083555E+01 +8.337963E+00 +6.069956E+00 +1.842364E-01 +1.477306E+01 +1.091303E+00 +2.914981E+01 +4.248581E+00 +9.449218E-01 +4.464439E-03 +2.299750E+00 +2.644457E-02 +3.706650E+01 +6.869699E+00 +1.234866E+00 +7.624725E-03 +3.005418E+00 +4.516416E-02 +9.764194E+01 +4.766982E+01 +1.147279E+00 +6.581267E-03 +2.792281E+00 +3.898431E-02 +2.155704E+02 +2.323591E+02 +3.288491E-01 +5.407419E-04 +8.137142E-01 +3.310856E-03 +1.141284E+02 +6.513710E+01 +1.543767E+00 +1.192055E-02 +4.293910E+00 +9.222288E-02 +6.827724E+01 +2.331163E+01 +2.541923E+01 +3.231703E+00 +6.186532E+01 +1.914261E+01 +4.341544E+01 +9.424942E+00 +6.474521E+00 +2.096183E-01 +1.575769E+01 +1.241649E+00 +2.957223E+01 +4.372622E+00 +9.605961E-01 +4.613792E-03 +2.337899E+00 +2.732925E-02 +3.770491E+01 +7.108396E+00 +1.259271E+00 +7.929072E-03 +3.064813E+00 +4.696693E-02 +9.756409E+01 +4.759386E+01 +1.148934E+00 +6.600277E-03 +2.796311E+00 +3.909692E-02 +2.114030E+02 +2.234629E+02 +3.234838E-01 +5.232457E-04 +8.004381E-01 +3.203731E-03 +1.123687E+02 +6.314294E+01 +1.527537E+00 +1.167217E-02 +4.248767E+00 +9.030131E-02 +tally 2: +3.727211E-01 +6.946052E-04 +8.048854E-01 +3.239203E-03 +3.094668E-01 +4.788484E-04 +2.194454E-01 +2.407815E-04 +1.708581E-01 +1.459624E-04 +2.305119E-02 +2.656788E-06 +8.000435E-03 +3.200348E-07 +1.273182E-03 +8.104960E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327638E-01 +5.536589E-04 +7.185983E-01 +2.581918E-03 +2.762906E-01 +3.816826E-04 +1.959200E-01 +1.919231E-04 +1.525414E-01 +1.163444E-04 +2.058001E-02 +2.117684E-06 +7.142754E-03 +2.550947E-07 +1.136691E-03 +6.460335E-09 +3.721891E-01 +6.926238E-04 +8.037366E-01 +3.229963E-03 +3.090251E-01 +4.774825E-04 +2.191322E-01 +2.400946E-04 +1.706142E-01 +1.455461E-04 +2.301829E-02 +2.649209E-06 +7.989016E-03 +3.191219E-07 +1.271365E-03 +8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat new file mode 100644 index 00000000000..bac8902424a --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.846312E+01 +2.343897E+01 +2.541202E+01 +3.229945E+00 +6.184776E+01 +1.913220E+01 +4.349759E+01 +9.460674E+00 +6.467170E+00 +2.091445E-01 +1.573980E+01 +1.238843E+00 +2.961211E+01 +4.384415E+00 +9.590524E-01 +4.598971E-03 +2.334141E+00 +2.724146E-02 +3.775673E+01 +7.127940E+00 +1.257246E+00 +7.903602E-03 +3.059885E+00 +4.681606E-02 +9.766123E+01 +4.768868E+01 +1.146721E+00 +6.574876E-03 +2.790924E+00 +3.894646E-02 +2.115196E+02 +2.237105E+02 +3.227770E-01 +5.209674E-04 +7.986892E-01 +3.189781E-03 +1.124582E+02 +6.324576E+01 +1.524926E+00 +1.163296E-02 +4.241504E+00 +8.999793E-02 +1.131371E+02 +6.400083E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.356358E+01 +1.434541E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.119744E+01 +4.866426E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.113471E+01 +8.460406E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.845360E+01 +4.846573E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.893303E+02 +1.792356E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.700227E+01 +4.706134E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.906717E+01 +1.744589E+01 +2.185188E+01 +2.388096E+00 +5.318310E+01 +1.414560E+01 +4.087275E+01 +8.353159E+00 +6.075499E+00 +1.845731E-01 +1.478655E+01 +1.093297E+00 +2.917987E+01 +4.257348E+00 +9.458970E-01 +4.473659E-03 +2.302124E+00 +2.649919E-02 +3.710470E+01 +6.883867E+00 +1.236141E+00 +7.640471E-03 +3.008519E+00 +4.525743E-02 +9.774725E+01 +4.777270E+01 +1.148516E+00 +6.595474E-03 +2.795293E+00 +3.906847E-02 +2.158098E+02 +2.328754E+02 +3.292126E-01 +5.419377E-04 +8.146135E-01 +3.318178E-03 +1.142484E+02 +6.527422E+01 +1.545377E+00 +1.194543E-02 +4.298389E+00 +9.241537E-02 +6.833016E+01 +2.334778E+01 +2.543915E+01 +3.236770E+00 +6.191381E+01 +1.917263E+01 +4.345500E+01 +9.442129E+00 +6.480434E+00 +2.100014E-01 +1.577208E+01 +1.243919E+00 +2.960282E+01 +4.381672E+00 +9.615903E-01 +4.623347E-03 +2.340318E+00 +2.738585E-02 +3.774401E+01 +7.123146E+00 +1.260578E+00 +7.945537E-03 +3.067994E+00 +4.706446E-02 +9.766964E+01 +4.769689E+01 +1.150177E+00 +6.614567E-03 +2.799336E+00 +3.918157E-02 +2.116380E+02 +2.239600E+02 +3.238418E-01 +5.244043E-04 +8.013238E-01 +3.210825E-03 +1.124870E+02 +6.327601E+01 +1.529133E+00 +1.169657E-02 +4.253205E+00 +9.049007E-02 +tally 2: +3.727212E-01 +6.946055E-04 +8.048859E-01 +3.239206E-03 +3.094670E-01 +4.788493E-04 +2.194460E-01 +2.407828E-04 +1.708591E-01 +1.459642E-04 +2.305151E-02 +2.656862E-06 +8.000705E-03 +3.200564E-07 +1.273273E-03 +8.106118E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327639E-01 +5.536592E-04 +7.185987E-01 +2.581921E-03 +2.762909E-01 +3.816833E-04 +1.959205E-01 +1.919242E-04 +1.525423E-01 +1.163458E-04 +2.058029E-02 +2.117742E-06 +7.142994E-03 +2.551118E-07 +1.136772E-03 +6.461253E-09 +3.721892E-01 +6.926241E-04 +8.037371E-01 +3.229967E-03 +3.090254E-01 +4.774834E-04 +2.191328E-01 +2.400960E-04 +1.706153E-01 +1.455479E-04 +2.301861E-02 +2.649283E-06 +7.989285E-03 +3.191434E-07 +1.271455E-03 +8.082995E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat new file mode 100644 index 00000000000..2625ac2a347 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.851755E+01 +2.347625E+01 +2.543244E+01 +3.235138E+00 +6.189746E+01 +1.916296E+01 +4.353807E+01 +9.478290E+00 +6.473201E+00 +2.095347E-01 +1.575448E+01 +1.241154E+00 +2.964329E+01 +4.393655E+00 +9.600630E-01 +4.608668E-03 +2.336601E+00 +2.729890E-02 +3.779660E+01 +7.143001E+00 +1.258574E+00 +7.920313E-03 +3.063118E+00 +4.691505E-02 +9.776873E+01 +4.779372E+01 +1.147984E+00 +6.589359E-03 +2.793996E+00 +3.903225E-02 +2.117587E+02 +2.242166E+02 +3.231403E-01 +5.221406E-04 +7.995881E-01 +3.196965E-03 +1.125788E+02 +6.338145E+01 +1.526548E+00 +1.165771E-02 +4.246015E+00 +9.018945E-02 +1.132350E+02 +6.411155E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361464E+01 +1.437278E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123071E+01 +4.876810E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117909E+01 +8.478672E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856285E+01 +4.857335E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895450E+02 +1.796425E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710717E+01 +4.716318E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911301E+01 +1.747298E+01 +2.186903E+01 +2.391846E+00 +5.322484E+01 +1.416782E+01 +4.091074E+01 +8.368698E+00 +6.081162E+00 +1.849173E-01 +1.480033E+01 +1.095336E+00 +2.921050E+01 +4.266292E+00 +9.468909E-01 +4.483065E-03 +2.304543E+00 +2.655491E-02 +3.714364E+01 +6.898322E+00 +1.237440E+00 +7.656535E-03 +3.011680E+00 +4.535258E-02 +9.785450E+01 +4.787760E+01 +1.149777E+00 +6.609958E-03 +2.798361E+00 +3.915427E-02 +2.160535E+02 +2.334017E+02 +3.295826E-01 +5.431567E-04 +8.155291E-01 +3.325642E-03 +1.143708E+02 +6.541413E+01 +1.547019E+00 +1.197082E-02 +4.302955E+00 +9.261180E-02 +6.838444E+01 +2.338489E+01 +2.545958E+01 +3.241970E+00 +6.196352E+01 +1.920343E+01 +4.349543E+01 +9.459705E+00 +6.486476E+00 +2.103931E-01 +1.578678E+01 +1.246239E+00 +2.963399E+01 +4.390905E+00 +9.626034E-01 +4.633094E-03 +2.342784E+00 +2.744358E-02 +3.778386E+01 +7.138194E+00 +1.261909E+00 +7.962333E-03 +3.071235E+00 +4.716395E-02 +9.777713E+01 +4.780194E+01 +1.151443E+00 +6.629136E-03 +2.802417E+00 +3.926787E-02 +2.118773E+02 +2.244667E+02 +3.242063E-01 +5.255855E-04 +8.022257E-01 +3.218057E-03 +1.126076E+02 +6.341177E+01 +1.530759E+00 +1.172147E-02 +4.257730E+00 +9.068268E-02 +tally 2: +3.727213E-01 +6.946060E-04 +8.048865E-01 +3.239212E-03 +3.094674E-01 +4.788505E-04 +2.194469E-01 +2.407847E-04 +1.708606E-01 +1.459668E-04 +2.305197E-02 +2.656966E-06 +8.001084E-03 +3.200868E-07 +1.273400E-03 +8.107736E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327641E-01 +5.536596E-04 +7.185993E-01 +2.581925E-03 +2.762912E-01 +3.816842E-04 +1.959213E-01 +1.919257E-04 +1.525436E-01 +1.163478E-04 +2.058070E-02 +2.117825E-06 +7.143331E-03 +2.551359E-07 +1.136885E-03 +6.462535E-09 +3.721894E-01 +6.926247E-04 +8.037378E-01 +3.229972E-03 +3.090257E-01 +4.774846E-04 +2.191337E-01 +2.400979E-04 +1.706168E-01 +1.455504E-04 +2.301907E-02 +2.649387E-06 +7.989664E-03 +3.191737E-07 +1.271582E-03 +8.084607E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat new file mode 100644 index 00000000000..5d21c6febfc --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.857321E+01 +2.351441E+01 +2.545331E+01 +3.240452E+00 +6.194827E+01 +1.919443E+01 +4.357935E+01 +9.496270E+00 +6.479351E+00 +2.099331E-01 +1.576944E+01 +1.243514E+00 +2.967503E+01 +4.403069E+00 +9.610914E-01 +4.618547E-03 +2.339104E+00 +2.735741E-02 +3.783717E+01 +7.158344E+00 +1.259926E+00 +7.937337E-03 +3.066408E+00 +4.701588E-02 +9.787805E+01 +4.790066E+01 +1.149267E+00 +6.604105E-03 +2.797121E+00 +3.911960E-02 +2.120018E+02 +2.247317E+02 +3.235096E-01 +5.233348E-04 +8.005019E-01 +3.204276E-03 +1.127015E+02 +6.351966E+01 +1.528198E+00 +1.168293E-02 +4.250605E+00 +9.038454E-02 +1.133348E+02 +6.422471E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366670E+01 +1.440070E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126455E+01 +4.887386E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122424E+01 +8.497275E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867395E+01 +4.868292E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897633E+02 +1.800565E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721388E+01 +4.726689E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915992E+01 +1.750072E+01 +2.188657E+01 +2.395685E+00 +5.326754E+01 +1.419056E+01 +4.094949E+01 +8.384559E+00 +6.086937E+00 +1.852687E-01 +1.481439E+01 +1.097417E+00 +2.924168E+01 +4.275405E+00 +9.479024E-01 +4.492648E-03 +2.307005E+00 +2.661167E-02 +3.718326E+01 +6.913048E+00 +1.238761E+00 +7.672900E-03 +3.014897E+00 +4.544952E-02 +9.796358E+01 +4.798440E+01 +1.151059E+00 +6.624706E-03 +2.801481E+00 +3.924163E-02 +2.163013E+02 +2.339374E+02 +3.299589E-01 +5.443975E-04 +8.164601E-01 +3.333239E-03 +1.144953E+02 +6.555663E+01 +1.548689E+00 +1.199669E-02 +4.307601E+00 +9.281190E-02 +6.843995E+01 +2.342287E+01 +2.548046E+01 +3.247292E+00 +6.201435E+01 +1.923495E+01 +4.353665E+01 +9.477643E+00 +6.492636E+00 +2.107930E-01 +1.580178E+01 +1.248607E+00 +2.966572E+01 +4.400311E+00 +9.636344E-01 +4.643024E-03 +2.345293E+00 +2.750240E-02 +3.782441E+01 +7.153523E+00 +1.263264E+00 +7.979443E-03 +3.074533E+00 +4.726529E-02 +9.788645E+01 +4.790889E+01 +1.152731E+00 +6.643969E-03 +2.805551E+00 +3.935573E-02 +2.121205E+02 +2.249823E+02 +3.245768E-01 +5.267876E-04 +8.031427E-01 +3.225417E-03 +1.127304E+02 +6.355006E+01 +1.532415E+00 +1.174683E-02 +4.262334E+00 +9.087889E-02 +tally 2: +3.727215E-01 +6.946067E-04 +8.048874E-01 +3.239219E-03 +3.094679E-01 +4.788521E-04 +2.194480E-01 +2.407872E-04 +1.708625E-01 +1.459700E-04 +2.305255E-02 +2.657101E-06 +8.001573E-03 +3.201259E-07 +1.273562E-03 +8.109801E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327642E-01 +5.536601E-04 +7.186001E-01 +2.581931E-03 +2.762917E-01 +3.816855E-04 +1.959223E-01 +1.919277E-04 +1.525453E-01 +1.163504E-04 +2.058122E-02 +2.117932E-06 +7.143764E-03 +2.551668E-07 +1.137029E-03 +6.464170E-09 +3.721896E-01 +6.926253E-04 +8.037386E-01 +3.229979E-03 +3.090263E-01 +4.774861E-04 +2.191348E-01 +2.401004E-04 +1.706187E-01 +1.455537E-04 +2.301965E-02 +2.649522E-06 +7.990152E-03 +3.192126E-07 +1.271744E-03 +8.086665E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat deleted file mode 100644 index 23ac3db9a86..00000000000 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_2.dat +++ /dev/null @@ -1,236 +0,0 @@ -k-combined: -1.311387E+00 6.434473E-04 -tally 1: -6.841002E+01 -2.340263E+01 -2.539209E+01 -3.224884E+00 -6.179927E+01 -1.910222E+01 -4.345795E+01 -9.443438E+00 -6.461264E+00 -2.087626E-01 -1.572542E+01 -1.236581E+00 -2.958149E+01 -4.375353E+00 -9.580602E-01 -4.589460E-03 -2.331727E+00 -2.718512E-02 -3.771759E+01 -7.113168E+00 -1.255942E+00 -7.887213E-03 -3.056711E+00 -4.671898E-02 -9.755563E+01 -4.758560E+01 -1.145481E+00 -6.560664E-03 -2.787906E+00 -3.886227E-02 -2.112846E+02 -2.232138E+02 -3.224201E-01 -5.198158E-04 -7.978060E-01 -3.182731E-03 -1.123398E+02 -6.311269E+01 -1.523334E+00 -1.160868E-02 -4.237076E+00 -8.981014E-02 -1.130415E+02 -6.389267E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.351354E+01 -1.431862E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.116478E+01 -4.856241E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.109112E+01 -8.442486E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.834626E+01 -4.836011E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.891192E+02 -1.788363E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.689929E+01 -4.696147E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.902247E+01 -1.741950E+01 -2.183516E+01 -2.384443E+00 -5.314240E+01 -1.412397E+01 -4.083553E+01 -8.337955E+00 -6.069953E+00 -1.842363E-01 -1.477305E+01 -1.091302E+00 -2.914979E+01 -4.248577E+00 -9.449213E-01 -4.464434E-03 -2.299749E+00 -2.644455E-02 -3.706648E+01 -6.869692E+00 -1.234866E+00 -7.624718E-03 -3.005416E+00 -4.516412E-02 -9.764189E+01 -4.766977E+01 -1.147278E+00 -6.581260E-03 -2.792280E+00 -3.898427E-02 -2.155703E+02 -2.323588E+02 -3.288490E-01 -5.407413E-04 -8.137137E-01 -3.310853E-03 -1.141283E+02 -6.513702E+01 -1.543766E+00 -1.192054E-02 -4.293907E+00 -9.222278E-02 -6.827719E+01 -2.331160E+01 -2.541921E+01 -3.231700E+00 -6.186528E+01 -1.914259E+01 -4.341541E+01 -9.424932E+00 -6.474517E+00 -2.096181E-01 -1.575768E+01 -1.241648E+00 -2.957222E+01 -4.372617E+00 -9.605956E-01 -4.613787E-03 -2.337897E+00 -2.732922E-02 -3.770489E+01 -7.108388E+00 -1.259270E+00 -7.929064E-03 -3.064812E+00 -4.696688E-02 -9.756404E+01 -4.759381E+01 -1.148934E+00 -6.600271E-03 -2.796309E+00 -3.909688E-02 -2.114029E+02 -2.234627E+02 -3.234836E-01 -5.232451E-04 -8.004376E-01 -3.203727E-03 -1.123686E+02 -6.314287E+01 -1.527536E+00 -1.167216E-02 -4.248764E+00 -9.030121E-02 -tally 2: -3.727211E-01 -6.946052E-04 -8.048854E-01 -3.239203E-03 -3.094668E-01 -4.788484E-04 -2.194454E-01 -2.407815E-04 -1.708581E-01 -1.459624E-04 -2.305119E-02 -2.656788E-06 -8.000435E-03 -3.200348E-07 -1.273182E-03 -8.104960E-09 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.327638E-01 -5.536589E-04 -7.185983E-01 -2.581918E-03 -2.762906E-01 -3.816826E-04 -1.959200E-01 -1.919231E-04 -1.525414E-01 -1.163444E-04 -2.058001E-02 -2.117684E-06 -7.142754E-03 -2.550947E-07 -1.136691E-03 -6.460334E-09 -3.721891E-01 -6.926238E-04 -8.037366E-01 -3.229963E-03 -3.090251E-01 -4.774825E-04 -2.191322E-01 -2.400946E-04 -1.706142E-01 -1.455461E-04 -2.301829E-02 -2.649209E-06 -7.989016E-03 -3.191219E-07 -1.271365E-03 -8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat deleted file mode 100644 index e808b21c1bd..00000000000 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_3.dat +++ /dev/null @@ -1,236 +0,0 @@ -k-combined: -1.311387E+00 6.434473E-04 -tally 1: -6.846307E+01 -2.343894E+01 -2.541200E+01 -3.229943E+00 -6.184772E+01 -1.913218E+01 -4.349756E+01 -9.460661E+00 -6.467166E+00 -2.091442E-01 -1.573979E+01 -1.238841E+00 -2.961208E+01 -4.384409E+00 -9.590517E-01 -4.598964E-03 -2.334140E+00 -2.724142E-02 -3.775670E+01 -7.127929E+00 -1.257245E+00 -7.903591E-03 -3.059883E+00 -4.681599E-02 -9.766116E+01 -4.768861E+01 -1.146720E+00 -6.574867E-03 -2.790922E+00 -3.894640E-02 -2.115194E+02 -2.237102E+02 -3.227768E-01 -5.209666E-04 -7.986886E-01 -3.189776E-03 -1.124581E+02 -6.324566E+01 -1.524925E+00 -1.163294E-02 -4.241501E+00 -8.999778E-02 -1.131371E+02 -6.400074E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.356354E+01 -1.434539E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.119742E+01 -4.866419E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.113468E+01 -8.460394E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.845352E+01 -4.846566E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.893301E+02 -1.792354E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.700220E+01 -4.706127E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.906713E+01 -1.744587E+01 -2.185187E+01 -2.388094E+00 -5.318307E+01 -1.414559E+01 -4.087271E+01 -8.353147E+00 -6.075495E+00 -1.845728E-01 -1.478654E+01 -1.093296E+00 -2.917985E+01 -4.257342E+00 -9.458963E-01 -4.473653E-03 -2.302122E+00 -2.649915E-02 -3.710467E+01 -6.883857E+00 -1.236140E+00 -7.640460E-03 -3.008517E+00 -4.525737E-02 -9.774718E+01 -4.777263E+01 -1.148515E+00 -6.595464E-03 -2.795291E+00 -3.906841E-02 -2.158096E+02 -2.328751E+02 -3.292123E-01 -5.419369E-04 -8.146128E-01 -3.318173E-03 -1.142483E+02 -6.527411E+01 -1.545376E+00 -1.194541E-02 -4.298386E+00 -9.241523E-02 -6.833010E+01 -2.334774E+01 -2.543913E+01 -3.236766E+00 -6.191375E+01 -1.917260E+01 -4.345497E+01 -9.442115E+00 -6.480429E+00 -2.100011E-01 -1.577207E+01 -1.243917E+00 -2.960280E+01 -4.381666E+00 -9.615896E-01 -4.623340E-03 -2.340316E+00 -2.738581E-02 -3.774398E+01 -7.123136E+00 -1.260577E+00 -7.945526E-03 -3.067991E+00 -4.706439E-02 -9.766957E+01 -4.769682E+01 -1.150177E+00 -6.614557E-03 -2.799334E+00 -3.918151E-02 -2.116379E+02 -2.239597E+02 -3.238415E-01 -5.244036E-04 -8.013232E-01 -3.210820E-03 -1.124869E+02 -6.327591E+01 -1.529132E+00 -1.169655E-02 -4.253202E+00 -9.048993E-02 -tally 2: -3.727212E-01 -6.946055E-04 -8.048859E-01 -3.239206E-03 -3.094670E-01 -4.788493E-04 -2.194460E-01 -2.407828E-04 -1.708591E-01 -1.459642E-04 -2.305151E-02 -2.656862E-06 -8.000704E-03 -3.200564E-07 -1.273273E-03 -8.106118E-09 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.327639E-01 -5.536592E-04 -7.185987E-01 -2.581921E-03 -2.762909E-01 -3.816833E-04 -1.959205E-01 -1.919242E-04 -1.525423E-01 -1.163458E-04 -2.058029E-02 -2.117742E-06 -7.142994E-03 -2.551118E-07 -1.136772E-03 -6.461253E-09 -3.721892E-01 -6.926241E-04 -8.037371E-01 -3.229967E-03 -3.090254E-01 -4.774833E-04 -2.191328E-01 -2.400960E-04 -1.706153E-01 -1.455479E-04 -2.301861E-02 -2.649283E-06 -7.989285E-03 -3.191434E-07 -1.271455E-03 -8.082994E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat deleted file mode 100644 index 4e969c448a1..00000000000 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_4.dat +++ /dev/null @@ -1,236 +0,0 @@ -k-combined: -1.311387E+00 6.434473E-04 -tally 1: -6.851748E+01 -2.347622E+01 -2.543241E+01 -3.235134E+00 -6.189740E+01 -1.916293E+01 -4.353803E+01 -9.478272E+00 -6.473195E+00 -2.095344E-01 -1.575446E+01 -1.241152E+00 -2.964326E+01 -4.393647E+00 -9.600620E-01 -4.608659E-03 -2.336599E+00 -2.729884E-02 -3.779657E+01 -7.142988E+00 -1.258573E+00 -7.920298E-03 -3.063115E+00 -4.691496E-02 -9.776864E+01 -4.779362E+01 -1.147982E+00 -6.589347E-03 -2.793994E+00 -3.903217E-02 -2.117585E+02 -2.242162E+02 -3.231400E-01 -5.221396E-04 -7.995873E-01 -3.196958E-03 -1.125787E+02 -6.338132E+01 -1.526546E+00 -1.165769E-02 -4.246011E+00 -9.018927E-02 -1.132349E+02 -6.411143E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361459E+01 -1.437275E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123068E+01 -4.876800E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117905E+01 -8.478656E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856275E+01 -4.857326E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895448E+02 -1.796421E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710707E+01 -4.716308E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911296E+01 -1.747295E+01 -2.186901E+01 -2.391843E+00 -5.322479E+01 -1.416780E+01 -4.091071E+01 -8.368683E+00 -6.081156E+00 -1.849170E-01 -1.480032E+01 -1.095334E+00 -2.921048E+01 -4.266284E+00 -9.468900E-01 -4.483057E-03 -2.304541E+00 -2.655486E-02 -3.714360E+01 -6.898309E+00 -1.237438E+00 -7.656520E-03 -3.011677E+00 -4.535250E-02 -9.785441E+01 -4.787751E+01 -1.149776E+00 -6.609946E-03 -2.798358E+00 -3.915419E-02 -2.160533E+02 -2.334013E+02 -3.295823E-01 -5.431557E-04 -8.155283E-01 -3.325636E-03 -1.143707E+02 -6.541399E+01 -1.547017E+00 -1.197080E-02 -4.302951E+00 -9.261162E-02 -6.838436E+01 -2.338484E+01 -2.545955E+01 -3.241965E+00 -6.196345E+01 -1.920339E+01 -4.349538E+01 -9.459686E+00 -6.486469E+00 -2.103927E-01 -1.578677E+01 -1.246237E+00 -2.963397E+01 -4.390897E+00 -9.626024E-01 -4.633085E-03 -2.342782E+00 -2.744353E-02 -3.778382E+01 -7.138180E+00 -1.261908E+00 -7.962318E-03 -3.071232E+00 -4.716385E-02 -9.777704E+01 -4.780184E+01 -1.151442E+00 -6.629123E-03 -2.802415E+00 -3.926779E-02 -2.118771E+02 -2.244662E+02 -3.242060E-01 -5.255844E-04 -8.022250E-01 -3.218050E-03 -1.126075E+02 -6.341165E+01 -1.530758E+00 -1.172144E-02 -4.257726E+00 -9.068250E-02 -tally 2: -3.727213E-01 -6.946060E-04 -8.048865E-01 -3.239212E-03 -3.094674E-01 -4.788505E-04 -2.194469E-01 -2.407847E-04 -1.708606E-01 -1.459668E-04 -2.305197E-02 -2.656966E-06 -8.001084E-03 -3.200867E-07 -1.273400E-03 -8.107735E-09 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.327641E-01 -5.536596E-04 -7.185993E-01 -2.581925E-03 -2.762912E-01 -3.816842E-04 -1.959213E-01 -1.919257E-04 -1.525436E-01 -1.163478E-04 -2.058070E-02 -2.117825E-06 -7.143330E-03 -2.551359E-07 -1.136885E-03 -6.462534E-09 -3.721894E-01 -6.926247E-04 -8.037378E-01 -3.229972E-03 -3.090257E-01 -4.774846E-04 -2.191337E-01 -2.400979E-04 -1.706168E-01 -1.455504E-04 -2.301907E-02 -2.649387E-06 -7.989664E-03 -3.191736E-07 -1.271582E-03 -8.084606E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat deleted file mode 100644 index 12b4941ec4b..00000000000 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/results_true_5.dat +++ /dev/null @@ -1,236 +0,0 @@ -k-combined: -1.311387E+00 6.434473E-04 -tally 1: -6.857313E+01 -2.351436E+01 -2.545329E+01 -3.240447E+00 -6.194820E+01 -1.919440E+01 -4.357930E+01 -9.496248E+00 -6.479343E+00 -2.099326E-01 -1.576943E+01 -1.243511E+00 -2.967500E+01 -4.403058E+00 -9.610902E-01 -4.618536E-03 -2.339101E+00 -2.735735E-02 -3.783713E+01 -7.158327E+00 -1.259925E+00 -7.937318E-03 -3.066405E+00 -4.701577E-02 -9.787794E+01 -4.790055E+01 -1.149266E+00 -6.604089E-03 -2.797118E+00 -3.911950E-02 -2.120015E+02 -2.247312E+02 -3.235092E-01 -5.233335E-04 -8.005009E-01 -3.204269E-03 -1.127013E+02 -6.351950E+01 -1.528196E+00 -1.168290E-02 -4.250600E+00 -9.038432E-02 -1.133347E+02 -6.422456E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366663E+01 -1.440067E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126452E+01 -4.887375E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122419E+01 -8.497255E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867383E+01 -4.868280E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897631E+02 -1.800561E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721376E+01 -4.726677E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.915985E+01 -1.750068E+01 -2.188655E+01 -2.395681E+00 -5.326748E+01 -1.419053E+01 -4.094945E+01 -8.384540E+00 -6.086929E+00 -1.852683E-01 -1.481437E+01 -1.097415E+00 -2.924165E+01 -4.275395E+00 -9.479013E-01 -4.492638E-03 -2.307002E+00 -2.661161E-02 -3.718322E+01 -6.913032E+00 -1.238760E+00 -7.672882E-03 -3.014894E+00 -4.544942E-02 -9.796347E+01 -4.798428E+01 -1.151057E+00 -6.624691E-03 -2.801478E+00 -3.924154E-02 -2.163011E+02 -2.339368E+02 -3.299585E-01 -5.443962E-04 -8.164591E-01 -3.333231E-03 -1.144952E+02 -6.555646E+01 -1.548688E+00 -1.199666E-02 -4.307596E+00 -9.281167E-02 -6.843986E+01 -2.342281E+01 -2.548043E+01 -3.247284E+00 -6.201426E+01 -1.923491E+01 -4.353660E+01 -9.477620E+00 -6.492628E+00 -2.107925E-01 -1.580176E+01 -1.248604E+00 -2.966568E+01 -4.400301E+00 -9.636332E-01 -4.643013E-03 -2.345290E+00 -2.750234E-02 -3.782436E+01 -7.153506E+00 -1.263263E+00 -7.979424E-03 -3.074529E+00 -4.726518E-02 -9.788634E+01 -4.790877E+01 -1.152730E+00 -6.643953E-03 -2.805547E+00 -3.935564E-02 -2.121203E+02 -2.249818E+02 -3.245765E-01 -5.267864E-04 -8.031417E-01 -3.225410E-03 -1.127302E+02 -6.354990E+01 -1.532413E+00 -1.174680E-02 -4.262329E+00 -9.087866E-02 -tally 2: -3.727215E-01 -6.946067E-04 -8.048874E-01 -3.239219E-03 -3.094679E-01 -4.788521E-04 -2.194480E-01 -2.407872E-04 -1.708625E-01 -1.459700E-04 -2.305255E-02 -2.657101E-06 -8.001572E-03 -3.201258E-07 -1.273562E-03 -8.109799E-09 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.327642E-01 -5.536601E-04 -7.186001E-01 -2.581931E-03 -2.762917E-01 -3.816855E-04 -1.959223E-01 -1.919277E-04 -1.525453E-01 -1.163504E-04 -2.058122E-02 -2.117932E-06 -7.143764E-03 -2.551668E-07 -1.137028E-03 -6.464168E-09 -3.721896E-01 -6.926253E-04 -8.037386E-01 -3.229979E-03 -3.090263E-01 -4.774861E-04 -2.191348E-01 -2.401004E-04 -1.706187E-01 -1.455537E-04 -2.301965E-02 -2.649522E-06 -7.990151E-03 -3.192126E-07 -1.271744E-03 -8.086663E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py index 7e330c4257c..56385243ce1 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py @@ -1,7 +1,9 @@ import os import openmc +from openmc.utility_funcs import change_directory from openmc.examples import random_ray_lattice +import pytest from tests.testing_harness import KineticTolerantPyAPITestHarness @@ -13,27 +15,30 @@ def _cleanup(self): if os.path.exists(f): os.remove(f) - -def test_random_ray_k_eff_mesh(): - model = random_ray_lattice(kinetic=True) - model.settings.timestep_parameters['n_timesteps'] = 5 - model.settings.batches = 400 - model.settings.inactive = 200 - - # The model already has some geometrical subdivisions - # up to a 10x10 grid in the moderator region. So, we - # increase the resolution 40x40 applied over the full - # 2x2 lattice. - pitch = 1.26 - dim = 40 - mesh = openmc.RegularMesh() - mesh.dimension = (dim, dim) - mesh.lower_left = (-pitch, -pitch) - mesh.upper_right = (pitch, pitch) +@pytest.mark.parametrize("time_method", ["isotropic", + "propagation"]) +def test_random_ray_k_eff_mesh(time_method): + with change_directory(time_method): + model = random_ray_lattice(kinetic=True) + model.settings.timestep_parameters['n_timesteps'] = 5 + model.settings.random_ray['time_method'] = time_method + model.settings.batches = 400 + model.settings.inactive = 200 + + # The model already has some geometrical subdivisions + # up to a 10x10 grid in the moderator region. So, we + # increase the resolution 40x40 applied over the full + # 2x2 lattice. + pitch = 1.26 + dim = 40 + mesh = openmc.RegularMesh() + mesh.dimension = (dim, dim) + mesh.lower_left = (-pitch, -pitch) + mesh.upper_right = (pitch, pitch) - root = model.geometry.root_universe + root = model.geometry.root_universe - model.settings.random_ray['source_region_meshes'] = [(mesh, [root])] + model.settings.random_ray['source_region_meshes'] = [(mesh, [root])] - harness = KineticMGXSTestHarness('statepoint.400', 6, model) - harness.main() + harness = KineticMGXSTestHarness('statepoint.400', 6, model) + harness.main() From bff941307ae42c1ead2a4b6a7c730344f3835411 Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 6 Jan 2026 12:39:55 -0600 Subject: [PATCH 43/64] update regression test --- .../isotropic/results_true_1.dat | 10 +++++----- .../isotropic/results_true_2.dat | 12 ++++++------ .../isotropic/results_true_3.dat | 16 ++++++++-------- .../isotropic/results_true_4.dat | 16 ++++++++-------- .../isotropic/results_true_5.dat | 18 +++++++++--------- .../propagation/results_true_1.dat | 10 +++++----- .../propagation/results_true_2.dat | 12 ++++++------ .../propagation/results_true_3.dat | 16 ++++++++-------- .../propagation/results_true_4.dat | 16 ++++++++-------- .../propagation/results_true_5.dat | 18 +++++++++--------- 10 files changed, 72 insertions(+), 72 deletions(-) diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat index 46dba4d56f4..a92843c016e 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.630190E+03 -3.458951E+04 +2.630191E+03 +3.458954E+04 1.079890E+02 -5.830986E+01 -2.651431E+02 -3.515147E+02 +5.830990E+01 +2.651432E+02 +3.515149E+02 tally 2: 1.077582E+00 5.805916E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat index 59ce5cb6cf3..1593f2550e3 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628842E+03 -3.455405E+04 -1.078945E+02 -5.820788E+01 -2.649118E+02 -3.509018E+02 +2.628844E+03 +3.455412E+04 +1.078946E+02 +5.820797E+01 +2.649121E+02 +3.509024E+02 tally 2: 1.077582E+00 5.805915E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat index c237ebd2591..b51d718be21 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.626019E+03 -3.447990E+04 -1.077393E+02 -5.804055E+01 -2.645315E+02 -3.498950E+02 +2.626023E+03 +3.447999E+04 +1.077395E+02 +5.804071E+01 +2.645319E+02 +3.498959E+02 tally 2: 1.077582E+00 5.805913E-03 @@ -22,5 +22,5 @@ tally 2: 2.220585E-05 2.312878E-02 2.674703E-06 -3.680428E-03 -6.772777E-08 +3.680429E-03 +6.772778E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat index 2a14986689a..397a03896ad 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621893E+03 -3.437163E+04 -1.075306E+02 -5.781591E+01 -2.640198E+02 -3.485426E+02 +2.621898E+03 +3.437177E+04 +1.075308E+02 +5.781614E+01 +2.640203E+02 +3.485440E+02 tally 2: 1.077581E+00 5.805908E-03 @@ -22,5 +22,5 @@ tally 2: 2.220489E-05 2.312757E-02 2.674422E-06 -3.680017E-03 -6.771264E-08 +3.680018E-03 +6.771265E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat index e66542145b7..45797f0de66 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616580E+03 -3.423247E+04 -1.072732E+02 -5.753947E+01 -2.633886E+02 -3.468780E+02 +2.616587E+03 +3.423265E+04 +1.072735E+02 +5.753976E+01 +2.633892E+02 +3.468797E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -20,7 +20,7 @@ tally 2: 1.219950E-03 6.663827E-02 2.220330E-05 -2.312556E-02 +2.312557E-02 2.673959E-06 -3.679343E-03 -6.768783E-08 +3.679344E-03 +6.768786E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat index 46dba4d56f4..a92843c016e 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.630190E+03 -3.458951E+04 +2.630191E+03 +3.458954E+04 1.079890E+02 -5.830986E+01 -2.651431E+02 -3.515147E+02 +5.830990E+01 +2.651432E+02 +3.515149E+02 tally 2: 1.077582E+00 5.805916E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat index 59ce5cb6cf3..1593f2550e3 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628842E+03 -3.455405E+04 -1.078945E+02 -5.820788E+01 -2.649118E+02 -3.509018E+02 +2.628844E+03 +3.455412E+04 +1.078946E+02 +5.820797E+01 +2.649121E+02 +3.509024E+02 tally 2: 1.077582E+00 5.805915E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat index c237ebd2591..b51d718be21 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.626019E+03 -3.447990E+04 -1.077393E+02 -5.804055E+01 -2.645315E+02 -3.498950E+02 +2.626023E+03 +3.447999E+04 +1.077395E+02 +5.804071E+01 +2.645319E+02 +3.498959E+02 tally 2: 1.077582E+00 5.805913E-03 @@ -22,5 +22,5 @@ tally 2: 2.220585E-05 2.312878E-02 2.674703E-06 -3.680428E-03 -6.772777E-08 +3.680429E-03 +6.772778E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat index 99def7858bf..397a03896ad 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621893E+03 -3.437163E+04 -1.075306E+02 -5.781591E+01 -2.640198E+02 -3.485427E+02 +2.621898E+03 +3.437177E+04 +1.075308E+02 +5.781614E+01 +2.640203E+02 +3.485440E+02 tally 2: 1.077581E+00 5.805908E-03 @@ -22,5 +22,5 @@ tally 2: 2.220489E-05 2.312757E-02 2.674422E-06 -3.680017E-03 -6.771264E-08 +3.680018E-03 +6.771265E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat index e66542145b7..45797f0de66 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616580E+03 -3.423247E+04 -1.072732E+02 -5.753947E+01 -2.633886E+02 -3.468780E+02 +2.616587E+03 +3.423265E+04 +1.072735E+02 +5.753976E+01 +2.633892E+02 +3.468797E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -20,7 +20,7 @@ tally 2: 1.219950E-03 6.663827E-02 2.220330E-05 -2.312556E-02 +2.312557E-02 2.673959E-06 -3.679343E-03 -6.768783E-08 +3.679344E-03 +6.768786E-08 From 7412a20ae664978e0f57009e27b3f120e6b1236a Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 6 Jan 2026 12:41:06 -0600 Subject: [PATCH 44/64] autopep8 --- .../random_ray_auto_convert_kinetic/test.py | 20 ++++++++++++------- .../test.py | 4 +++- .../random_ray_k_eff_kinetic/test.py | 2 +- .../random_ray_k_eff_mesh_kinetic/test.py | 7 ++++--- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py index 215fe8e6915..34ed2012b1e 100644 --- a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py @@ -18,12 +18,17 @@ def _cleanup(self): os.remove(f) -@pytest.mark.parametrize("generation_method, time_method", [("material_wise","isotropic"), - ("stochastic_slab","isotropic"), - ("infinite_medium","isotropic"), - ("material_wise","propagation"), - ("stochastic_slab","propagation"), - ("infinite_medium","propagation"), +@pytest.mark.parametrize("generation_method, time_method", [("material_wise", "isotropic"), + ("stochastic_slab", + "isotropic"), + ("infinite_medium", + "isotropic"), + ("material_wise", + "propagation"), + ("stochastic_slab", + "propagation"), + ("infinite_medium", + "propagation"), ]) def test_random_ray_auto_convert(generation_method, time_method): with change_directory(f'{generation_method}/{time_method}'): @@ -41,7 +46,8 @@ def test_random_ray_auto_convert(generation_method, time_method): model.settings.timestep_parameters['n_timesteps'] = 5 density_timeseries = np.linspace(1, 0.95, 100) - model.materials[2].set_density('macro', density=1.0, density_timeseries=density_timeseries) + model.materials[2].set_density( + 'macro', density=1.0, density_timeseries=density_timeseries) # Convert to a random ray model model.convert_to_random_ray() diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py index 1acc1b0196f..7fe140d5a13 100644 --- a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py @@ -17,6 +17,7 @@ def _cleanup(self): if os.path.exists(f): os.remove(f) + @pytest.mark.parametrize("time_method", ["isotropic", "propagation"]) def test_random_ray_diagonal_stabilization(time_method): @@ -38,7 +39,8 @@ def test_random_ray_diagonal_stabilization(time_method): model.settings.timestep_parameters['n_timesteps'] = 5 density_timeseries = np.linspace(1, 0.95, 100) - model.materials[2].set_density('macro', density=1.0, density_timeseries=density_timeseries) + model.materials[2].set_density( + 'macro', density=1.0, density_timeseries=density_timeseries) # Convert to a random ray model model.convert_to_random_ray() diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_kinetic/test.py index 11a2b30fe87..2037554d295 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_kinetic/test.py @@ -25,6 +25,6 @@ def test_random_ray_time_dependent(time_method): model.settings.timestep_parameters['n_timesteps'] = 5 model.settings.random_ray['time_method'] = time_method model.settings.batches = 400 - model.settings.inactive = 200 + model.settings.inactive = 200 harness = KineticMGXSTestHarness('statepoint.400', 6, model) harness.main() diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py index 56385243ce1..1b082ca6078 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py @@ -15,6 +15,7 @@ def _cleanup(self): if os.path.exists(f): os.remove(f) + @pytest.mark.parametrize("time_method", ["isotropic", "propagation"]) def test_random_ray_k_eff_mesh(time_method): @@ -23,7 +24,7 @@ def test_random_ray_k_eff_mesh(time_method): model.settings.timestep_parameters['n_timesteps'] = 5 model.settings.random_ray['time_method'] = time_method model.settings.batches = 400 - model.settings.inactive = 200 + model.settings.inactive = 200 # The model already has some geometrical subdivisions # up to a 10x10 grid in the moderator region. So, we @@ -35,9 +36,9 @@ def test_random_ray_k_eff_mesh(time_method): mesh.dimension = (dim, dim) mesh.lower_left = (-pitch, -pitch) mesh.upper_right = (pitch, pitch) - + root = model.geometry.root_universe - + model.settings.random_ray['source_region_meshes'] = [(mesh, [root])] harness = KineticMGXSTestHarness('statepoint.400', 6, model) From e621259bbdd301326aefc208fbe25a84b5543e85 Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 6 Jan 2026 12:42:20 -0600 Subject: [PATCH 45/64] autopep8 --- .../random_ray_auto_convert_kinetic/test.py | 20 ++++++++++++------- .../test.py | 4 +++- .../random_ray_k_eff_kinetic/test.py | 2 +- .../random_ray_k_eff_mesh_kinetic/test.py | 7 ++++--- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py index 215fe8e6915..34ed2012b1e 100644 --- a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py @@ -18,12 +18,17 @@ def _cleanup(self): os.remove(f) -@pytest.mark.parametrize("generation_method, time_method", [("material_wise","isotropic"), - ("stochastic_slab","isotropic"), - ("infinite_medium","isotropic"), - ("material_wise","propagation"), - ("stochastic_slab","propagation"), - ("infinite_medium","propagation"), +@pytest.mark.parametrize("generation_method, time_method", [("material_wise", "isotropic"), + ("stochastic_slab", + "isotropic"), + ("infinite_medium", + "isotropic"), + ("material_wise", + "propagation"), + ("stochastic_slab", + "propagation"), + ("infinite_medium", + "propagation"), ]) def test_random_ray_auto_convert(generation_method, time_method): with change_directory(f'{generation_method}/{time_method}'): @@ -41,7 +46,8 @@ def test_random_ray_auto_convert(generation_method, time_method): model.settings.timestep_parameters['n_timesteps'] = 5 density_timeseries = np.linspace(1, 0.95, 100) - model.materials[2].set_density('macro', density=1.0, density_timeseries=density_timeseries) + model.materials[2].set_density( + 'macro', density=1.0, density_timeseries=density_timeseries) # Convert to a random ray model model.convert_to_random_ray() diff --git a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py index 1acc1b0196f..7fe140d5a13 100644 --- a/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py +++ b/tests/regression_tests/random_ray_diagonal_stabilization_kinetic/test.py @@ -17,6 +17,7 @@ def _cleanup(self): if os.path.exists(f): os.remove(f) + @pytest.mark.parametrize("time_method", ["isotropic", "propagation"]) def test_random_ray_diagonal_stabilization(time_method): @@ -38,7 +39,8 @@ def test_random_ray_diagonal_stabilization(time_method): model.settings.timestep_parameters['n_timesteps'] = 5 density_timeseries = np.linspace(1, 0.95, 100) - model.materials[2].set_density('macro', density=1.0, density_timeseries=density_timeseries) + model.materials[2].set_density( + 'macro', density=1.0, density_timeseries=density_timeseries) # Convert to a random ray model model.convert_to_random_ray() diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_kinetic/test.py index 11a2b30fe87..2037554d295 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_kinetic/test.py @@ -25,6 +25,6 @@ def test_random_ray_time_dependent(time_method): model.settings.timestep_parameters['n_timesteps'] = 5 model.settings.random_ray['time_method'] = time_method model.settings.batches = 400 - model.settings.inactive = 200 + model.settings.inactive = 200 harness = KineticMGXSTestHarness('statepoint.400', 6, model) harness.main() diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py index 56385243ce1..1b082ca6078 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py @@ -15,6 +15,7 @@ def _cleanup(self): if os.path.exists(f): os.remove(f) + @pytest.mark.parametrize("time_method", ["isotropic", "propagation"]) def test_random_ray_k_eff_mesh(time_method): @@ -23,7 +24,7 @@ def test_random_ray_k_eff_mesh(time_method): model.settings.timestep_parameters['n_timesteps'] = 5 model.settings.random_ray['time_method'] = time_method model.settings.batches = 400 - model.settings.inactive = 200 + model.settings.inactive = 200 # The model already has some geometrical subdivisions # up to a 10x10 grid in the moderator region. So, we @@ -35,9 +36,9 @@ def test_random_ray_k_eff_mesh(time_method): mesh.dimension = (dim, dim) mesh.lower_left = (-pitch, -pitch) mesh.upper_right = (pitch, pitch) - + root = model.geometry.root_universe - + model.settings.random_ray['source_region_meshes'] = [(mesh, [root])] harness = KineticMGXSTestHarness('statepoint.400', 6, model) From 63d1f6990061b032b12dddd6802063c3ff9f9c21 Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 7 Jan 2026 07:38:20 -0600 Subject: [PATCH 46/64] allow fixed source simulations --- src/settings.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/settings.cpp b/src/settings.cpp index c3bfad37532..9bef59b1bed 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -266,12 +266,6 @@ void get_run_parameters(pugi::xml_node node_base) fatal_error("Unsupported solver selected for kinetic simulation. Kinetic " "simulations currently only support the random ray solver."); } - if (run_mode != RunMode::EIGENVALUE) { - fatal_error( - "Unsupported run mode selected for kinetic simulation. Kinetic " - "simulations currently only support run mode based on an eigenvalue " - "simulation establishing an initial condition."); - } } // Get timestep parameters for kinetic simulations From 98dff827e6fc637872b2b835c95a94364d0cfe64 Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 7 Jan 2026 21:26:23 -0600 Subject: [PATCH 47/64] update mesh kinetic tests --- .../isotropic/results_error_2.dat | 236 ++++++++++++ .../isotropic/results_true_1.dat | 228 ++++++------ .../isotropic/results_true_2.dat | 270 +++++++------- .../isotropic/results_true_3.dat | 282 +++++++------- .../isotropic/results_true_4.dat | 348 ++++++++--------- .../isotropic/results_true_5.dat | 350 +++++++++--------- .../propagation/results_error_2.dat | 236 ++++++++++++ .../propagation/results_true_1.dat | 228 ++++++------ .../propagation/results_true_2.dat | 270 +++++++------- .../propagation/results_true_3.dat | 282 +++++++------- .../propagation/results_true_4.dat | 348 ++++++++--------- .../propagation/results_true_5.dat | 350 +++++++++--------- 12 files changed, 1950 insertions(+), 1478 deletions(-) create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_error_2.dat create mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_error_2.dat diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_error_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_error_2.dat new file mode 100644 index 00000000000..3d87c1ff778 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_error_2.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.841002E+01 +2.340263E+01 +2.539209E+01 +3.224884E+00 +6.179927E+01 +1.910222E+01 +4.345795E+01 +9.443438E+00 +6.461264E+00 +2.087627E-01 +1.572542E+01 +1.236581E+00 +2.958149E+01 +4.375353E+00 +9.580602E-01 +4.589460E-03 +2.331727E+00 +2.718512E-02 +3.771759E+01 +7.113168E+00 +1.255942E+00 +7.887213E-03 +3.056711E+00 +4.671898E-02 +9.755563E+01 +4.758560E+01 +1.145481E+00 +6.560664E-03 +2.787906E+00 +3.886227E-02 +2.112846E+02 +2.232138E+02 +3.224201E-01 +5.198159E-04 +7.978060E-01 +3.182731E-03 +1.123398E+02 +6.311270E+01 +1.523334E+00 +1.160869E-02 +4.237076E+00 +8.981014E-02 +1.130415E+02 +6.389267E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.351354E+01 +1.431862E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116478E+01 +4.856241E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.109112E+01 +8.442486E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.834626E+01 +4.836011E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891192E+02 +1.788363E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.689929E+01 +4.696147E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.902247E+01 +1.741950E+01 +2.183516E+01 +2.384443E+00 +5.314240E+01 +1.412397E+01 +4.083553E+01 +8.337955E+00 +6.069953E+00 +1.842363E-01 +1.477305E+01 +1.091302E+00 +2.914979E+01 +4.248577E+00 +9.449213E-01 +4.464435E-03 +2.299749E+00 +2.644455E-02 +3.706648E+01 +6.869692E+00 +1.234866E+00 +7.624718E-03 +3.005416E+00 +4.516412E-02 +9.764189E+01 +4.766978E+01 +1.147278E+00 +6.581260E-03 +2.792280E+00 +3.898427E-02 +2.155703E+02 +2.323588E+02 +3.288490E-01 +5.407413E-04 +8.137138E-01 +3.310853E-03 +1.141283E+02 +6.513702E+01 +1.543766E+00 +1.192054E-02 +4.293907E+00 +9.222278E-02 +6.827719E+01 +2.331160E+01 +2.541921E+01 +3.231700E+00 +6.186528E+01 +1.914259E+01 +4.341541E+01 +9.424932E+00 +6.474517E+00 +2.096181E-01 +1.575768E+01 +1.241648E+00 +2.957222E+01 +4.372617E+00 +9.605956E-01 +4.613787E-03 +2.337897E+00 +2.732922E-02 +3.770489E+01 +7.108388E+00 +1.259270E+00 +7.929065E-03 +3.064812E+00 +4.696688E-02 +9.756404E+01 +4.759381E+01 +1.148934E+00 +6.600271E-03 +2.796309E+00 +3.909688E-02 +2.114029E+02 +2.234627E+02 +3.234836E-01 +5.232451E-04 +8.004376E-01 +3.203727E-03 +1.123686E+02 +6.314288E+01 +1.527536E+00 +1.167216E-02 +4.248764E+00 +9.030121E-02 +tally 2: +3.727211E-01 +6.946052E-04 +8.048854E-01 +3.239203E-03 +3.094668E-01 +4.788484E-04 +2.194454E-01 +2.407815E-04 +1.708581E-01 +1.459624E-04 +2.305119E-02 +2.656788E-06 +8.000435E-03 +3.200348E-07 +1.273182E-03 +8.104960E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327638E-01 +5.536589E-04 +7.185983E-01 +2.581918E-03 +2.762906E-01 +3.816826E-04 +1.959200E-01 +1.919231E-04 +1.525414E-01 +1.163444E-04 +2.058001E-02 +2.117684E-06 +7.142754E-03 +2.550947E-07 +1.136691E-03 +6.460334E-09 +3.721891E-01 +6.926238E-04 +8.037366E-01 +3.229963E-03 +3.090251E-01 +4.774825E-04 +2.191322E-01 +2.400946E-04 +1.706142E-01 +1.455461E-04 +2.301829E-02 +2.649209E-06 +7.989016E-03 +3.191219E-07 +1.271365E-03 +8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat index 3b5aea51fd9..25731b9a04d 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835753E+01 +6.835752E+01 2.336672E+01 -2.537239E+01 -3.219878E+00 -6.175132E+01 +2.537238E+01 +3.219879E+00 +6.175130E+01 1.907257E+01 -4.341877E+01 -9.426414E+00 -6.455425E+00 +4.341875E+01 +9.426410E+00 +6.455423E+00 2.083854E-01 1.571121E+01 -1.234347E+00 +1.234346E+00 2.955121E+01 -4.366402E+00 -9.570792E-01 -4.580066E-03 -2.329339E+00 -2.712948E-02 -3.767888E+01 -7.098576E+00 +4.366400E+00 +9.570789E-01 +4.580063E-03 +2.329338E+00 +2.712946E-02 +3.767887E+01 +7.098572E+00 1.254652E+00 -7.871022E-03 -3.053572E+00 -4.662307E-02 -9.745115E+01 -4.748373E+01 +7.871018E-03 +3.053571E+00 +4.662305E-02 +9.745113E+01 +4.748370E+01 1.144254E+00 -6.546618E-03 -2.784920E+00 -3.877907E-02 -2.110520E+02 -2.227225E+02 +6.546614E-03 +2.784919E+00 +3.877905E-02 +2.110519E+02 +2.227224E+02 3.220667E-01 -5.186770E-04 -7.969316E-01 -3.175758E-03 +5.186767E-04 +7.969314E-01 +3.175756E-03 1.122226E+02 -6.298107E+01 -1.521758E+00 -1.158468E-02 -4.232692E+00 -8.962439E-02 -1.129470E+02 -6.378585E+01 +6.298103E+01 +1.521757E+00 +1.158467E-02 +4.232690E+00 +8.962434E-02 +1.129469E+02 +6.378582E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.346407E+01 +5.346406E+01 1.429216E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.113247E+01 -4.846178E+00 +3.113246E+01 +4.846176E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.104801E+01 -8.424780E+00 +4.104800E+01 +8.424776E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.824005E+01 -4.825571E+01 +9.824002E+01 +4.825568E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.889103E+02 -1.784413E+02 +1.889102E+02 +1.784412E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.679730E+01 -4.686267E+01 +9.679727E+01 +4.686264E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.897828E+01 +5.897826E+01 1.739342E+01 -2.181862E+01 +2.181861E+01 2.380831E+00 -5.310215E+01 +5.310214E+01 1.410257E+01 -4.079874E+01 -8.322938E+00 -6.064469E+00 +4.079873E+01 +8.322934E+00 +6.064468E+00 1.839035E-01 -1.475971E+01 +1.475970E+01 1.089331E+00 -2.912006E+01 -4.239913E+00 -9.439565E-01 -4.455323E-03 -2.297401E+00 -2.639057E-02 -3.702869E+01 -6.855691E+00 +2.912005E+01 +4.239911E+00 +9.439562E-01 +4.455320E-03 +2.297400E+00 +2.639056E-02 +3.702868E+01 +6.855687E+00 1.233605E+00 -7.609156E-03 -3.002348E+00 -4.507194E-02 -9.753766E+01 -4.756805E+01 +7.609152E-03 +3.002347E+00 +4.507192E-02 +9.753763E+01 +4.756803E+01 1.146053E+00 -6.567213E-03 -2.789298E+00 -3.890107E-02 -2.153332E+02 -2.318479E+02 -3.284890E-01 -5.395580E-04 -8.128230E-01 -3.303608E-03 +6.567210E-03 +2.789297E+00 +3.890105E-02 +2.153331E+02 +2.318478E+02 +3.284889E-01 +5.395577E-04 +8.128227E-01 +3.303606E-03 1.140093E+02 -6.500131E+01 -1.542171E+00 +6.500127E+01 +1.542170E+00 1.189591E-02 -4.289470E+00 -9.203227E-02 -6.822486E+01 -2.327587E+01 -2.539951E+01 -3.226691E+00 -6.181733E+01 -1.911292E+01 -4.337628E+01 -9.407949E+00 -6.468668E+00 -2.092395E-01 +4.289468E+00 +9.203221E-02 +6.822483E+01 +2.327586E+01 +2.539950E+01 +3.226689E+00 +6.181730E+01 +1.911291E+01 +4.337627E+01 +9.407943E+00 +6.468666E+00 +2.092394E-01 1.574344E+01 -1.239406E+00 -2.954196E+01 -4.363673E+00 -9.596121E-01 -4.604345E-03 -2.335504E+00 -2.727329E-02 -3.766621E+01 -7.093810E+00 +1.239405E+00 +2.954195E+01 +4.363671E+00 +9.596119E-01 +4.604342E-03 +2.335503E+00 +2.727327E-02 +3.766620E+01 +7.093806E+00 1.257977E+00 -7.912792E-03 -3.061665E+00 -4.687049E-02 -9.745956E+01 -4.749193E+01 +7.912788E-03 +3.061664E+00 +4.687047E-02 +9.745954E+01 +4.749190E+01 1.147703E+00 -6.586141E-03 -2.793315E+00 -3.901318E-02 +6.586137E-03 +2.793314E+00 +3.901316E-02 2.111701E+02 -2.229708E+02 +2.229707E+02 3.231290E-01 -5.220986E-04 -7.995602E-01 -3.196707E-03 -1.122514E+02 -6.301118E+01 +5.220983E-04 +7.995600E-01 +3.196706E-03 +1.122513E+02 +6.301114E+01 1.525955E+00 1.164801E-02 -4.244367E+00 -9.011440E-02 +4.244366E+00 +9.011434E-02 tally 2: 3.727210E-01 6.946049E-04 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat index db723684684..3d87c1ff778 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.841005E+01 -2.340265E+01 -2.539210E+01 -3.224885E+00 -6.179930E+01 +6.841002E+01 +2.340263E+01 +2.539209E+01 +3.224884E+00 +6.179927E+01 1.910222E+01 -4.345797E+01 -9.443447E+00 -6.461267E+00 -2.087628E-01 -1.572543E+01 -1.236582E+00 -2.958150E+01 -4.375358E+00 -9.580607E-01 -4.589465E-03 -2.331728E+00 -2.718515E-02 -3.771761E+01 -7.113176E+00 +4.345795E+01 +9.443438E+00 +6.461264E+00 +2.087627E-01 +1.572542E+01 +1.236581E+00 +2.958149E+01 +4.375353E+00 +9.580602E-01 +4.589460E-03 +2.331727E+00 +2.718512E-02 +3.771759E+01 +7.113168E+00 1.255942E+00 -7.887221E-03 -3.056712E+00 -4.671902E-02 -9.755568E+01 -4.758565E+01 -1.145482E+00 -6.560671E-03 -2.787908E+00 -3.886231E-02 -2.112847E+02 -2.232140E+02 -3.224203E-01 -5.198164E-04 -7.978065E-01 -3.182734E-03 -1.123399E+02 -6.311276E+01 -1.523335E+00 -1.160870E-02 -4.237078E+00 -8.981024E-02 -1.130416E+02 -6.389274E+01 +7.887213E-03 +3.056711E+00 +4.671898E-02 +9.755563E+01 +4.758560E+01 +1.145481E+00 +6.560664E-03 +2.787906E+00 +3.886227E-02 +2.112846E+02 +2.232138E+02 +3.224201E-01 +5.198159E-04 +7.978060E-01 +3.182731E-03 +1.123398E+02 +6.311270E+01 +1.523334E+00 +1.160869E-02 +4.237076E+00 +8.981014E-02 +1.130415E+02 +6.389267E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.351357E+01 -1.431864E+01 +5.351354E+01 +1.431862E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.116479E+01 -4.856246E+00 +3.116478E+01 +4.856241E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.109114E+01 -8.442495E+00 +4.109112E+01 +8.442486E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.834631E+01 -4.836016E+01 +9.834626E+01 +4.836011E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.891193E+02 -1.788365E+02 +1.891192E+02 +1.788363E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.689934E+01 -4.696152E+01 +9.689929E+01 +4.696147E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.902249E+01 -1.741951E+01 +5.902247E+01 +1.741950E+01 2.183516E+01 -2.384444E+00 -5.314242E+01 +2.384443E+00 +5.314240E+01 1.412397E+01 -4.083555E+01 -8.337963E+00 -6.069956E+00 -1.842364E-01 -1.477306E+01 -1.091303E+00 -2.914981E+01 -4.248581E+00 -9.449218E-01 -4.464439E-03 -2.299750E+00 -2.644457E-02 -3.706650E+01 -6.869699E+00 +4.083553E+01 +8.337955E+00 +6.069953E+00 +1.842363E-01 +1.477305E+01 +1.091302E+00 +2.914979E+01 +4.248577E+00 +9.449213E-01 +4.464435E-03 +2.299749E+00 +2.644455E-02 +3.706648E+01 +6.869692E+00 1.234866E+00 -7.624725E-03 -3.005418E+00 -4.516416E-02 -9.764194E+01 -4.766982E+01 -1.147279E+00 -6.581267E-03 -2.792281E+00 -3.898431E-02 -2.155704E+02 -2.323591E+02 -3.288491E-01 -5.407419E-04 -8.137142E-01 -3.310856E-03 -1.141284E+02 -6.513710E+01 -1.543767E+00 -1.192055E-02 -4.293910E+00 -9.222288E-02 -6.827724E+01 -2.331163E+01 -2.541923E+01 -3.231703E+00 -6.186532E+01 -1.914261E+01 -4.341544E+01 -9.424942E+00 -6.474521E+00 -2.096183E-01 -1.575769E+01 -1.241649E+00 -2.957223E+01 -4.372622E+00 -9.605961E-01 -4.613792E-03 -2.337899E+00 -2.732925E-02 -3.770491E+01 -7.108396E+00 -1.259271E+00 -7.929072E-03 -3.064813E+00 -4.696693E-02 -9.756409E+01 -4.759386E+01 +7.624718E-03 +3.005416E+00 +4.516412E-02 +9.764189E+01 +4.766978E+01 +1.147278E+00 +6.581260E-03 +2.792280E+00 +3.898427E-02 +2.155703E+02 +2.323588E+02 +3.288490E-01 +5.407413E-04 +8.137138E-01 +3.310853E-03 +1.141283E+02 +6.513702E+01 +1.543766E+00 +1.192054E-02 +4.293907E+00 +9.222278E-02 +6.827719E+01 +2.331160E+01 +2.541921E+01 +3.231700E+00 +6.186528E+01 +1.914259E+01 +4.341541E+01 +9.424932E+00 +6.474517E+00 +2.096181E-01 +1.575768E+01 +1.241648E+00 +2.957222E+01 +4.372617E+00 +9.605956E-01 +4.613787E-03 +2.337897E+00 +2.732922E-02 +3.770489E+01 +7.108388E+00 +1.259270E+00 +7.929065E-03 +3.064812E+00 +4.696688E-02 +9.756404E+01 +4.759381E+01 1.148934E+00 -6.600277E-03 -2.796311E+00 -3.909692E-02 -2.114030E+02 -2.234629E+02 -3.234838E-01 -5.232457E-04 -8.004381E-01 -3.203731E-03 -1.123687E+02 -6.314294E+01 -1.527537E+00 -1.167217E-02 -4.248767E+00 -9.030131E-02 +6.600271E-03 +2.796309E+00 +3.909688E-02 +2.114029E+02 +2.234627E+02 +3.234836E-01 +5.232451E-04 +8.004376E-01 +3.203727E-03 +1.123686E+02 +6.314288E+01 +1.527536E+00 +1.167216E-02 +4.248764E+00 +9.030121E-02 tally 2: 3.727211E-01 6.946052E-04 @@ -217,7 +217,7 @@ tally 2: 7.142754E-03 2.550947E-07 1.136691E-03 -6.460335E-09 +6.460334E-09 3.721891E-01 6.926238E-04 8.037366E-01 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat index bac8902424a..f5d2338864e 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.846312E+01 -2.343897E+01 -2.541202E+01 -3.229945E+00 -6.184776E+01 -1.913220E+01 -4.349759E+01 -9.460674E+00 -6.467170E+00 -2.091445E-01 -1.573980E+01 -1.238843E+00 -2.961211E+01 -4.384415E+00 -9.590524E-01 -4.598971E-03 -2.334141E+00 -2.724146E-02 -3.775673E+01 -7.127940E+00 -1.257246E+00 -7.903602E-03 -3.059885E+00 -4.681606E-02 -9.766123E+01 -4.768868E+01 -1.146721E+00 -6.574876E-03 -2.790924E+00 -3.894646E-02 -2.115196E+02 -2.237105E+02 -3.227770E-01 -5.209674E-04 -7.986892E-01 -3.189781E-03 -1.124582E+02 -6.324576E+01 -1.524926E+00 -1.163296E-02 -4.241504E+00 -8.999793E-02 +6.846308E+01 +2.343895E+01 +2.541200E+01 +3.229943E+00 +6.184772E+01 +1.913218E+01 +4.349756E+01 +9.460661E+00 +6.467166E+00 +2.091442E-01 +1.573979E+01 +1.238841E+00 +2.961209E+01 +4.384409E+00 +9.590517E-01 +4.598964E-03 +2.334140E+00 +2.724142E-02 +3.775670E+01 +7.127929E+00 +1.257245E+00 +7.903591E-03 +3.059883E+00 +4.681599E-02 +9.766116E+01 +4.768861E+01 +1.146720E+00 +6.574867E-03 +2.790922E+00 +3.894640E-02 +2.115194E+02 +2.237102E+02 +3.227768E-01 +5.209666E-04 +7.986886E-01 +3.189776E-03 +1.124581E+02 +6.324566E+01 +1.524925E+00 +1.163294E-02 +4.241501E+00 +8.999779E-02 1.131371E+02 -6.400083E+01 +6.400074E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.356358E+01 -1.434541E+01 +5.356354E+01 +1.434539E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.119744E+01 -4.866426E+00 +3.119742E+01 +4.866419E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.113471E+01 -8.460406E+00 +4.113468E+01 +8.460394E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.845360E+01 -4.846573E+01 +9.845352E+01 +4.846566E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.893303E+02 -1.792356E+02 +1.893301E+02 +1.792354E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.700227E+01 -4.706134E+01 +9.700220E+01 +4.706127E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.906717E+01 -1.744589E+01 -2.185188E+01 -2.388096E+00 -5.318310E+01 -1.414560E+01 -4.087275E+01 -8.353159E+00 -6.075499E+00 -1.845731E-01 -1.478655E+01 -1.093297E+00 -2.917987E+01 -4.257348E+00 -9.458970E-01 -4.473659E-03 -2.302124E+00 -2.649919E-02 -3.710470E+01 -6.883867E+00 -1.236141E+00 -7.640471E-03 -3.008519E+00 -4.525743E-02 -9.774725E+01 -4.777270E+01 -1.148516E+00 -6.595474E-03 -2.795293E+00 -3.906847E-02 -2.158098E+02 -2.328754E+02 -3.292126E-01 -5.419377E-04 -8.146135E-01 -3.318178E-03 -1.142484E+02 -6.527422E+01 -1.545377E+00 -1.194543E-02 -4.298389E+00 -9.241537E-02 -6.833016E+01 -2.334778E+01 -2.543915E+01 -3.236770E+00 -6.191381E+01 -1.917263E+01 -4.345500E+01 -9.442129E+00 -6.480434E+00 -2.100014E-01 -1.577208E+01 -1.243919E+00 -2.960282E+01 -4.381672E+00 -9.615903E-01 -4.623347E-03 -2.340318E+00 -2.738585E-02 -3.774401E+01 -7.123146E+00 -1.260578E+00 -7.945537E-03 -3.067994E+00 -4.706446E-02 -9.766964E+01 -4.769689E+01 +5.906713E+01 +1.744587E+01 +2.185187E+01 +2.388094E+00 +5.318307E+01 +1.414559E+01 +4.087272E+01 +8.353147E+00 +6.075495E+00 +1.845728E-01 +1.478654E+01 +1.093296E+00 +2.917985E+01 +4.257342E+00 +9.458963E-01 +4.473653E-03 +2.302122E+00 +2.649915E-02 +3.710467E+01 +6.883857E+00 +1.236140E+00 +7.640460E-03 +3.008517E+00 +4.525737E-02 +9.774718E+01 +4.777263E+01 +1.148515E+00 +6.595464E-03 +2.795291E+00 +3.906841E-02 +2.158096E+02 +2.328751E+02 +3.292123E-01 +5.419369E-04 +8.146129E-01 +3.318173E-03 +1.142483E+02 +6.527411E+01 +1.545376E+00 +1.194541E-02 +4.298386E+00 +9.241523E-02 +6.833010E+01 +2.334774E+01 +2.543913E+01 +3.236766E+00 +6.191375E+01 +1.917260E+01 +4.345497E+01 +9.442115E+00 +6.480429E+00 +2.100011E-01 +1.577207E+01 +1.243917E+00 +2.960280E+01 +4.381666E+00 +9.615896E-01 +4.623340E-03 +2.340316E+00 +2.738581E-02 +3.774398E+01 +7.123136E+00 +1.260577E+00 +7.945526E-03 +3.067991E+00 +4.706439E-02 +9.766957E+01 +4.769682E+01 1.150177E+00 -6.614567E-03 -2.799336E+00 -3.918157E-02 -2.116380E+02 -2.239600E+02 -3.238418E-01 -5.244043E-04 -8.013238E-01 -3.210825E-03 -1.124870E+02 -6.327601E+01 -1.529133E+00 -1.169657E-02 -4.253205E+00 -9.049007E-02 +6.614557E-03 +2.799334E+00 +3.918151E-02 +2.116379E+02 +2.239597E+02 +3.238415E-01 +5.244036E-04 +8.013232E-01 +3.210820E-03 +1.124869E+02 +6.327591E+01 +1.529132E+00 +1.169655E-02 +4.253202E+00 +9.048993E-02 tally 2: 3.727212E-01 6.946055E-04 @@ -182,7 +182,7 @@ tally 2: 1.459642E-04 2.305151E-02 2.656862E-06 -8.000705E-03 +8.000704E-03 3.200564E-07 1.273273E-03 8.106118E-09 @@ -223,7 +223,7 @@ tally 2: 8.037371E-01 3.229967E-03 3.090254E-01 -4.774834E-04 +4.774833E-04 2.191328E-01 2.400960E-04 1.706153E-01 @@ -233,4 +233,4 @@ tally 2: 7.989285E-03 3.191434E-07 1.271455E-03 -8.082995E-09 +8.082994E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat index 2625ac2a347..c40bfbeff1b 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.851755E+01 -2.347625E+01 -2.543244E+01 -3.235138E+00 -6.189746E+01 -1.916296E+01 -4.353807E+01 -9.478290E+00 -6.473201E+00 -2.095347E-01 -1.575448E+01 -1.241154E+00 -2.964329E+01 -4.393655E+00 -9.600630E-01 -4.608668E-03 -2.336601E+00 -2.729890E-02 -3.779660E+01 -7.143001E+00 -1.258574E+00 -7.920313E-03 -3.063118E+00 -4.691505E-02 -9.776873E+01 -4.779372E+01 -1.147984E+00 -6.589359E-03 -2.793996E+00 -3.903225E-02 -2.117587E+02 -2.242166E+02 -3.231403E-01 -5.221406E-04 -7.995881E-01 -3.196965E-03 -1.125788E+02 -6.338145E+01 -1.526548E+00 -1.165771E-02 -4.246015E+00 -9.018945E-02 -1.132350E+02 -6.411155E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361464E+01 -1.437278E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123071E+01 -4.876810E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117909E+01 -8.478672E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856285E+01 -4.857335E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895450E+02 -1.796425E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710717E+01 -4.716318E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911301E+01 -1.747298E+01 -2.186903E+01 -2.391846E+00 -5.322484E+01 -1.416782E+01 -4.091074E+01 -8.368698E+00 -6.081162E+00 -1.849173E-01 -1.480033E+01 -1.095336E+00 -2.921050E+01 -4.266292E+00 -9.468909E-01 -4.483065E-03 -2.304543E+00 -2.655491E-02 -3.714364E+01 -6.898322E+00 -1.237440E+00 -7.656535E-03 -3.011680E+00 -4.535258E-02 -9.785450E+01 -4.787760E+01 -1.149777E+00 -6.609958E-03 -2.798361E+00 -3.915427E-02 -2.160535E+02 -2.334017E+02 -3.295826E-01 -5.431567E-04 -8.155291E-01 -3.325642E-03 -1.143708E+02 -6.541413E+01 -1.547019E+00 -1.197082E-02 -4.302955E+00 -9.261180E-02 -6.838444E+01 -2.338489E+01 -2.545958E+01 -3.241970E+00 -6.196352E+01 -1.920343E+01 -4.349543E+01 -9.459705E+00 -6.486476E+00 -2.103931E-01 -1.578678E+01 -1.246239E+00 -2.963399E+01 -4.390905E+00 -9.626034E-01 -4.633094E-03 -2.342784E+00 -2.744358E-02 -3.778386E+01 -7.138194E+00 -1.261909E+00 -7.962333E-03 -3.071235E+00 -4.716395E-02 -9.777713E+01 -4.780194E+01 -1.151443E+00 -6.629136E-03 -2.802417E+00 -3.926787E-02 -2.118773E+02 -2.244667E+02 -3.242063E-01 -5.255855E-04 -8.022257E-01 -3.218057E-03 -1.126076E+02 -6.341177E+01 -1.530759E+00 -1.172147E-02 -4.257730E+00 -9.068268E-02 +6.851748E+01 +2.347622E+01 +2.543241E+01 +3.235134E+00 +6.189740E+01 +1.916293E+01 +4.353803E+01 +9.478273E+00 +6.473195E+00 +2.095344E-01 +1.575446E+01 +1.241152E+00 +2.964327E+01 +4.393647E+00 +9.600620E-01 +4.608659E-03 +2.336599E+00 +2.729885E-02 +3.779657E+01 +7.142988E+00 +1.258573E+00 +7.920299E-03 +3.063115E+00 +4.691496E-02 +9.776864E+01 +4.779363E+01 +1.147982E+00 +6.589347E-03 +2.793994E+00 +3.903218E-02 +2.117585E+02 +2.242162E+02 +3.231400E-01 +5.221396E-04 +7.995873E-01 +3.196958E-03 +1.125787E+02 +6.338133E+01 +1.526546E+00 +1.165769E-02 +4.246011E+00 +9.018927E-02 +1.132349E+02 +6.411143E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361459E+01 +1.437275E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123068E+01 +4.876801E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117905E+01 +8.478656E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856276E+01 +4.857326E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895448E+02 +1.796421E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710707E+01 +4.716308E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911296E+01 +1.747295E+01 +2.186901E+01 +2.391843E+00 +5.322479E+01 +1.416780E+01 +4.091071E+01 +8.368683E+00 +6.081156E+00 +1.849170E-01 +1.480032E+01 +1.095334E+00 +2.921048E+01 +4.266284E+00 +9.468900E-01 +4.483057E-03 +2.304541E+00 +2.655486E-02 +3.714360E+01 +6.898309E+00 +1.237438E+00 +7.656521E-03 +3.011678E+00 +4.535250E-02 +9.785441E+01 +4.787751E+01 +1.149776E+00 +6.609946E-03 +2.798358E+00 +3.915419E-02 +2.160533E+02 +2.334013E+02 +3.295823E-01 +5.431557E-04 +8.155283E-01 +3.325636E-03 +1.143707E+02 +6.541399E+01 +1.547017E+00 +1.197080E-02 +4.302951E+00 +9.261162E-02 +6.838436E+01 +2.338484E+01 +2.545955E+01 +3.241965E+00 +6.196345E+01 +1.920339E+01 +4.349538E+01 +9.459686E+00 +6.486469E+00 +2.103927E-01 +1.578677E+01 +1.246237E+00 +2.963397E+01 +4.390897E+00 +9.626025E-01 +4.633085E-03 +2.342782E+00 +2.744353E-02 +3.778382E+01 +7.138181E+00 +1.261908E+00 +7.962318E-03 +3.071232E+00 +4.716386E-02 +9.777704E+01 +4.780184E+01 +1.151442E+00 +6.629123E-03 +2.802415E+00 +3.926779E-02 +2.118771E+02 +2.244662E+02 +3.242060E-01 +5.255844E-04 +8.022250E-01 +3.218051E-03 +1.126075E+02 +6.341165E+01 +1.530758E+00 +1.172145E-02 +4.257726E+00 +9.068250E-02 tally 2: 3.727213E-01 6.946060E-04 @@ -183,9 +183,9 @@ tally 2: 2.305197E-02 2.656966E-06 8.001084E-03 -3.200868E-07 +3.200867E-07 1.273400E-03 -8.107736E-09 +8.107735E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -214,10 +214,10 @@ tally 2: 1.163478E-04 2.058070E-02 2.117825E-06 -7.143331E-03 +7.143330E-03 2.551359E-07 1.136885E-03 -6.462535E-09 +6.462534E-09 3.721894E-01 6.926247E-04 8.037378E-01 @@ -231,6 +231,6 @@ tally 2: 2.301907E-02 2.649387E-06 7.989664E-03 -3.191737E-07 +3.191736E-07 1.271582E-03 -8.084607E-09 +8.084606E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat index 5d21c6febfc..934aa0bb4e0 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.857321E+01 -2.351441E+01 -2.545331E+01 -3.240452E+00 -6.194827E+01 -1.919443E+01 -4.357935E+01 -9.496270E+00 -6.479351E+00 -2.099331E-01 -1.576944E+01 -1.243514E+00 -2.967503E+01 -4.403069E+00 -9.610914E-01 -4.618547E-03 -2.339104E+00 -2.735741E-02 -3.783717E+01 -7.158344E+00 -1.259926E+00 -7.937337E-03 -3.066408E+00 -4.701588E-02 -9.787805E+01 -4.790066E+01 -1.149267E+00 -6.604105E-03 -2.797121E+00 -3.911960E-02 -2.120018E+02 -2.247317E+02 -3.235096E-01 -5.233348E-04 -8.005019E-01 -3.204276E-03 -1.127015E+02 -6.351966E+01 -1.528198E+00 -1.168293E-02 -4.250605E+00 -9.038454E-02 -1.133348E+02 -6.422471E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366670E+01 -1.440070E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126455E+01 -4.887386E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122424E+01 -8.497275E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867395E+01 -4.868292E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897633E+02 -1.800565E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721388E+01 -4.726689E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.915992E+01 -1.750072E+01 -2.188657E+01 -2.395685E+00 -5.326754E+01 -1.419056E+01 -4.094949E+01 -8.384559E+00 -6.086937E+00 -1.852687E-01 -1.481439E+01 -1.097417E+00 -2.924168E+01 -4.275405E+00 -9.479024E-01 -4.492648E-03 -2.307005E+00 -2.661167E-02 -3.718326E+01 -6.913048E+00 -1.238761E+00 -7.672900E-03 -3.014897E+00 -4.544952E-02 -9.796358E+01 -4.798440E+01 -1.151059E+00 -6.624706E-03 -2.801481E+00 -3.924163E-02 -2.163013E+02 -2.339374E+02 -3.299589E-01 -5.443975E-04 -8.164601E-01 -3.333239E-03 -1.144953E+02 -6.555663E+01 -1.548689E+00 -1.199669E-02 -4.307601E+00 -9.281190E-02 -6.843995E+01 -2.342287E+01 -2.548046E+01 -3.247292E+00 -6.201435E+01 -1.923495E+01 -4.353665E+01 -9.477643E+00 -6.492636E+00 -2.107930E-01 -1.580178E+01 -1.248607E+00 -2.966572E+01 -4.400311E+00 -9.636344E-01 -4.643024E-03 -2.345293E+00 -2.750240E-02 -3.782441E+01 -7.153523E+00 -1.263264E+00 -7.979443E-03 -3.074533E+00 -4.726529E-02 -9.788645E+01 -4.790889E+01 -1.152731E+00 -6.643969E-03 -2.805551E+00 -3.935573E-02 -2.121205E+02 -2.249823E+02 -3.245768E-01 -5.267876E-04 -8.031427E-01 -3.225417E-03 -1.127304E+02 -6.355006E+01 -1.532415E+00 -1.174683E-02 -4.262334E+00 -9.087889E-02 +6.857313E+01 +2.351436E+01 +2.545329E+01 +3.240447E+00 +6.194820E+01 +1.919440E+01 +4.357930E+01 +9.496249E+00 +6.479343E+00 +2.099326E-01 +1.576943E+01 +1.243511E+00 +2.967500E+01 +4.403058E+00 +9.610902E-01 +4.618536E-03 +2.339101E+00 +2.735735E-02 +3.783713E+01 +7.158328E+00 +1.259925E+00 +7.937318E-03 +3.066405E+00 +4.701577E-02 +9.787794E+01 +4.790055E+01 +1.149266E+00 +6.604089E-03 +2.797118E+00 +3.911950E-02 +2.120015E+02 +2.247312E+02 +3.235092E-01 +5.233335E-04 +8.005010E-01 +3.204269E-03 +1.127013E+02 +6.351950E+01 +1.528196E+00 +1.168290E-02 +4.250600E+00 +9.038432E-02 +1.133347E+02 +6.422456E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366664E+01 +1.440067E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126452E+01 +4.887375E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122419E+01 +8.497255E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867383E+01 +4.868280E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897631E+02 +1.800561E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721376E+01 +4.726677E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915985E+01 +1.750069E+01 +2.188655E+01 +2.395681E+00 +5.326748E+01 +1.419053E+01 +4.094945E+01 +8.384540E+00 +6.086930E+00 +1.852683E-01 +1.481437E+01 +1.097415E+00 +2.924165E+01 +4.275395E+00 +9.479013E-01 +4.492638E-03 +2.307002E+00 +2.661161E-02 +3.718322E+01 +6.913032E+00 +1.238760E+00 +7.672882E-03 +3.014894E+00 +4.544942E-02 +9.796347E+01 +4.798428E+01 +1.151057E+00 +6.624691E-03 +2.801478E+00 +3.924154E-02 +2.163011E+02 +2.339368E+02 +3.299585E-01 +5.443962E-04 +8.164591E-01 +3.333231E-03 +1.144952E+02 +6.555647E+01 +1.548688E+00 +1.199666E-02 +4.307596E+00 +9.281167E-02 +6.843986E+01 +2.342281E+01 +2.548043E+01 +3.247285E+00 +6.201427E+01 +1.923491E+01 +4.353660E+01 +9.477621E+00 +6.492628E+00 +2.107925E-01 +1.580176E+01 +1.248604E+00 +2.966568E+01 +4.400301E+00 +9.636332E-01 +4.643013E-03 +2.345290E+00 +2.750234E-02 +3.782436E+01 +7.153506E+00 +1.263263E+00 +7.979425E-03 +3.074529E+00 +4.726518E-02 +9.788634E+01 +4.790877E+01 +1.152730E+00 +6.643954E-03 +2.805548E+00 +3.935564E-02 +2.121203E+02 +2.249818E+02 +3.245765E-01 +5.267864E-04 +8.031417E-01 +3.225410E-03 +1.127302E+02 +6.354990E+01 +1.532413E+00 +1.174680E-02 +4.262329E+00 +9.087867E-02 tally 2: 3.727215E-01 6.946067E-04 @@ -182,10 +182,10 @@ tally 2: 1.459700E-04 2.305255E-02 2.657101E-06 -8.001573E-03 -3.201259E-07 +8.001572E-03 +3.201258E-07 1.273562E-03 -8.109801E-09 +8.109799E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -216,8 +216,8 @@ tally 2: 2.117932E-06 7.143764E-03 2.551668E-07 -1.137029E-03 -6.464170E-09 +1.137028E-03 +6.464168E-09 3.721896E-01 6.926253E-04 8.037386E-01 @@ -230,7 +230,7 @@ tally 2: 1.455537E-04 2.301965E-02 2.649522E-06 -7.990152E-03 +7.990151E-03 3.192126E-07 1.271744E-03 -8.086665E-09 +8.086663E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_error_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_error_2.dat new file mode 100644 index 00000000000..3d87c1ff778 --- /dev/null +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_error_2.dat @@ -0,0 +1,236 @@ +k-combined: +1.311387E+00 6.434473E-04 +tally 1: +6.841002E+01 +2.340263E+01 +2.539209E+01 +3.224884E+00 +6.179927E+01 +1.910222E+01 +4.345795E+01 +9.443438E+00 +6.461264E+00 +2.087627E-01 +1.572542E+01 +1.236581E+00 +2.958149E+01 +4.375353E+00 +9.580602E-01 +4.589460E-03 +2.331727E+00 +2.718512E-02 +3.771759E+01 +7.113168E+00 +1.255942E+00 +7.887213E-03 +3.056711E+00 +4.671898E-02 +9.755563E+01 +4.758560E+01 +1.145481E+00 +6.560664E-03 +2.787906E+00 +3.886227E-02 +2.112846E+02 +2.232138E+02 +3.224201E-01 +5.198159E-04 +7.978060E-01 +3.182731E-03 +1.123398E+02 +6.311270E+01 +1.523334E+00 +1.160869E-02 +4.237076E+00 +8.981014E-02 +1.130415E+02 +6.389267E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.351354E+01 +1.431862E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116478E+01 +4.856241E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.109112E+01 +8.442486E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.834626E+01 +4.836011E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891192E+02 +1.788363E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.689929E+01 +4.696147E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.902247E+01 +1.741950E+01 +2.183516E+01 +2.384443E+00 +5.314240E+01 +1.412397E+01 +4.083553E+01 +8.337955E+00 +6.069953E+00 +1.842363E-01 +1.477305E+01 +1.091302E+00 +2.914979E+01 +4.248577E+00 +9.449213E-01 +4.464435E-03 +2.299749E+00 +2.644455E-02 +3.706648E+01 +6.869692E+00 +1.234866E+00 +7.624718E-03 +3.005416E+00 +4.516412E-02 +9.764189E+01 +4.766978E+01 +1.147278E+00 +6.581260E-03 +2.792280E+00 +3.898427E-02 +2.155703E+02 +2.323588E+02 +3.288490E-01 +5.407413E-04 +8.137138E-01 +3.310853E-03 +1.141283E+02 +6.513702E+01 +1.543766E+00 +1.192054E-02 +4.293907E+00 +9.222278E-02 +6.827719E+01 +2.331160E+01 +2.541921E+01 +3.231700E+00 +6.186528E+01 +1.914259E+01 +4.341541E+01 +9.424932E+00 +6.474517E+00 +2.096181E-01 +1.575768E+01 +1.241648E+00 +2.957222E+01 +4.372617E+00 +9.605956E-01 +4.613787E-03 +2.337897E+00 +2.732922E-02 +3.770489E+01 +7.108388E+00 +1.259270E+00 +7.929065E-03 +3.064812E+00 +4.696688E-02 +9.756404E+01 +4.759381E+01 +1.148934E+00 +6.600271E-03 +2.796309E+00 +3.909688E-02 +2.114029E+02 +2.234627E+02 +3.234836E-01 +5.232451E-04 +8.004376E-01 +3.203727E-03 +1.123686E+02 +6.314288E+01 +1.527536E+00 +1.167216E-02 +4.248764E+00 +9.030121E-02 +tally 2: +3.727211E-01 +6.946052E-04 +8.048854E-01 +3.239203E-03 +3.094668E-01 +4.788484E-04 +2.194454E-01 +2.407815E-04 +1.708581E-01 +1.459624E-04 +2.305119E-02 +2.656788E-06 +8.000435E-03 +3.200348E-07 +1.273182E-03 +8.104960E-09 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.327638E-01 +5.536589E-04 +7.185983E-01 +2.581918E-03 +2.762906E-01 +3.816826E-04 +1.959200E-01 +1.919231E-04 +1.525414E-01 +1.163444E-04 +2.058001E-02 +2.117684E-06 +7.142754E-03 +2.550947E-07 +1.136691E-03 +6.460334E-09 +3.721891E-01 +6.926238E-04 +8.037366E-01 +3.229963E-03 +3.090251E-01 +4.774825E-04 +2.191322E-01 +2.400946E-04 +1.706142E-01 +1.455461E-04 +2.301829E-02 +2.649209E-06 +7.989016E-03 +3.191219E-07 +1.271365E-03 +8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat index 3b5aea51fd9..25731b9a04d 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835753E+01 +6.835752E+01 2.336672E+01 -2.537239E+01 -3.219878E+00 -6.175132E+01 +2.537238E+01 +3.219879E+00 +6.175130E+01 1.907257E+01 -4.341877E+01 -9.426414E+00 -6.455425E+00 +4.341875E+01 +9.426410E+00 +6.455423E+00 2.083854E-01 1.571121E+01 -1.234347E+00 +1.234346E+00 2.955121E+01 -4.366402E+00 -9.570792E-01 -4.580066E-03 -2.329339E+00 -2.712948E-02 -3.767888E+01 -7.098576E+00 +4.366400E+00 +9.570789E-01 +4.580063E-03 +2.329338E+00 +2.712946E-02 +3.767887E+01 +7.098572E+00 1.254652E+00 -7.871022E-03 -3.053572E+00 -4.662307E-02 -9.745115E+01 -4.748373E+01 +7.871018E-03 +3.053571E+00 +4.662305E-02 +9.745113E+01 +4.748370E+01 1.144254E+00 -6.546618E-03 -2.784920E+00 -3.877907E-02 -2.110520E+02 -2.227225E+02 +6.546614E-03 +2.784919E+00 +3.877905E-02 +2.110519E+02 +2.227224E+02 3.220667E-01 -5.186770E-04 -7.969316E-01 -3.175758E-03 +5.186767E-04 +7.969314E-01 +3.175756E-03 1.122226E+02 -6.298107E+01 -1.521758E+00 -1.158468E-02 -4.232692E+00 -8.962439E-02 -1.129470E+02 -6.378585E+01 +6.298103E+01 +1.521757E+00 +1.158467E-02 +4.232690E+00 +8.962434E-02 +1.129469E+02 +6.378582E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.346407E+01 +5.346406E+01 1.429216E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.113247E+01 -4.846178E+00 +3.113246E+01 +4.846176E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.104801E+01 -8.424780E+00 +4.104800E+01 +8.424776E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.824005E+01 -4.825571E+01 +9.824002E+01 +4.825568E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.889103E+02 -1.784413E+02 +1.889102E+02 +1.784412E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.679730E+01 -4.686267E+01 +9.679727E+01 +4.686264E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.897828E+01 +5.897826E+01 1.739342E+01 -2.181862E+01 +2.181861E+01 2.380831E+00 -5.310215E+01 +5.310214E+01 1.410257E+01 -4.079874E+01 -8.322938E+00 -6.064469E+00 +4.079873E+01 +8.322934E+00 +6.064468E+00 1.839035E-01 -1.475971E+01 +1.475970E+01 1.089331E+00 -2.912006E+01 -4.239913E+00 -9.439565E-01 -4.455323E-03 -2.297401E+00 -2.639057E-02 -3.702869E+01 -6.855691E+00 +2.912005E+01 +4.239911E+00 +9.439562E-01 +4.455320E-03 +2.297400E+00 +2.639056E-02 +3.702868E+01 +6.855687E+00 1.233605E+00 -7.609156E-03 -3.002348E+00 -4.507194E-02 -9.753766E+01 -4.756805E+01 +7.609152E-03 +3.002347E+00 +4.507192E-02 +9.753763E+01 +4.756803E+01 1.146053E+00 -6.567213E-03 -2.789298E+00 -3.890107E-02 -2.153332E+02 -2.318479E+02 -3.284890E-01 -5.395580E-04 -8.128230E-01 -3.303608E-03 +6.567210E-03 +2.789297E+00 +3.890105E-02 +2.153331E+02 +2.318478E+02 +3.284889E-01 +5.395577E-04 +8.128227E-01 +3.303606E-03 1.140093E+02 -6.500131E+01 -1.542171E+00 +6.500127E+01 +1.542170E+00 1.189591E-02 -4.289470E+00 -9.203227E-02 -6.822486E+01 -2.327587E+01 -2.539951E+01 -3.226691E+00 -6.181733E+01 -1.911292E+01 -4.337628E+01 -9.407949E+00 -6.468668E+00 -2.092395E-01 +4.289468E+00 +9.203221E-02 +6.822483E+01 +2.327586E+01 +2.539950E+01 +3.226689E+00 +6.181730E+01 +1.911291E+01 +4.337627E+01 +9.407943E+00 +6.468666E+00 +2.092394E-01 1.574344E+01 -1.239406E+00 -2.954196E+01 -4.363673E+00 -9.596121E-01 -4.604345E-03 -2.335504E+00 -2.727329E-02 -3.766621E+01 -7.093810E+00 +1.239405E+00 +2.954195E+01 +4.363671E+00 +9.596119E-01 +4.604342E-03 +2.335503E+00 +2.727327E-02 +3.766620E+01 +7.093806E+00 1.257977E+00 -7.912792E-03 -3.061665E+00 -4.687049E-02 -9.745956E+01 -4.749193E+01 +7.912788E-03 +3.061664E+00 +4.687047E-02 +9.745954E+01 +4.749190E+01 1.147703E+00 -6.586141E-03 -2.793315E+00 -3.901318E-02 +6.586137E-03 +2.793314E+00 +3.901316E-02 2.111701E+02 -2.229708E+02 +2.229707E+02 3.231290E-01 -5.220986E-04 -7.995602E-01 -3.196707E-03 -1.122514E+02 -6.301118E+01 +5.220983E-04 +7.995600E-01 +3.196706E-03 +1.122513E+02 +6.301114E+01 1.525955E+00 1.164801E-02 -4.244367E+00 -9.011440E-02 +4.244366E+00 +9.011434E-02 tally 2: 3.727210E-01 6.946049E-04 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat index db723684684..3d87c1ff778 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.841005E+01 -2.340265E+01 -2.539210E+01 -3.224885E+00 -6.179930E+01 +6.841002E+01 +2.340263E+01 +2.539209E+01 +3.224884E+00 +6.179927E+01 1.910222E+01 -4.345797E+01 -9.443447E+00 -6.461267E+00 -2.087628E-01 -1.572543E+01 -1.236582E+00 -2.958150E+01 -4.375358E+00 -9.580607E-01 -4.589465E-03 -2.331728E+00 -2.718515E-02 -3.771761E+01 -7.113176E+00 +4.345795E+01 +9.443438E+00 +6.461264E+00 +2.087627E-01 +1.572542E+01 +1.236581E+00 +2.958149E+01 +4.375353E+00 +9.580602E-01 +4.589460E-03 +2.331727E+00 +2.718512E-02 +3.771759E+01 +7.113168E+00 1.255942E+00 -7.887221E-03 -3.056712E+00 -4.671902E-02 -9.755568E+01 -4.758565E+01 -1.145482E+00 -6.560671E-03 -2.787908E+00 -3.886231E-02 -2.112847E+02 -2.232140E+02 -3.224203E-01 -5.198164E-04 -7.978065E-01 -3.182734E-03 -1.123399E+02 -6.311276E+01 -1.523335E+00 -1.160870E-02 -4.237078E+00 -8.981024E-02 -1.130416E+02 -6.389274E+01 +7.887213E-03 +3.056711E+00 +4.671898E-02 +9.755563E+01 +4.758560E+01 +1.145481E+00 +6.560664E-03 +2.787906E+00 +3.886227E-02 +2.112846E+02 +2.232138E+02 +3.224201E-01 +5.198159E-04 +7.978060E-01 +3.182731E-03 +1.123398E+02 +6.311270E+01 +1.523334E+00 +1.160869E-02 +4.237076E+00 +8.981014E-02 +1.130415E+02 +6.389267E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.351357E+01 -1.431864E+01 +5.351354E+01 +1.431862E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.116479E+01 -4.856246E+00 +3.116478E+01 +4.856241E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.109114E+01 -8.442495E+00 +4.109112E+01 +8.442486E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.834631E+01 -4.836016E+01 +9.834626E+01 +4.836011E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.891193E+02 -1.788365E+02 +1.891192E+02 +1.788363E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.689934E+01 -4.696152E+01 +9.689929E+01 +4.696147E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.902249E+01 -1.741951E+01 +5.902247E+01 +1.741950E+01 2.183516E+01 -2.384444E+00 -5.314242E+01 +2.384443E+00 +5.314240E+01 1.412397E+01 -4.083555E+01 -8.337963E+00 -6.069956E+00 -1.842364E-01 -1.477306E+01 -1.091303E+00 -2.914981E+01 -4.248581E+00 -9.449218E-01 -4.464439E-03 -2.299750E+00 -2.644457E-02 -3.706650E+01 -6.869699E+00 +4.083553E+01 +8.337955E+00 +6.069953E+00 +1.842363E-01 +1.477305E+01 +1.091302E+00 +2.914979E+01 +4.248577E+00 +9.449213E-01 +4.464435E-03 +2.299749E+00 +2.644455E-02 +3.706648E+01 +6.869692E+00 1.234866E+00 -7.624725E-03 -3.005418E+00 -4.516416E-02 -9.764194E+01 -4.766982E+01 -1.147279E+00 -6.581267E-03 -2.792281E+00 -3.898431E-02 -2.155704E+02 -2.323591E+02 -3.288491E-01 -5.407419E-04 -8.137142E-01 -3.310856E-03 -1.141284E+02 -6.513710E+01 -1.543767E+00 -1.192055E-02 -4.293910E+00 -9.222288E-02 -6.827724E+01 -2.331163E+01 -2.541923E+01 -3.231703E+00 -6.186532E+01 -1.914261E+01 -4.341544E+01 -9.424942E+00 -6.474521E+00 -2.096183E-01 -1.575769E+01 -1.241649E+00 -2.957223E+01 -4.372622E+00 -9.605961E-01 -4.613792E-03 -2.337899E+00 -2.732925E-02 -3.770491E+01 -7.108396E+00 -1.259271E+00 -7.929072E-03 -3.064813E+00 -4.696693E-02 -9.756409E+01 -4.759386E+01 +7.624718E-03 +3.005416E+00 +4.516412E-02 +9.764189E+01 +4.766978E+01 +1.147278E+00 +6.581260E-03 +2.792280E+00 +3.898427E-02 +2.155703E+02 +2.323588E+02 +3.288490E-01 +5.407413E-04 +8.137138E-01 +3.310853E-03 +1.141283E+02 +6.513702E+01 +1.543766E+00 +1.192054E-02 +4.293907E+00 +9.222278E-02 +6.827719E+01 +2.331160E+01 +2.541921E+01 +3.231700E+00 +6.186528E+01 +1.914259E+01 +4.341541E+01 +9.424932E+00 +6.474517E+00 +2.096181E-01 +1.575768E+01 +1.241648E+00 +2.957222E+01 +4.372617E+00 +9.605956E-01 +4.613787E-03 +2.337897E+00 +2.732922E-02 +3.770489E+01 +7.108388E+00 +1.259270E+00 +7.929065E-03 +3.064812E+00 +4.696688E-02 +9.756404E+01 +4.759381E+01 1.148934E+00 -6.600277E-03 -2.796311E+00 -3.909692E-02 -2.114030E+02 -2.234629E+02 -3.234838E-01 -5.232457E-04 -8.004381E-01 -3.203731E-03 -1.123687E+02 -6.314294E+01 -1.527537E+00 -1.167217E-02 -4.248767E+00 -9.030131E-02 +6.600271E-03 +2.796309E+00 +3.909688E-02 +2.114029E+02 +2.234627E+02 +3.234836E-01 +5.232451E-04 +8.004376E-01 +3.203727E-03 +1.123686E+02 +6.314288E+01 +1.527536E+00 +1.167216E-02 +4.248764E+00 +9.030121E-02 tally 2: 3.727211E-01 6.946052E-04 @@ -217,7 +217,7 @@ tally 2: 7.142754E-03 2.550947E-07 1.136691E-03 -6.460335E-09 +6.460334E-09 3.721891E-01 6.926238E-04 8.037366E-01 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat index bac8902424a..f5d2338864e 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.846312E+01 -2.343897E+01 -2.541202E+01 -3.229945E+00 -6.184776E+01 -1.913220E+01 -4.349759E+01 -9.460674E+00 -6.467170E+00 -2.091445E-01 -1.573980E+01 -1.238843E+00 -2.961211E+01 -4.384415E+00 -9.590524E-01 -4.598971E-03 -2.334141E+00 -2.724146E-02 -3.775673E+01 -7.127940E+00 -1.257246E+00 -7.903602E-03 -3.059885E+00 -4.681606E-02 -9.766123E+01 -4.768868E+01 -1.146721E+00 -6.574876E-03 -2.790924E+00 -3.894646E-02 -2.115196E+02 -2.237105E+02 -3.227770E-01 -5.209674E-04 -7.986892E-01 -3.189781E-03 -1.124582E+02 -6.324576E+01 -1.524926E+00 -1.163296E-02 -4.241504E+00 -8.999793E-02 +6.846308E+01 +2.343895E+01 +2.541200E+01 +3.229943E+00 +6.184772E+01 +1.913218E+01 +4.349756E+01 +9.460661E+00 +6.467166E+00 +2.091442E-01 +1.573979E+01 +1.238841E+00 +2.961209E+01 +4.384409E+00 +9.590517E-01 +4.598964E-03 +2.334140E+00 +2.724142E-02 +3.775670E+01 +7.127929E+00 +1.257245E+00 +7.903591E-03 +3.059883E+00 +4.681599E-02 +9.766116E+01 +4.768861E+01 +1.146720E+00 +6.574867E-03 +2.790922E+00 +3.894640E-02 +2.115194E+02 +2.237102E+02 +3.227768E-01 +5.209666E-04 +7.986886E-01 +3.189776E-03 +1.124581E+02 +6.324566E+01 +1.524925E+00 +1.163294E-02 +4.241501E+00 +8.999779E-02 1.131371E+02 -6.400083E+01 +6.400074E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.356358E+01 -1.434541E+01 +5.356354E+01 +1.434539E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.119744E+01 -4.866426E+00 +3.119742E+01 +4.866419E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.113471E+01 -8.460406E+00 +4.113468E+01 +8.460394E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.845360E+01 -4.846573E+01 +9.845352E+01 +4.846566E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.893303E+02 -1.792356E+02 +1.893301E+02 +1.792354E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.700227E+01 -4.706134E+01 +9.700220E+01 +4.706127E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.906717E+01 -1.744589E+01 -2.185188E+01 -2.388096E+00 -5.318310E+01 -1.414560E+01 -4.087275E+01 -8.353159E+00 -6.075499E+00 -1.845731E-01 -1.478655E+01 -1.093297E+00 -2.917987E+01 -4.257348E+00 -9.458970E-01 -4.473659E-03 -2.302124E+00 -2.649919E-02 -3.710470E+01 -6.883867E+00 -1.236141E+00 -7.640471E-03 -3.008519E+00 -4.525743E-02 -9.774725E+01 -4.777270E+01 -1.148516E+00 -6.595474E-03 -2.795293E+00 -3.906847E-02 -2.158098E+02 -2.328754E+02 -3.292126E-01 -5.419377E-04 -8.146135E-01 -3.318178E-03 -1.142484E+02 -6.527422E+01 -1.545377E+00 -1.194543E-02 -4.298389E+00 -9.241537E-02 -6.833016E+01 -2.334778E+01 -2.543915E+01 -3.236770E+00 -6.191381E+01 -1.917263E+01 -4.345500E+01 -9.442129E+00 -6.480434E+00 -2.100014E-01 -1.577208E+01 -1.243919E+00 -2.960282E+01 -4.381672E+00 -9.615903E-01 -4.623347E-03 -2.340318E+00 -2.738585E-02 -3.774401E+01 -7.123146E+00 -1.260578E+00 -7.945537E-03 -3.067994E+00 -4.706446E-02 -9.766964E+01 -4.769689E+01 +5.906713E+01 +1.744587E+01 +2.185187E+01 +2.388094E+00 +5.318307E+01 +1.414559E+01 +4.087272E+01 +8.353147E+00 +6.075495E+00 +1.845728E-01 +1.478654E+01 +1.093296E+00 +2.917985E+01 +4.257342E+00 +9.458963E-01 +4.473653E-03 +2.302122E+00 +2.649915E-02 +3.710467E+01 +6.883857E+00 +1.236140E+00 +7.640460E-03 +3.008517E+00 +4.525737E-02 +9.774718E+01 +4.777263E+01 +1.148515E+00 +6.595464E-03 +2.795291E+00 +3.906841E-02 +2.158096E+02 +2.328751E+02 +3.292123E-01 +5.419369E-04 +8.146129E-01 +3.318173E-03 +1.142483E+02 +6.527411E+01 +1.545376E+00 +1.194541E-02 +4.298386E+00 +9.241523E-02 +6.833010E+01 +2.334774E+01 +2.543913E+01 +3.236766E+00 +6.191375E+01 +1.917260E+01 +4.345497E+01 +9.442115E+00 +6.480429E+00 +2.100011E-01 +1.577207E+01 +1.243917E+00 +2.960280E+01 +4.381666E+00 +9.615896E-01 +4.623340E-03 +2.340316E+00 +2.738581E-02 +3.774398E+01 +7.123136E+00 +1.260577E+00 +7.945526E-03 +3.067991E+00 +4.706439E-02 +9.766957E+01 +4.769682E+01 1.150177E+00 -6.614567E-03 -2.799336E+00 -3.918157E-02 -2.116380E+02 -2.239600E+02 -3.238418E-01 -5.244043E-04 -8.013238E-01 -3.210825E-03 -1.124870E+02 -6.327601E+01 -1.529133E+00 -1.169657E-02 -4.253205E+00 -9.049007E-02 +6.614557E-03 +2.799334E+00 +3.918151E-02 +2.116379E+02 +2.239597E+02 +3.238415E-01 +5.244036E-04 +8.013232E-01 +3.210820E-03 +1.124869E+02 +6.327591E+01 +1.529132E+00 +1.169655E-02 +4.253202E+00 +9.048993E-02 tally 2: 3.727212E-01 6.946055E-04 @@ -182,7 +182,7 @@ tally 2: 1.459642E-04 2.305151E-02 2.656862E-06 -8.000705E-03 +8.000704E-03 3.200564E-07 1.273273E-03 8.106118E-09 @@ -223,7 +223,7 @@ tally 2: 8.037371E-01 3.229967E-03 3.090254E-01 -4.774834E-04 +4.774833E-04 2.191328E-01 2.400960E-04 1.706153E-01 @@ -233,4 +233,4 @@ tally 2: 7.989285E-03 3.191434E-07 1.271455E-03 -8.082995E-09 +8.082994E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat index 2625ac2a347..c40bfbeff1b 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.851755E+01 -2.347625E+01 -2.543244E+01 -3.235138E+00 -6.189746E+01 -1.916296E+01 -4.353807E+01 -9.478290E+00 -6.473201E+00 -2.095347E-01 -1.575448E+01 -1.241154E+00 -2.964329E+01 -4.393655E+00 -9.600630E-01 -4.608668E-03 -2.336601E+00 -2.729890E-02 -3.779660E+01 -7.143001E+00 -1.258574E+00 -7.920313E-03 -3.063118E+00 -4.691505E-02 -9.776873E+01 -4.779372E+01 -1.147984E+00 -6.589359E-03 -2.793996E+00 -3.903225E-02 -2.117587E+02 -2.242166E+02 -3.231403E-01 -5.221406E-04 -7.995881E-01 -3.196965E-03 -1.125788E+02 -6.338145E+01 -1.526548E+00 -1.165771E-02 -4.246015E+00 -9.018945E-02 -1.132350E+02 -6.411155E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361464E+01 -1.437278E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123071E+01 -4.876810E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117909E+01 -8.478672E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856285E+01 -4.857335E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895450E+02 -1.796425E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710717E+01 -4.716318E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911301E+01 -1.747298E+01 -2.186903E+01 -2.391846E+00 -5.322484E+01 -1.416782E+01 -4.091074E+01 -8.368698E+00 -6.081162E+00 -1.849173E-01 -1.480033E+01 -1.095336E+00 -2.921050E+01 -4.266292E+00 -9.468909E-01 -4.483065E-03 -2.304543E+00 -2.655491E-02 -3.714364E+01 -6.898322E+00 -1.237440E+00 -7.656535E-03 -3.011680E+00 -4.535258E-02 -9.785450E+01 -4.787760E+01 -1.149777E+00 -6.609958E-03 -2.798361E+00 -3.915427E-02 -2.160535E+02 -2.334017E+02 -3.295826E-01 -5.431567E-04 -8.155291E-01 -3.325642E-03 -1.143708E+02 -6.541413E+01 -1.547019E+00 -1.197082E-02 -4.302955E+00 -9.261180E-02 -6.838444E+01 -2.338489E+01 -2.545958E+01 -3.241970E+00 -6.196352E+01 -1.920343E+01 -4.349543E+01 -9.459705E+00 -6.486476E+00 -2.103931E-01 -1.578678E+01 -1.246239E+00 -2.963399E+01 -4.390905E+00 -9.626034E-01 -4.633094E-03 -2.342784E+00 -2.744358E-02 -3.778386E+01 -7.138194E+00 -1.261909E+00 -7.962333E-03 -3.071235E+00 -4.716395E-02 -9.777713E+01 -4.780194E+01 -1.151443E+00 -6.629136E-03 -2.802417E+00 -3.926787E-02 -2.118773E+02 -2.244667E+02 -3.242063E-01 -5.255855E-04 -8.022257E-01 -3.218057E-03 -1.126076E+02 -6.341177E+01 -1.530759E+00 -1.172147E-02 -4.257730E+00 -9.068268E-02 +6.851748E+01 +2.347622E+01 +2.543241E+01 +3.235134E+00 +6.189740E+01 +1.916293E+01 +4.353803E+01 +9.478273E+00 +6.473195E+00 +2.095344E-01 +1.575446E+01 +1.241152E+00 +2.964327E+01 +4.393647E+00 +9.600620E-01 +4.608659E-03 +2.336599E+00 +2.729885E-02 +3.779657E+01 +7.142988E+00 +1.258573E+00 +7.920299E-03 +3.063115E+00 +4.691496E-02 +9.776864E+01 +4.779363E+01 +1.147982E+00 +6.589347E-03 +2.793994E+00 +3.903218E-02 +2.117585E+02 +2.242162E+02 +3.231400E-01 +5.221396E-04 +7.995873E-01 +3.196958E-03 +1.125787E+02 +6.338133E+01 +1.526546E+00 +1.165769E-02 +4.246011E+00 +9.018927E-02 +1.132349E+02 +6.411143E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361459E+01 +1.437275E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123068E+01 +4.876801E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117905E+01 +8.478656E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856276E+01 +4.857326E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895448E+02 +1.796421E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710707E+01 +4.716308E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911296E+01 +1.747295E+01 +2.186901E+01 +2.391843E+00 +5.322479E+01 +1.416780E+01 +4.091071E+01 +8.368683E+00 +6.081156E+00 +1.849170E-01 +1.480032E+01 +1.095334E+00 +2.921048E+01 +4.266284E+00 +9.468900E-01 +4.483057E-03 +2.304541E+00 +2.655486E-02 +3.714360E+01 +6.898309E+00 +1.237438E+00 +7.656521E-03 +3.011678E+00 +4.535250E-02 +9.785441E+01 +4.787751E+01 +1.149776E+00 +6.609946E-03 +2.798358E+00 +3.915419E-02 +2.160533E+02 +2.334013E+02 +3.295823E-01 +5.431557E-04 +8.155283E-01 +3.325636E-03 +1.143707E+02 +6.541399E+01 +1.547017E+00 +1.197080E-02 +4.302951E+00 +9.261162E-02 +6.838436E+01 +2.338484E+01 +2.545955E+01 +3.241965E+00 +6.196345E+01 +1.920339E+01 +4.349538E+01 +9.459686E+00 +6.486469E+00 +2.103927E-01 +1.578677E+01 +1.246237E+00 +2.963397E+01 +4.390897E+00 +9.626025E-01 +4.633085E-03 +2.342782E+00 +2.744353E-02 +3.778382E+01 +7.138181E+00 +1.261908E+00 +7.962318E-03 +3.071232E+00 +4.716386E-02 +9.777704E+01 +4.780184E+01 +1.151442E+00 +6.629123E-03 +2.802415E+00 +3.926779E-02 +2.118771E+02 +2.244662E+02 +3.242060E-01 +5.255844E-04 +8.022250E-01 +3.218051E-03 +1.126075E+02 +6.341165E+01 +1.530758E+00 +1.172145E-02 +4.257726E+00 +9.068250E-02 tally 2: 3.727213E-01 6.946060E-04 @@ -183,9 +183,9 @@ tally 2: 2.305197E-02 2.656966E-06 8.001084E-03 -3.200868E-07 +3.200867E-07 1.273400E-03 -8.107736E-09 +8.107735E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -214,10 +214,10 @@ tally 2: 1.163478E-04 2.058070E-02 2.117825E-06 -7.143331E-03 +7.143330E-03 2.551359E-07 1.136885E-03 -6.462535E-09 +6.462534E-09 3.721894E-01 6.926247E-04 8.037378E-01 @@ -231,6 +231,6 @@ tally 2: 2.301907E-02 2.649387E-06 7.989664E-03 -3.191737E-07 +3.191736E-07 1.271582E-03 -8.084607E-09 +8.084606E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat index 5d21c6febfc..934aa0bb4e0 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.857321E+01 -2.351441E+01 -2.545331E+01 -3.240452E+00 -6.194827E+01 -1.919443E+01 -4.357935E+01 -9.496270E+00 -6.479351E+00 -2.099331E-01 -1.576944E+01 -1.243514E+00 -2.967503E+01 -4.403069E+00 -9.610914E-01 -4.618547E-03 -2.339104E+00 -2.735741E-02 -3.783717E+01 -7.158344E+00 -1.259926E+00 -7.937337E-03 -3.066408E+00 -4.701588E-02 -9.787805E+01 -4.790066E+01 -1.149267E+00 -6.604105E-03 -2.797121E+00 -3.911960E-02 -2.120018E+02 -2.247317E+02 -3.235096E-01 -5.233348E-04 -8.005019E-01 -3.204276E-03 -1.127015E+02 -6.351966E+01 -1.528198E+00 -1.168293E-02 -4.250605E+00 -9.038454E-02 -1.133348E+02 -6.422471E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366670E+01 -1.440070E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126455E+01 -4.887386E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122424E+01 -8.497275E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867395E+01 -4.868292E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897633E+02 -1.800565E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721388E+01 -4.726689E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.915992E+01 -1.750072E+01 -2.188657E+01 -2.395685E+00 -5.326754E+01 -1.419056E+01 -4.094949E+01 -8.384559E+00 -6.086937E+00 -1.852687E-01 -1.481439E+01 -1.097417E+00 -2.924168E+01 -4.275405E+00 -9.479024E-01 -4.492648E-03 -2.307005E+00 -2.661167E-02 -3.718326E+01 -6.913048E+00 -1.238761E+00 -7.672900E-03 -3.014897E+00 -4.544952E-02 -9.796358E+01 -4.798440E+01 -1.151059E+00 -6.624706E-03 -2.801481E+00 -3.924163E-02 -2.163013E+02 -2.339374E+02 -3.299589E-01 -5.443975E-04 -8.164601E-01 -3.333239E-03 -1.144953E+02 -6.555663E+01 -1.548689E+00 -1.199669E-02 -4.307601E+00 -9.281190E-02 -6.843995E+01 -2.342287E+01 -2.548046E+01 -3.247292E+00 -6.201435E+01 -1.923495E+01 -4.353665E+01 -9.477643E+00 -6.492636E+00 -2.107930E-01 -1.580178E+01 -1.248607E+00 -2.966572E+01 -4.400311E+00 -9.636344E-01 -4.643024E-03 -2.345293E+00 -2.750240E-02 -3.782441E+01 -7.153523E+00 -1.263264E+00 -7.979443E-03 -3.074533E+00 -4.726529E-02 -9.788645E+01 -4.790889E+01 -1.152731E+00 -6.643969E-03 -2.805551E+00 -3.935573E-02 -2.121205E+02 -2.249823E+02 -3.245768E-01 -5.267876E-04 -8.031427E-01 -3.225417E-03 -1.127304E+02 -6.355006E+01 -1.532415E+00 -1.174683E-02 -4.262334E+00 -9.087889E-02 +6.857313E+01 +2.351436E+01 +2.545329E+01 +3.240447E+00 +6.194820E+01 +1.919440E+01 +4.357930E+01 +9.496249E+00 +6.479343E+00 +2.099326E-01 +1.576943E+01 +1.243511E+00 +2.967500E+01 +4.403058E+00 +9.610902E-01 +4.618536E-03 +2.339101E+00 +2.735735E-02 +3.783713E+01 +7.158328E+00 +1.259925E+00 +7.937318E-03 +3.066405E+00 +4.701577E-02 +9.787794E+01 +4.790055E+01 +1.149266E+00 +6.604089E-03 +2.797118E+00 +3.911950E-02 +2.120015E+02 +2.247312E+02 +3.235092E-01 +5.233335E-04 +8.005010E-01 +3.204269E-03 +1.127013E+02 +6.351950E+01 +1.528196E+00 +1.168290E-02 +4.250600E+00 +9.038432E-02 +1.133347E+02 +6.422456E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366664E+01 +1.440067E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126452E+01 +4.887375E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122419E+01 +8.497255E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867383E+01 +4.868280E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897631E+02 +1.800561E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721376E+01 +4.726677E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915985E+01 +1.750069E+01 +2.188655E+01 +2.395681E+00 +5.326748E+01 +1.419053E+01 +4.094945E+01 +8.384540E+00 +6.086930E+00 +1.852683E-01 +1.481437E+01 +1.097415E+00 +2.924165E+01 +4.275395E+00 +9.479013E-01 +4.492638E-03 +2.307002E+00 +2.661161E-02 +3.718322E+01 +6.913032E+00 +1.238760E+00 +7.672882E-03 +3.014894E+00 +4.544942E-02 +9.796347E+01 +4.798428E+01 +1.151057E+00 +6.624691E-03 +2.801478E+00 +3.924154E-02 +2.163011E+02 +2.339368E+02 +3.299585E-01 +5.443962E-04 +8.164591E-01 +3.333231E-03 +1.144952E+02 +6.555647E+01 +1.548688E+00 +1.199666E-02 +4.307596E+00 +9.281167E-02 +6.843986E+01 +2.342281E+01 +2.548043E+01 +3.247285E+00 +6.201427E+01 +1.923491E+01 +4.353660E+01 +9.477621E+00 +6.492628E+00 +2.107925E-01 +1.580176E+01 +1.248604E+00 +2.966568E+01 +4.400301E+00 +9.636332E-01 +4.643013E-03 +2.345290E+00 +2.750234E-02 +3.782436E+01 +7.153506E+00 +1.263263E+00 +7.979425E-03 +3.074529E+00 +4.726518E-02 +9.788634E+01 +4.790877E+01 +1.152730E+00 +6.643954E-03 +2.805548E+00 +3.935564E-02 +2.121203E+02 +2.249818E+02 +3.245765E-01 +5.267864E-04 +8.031417E-01 +3.225410E-03 +1.127302E+02 +6.354990E+01 +1.532413E+00 +1.174680E-02 +4.262329E+00 +9.087867E-02 tally 2: 3.727215E-01 6.946067E-04 @@ -182,10 +182,10 @@ tally 2: 1.459700E-04 2.305255E-02 2.657101E-06 -8.001573E-03 -3.201259E-07 +8.001572E-03 +3.201258E-07 1.273562E-03 -8.109801E-09 +8.109799E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -216,8 +216,8 @@ tally 2: 2.117932E-06 7.143764E-03 2.551668E-07 -1.137029E-03 -6.464170E-09 +1.137028E-03 +6.464168E-09 3.721896E-01 6.926253E-04 8.037386E-01 @@ -230,7 +230,7 @@ tally 2: 1.455537E-04 2.301965E-02 2.649522E-06 -7.990152E-03 +7.990151E-03 3.192126E-07 1.271744E-03 -8.086665E-09 +8.086663E-09 From 6f1718298ee7594bb34ac367234d8a4ffb3a8482 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 11 Jan 2026 20:52:41 -0600 Subject: [PATCH 48/64] Revert explicit void treatment in kinetic random ray --- src/random_ray/random_ray.cpp | 19 +------------------ src/settings.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index 8b4d9e43644..f158f1d7015 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -504,6 +504,7 @@ void RandomRay::attenuate_flux_flat_source( } // Alternative flux attenuation function for true void regions. +// TODO: Implement support for time-dependent voids void RandomRay::attenuate_flux_flat_source_void( SourceRegionHandle& srh, double distance, bool is_active, Position r) { @@ -549,24 +550,6 @@ void RandomRay::attenuate_flux_flat_source_void( angular_flux_[g] += srh.external_source(g) * distance; } } - - if (settings::kinetic_simulation && !simulation::is_initial_condition) { - for (int g = 0; g < negroups_; g++) { - if (RandomRay::time_method_ == RandomRayTimeMethod::ISOTROPIC) { - angular_flux_[g] -= srh.phi_prime(g) * distance; - } else if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - float inverse_vbar = domain_->inverse_vbar_[material * negroups_ + g]; - float T1 = srh.T1(g); - - // Source Derivative Propogation terms for Characteristic Equation - angular_flux_[g] -= inverse_vbar * angular_flux_prime_[g] * distance; - angular_flux_[g] -= distance * distance * 0.5f * T1; - - // Time Derivative Characteristic Equation - angular_flux_prime_[g] += T1 * distance; - } - } - } } void RandomRay::attenuate_flux_linear_source( diff --git a/src/settings.cpp b/src/settings.cpp index 9bef59b1bed..c3bfad37532 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -266,6 +266,12 @@ void get_run_parameters(pugi::xml_node node_base) fatal_error("Unsupported solver selected for kinetic simulation. Kinetic " "simulations currently only support the random ray solver."); } + if (run_mode != RunMode::EIGENVALUE) { + fatal_error( + "Unsupported run mode selected for kinetic simulation. Kinetic " + "simulations currently only support run mode based on an eigenvalue " + "simulation establishing an initial condition."); + } } // Get timestep parameters for kinetic simulations From f28c57a84e9f113dee66bb3252f8d3e5693bb513 Mon Sep 17 00:00:00 2001 From: yardasol Date: Sun, 11 Jan 2026 21:26:16 -0600 Subject: [PATCH 49/64] more explicitly prohibit void regions in kinetic simuations (for now) --- src/random_ray/flat_source_domain.cpp | 28 +++++++++++------------- src/random_ray/random_ray_simulation.cpp | 4 ---- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index f51473456d3..cc1274aaea6 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -248,11 +248,8 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; - - double sigma_t = 1.0; - if (material != MATERIAL_VOID) - sigma_t = sigma_t_[material * negroups_ + g]; - + // TODO: Add support for expicit void regions + double sigma_t = sigma_t_[material * negroups_ + g]; source_regions_.scalar_flux_new(sr, g) -= scalar_flux_rhs_bd * inverse_vbar / sigma_t; source_regions_.scalar_flux_new(sr, g) /= 1 + A0 * inverse_vbar / sigma_t; @@ -1726,6 +1723,11 @@ SourceRegionHandle FlatSourceDomain::get_subdivided_source_region_handle( } } + if (settings::kinetic_simulation && material == MATERIAL_VOID) { + fatal_error("Explicit void treatment for kinetic simulations " + " is not currently supported."); + } + handle.material() = material; // Store the mesh index (if any) assigned to this source region @@ -1935,9 +1937,8 @@ void FlatSourceDomain::compute_single_phi_prime(SourceRegionHandle& srh) int material = srh.material(); for (int g = 0; g < negroups_; g++) { double inverse_vbar = inverse_vbar_[material * negroups_ + g]; - double sigma_t = 1.0; - if (material != MATERIAL_VOID) - sigma_t = sigma_t_[material * negroups_ + g]; + // TODO: add support for explicit void + double sigma_t = sigma_t_[material * negroups_ + g]; double scalar_flux_time_derivative = A0 * srh.scalar_flux_old(g) + srh.scalar_flux_rhs_bd(g); @@ -1955,9 +1956,8 @@ void FlatSourceDomain::compute_single_T1(SourceRegionHandle& srh) int material = srh.material(); for (int g = 0; g < negroups_; g++) { double inverse_vbar = inverse_vbar_[material * negroups_ + g]; - double sigma_t = 1.0; - if (material != MATERIAL_VOID) - sigma_t = sigma_t_[material * negroups_ + g]; + // TODO: add support for explicit void + double sigma_t = sigma_t_[material * negroups_ + g]; // Multiply out sigma_t to correctly compute the derivative term float source_time_derivative = @@ -2140,12 +2140,10 @@ void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) source_regions_.scalar_flux_final(sr, g), increment_not_initialize, RandomRay::bd_order_ + j); if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { - // TODO: add support for void regions // Multiply out sigma_t to store the base source int material = source_regions_.material(sr); - double sigma_t = 1.0; - if (material != MATERIAL_VOID) - sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; + // TODO: add support for explicit void regions + double sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; float source = source_regions_.source_final(sr, g) * sigma_t; add_value_to_bd_vector(source_regions_.source_bd(sr, g), source, increment_not_initialize, RandomRay::bd_order_); diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index 901148ad224..45b9d12bacb 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -53,10 +53,6 @@ void openmc_run_random_ray() // Second steady state simulation to correct the batchwise k-eff sim.kinetic_initial_condition(); - warning( - "Time-dependent explicit void treatment has not yet been " - "implemented. Use caution when interpreting results from models with " - "voids, as they may contain large inaccuracies."); // Timestepping loop for (int i = 0; i < settings::n_timesteps; i++) sim.kinetic_single_time_step(i); From 80e4cff3d00f2f05100c19e6a47d1b3efa87faa8 Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 12 Jan 2026 13:24:32 -0600 Subject: [PATCH 50/64] fix test results overwritten by merge --- .../isotropic/results_error_2.dat | 236 ------------ .../isotropic/results_true_1.dat | 228 ++++++------ .../isotropic/results_true_2.dat | 270 +++++++------- .../isotropic/results_true_3.dat | 282 +++++++------- .../isotropic/results_true_4.dat | 348 ++++++++--------- .../isotropic/results_true_5.dat | 350 +++++++++--------- .../propagation/results_error_2.dat | 236 ------------ .../propagation/results_true_1.dat | 228 ++++++------ .../propagation/results_true_2.dat | 270 +++++++------- .../propagation/results_true_3.dat | 282 +++++++------- .../propagation/results_true_4.dat | 348 ++++++++--------- .../propagation/results_true_5.dat | 350 +++++++++--------- 12 files changed, 1478 insertions(+), 1950 deletions(-) delete mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_error_2.dat delete mode 100644 tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_error_2.dat diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_error_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_error_2.dat deleted file mode 100644 index 3d87c1ff778..00000000000 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_error_2.dat +++ /dev/null @@ -1,236 +0,0 @@ -k-combined: -1.311387E+00 6.434473E-04 -tally 1: -6.841002E+01 -2.340263E+01 -2.539209E+01 -3.224884E+00 -6.179927E+01 -1.910222E+01 -4.345795E+01 -9.443438E+00 -6.461264E+00 -2.087627E-01 -1.572542E+01 -1.236581E+00 -2.958149E+01 -4.375353E+00 -9.580602E-01 -4.589460E-03 -2.331727E+00 -2.718512E-02 -3.771759E+01 -7.113168E+00 -1.255942E+00 -7.887213E-03 -3.056711E+00 -4.671898E-02 -9.755563E+01 -4.758560E+01 -1.145481E+00 -6.560664E-03 -2.787906E+00 -3.886227E-02 -2.112846E+02 -2.232138E+02 -3.224201E-01 -5.198159E-04 -7.978060E-01 -3.182731E-03 -1.123398E+02 -6.311270E+01 -1.523334E+00 -1.160869E-02 -4.237076E+00 -8.981014E-02 -1.130415E+02 -6.389267E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.351354E+01 -1.431862E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.116478E+01 -4.856241E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.109112E+01 -8.442486E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.834626E+01 -4.836011E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.891192E+02 -1.788363E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.689929E+01 -4.696147E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.902247E+01 -1.741950E+01 -2.183516E+01 -2.384443E+00 -5.314240E+01 -1.412397E+01 -4.083553E+01 -8.337955E+00 -6.069953E+00 -1.842363E-01 -1.477305E+01 -1.091302E+00 -2.914979E+01 -4.248577E+00 -9.449213E-01 -4.464435E-03 -2.299749E+00 -2.644455E-02 -3.706648E+01 -6.869692E+00 -1.234866E+00 -7.624718E-03 -3.005416E+00 -4.516412E-02 -9.764189E+01 -4.766978E+01 -1.147278E+00 -6.581260E-03 -2.792280E+00 -3.898427E-02 -2.155703E+02 -2.323588E+02 -3.288490E-01 -5.407413E-04 -8.137138E-01 -3.310853E-03 -1.141283E+02 -6.513702E+01 -1.543766E+00 -1.192054E-02 -4.293907E+00 -9.222278E-02 -6.827719E+01 -2.331160E+01 -2.541921E+01 -3.231700E+00 -6.186528E+01 -1.914259E+01 -4.341541E+01 -9.424932E+00 -6.474517E+00 -2.096181E-01 -1.575768E+01 -1.241648E+00 -2.957222E+01 -4.372617E+00 -9.605956E-01 -4.613787E-03 -2.337897E+00 -2.732922E-02 -3.770489E+01 -7.108388E+00 -1.259270E+00 -7.929065E-03 -3.064812E+00 -4.696688E-02 -9.756404E+01 -4.759381E+01 -1.148934E+00 -6.600271E-03 -2.796309E+00 -3.909688E-02 -2.114029E+02 -2.234627E+02 -3.234836E-01 -5.232451E-04 -8.004376E-01 -3.203727E-03 -1.123686E+02 -6.314288E+01 -1.527536E+00 -1.167216E-02 -4.248764E+00 -9.030121E-02 -tally 2: -3.727211E-01 -6.946052E-04 -8.048854E-01 -3.239203E-03 -3.094668E-01 -4.788484E-04 -2.194454E-01 -2.407815E-04 -1.708581E-01 -1.459624E-04 -2.305119E-02 -2.656788E-06 -8.000435E-03 -3.200348E-07 -1.273182E-03 -8.104960E-09 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.327638E-01 -5.536589E-04 -7.185983E-01 -2.581918E-03 -2.762906E-01 -3.816826E-04 -1.959200E-01 -1.919231E-04 -1.525414E-01 -1.163444E-04 -2.058001E-02 -2.117684E-06 -7.142754E-03 -2.550947E-07 -1.136691E-03 -6.460334E-09 -3.721891E-01 -6.926238E-04 -8.037366E-01 -3.229963E-03 -3.090251E-01 -4.774825E-04 -2.191322E-01 -2.400946E-04 -1.706142E-01 -1.455461E-04 -2.301829E-02 -2.649209E-06 -7.989016E-03 -3.191219E-07 -1.271365E-03 -8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat index 25731b9a04d..3b5aea51fd9 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835752E+01 +6.835753E+01 2.336672E+01 -2.537238E+01 -3.219879E+00 -6.175130E+01 +2.537239E+01 +3.219878E+00 +6.175132E+01 1.907257E+01 -4.341875E+01 -9.426410E+00 -6.455423E+00 +4.341877E+01 +9.426414E+00 +6.455425E+00 2.083854E-01 1.571121E+01 -1.234346E+00 +1.234347E+00 2.955121E+01 -4.366400E+00 -9.570789E-01 -4.580063E-03 -2.329338E+00 -2.712946E-02 -3.767887E+01 -7.098572E+00 +4.366402E+00 +9.570792E-01 +4.580066E-03 +2.329339E+00 +2.712948E-02 +3.767888E+01 +7.098576E+00 1.254652E+00 -7.871018E-03 -3.053571E+00 -4.662305E-02 -9.745113E+01 -4.748370E+01 +7.871022E-03 +3.053572E+00 +4.662307E-02 +9.745115E+01 +4.748373E+01 1.144254E+00 -6.546614E-03 -2.784919E+00 -3.877905E-02 -2.110519E+02 -2.227224E+02 +6.546618E-03 +2.784920E+00 +3.877907E-02 +2.110520E+02 +2.227225E+02 3.220667E-01 -5.186767E-04 -7.969314E-01 -3.175756E-03 +5.186770E-04 +7.969316E-01 +3.175758E-03 1.122226E+02 -6.298103E+01 -1.521757E+00 -1.158467E-02 -4.232690E+00 -8.962434E-02 -1.129469E+02 -6.378582E+01 +6.298107E+01 +1.521758E+00 +1.158468E-02 +4.232692E+00 +8.962439E-02 +1.129470E+02 +6.378585E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.346406E+01 +5.346407E+01 1.429216E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.113246E+01 -4.846176E+00 +3.113247E+01 +4.846178E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.104800E+01 -8.424776E+00 +4.104801E+01 +8.424780E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.824002E+01 -4.825568E+01 +9.824005E+01 +4.825571E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.889102E+02 -1.784412E+02 +1.889103E+02 +1.784413E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.679727E+01 -4.686264E+01 +9.679730E+01 +4.686267E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.897826E+01 +5.897828E+01 1.739342E+01 -2.181861E+01 +2.181862E+01 2.380831E+00 -5.310214E+01 +5.310215E+01 1.410257E+01 -4.079873E+01 -8.322934E+00 -6.064468E+00 +4.079874E+01 +8.322938E+00 +6.064469E+00 1.839035E-01 -1.475970E+01 +1.475971E+01 1.089331E+00 -2.912005E+01 -4.239911E+00 -9.439562E-01 -4.455320E-03 -2.297400E+00 -2.639056E-02 -3.702868E+01 -6.855687E+00 +2.912006E+01 +4.239913E+00 +9.439565E-01 +4.455323E-03 +2.297401E+00 +2.639057E-02 +3.702869E+01 +6.855691E+00 1.233605E+00 -7.609152E-03 -3.002347E+00 -4.507192E-02 -9.753763E+01 -4.756803E+01 +7.609156E-03 +3.002348E+00 +4.507194E-02 +9.753766E+01 +4.756805E+01 1.146053E+00 -6.567210E-03 -2.789297E+00 -3.890105E-02 -2.153331E+02 -2.318478E+02 -3.284889E-01 -5.395577E-04 -8.128227E-01 -3.303606E-03 +6.567213E-03 +2.789298E+00 +3.890107E-02 +2.153332E+02 +2.318479E+02 +3.284890E-01 +5.395580E-04 +8.128230E-01 +3.303608E-03 1.140093E+02 -6.500127E+01 -1.542170E+00 +6.500131E+01 +1.542171E+00 1.189591E-02 -4.289468E+00 -9.203221E-02 -6.822483E+01 -2.327586E+01 -2.539950E+01 -3.226689E+00 -6.181730E+01 -1.911291E+01 -4.337627E+01 -9.407943E+00 -6.468666E+00 -2.092394E-01 +4.289470E+00 +9.203227E-02 +6.822486E+01 +2.327587E+01 +2.539951E+01 +3.226691E+00 +6.181733E+01 +1.911292E+01 +4.337628E+01 +9.407949E+00 +6.468668E+00 +2.092395E-01 1.574344E+01 -1.239405E+00 -2.954195E+01 -4.363671E+00 -9.596119E-01 -4.604342E-03 -2.335503E+00 -2.727327E-02 -3.766620E+01 -7.093806E+00 +1.239406E+00 +2.954196E+01 +4.363673E+00 +9.596121E-01 +4.604345E-03 +2.335504E+00 +2.727329E-02 +3.766621E+01 +7.093810E+00 1.257977E+00 -7.912788E-03 -3.061664E+00 -4.687047E-02 -9.745954E+01 -4.749190E+01 +7.912792E-03 +3.061665E+00 +4.687049E-02 +9.745956E+01 +4.749193E+01 1.147703E+00 -6.586137E-03 -2.793314E+00 -3.901316E-02 +6.586141E-03 +2.793315E+00 +3.901318E-02 2.111701E+02 -2.229707E+02 +2.229708E+02 3.231290E-01 -5.220983E-04 -7.995600E-01 -3.196706E-03 -1.122513E+02 -6.301114E+01 +5.220986E-04 +7.995602E-01 +3.196707E-03 +1.122514E+02 +6.301118E+01 1.525955E+00 1.164801E-02 -4.244366E+00 -9.011434E-02 +4.244367E+00 +9.011440E-02 tally 2: 3.727210E-01 6.946049E-04 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat index 3d87c1ff778..db723684684 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.841002E+01 -2.340263E+01 -2.539209E+01 -3.224884E+00 -6.179927E+01 +6.841005E+01 +2.340265E+01 +2.539210E+01 +3.224885E+00 +6.179930E+01 1.910222E+01 -4.345795E+01 -9.443438E+00 -6.461264E+00 -2.087627E-01 -1.572542E+01 -1.236581E+00 -2.958149E+01 -4.375353E+00 -9.580602E-01 -4.589460E-03 -2.331727E+00 -2.718512E-02 -3.771759E+01 -7.113168E+00 +4.345797E+01 +9.443447E+00 +6.461267E+00 +2.087628E-01 +1.572543E+01 +1.236582E+00 +2.958150E+01 +4.375358E+00 +9.580607E-01 +4.589465E-03 +2.331728E+00 +2.718515E-02 +3.771761E+01 +7.113176E+00 1.255942E+00 -7.887213E-03 -3.056711E+00 -4.671898E-02 -9.755563E+01 -4.758560E+01 -1.145481E+00 -6.560664E-03 -2.787906E+00 -3.886227E-02 -2.112846E+02 -2.232138E+02 -3.224201E-01 -5.198159E-04 -7.978060E-01 -3.182731E-03 -1.123398E+02 -6.311270E+01 -1.523334E+00 -1.160869E-02 -4.237076E+00 -8.981014E-02 -1.130415E+02 -6.389267E+01 +7.887221E-03 +3.056712E+00 +4.671902E-02 +9.755568E+01 +4.758565E+01 +1.145482E+00 +6.560671E-03 +2.787908E+00 +3.886231E-02 +2.112847E+02 +2.232140E+02 +3.224203E-01 +5.198164E-04 +7.978065E-01 +3.182734E-03 +1.123399E+02 +6.311276E+01 +1.523335E+00 +1.160870E-02 +4.237078E+00 +8.981024E-02 +1.130416E+02 +6.389274E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.351354E+01 -1.431862E+01 +5.351357E+01 +1.431864E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.116478E+01 -4.856241E+00 +3.116479E+01 +4.856246E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.109112E+01 -8.442486E+00 +4.109114E+01 +8.442495E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.834626E+01 -4.836011E+01 +9.834631E+01 +4.836016E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.891192E+02 -1.788363E+02 +1.891193E+02 +1.788365E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.689929E+01 -4.696147E+01 +9.689934E+01 +4.696152E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.902247E+01 -1.741950E+01 +5.902249E+01 +1.741951E+01 2.183516E+01 -2.384443E+00 -5.314240E+01 +2.384444E+00 +5.314242E+01 1.412397E+01 -4.083553E+01 -8.337955E+00 -6.069953E+00 -1.842363E-01 -1.477305E+01 -1.091302E+00 -2.914979E+01 -4.248577E+00 -9.449213E-01 -4.464435E-03 -2.299749E+00 -2.644455E-02 -3.706648E+01 -6.869692E+00 +4.083555E+01 +8.337963E+00 +6.069956E+00 +1.842364E-01 +1.477306E+01 +1.091303E+00 +2.914981E+01 +4.248581E+00 +9.449218E-01 +4.464439E-03 +2.299750E+00 +2.644457E-02 +3.706650E+01 +6.869699E+00 1.234866E+00 -7.624718E-03 -3.005416E+00 -4.516412E-02 -9.764189E+01 -4.766978E+01 -1.147278E+00 -6.581260E-03 -2.792280E+00 -3.898427E-02 -2.155703E+02 -2.323588E+02 -3.288490E-01 -5.407413E-04 -8.137138E-01 -3.310853E-03 -1.141283E+02 -6.513702E+01 -1.543766E+00 -1.192054E-02 -4.293907E+00 -9.222278E-02 -6.827719E+01 -2.331160E+01 -2.541921E+01 -3.231700E+00 -6.186528E+01 -1.914259E+01 -4.341541E+01 -9.424932E+00 -6.474517E+00 -2.096181E-01 -1.575768E+01 -1.241648E+00 -2.957222E+01 -4.372617E+00 -9.605956E-01 -4.613787E-03 -2.337897E+00 -2.732922E-02 -3.770489E+01 -7.108388E+00 -1.259270E+00 -7.929065E-03 -3.064812E+00 -4.696688E-02 -9.756404E+01 -4.759381E+01 +7.624725E-03 +3.005418E+00 +4.516416E-02 +9.764194E+01 +4.766982E+01 +1.147279E+00 +6.581267E-03 +2.792281E+00 +3.898431E-02 +2.155704E+02 +2.323591E+02 +3.288491E-01 +5.407419E-04 +8.137142E-01 +3.310856E-03 +1.141284E+02 +6.513710E+01 +1.543767E+00 +1.192055E-02 +4.293910E+00 +9.222288E-02 +6.827724E+01 +2.331163E+01 +2.541923E+01 +3.231703E+00 +6.186532E+01 +1.914261E+01 +4.341544E+01 +9.424942E+00 +6.474521E+00 +2.096183E-01 +1.575769E+01 +1.241649E+00 +2.957223E+01 +4.372622E+00 +9.605961E-01 +4.613792E-03 +2.337899E+00 +2.732925E-02 +3.770491E+01 +7.108396E+00 +1.259271E+00 +7.929072E-03 +3.064813E+00 +4.696693E-02 +9.756409E+01 +4.759386E+01 1.148934E+00 -6.600271E-03 -2.796309E+00 -3.909688E-02 -2.114029E+02 -2.234627E+02 -3.234836E-01 -5.232451E-04 -8.004376E-01 -3.203727E-03 -1.123686E+02 -6.314288E+01 -1.527536E+00 -1.167216E-02 -4.248764E+00 -9.030121E-02 +6.600277E-03 +2.796311E+00 +3.909692E-02 +2.114030E+02 +2.234629E+02 +3.234838E-01 +5.232457E-04 +8.004381E-01 +3.203731E-03 +1.123687E+02 +6.314294E+01 +1.527537E+00 +1.167217E-02 +4.248767E+00 +9.030131E-02 tally 2: 3.727211E-01 6.946052E-04 @@ -217,7 +217,7 @@ tally 2: 7.142754E-03 2.550947E-07 1.136691E-03 -6.460334E-09 +6.460335E-09 3.721891E-01 6.926238E-04 8.037366E-01 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat index f5d2338864e..bac8902424a 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.846308E+01 -2.343895E+01 -2.541200E+01 -3.229943E+00 -6.184772E+01 -1.913218E+01 -4.349756E+01 -9.460661E+00 -6.467166E+00 -2.091442E-01 -1.573979E+01 -1.238841E+00 -2.961209E+01 -4.384409E+00 -9.590517E-01 -4.598964E-03 -2.334140E+00 -2.724142E-02 -3.775670E+01 -7.127929E+00 -1.257245E+00 -7.903591E-03 -3.059883E+00 -4.681599E-02 -9.766116E+01 -4.768861E+01 -1.146720E+00 -6.574867E-03 -2.790922E+00 -3.894640E-02 -2.115194E+02 -2.237102E+02 -3.227768E-01 -5.209666E-04 -7.986886E-01 -3.189776E-03 -1.124581E+02 -6.324566E+01 -1.524925E+00 -1.163294E-02 -4.241501E+00 -8.999779E-02 +6.846312E+01 +2.343897E+01 +2.541202E+01 +3.229945E+00 +6.184776E+01 +1.913220E+01 +4.349759E+01 +9.460674E+00 +6.467170E+00 +2.091445E-01 +1.573980E+01 +1.238843E+00 +2.961211E+01 +4.384415E+00 +9.590524E-01 +4.598971E-03 +2.334141E+00 +2.724146E-02 +3.775673E+01 +7.127940E+00 +1.257246E+00 +7.903602E-03 +3.059885E+00 +4.681606E-02 +9.766123E+01 +4.768868E+01 +1.146721E+00 +6.574876E-03 +2.790924E+00 +3.894646E-02 +2.115196E+02 +2.237105E+02 +3.227770E-01 +5.209674E-04 +7.986892E-01 +3.189781E-03 +1.124582E+02 +6.324576E+01 +1.524926E+00 +1.163296E-02 +4.241504E+00 +8.999793E-02 1.131371E+02 -6.400074E+01 +6.400083E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.356354E+01 -1.434539E+01 +5.356358E+01 +1.434541E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.119742E+01 -4.866419E+00 +3.119744E+01 +4.866426E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.113468E+01 -8.460394E+00 +4.113471E+01 +8.460406E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.845352E+01 -4.846566E+01 +9.845360E+01 +4.846573E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.893301E+02 -1.792354E+02 +1.893303E+02 +1.792356E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.700220E+01 -4.706127E+01 +9.700227E+01 +4.706134E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.906713E+01 -1.744587E+01 -2.185187E+01 -2.388094E+00 -5.318307E+01 -1.414559E+01 -4.087272E+01 -8.353147E+00 -6.075495E+00 -1.845728E-01 -1.478654E+01 -1.093296E+00 -2.917985E+01 -4.257342E+00 -9.458963E-01 -4.473653E-03 -2.302122E+00 -2.649915E-02 -3.710467E+01 -6.883857E+00 -1.236140E+00 -7.640460E-03 -3.008517E+00 -4.525737E-02 -9.774718E+01 -4.777263E+01 -1.148515E+00 -6.595464E-03 -2.795291E+00 -3.906841E-02 -2.158096E+02 -2.328751E+02 -3.292123E-01 -5.419369E-04 -8.146129E-01 -3.318173E-03 -1.142483E+02 -6.527411E+01 -1.545376E+00 -1.194541E-02 -4.298386E+00 -9.241523E-02 -6.833010E+01 -2.334774E+01 -2.543913E+01 -3.236766E+00 -6.191375E+01 -1.917260E+01 -4.345497E+01 -9.442115E+00 -6.480429E+00 -2.100011E-01 -1.577207E+01 -1.243917E+00 -2.960280E+01 -4.381666E+00 -9.615896E-01 -4.623340E-03 -2.340316E+00 -2.738581E-02 -3.774398E+01 -7.123136E+00 -1.260577E+00 -7.945526E-03 -3.067991E+00 -4.706439E-02 -9.766957E+01 -4.769682E+01 +5.906717E+01 +1.744589E+01 +2.185188E+01 +2.388096E+00 +5.318310E+01 +1.414560E+01 +4.087275E+01 +8.353159E+00 +6.075499E+00 +1.845731E-01 +1.478655E+01 +1.093297E+00 +2.917987E+01 +4.257348E+00 +9.458970E-01 +4.473659E-03 +2.302124E+00 +2.649919E-02 +3.710470E+01 +6.883867E+00 +1.236141E+00 +7.640471E-03 +3.008519E+00 +4.525743E-02 +9.774725E+01 +4.777270E+01 +1.148516E+00 +6.595474E-03 +2.795293E+00 +3.906847E-02 +2.158098E+02 +2.328754E+02 +3.292126E-01 +5.419377E-04 +8.146135E-01 +3.318178E-03 +1.142484E+02 +6.527422E+01 +1.545377E+00 +1.194543E-02 +4.298389E+00 +9.241537E-02 +6.833016E+01 +2.334778E+01 +2.543915E+01 +3.236770E+00 +6.191381E+01 +1.917263E+01 +4.345500E+01 +9.442129E+00 +6.480434E+00 +2.100014E-01 +1.577208E+01 +1.243919E+00 +2.960282E+01 +4.381672E+00 +9.615903E-01 +4.623347E-03 +2.340318E+00 +2.738585E-02 +3.774401E+01 +7.123146E+00 +1.260578E+00 +7.945537E-03 +3.067994E+00 +4.706446E-02 +9.766964E+01 +4.769689E+01 1.150177E+00 -6.614557E-03 -2.799334E+00 -3.918151E-02 -2.116379E+02 -2.239597E+02 -3.238415E-01 -5.244036E-04 -8.013232E-01 -3.210820E-03 -1.124869E+02 -6.327591E+01 -1.529132E+00 -1.169655E-02 -4.253202E+00 -9.048993E-02 +6.614567E-03 +2.799336E+00 +3.918157E-02 +2.116380E+02 +2.239600E+02 +3.238418E-01 +5.244043E-04 +8.013238E-01 +3.210825E-03 +1.124870E+02 +6.327601E+01 +1.529133E+00 +1.169657E-02 +4.253205E+00 +9.049007E-02 tally 2: 3.727212E-01 6.946055E-04 @@ -182,7 +182,7 @@ tally 2: 1.459642E-04 2.305151E-02 2.656862E-06 -8.000704E-03 +8.000705E-03 3.200564E-07 1.273273E-03 8.106118E-09 @@ -223,7 +223,7 @@ tally 2: 8.037371E-01 3.229967E-03 3.090254E-01 -4.774833E-04 +4.774834E-04 2.191328E-01 2.400960E-04 1.706153E-01 @@ -233,4 +233,4 @@ tally 2: 7.989285E-03 3.191434E-07 1.271455E-03 -8.082994E-09 +8.082995E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat index c40bfbeff1b..2625ac2a347 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.851748E+01 -2.347622E+01 -2.543241E+01 -3.235134E+00 -6.189740E+01 -1.916293E+01 -4.353803E+01 -9.478273E+00 -6.473195E+00 -2.095344E-01 -1.575446E+01 -1.241152E+00 -2.964327E+01 -4.393647E+00 -9.600620E-01 -4.608659E-03 -2.336599E+00 -2.729885E-02 -3.779657E+01 -7.142988E+00 -1.258573E+00 -7.920299E-03 -3.063115E+00 -4.691496E-02 -9.776864E+01 -4.779363E+01 -1.147982E+00 -6.589347E-03 -2.793994E+00 -3.903218E-02 -2.117585E+02 -2.242162E+02 -3.231400E-01 -5.221396E-04 -7.995873E-01 -3.196958E-03 -1.125787E+02 -6.338133E+01 -1.526546E+00 -1.165769E-02 -4.246011E+00 -9.018927E-02 -1.132349E+02 -6.411143E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361459E+01 -1.437275E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123068E+01 -4.876801E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117905E+01 -8.478656E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856276E+01 -4.857326E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895448E+02 -1.796421E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710707E+01 -4.716308E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911296E+01 -1.747295E+01 -2.186901E+01 -2.391843E+00 -5.322479E+01 -1.416780E+01 -4.091071E+01 -8.368683E+00 -6.081156E+00 -1.849170E-01 -1.480032E+01 -1.095334E+00 -2.921048E+01 -4.266284E+00 -9.468900E-01 -4.483057E-03 -2.304541E+00 -2.655486E-02 -3.714360E+01 -6.898309E+00 -1.237438E+00 -7.656521E-03 -3.011678E+00 -4.535250E-02 -9.785441E+01 -4.787751E+01 -1.149776E+00 -6.609946E-03 -2.798358E+00 -3.915419E-02 -2.160533E+02 -2.334013E+02 -3.295823E-01 -5.431557E-04 -8.155283E-01 -3.325636E-03 -1.143707E+02 -6.541399E+01 -1.547017E+00 -1.197080E-02 -4.302951E+00 -9.261162E-02 -6.838436E+01 -2.338484E+01 -2.545955E+01 -3.241965E+00 -6.196345E+01 -1.920339E+01 -4.349538E+01 -9.459686E+00 -6.486469E+00 -2.103927E-01 -1.578677E+01 -1.246237E+00 -2.963397E+01 -4.390897E+00 -9.626025E-01 -4.633085E-03 -2.342782E+00 -2.744353E-02 -3.778382E+01 -7.138181E+00 -1.261908E+00 -7.962318E-03 -3.071232E+00 -4.716386E-02 -9.777704E+01 -4.780184E+01 -1.151442E+00 -6.629123E-03 -2.802415E+00 -3.926779E-02 -2.118771E+02 -2.244662E+02 -3.242060E-01 -5.255844E-04 -8.022250E-01 -3.218051E-03 -1.126075E+02 -6.341165E+01 -1.530758E+00 -1.172145E-02 -4.257726E+00 -9.068250E-02 +6.851755E+01 +2.347625E+01 +2.543244E+01 +3.235138E+00 +6.189746E+01 +1.916296E+01 +4.353807E+01 +9.478290E+00 +6.473201E+00 +2.095347E-01 +1.575448E+01 +1.241154E+00 +2.964329E+01 +4.393655E+00 +9.600630E-01 +4.608668E-03 +2.336601E+00 +2.729890E-02 +3.779660E+01 +7.143001E+00 +1.258574E+00 +7.920313E-03 +3.063118E+00 +4.691505E-02 +9.776873E+01 +4.779372E+01 +1.147984E+00 +6.589359E-03 +2.793996E+00 +3.903225E-02 +2.117587E+02 +2.242166E+02 +3.231403E-01 +5.221406E-04 +7.995881E-01 +3.196965E-03 +1.125788E+02 +6.338145E+01 +1.526548E+00 +1.165771E-02 +4.246015E+00 +9.018945E-02 +1.132350E+02 +6.411155E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361464E+01 +1.437278E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123071E+01 +4.876810E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117909E+01 +8.478672E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856285E+01 +4.857335E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895450E+02 +1.796425E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710717E+01 +4.716318E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911301E+01 +1.747298E+01 +2.186903E+01 +2.391846E+00 +5.322484E+01 +1.416782E+01 +4.091074E+01 +8.368698E+00 +6.081162E+00 +1.849173E-01 +1.480033E+01 +1.095336E+00 +2.921050E+01 +4.266292E+00 +9.468909E-01 +4.483065E-03 +2.304543E+00 +2.655491E-02 +3.714364E+01 +6.898322E+00 +1.237440E+00 +7.656535E-03 +3.011680E+00 +4.535258E-02 +9.785450E+01 +4.787760E+01 +1.149777E+00 +6.609958E-03 +2.798361E+00 +3.915427E-02 +2.160535E+02 +2.334017E+02 +3.295826E-01 +5.431567E-04 +8.155291E-01 +3.325642E-03 +1.143708E+02 +6.541413E+01 +1.547019E+00 +1.197082E-02 +4.302955E+00 +9.261180E-02 +6.838444E+01 +2.338489E+01 +2.545958E+01 +3.241970E+00 +6.196352E+01 +1.920343E+01 +4.349543E+01 +9.459705E+00 +6.486476E+00 +2.103931E-01 +1.578678E+01 +1.246239E+00 +2.963399E+01 +4.390905E+00 +9.626034E-01 +4.633094E-03 +2.342784E+00 +2.744358E-02 +3.778386E+01 +7.138194E+00 +1.261909E+00 +7.962333E-03 +3.071235E+00 +4.716395E-02 +9.777713E+01 +4.780194E+01 +1.151443E+00 +6.629136E-03 +2.802417E+00 +3.926787E-02 +2.118773E+02 +2.244667E+02 +3.242063E-01 +5.255855E-04 +8.022257E-01 +3.218057E-03 +1.126076E+02 +6.341177E+01 +1.530759E+00 +1.172147E-02 +4.257730E+00 +9.068268E-02 tally 2: 3.727213E-01 6.946060E-04 @@ -183,9 +183,9 @@ tally 2: 2.305197E-02 2.656966E-06 8.001084E-03 -3.200867E-07 +3.200868E-07 1.273400E-03 -8.107735E-09 +8.107736E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -214,10 +214,10 @@ tally 2: 1.163478E-04 2.058070E-02 2.117825E-06 -7.143330E-03 +7.143331E-03 2.551359E-07 1.136885E-03 -6.462534E-09 +6.462535E-09 3.721894E-01 6.926247E-04 8.037378E-01 @@ -231,6 +231,6 @@ tally 2: 2.301907E-02 2.649387E-06 7.989664E-03 -3.191736E-07 +3.191737E-07 1.271582E-03 -8.084606E-09 +8.084607E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat index 934aa0bb4e0..5d21c6febfc 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.857313E+01 -2.351436E+01 -2.545329E+01 -3.240447E+00 -6.194820E+01 -1.919440E+01 -4.357930E+01 -9.496249E+00 -6.479343E+00 -2.099326E-01 -1.576943E+01 -1.243511E+00 -2.967500E+01 -4.403058E+00 -9.610902E-01 -4.618536E-03 -2.339101E+00 -2.735735E-02 -3.783713E+01 -7.158328E+00 -1.259925E+00 -7.937318E-03 -3.066405E+00 -4.701577E-02 -9.787794E+01 -4.790055E+01 -1.149266E+00 -6.604089E-03 -2.797118E+00 -3.911950E-02 -2.120015E+02 -2.247312E+02 -3.235092E-01 -5.233335E-04 -8.005010E-01 -3.204269E-03 -1.127013E+02 -6.351950E+01 -1.528196E+00 -1.168290E-02 -4.250600E+00 -9.038432E-02 -1.133347E+02 -6.422456E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366664E+01 -1.440067E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126452E+01 -4.887375E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122419E+01 -8.497255E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867383E+01 -4.868280E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897631E+02 -1.800561E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721376E+01 -4.726677E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.915985E+01 -1.750069E+01 -2.188655E+01 -2.395681E+00 -5.326748E+01 -1.419053E+01 -4.094945E+01 -8.384540E+00 -6.086930E+00 -1.852683E-01 -1.481437E+01 -1.097415E+00 -2.924165E+01 -4.275395E+00 -9.479013E-01 -4.492638E-03 -2.307002E+00 -2.661161E-02 -3.718322E+01 -6.913032E+00 -1.238760E+00 -7.672882E-03 -3.014894E+00 -4.544942E-02 -9.796347E+01 -4.798428E+01 -1.151057E+00 -6.624691E-03 -2.801478E+00 -3.924154E-02 -2.163011E+02 -2.339368E+02 -3.299585E-01 -5.443962E-04 -8.164591E-01 -3.333231E-03 -1.144952E+02 -6.555647E+01 -1.548688E+00 -1.199666E-02 -4.307596E+00 -9.281167E-02 -6.843986E+01 -2.342281E+01 -2.548043E+01 -3.247285E+00 -6.201427E+01 -1.923491E+01 -4.353660E+01 -9.477621E+00 -6.492628E+00 -2.107925E-01 -1.580176E+01 -1.248604E+00 -2.966568E+01 -4.400301E+00 -9.636332E-01 -4.643013E-03 -2.345290E+00 -2.750234E-02 -3.782436E+01 -7.153506E+00 -1.263263E+00 -7.979425E-03 -3.074529E+00 -4.726518E-02 -9.788634E+01 -4.790877E+01 -1.152730E+00 -6.643954E-03 -2.805548E+00 -3.935564E-02 -2.121203E+02 -2.249818E+02 -3.245765E-01 -5.267864E-04 -8.031417E-01 -3.225410E-03 -1.127302E+02 -6.354990E+01 -1.532413E+00 -1.174680E-02 -4.262329E+00 -9.087867E-02 +6.857321E+01 +2.351441E+01 +2.545331E+01 +3.240452E+00 +6.194827E+01 +1.919443E+01 +4.357935E+01 +9.496270E+00 +6.479351E+00 +2.099331E-01 +1.576944E+01 +1.243514E+00 +2.967503E+01 +4.403069E+00 +9.610914E-01 +4.618547E-03 +2.339104E+00 +2.735741E-02 +3.783717E+01 +7.158344E+00 +1.259926E+00 +7.937337E-03 +3.066408E+00 +4.701588E-02 +9.787805E+01 +4.790066E+01 +1.149267E+00 +6.604105E-03 +2.797121E+00 +3.911960E-02 +2.120018E+02 +2.247317E+02 +3.235096E-01 +5.233348E-04 +8.005019E-01 +3.204276E-03 +1.127015E+02 +6.351966E+01 +1.528198E+00 +1.168293E-02 +4.250605E+00 +9.038454E-02 +1.133348E+02 +6.422471E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366670E+01 +1.440070E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126455E+01 +4.887386E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122424E+01 +8.497275E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867395E+01 +4.868292E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897633E+02 +1.800565E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721388E+01 +4.726689E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915992E+01 +1.750072E+01 +2.188657E+01 +2.395685E+00 +5.326754E+01 +1.419056E+01 +4.094949E+01 +8.384559E+00 +6.086937E+00 +1.852687E-01 +1.481439E+01 +1.097417E+00 +2.924168E+01 +4.275405E+00 +9.479024E-01 +4.492648E-03 +2.307005E+00 +2.661167E-02 +3.718326E+01 +6.913048E+00 +1.238761E+00 +7.672900E-03 +3.014897E+00 +4.544952E-02 +9.796358E+01 +4.798440E+01 +1.151059E+00 +6.624706E-03 +2.801481E+00 +3.924163E-02 +2.163013E+02 +2.339374E+02 +3.299589E-01 +5.443975E-04 +8.164601E-01 +3.333239E-03 +1.144953E+02 +6.555663E+01 +1.548689E+00 +1.199669E-02 +4.307601E+00 +9.281190E-02 +6.843995E+01 +2.342287E+01 +2.548046E+01 +3.247292E+00 +6.201435E+01 +1.923495E+01 +4.353665E+01 +9.477643E+00 +6.492636E+00 +2.107930E-01 +1.580178E+01 +1.248607E+00 +2.966572E+01 +4.400311E+00 +9.636344E-01 +4.643024E-03 +2.345293E+00 +2.750240E-02 +3.782441E+01 +7.153523E+00 +1.263264E+00 +7.979443E-03 +3.074533E+00 +4.726529E-02 +9.788645E+01 +4.790889E+01 +1.152731E+00 +6.643969E-03 +2.805551E+00 +3.935573E-02 +2.121205E+02 +2.249823E+02 +3.245768E-01 +5.267876E-04 +8.031427E-01 +3.225417E-03 +1.127304E+02 +6.355006E+01 +1.532415E+00 +1.174683E-02 +4.262334E+00 +9.087889E-02 tally 2: 3.727215E-01 6.946067E-04 @@ -182,10 +182,10 @@ tally 2: 1.459700E-04 2.305255E-02 2.657101E-06 -8.001572E-03 -3.201258E-07 +8.001573E-03 +3.201259E-07 1.273562E-03 -8.109799E-09 +8.109801E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -216,8 +216,8 @@ tally 2: 2.117932E-06 7.143764E-03 2.551668E-07 -1.137028E-03 -6.464168E-09 +1.137029E-03 +6.464170E-09 3.721896E-01 6.926253E-04 8.037386E-01 @@ -230,7 +230,7 @@ tally 2: 1.455537E-04 2.301965E-02 2.649522E-06 -7.990151E-03 +7.990152E-03 3.192126E-07 1.271744E-03 -8.086663E-09 +8.086665E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_error_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_error_2.dat deleted file mode 100644 index 3d87c1ff778..00000000000 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_error_2.dat +++ /dev/null @@ -1,236 +0,0 @@ -k-combined: -1.311387E+00 6.434473E-04 -tally 1: -6.841002E+01 -2.340263E+01 -2.539209E+01 -3.224884E+00 -6.179927E+01 -1.910222E+01 -4.345795E+01 -9.443438E+00 -6.461264E+00 -2.087627E-01 -1.572542E+01 -1.236581E+00 -2.958149E+01 -4.375353E+00 -9.580602E-01 -4.589460E-03 -2.331727E+00 -2.718512E-02 -3.771759E+01 -7.113168E+00 -1.255942E+00 -7.887213E-03 -3.056711E+00 -4.671898E-02 -9.755563E+01 -4.758560E+01 -1.145481E+00 -6.560664E-03 -2.787906E+00 -3.886227E-02 -2.112846E+02 -2.232138E+02 -3.224201E-01 -5.198159E-04 -7.978060E-01 -3.182731E-03 -1.123398E+02 -6.311270E+01 -1.523334E+00 -1.160869E-02 -4.237076E+00 -8.981014E-02 -1.130415E+02 -6.389267E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.351354E+01 -1.431862E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.116478E+01 -4.856241E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.109112E+01 -8.442486E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.834626E+01 -4.836011E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.891192E+02 -1.788363E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.689929E+01 -4.696147E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.902247E+01 -1.741950E+01 -2.183516E+01 -2.384443E+00 -5.314240E+01 -1.412397E+01 -4.083553E+01 -8.337955E+00 -6.069953E+00 -1.842363E-01 -1.477305E+01 -1.091302E+00 -2.914979E+01 -4.248577E+00 -9.449213E-01 -4.464435E-03 -2.299749E+00 -2.644455E-02 -3.706648E+01 -6.869692E+00 -1.234866E+00 -7.624718E-03 -3.005416E+00 -4.516412E-02 -9.764189E+01 -4.766978E+01 -1.147278E+00 -6.581260E-03 -2.792280E+00 -3.898427E-02 -2.155703E+02 -2.323588E+02 -3.288490E-01 -5.407413E-04 -8.137138E-01 -3.310853E-03 -1.141283E+02 -6.513702E+01 -1.543766E+00 -1.192054E-02 -4.293907E+00 -9.222278E-02 -6.827719E+01 -2.331160E+01 -2.541921E+01 -3.231700E+00 -6.186528E+01 -1.914259E+01 -4.341541E+01 -9.424932E+00 -6.474517E+00 -2.096181E-01 -1.575768E+01 -1.241648E+00 -2.957222E+01 -4.372617E+00 -9.605956E-01 -4.613787E-03 -2.337897E+00 -2.732922E-02 -3.770489E+01 -7.108388E+00 -1.259270E+00 -7.929065E-03 -3.064812E+00 -4.696688E-02 -9.756404E+01 -4.759381E+01 -1.148934E+00 -6.600271E-03 -2.796309E+00 -3.909688E-02 -2.114029E+02 -2.234627E+02 -3.234836E-01 -5.232451E-04 -8.004376E-01 -3.203727E-03 -1.123686E+02 -6.314288E+01 -1.527536E+00 -1.167216E-02 -4.248764E+00 -9.030121E-02 -tally 2: -3.727211E-01 -6.946052E-04 -8.048854E-01 -3.239203E-03 -3.094668E-01 -4.788484E-04 -2.194454E-01 -2.407815E-04 -1.708581E-01 -1.459624E-04 -2.305119E-02 -2.656788E-06 -8.000435E-03 -3.200348E-07 -1.273182E-03 -8.104960E-09 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.327638E-01 -5.536589E-04 -7.185983E-01 -2.581918E-03 -2.762906E-01 -3.816826E-04 -1.959200E-01 -1.919231E-04 -1.525414E-01 -1.163444E-04 -2.058001E-02 -2.117684E-06 -7.142754E-03 -2.550947E-07 -1.136691E-03 -6.460334E-09 -3.721891E-01 -6.926238E-04 -8.037366E-01 -3.229963E-03 -3.090251E-01 -4.774825E-04 -2.191322E-01 -2.400946E-04 -1.706142E-01 -1.455461E-04 -2.301829E-02 -2.649209E-06 -7.989016E-03 -3.191219E-07 -1.271365E-03 -8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat index 25731b9a04d..3b5aea51fd9 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835752E+01 +6.835753E+01 2.336672E+01 -2.537238E+01 -3.219879E+00 -6.175130E+01 +2.537239E+01 +3.219878E+00 +6.175132E+01 1.907257E+01 -4.341875E+01 -9.426410E+00 -6.455423E+00 +4.341877E+01 +9.426414E+00 +6.455425E+00 2.083854E-01 1.571121E+01 -1.234346E+00 +1.234347E+00 2.955121E+01 -4.366400E+00 -9.570789E-01 -4.580063E-03 -2.329338E+00 -2.712946E-02 -3.767887E+01 -7.098572E+00 +4.366402E+00 +9.570792E-01 +4.580066E-03 +2.329339E+00 +2.712948E-02 +3.767888E+01 +7.098576E+00 1.254652E+00 -7.871018E-03 -3.053571E+00 -4.662305E-02 -9.745113E+01 -4.748370E+01 +7.871022E-03 +3.053572E+00 +4.662307E-02 +9.745115E+01 +4.748373E+01 1.144254E+00 -6.546614E-03 -2.784919E+00 -3.877905E-02 -2.110519E+02 -2.227224E+02 +6.546618E-03 +2.784920E+00 +3.877907E-02 +2.110520E+02 +2.227225E+02 3.220667E-01 -5.186767E-04 -7.969314E-01 -3.175756E-03 +5.186770E-04 +7.969316E-01 +3.175758E-03 1.122226E+02 -6.298103E+01 -1.521757E+00 -1.158467E-02 -4.232690E+00 -8.962434E-02 -1.129469E+02 -6.378582E+01 +6.298107E+01 +1.521758E+00 +1.158468E-02 +4.232692E+00 +8.962439E-02 +1.129470E+02 +6.378585E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.346406E+01 +5.346407E+01 1.429216E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.113246E+01 -4.846176E+00 +3.113247E+01 +4.846178E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.104800E+01 -8.424776E+00 +4.104801E+01 +8.424780E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.824002E+01 -4.825568E+01 +9.824005E+01 +4.825571E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.889102E+02 -1.784412E+02 +1.889103E+02 +1.784413E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.679727E+01 -4.686264E+01 +9.679730E+01 +4.686267E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.897826E+01 +5.897828E+01 1.739342E+01 -2.181861E+01 +2.181862E+01 2.380831E+00 -5.310214E+01 +5.310215E+01 1.410257E+01 -4.079873E+01 -8.322934E+00 -6.064468E+00 +4.079874E+01 +8.322938E+00 +6.064469E+00 1.839035E-01 -1.475970E+01 +1.475971E+01 1.089331E+00 -2.912005E+01 -4.239911E+00 -9.439562E-01 -4.455320E-03 -2.297400E+00 -2.639056E-02 -3.702868E+01 -6.855687E+00 +2.912006E+01 +4.239913E+00 +9.439565E-01 +4.455323E-03 +2.297401E+00 +2.639057E-02 +3.702869E+01 +6.855691E+00 1.233605E+00 -7.609152E-03 -3.002347E+00 -4.507192E-02 -9.753763E+01 -4.756803E+01 +7.609156E-03 +3.002348E+00 +4.507194E-02 +9.753766E+01 +4.756805E+01 1.146053E+00 -6.567210E-03 -2.789297E+00 -3.890105E-02 -2.153331E+02 -2.318478E+02 -3.284889E-01 -5.395577E-04 -8.128227E-01 -3.303606E-03 +6.567213E-03 +2.789298E+00 +3.890107E-02 +2.153332E+02 +2.318479E+02 +3.284890E-01 +5.395580E-04 +8.128230E-01 +3.303608E-03 1.140093E+02 -6.500127E+01 -1.542170E+00 +6.500131E+01 +1.542171E+00 1.189591E-02 -4.289468E+00 -9.203221E-02 -6.822483E+01 -2.327586E+01 -2.539950E+01 -3.226689E+00 -6.181730E+01 -1.911291E+01 -4.337627E+01 -9.407943E+00 -6.468666E+00 -2.092394E-01 +4.289470E+00 +9.203227E-02 +6.822486E+01 +2.327587E+01 +2.539951E+01 +3.226691E+00 +6.181733E+01 +1.911292E+01 +4.337628E+01 +9.407949E+00 +6.468668E+00 +2.092395E-01 1.574344E+01 -1.239405E+00 -2.954195E+01 -4.363671E+00 -9.596119E-01 -4.604342E-03 -2.335503E+00 -2.727327E-02 -3.766620E+01 -7.093806E+00 +1.239406E+00 +2.954196E+01 +4.363673E+00 +9.596121E-01 +4.604345E-03 +2.335504E+00 +2.727329E-02 +3.766621E+01 +7.093810E+00 1.257977E+00 -7.912788E-03 -3.061664E+00 -4.687047E-02 -9.745954E+01 -4.749190E+01 +7.912792E-03 +3.061665E+00 +4.687049E-02 +9.745956E+01 +4.749193E+01 1.147703E+00 -6.586137E-03 -2.793314E+00 -3.901316E-02 +6.586141E-03 +2.793315E+00 +3.901318E-02 2.111701E+02 -2.229707E+02 +2.229708E+02 3.231290E-01 -5.220983E-04 -7.995600E-01 -3.196706E-03 -1.122513E+02 -6.301114E+01 +5.220986E-04 +7.995602E-01 +3.196707E-03 +1.122514E+02 +6.301118E+01 1.525955E+00 1.164801E-02 -4.244366E+00 -9.011434E-02 +4.244367E+00 +9.011440E-02 tally 2: 3.727210E-01 6.946049E-04 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat index 3d87c1ff778..db723684684 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.841002E+01 -2.340263E+01 -2.539209E+01 -3.224884E+00 -6.179927E+01 +6.841005E+01 +2.340265E+01 +2.539210E+01 +3.224885E+00 +6.179930E+01 1.910222E+01 -4.345795E+01 -9.443438E+00 -6.461264E+00 -2.087627E-01 -1.572542E+01 -1.236581E+00 -2.958149E+01 -4.375353E+00 -9.580602E-01 -4.589460E-03 -2.331727E+00 -2.718512E-02 -3.771759E+01 -7.113168E+00 +4.345797E+01 +9.443447E+00 +6.461267E+00 +2.087628E-01 +1.572543E+01 +1.236582E+00 +2.958150E+01 +4.375358E+00 +9.580607E-01 +4.589465E-03 +2.331728E+00 +2.718515E-02 +3.771761E+01 +7.113176E+00 1.255942E+00 -7.887213E-03 -3.056711E+00 -4.671898E-02 -9.755563E+01 -4.758560E+01 -1.145481E+00 -6.560664E-03 -2.787906E+00 -3.886227E-02 -2.112846E+02 -2.232138E+02 -3.224201E-01 -5.198159E-04 -7.978060E-01 -3.182731E-03 -1.123398E+02 -6.311270E+01 -1.523334E+00 -1.160869E-02 -4.237076E+00 -8.981014E-02 -1.130415E+02 -6.389267E+01 +7.887221E-03 +3.056712E+00 +4.671902E-02 +9.755568E+01 +4.758565E+01 +1.145482E+00 +6.560671E-03 +2.787908E+00 +3.886231E-02 +2.112847E+02 +2.232140E+02 +3.224203E-01 +5.198164E-04 +7.978065E-01 +3.182734E-03 +1.123399E+02 +6.311276E+01 +1.523335E+00 +1.160870E-02 +4.237078E+00 +8.981024E-02 +1.130416E+02 +6.389274E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.351354E+01 -1.431862E+01 +5.351357E+01 +1.431864E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.116478E+01 -4.856241E+00 +3.116479E+01 +4.856246E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.109112E+01 -8.442486E+00 +4.109114E+01 +8.442495E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.834626E+01 -4.836011E+01 +9.834631E+01 +4.836016E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.891192E+02 -1.788363E+02 +1.891193E+02 +1.788365E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.689929E+01 -4.696147E+01 +9.689934E+01 +4.696152E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.902247E+01 -1.741950E+01 +5.902249E+01 +1.741951E+01 2.183516E+01 -2.384443E+00 -5.314240E+01 +2.384444E+00 +5.314242E+01 1.412397E+01 -4.083553E+01 -8.337955E+00 -6.069953E+00 -1.842363E-01 -1.477305E+01 -1.091302E+00 -2.914979E+01 -4.248577E+00 -9.449213E-01 -4.464435E-03 -2.299749E+00 -2.644455E-02 -3.706648E+01 -6.869692E+00 +4.083555E+01 +8.337963E+00 +6.069956E+00 +1.842364E-01 +1.477306E+01 +1.091303E+00 +2.914981E+01 +4.248581E+00 +9.449218E-01 +4.464439E-03 +2.299750E+00 +2.644457E-02 +3.706650E+01 +6.869699E+00 1.234866E+00 -7.624718E-03 -3.005416E+00 -4.516412E-02 -9.764189E+01 -4.766978E+01 -1.147278E+00 -6.581260E-03 -2.792280E+00 -3.898427E-02 -2.155703E+02 -2.323588E+02 -3.288490E-01 -5.407413E-04 -8.137138E-01 -3.310853E-03 -1.141283E+02 -6.513702E+01 -1.543766E+00 -1.192054E-02 -4.293907E+00 -9.222278E-02 -6.827719E+01 -2.331160E+01 -2.541921E+01 -3.231700E+00 -6.186528E+01 -1.914259E+01 -4.341541E+01 -9.424932E+00 -6.474517E+00 -2.096181E-01 -1.575768E+01 -1.241648E+00 -2.957222E+01 -4.372617E+00 -9.605956E-01 -4.613787E-03 -2.337897E+00 -2.732922E-02 -3.770489E+01 -7.108388E+00 -1.259270E+00 -7.929065E-03 -3.064812E+00 -4.696688E-02 -9.756404E+01 -4.759381E+01 +7.624725E-03 +3.005418E+00 +4.516416E-02 +9.764194E+01 +4.766982E+01 +1.147279E+00 +6.581267E-03 +2.792281E+00 +3.898431E-02 +2.155704E+02 +2.323591E+02 +3.288491E-01 +5.407419E-04 +8.137142E-01 +3.310856E-03 +1.141284E+02 +6.513710E+01 +1.543767E+00 +1.192055E-02 +4.293910E+00 +9.222288E-02 +6.827724E+01 +2.331163E+01 +2.541923E+01 +3.231703E+00 +6.186532E+01 +1.914261E+01 +4.341544E+01 +9.424942E+00 +6.474521E+00 +2.096183E-01 +1.575769E+01 +1.241649E+00 +2.957223E+01 +4.372622E+00 +9.605961E-01 +4.613792E-03 +2.337899E+00 +2.732925E-02 +3.770491E+01 +7.108396E+00 +1.259271E+00 +7.929072E-03 +3.064813E+00 +4.696693E-02 +9.756409E+01 +4.759386E+01 1.148934E+00 -6.600271E-03 -2.796309E+00 -3.909688E-02 -2.114029E+02 -2.234627E+02 -3.234836E-01 -5.232451E-04 -8.004376E-01 -3.203727E-03 -1.123686E+02 -6.314288E+01 -1.527536E+00 -1.167216E-02 -4.248764E+00 -9.030121E-02 +6.600277E-03 +2.796311E+00 +3.909692E-02 +2.114030E+02 +2.234629E+02 +3.234838E-01 +5.232457E-04 +8.004381E-01 +3.203731E-03 +1.123687E+02 +6.314294E+01 +1.527537E+00 +1.167217E-02 +4.248767E+00 +9.030131E-02 tally 2: 3.727211E-01 6.946052E-04 @@ -217,7 +217,7 @@ tally 2: 7.142754E-03 2.550947E-07 1.136691E-03 -6.460334E-09 +6.460335E-09 3.721891E-01 6.926238E-04 8.037366E-01 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat index f5d2338864e..bac8902424a 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.846308E+01 -2.343895E+01 -2.541200E+01 -3.229943E+00 -6.184772E+01 -1.913218E+01 -4.349756E+01 -9.460661E+00 -6.467166E+00 -2.091442E-01 -1.573979E+01 -1.238841E+00 -2.961209E+01 -4.384409E+00 -9.590517E-01 -4.598964E-03 -2.334140E+00 -2.724142E-02 -3.775670E+01 -7.127929E+00 -1.257245E+00 -7.903591E-03 -3.059883E+00 -4.681599E-02 -9.766116E+01 -4.768861E+01 -1.146720E+00 -6.574867E-03 -2.790922E+00 -3.894640E-02 -2.115194E+02 -2.237102E+02 -3.227768E-01 -5.209666E-04 -7.986886E-01 -3.189776E-03 -1.124581E+02 -6.324566E+01 -1.524925E+00 -1.163294E-02 -4.241501E+00 -8.999779E-02 +6.846312E+01 +2.343897E+01 +2.541202E+01 +3.229945E+00 +6.184776E+01 +1.913220E+01 +4.349759E+01 +9.460674E+00 +6.467170E+00 +2.091445E-01 +1.573980E+01 +1.238843E+00 +2.961211E+01 +4.384415E+00 +9.590524E-01 +4.598971E-03 +2.334141E+00 +2.724146E-02 +3.775673E+01 +7.127940E+00 +1.257246E+00 +7.903602E-03 +3.059885E+00 +4.681606E-02 +9.766123E+01 +4.768868E+01 +1.146721E+00 +6.574876E-03 +2.790924E+00 +3.894646E-02 +2.115196E+02 +2.237105E+02 +3.227770E-01 +5.209674E-04 +7.986892E-01 +3.189781E-03 +1.124582E+02 +6.324576E+01 +1.524926E+00 +1.163296E-02 +4.241504E+00 +8.999793E-02 1.131371E+02 -6.400074E+01 +6.400083E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.356354E+01 -1.434539E+01 +5.356358E+01 +1.434541E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.119742E+01 -4.866419E+00 +3.119744E+01 +4.866426E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.113468E+01 -8.460394E+00 +4.113471E+01 +8.460406E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.845352E+01 -4.846566E+01 +9.845360E+01 +4.846573E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.893301E+02 -1.792354E+02 +1.893303E+02 +1.792356E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.700220E+01 -4.706127E+01 +9.700227E+01 +4.706134E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.906713E+01 -1.744587E+01 -2.185187E+01 -2.388094E+00 -5.318307E+01 -1.414559E+01 -4.087272E+01 -8.353147E+00 -6.075495E+00 -1.845728E-01 -1.478654E+01 -1.093296E+00 -2.917985E+01 -4.257342E+00 -9.458963E-01 -4.473653E-03 -2.302122E+00 -2.649915E-02 -3.710467E+01 -6.883857E+00 -1.236140E+00 -7.640460E-03 -3.008517E+00 -4.525737E-02 -9.774718E+01 -4.777263E+01 -1.148515E+00 -6.595464E-03 -2.795291E+00 -3.906841E-02 -2.158096E+02 -2.328751E+02 -3.292123E-01 -5.419369E-04 -8.146129E-01 -3.318173E-03 -1.142483E+02 -6.527411E+01 -1.545376E+00 -1.194541E-02 -4.298386E+00 -9.241523E-02 -6.833010E+01 -2.334774E+01 -2.543913E+01 -3.236766E+00 -6.191375E+01 -1.917260E+01 -4.345497E+01 -9.442115E+00 -6.480429E+00 -2.100011E-01 -1.577207E+01 -1.243917E+00 -2.960280E+01 -4.381666E+00 -9.615896E-01 -4.623340E-03 -2.340316E+00 -2.738581E-02 -3.774398E+01 -7.123136E+00 -1.260577E+00 -7.945526E-03 -3.067991E+00 -4.706439E-02 -9.766957E+01 -4.769682E+01 +5.906717E+01 +1.744589E+01 +2.185188E+01 +2.388096E+00 +5.318310E+01 +1.414560E+01 +4.087275E+01 +8.353159E+00 +6.075499E+00 +1.845731E-01 +1.478655E+01 +1.093297E+00 +2.917987E+01 +4.257348E+00 +9.458970E-01 +4.473659E-03 +2.302124E+00 +2.649919E-02 +3.710470E+01 +6.883867E+00 +1.236141E+00 +7.640471E-03 +3.008519E+00 +4.525743E-02 +9.774725E+01 +4.777270E+01 +1.148516E+00 +6.595474E-03 +2.795293E+00 +3.906847E-02 +2.158098E+02 +2.328754E+02 +3.292126E-01 +5.419377E-04 +8.146135E-01 +3.318178E-03 +1.142484E+02 +6.527422E+01 +1.545377E+00 +1.194543E-02 +4.298389E+00 +9.241537E-02 +6.833016E+01 +2.334778E+01 +2.543915E+01 +3.236770E+00 +6.191381E+01 +1.917263E+01 +4.345500E+01 +9.442129E+00 +6.480434E+00 +2.100014E-01 +1.577208E+01 +1.243919E+00 +2.960282E+01 +4.381672E+00 +9.615903E-01 +4.623347E-03 +2.340318E+00 +2.738585E-02 +3.774401E+01 +7.123146E+00 +1.260578E+00 +7.945537E-03 +3.067994E+00 +4.706446E-02 +9.766964E+01 +4.769689E+01 1.150177E+00 -6.614557E-03 -2.799334E+00 -3.918151E-02 -2.116379E+02 -2.239597E+02 -3.238415E-01 -5.244036E-04 -8.013232E-01 -3.210820E-03 -1.124869E+02 -6.327591E+01 -1.529132E+00 -1.169655E-02 -4.253202E+00 -9.048993E-02 +6.614567E-03 +2.799336E+00 +3.918157E-02 +2.116380E+02 +2.239600E+02 +3.238418E-01 +5.244043E-04 +8.013238E-01 +3.210825E-03 +1.124870E+02 +6.327601E+01 +1.529133E+00 +1.169657E-02 +4.253205E+00 +9.049007E-02 tally 2: 3.727212E-01 6.946055E-04 @@ -182,7 +182,7 @@ tally 2: 1.459642E-04 2.305151E-02 2.656862E-06 -8.000704E-03 +8.000705E-03 3.200564E-07 1.273273E-03 8.106118E-09 @@ -223,7 +223,7 @@ tally 2: 8.037371E-01 3.229967E-03 3.090254E-01 -4.774833E-04 +4.774834E-04 2.191328E-01 2.400960E-04 1.706153E-01 @@ -233,4 +233,4 @@ tally 2: 7.989285E-03 3.191434E-07 1.271455E-03 -8.082994E-09 +8.082995E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat index c40bfbeff1b..2625ac2a347 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.851748E+01 -2.347622E+01 -2.543241E+01 -3.235134E+00 -6.189740E+01 -1.916293E+01 -4.353803E+01 -9.478273E+00 -6.473195E+00 -2.095344E-01 -1.575446E+01 -1.241152E+00 -2.964327E+01 -4.393647E+00 -9.600620E-01 -4.608659E-03 -2.336599E+00 -2.729885E-02 -3.779657E+01 -7.142988E+00 -1.258573E+00 -7.920299E-03 -3.063115E+00 -4.691496E-02 -9.776864E+01 -4.779363E+01 -1.147982E+00 -6.589347E-03 -2.793994E+00 -3.903218E-02 -2.117585E+02 -2.242162E+02 -3.231400E-01 -5.221396E-04 -7.995873E-01 -3.196958E-03 -1.125787E+02 -6.338133E+01 -1.526546E+00 -1.165769E-02 -4.246011E+00 -9.018927E-02 -1.132349E+02 -6.411143E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361459E+01 -1.437275E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123068E+01 -4.876801E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117905E+01 -8.478656E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856276E+01 -4.857326E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895448E+02 -1.796421E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710707E+01 -4.716308E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911296E+01 -1.747295E+01 -2.186901E+01 -2.391843E+00 -5.322479E+01 -1.416780E+01 -4.091071E+01 -8.368683E+00 -6.081156E+00 -1.849170E-01 -1.480032E+01 -1.095334E+00 -2.921048E+01 -4.266284E+00 -9.468900E-01 -4.483057E-03 -2.304541E+00 -2.655486E-02 -3.714360E+01 -6.898309E+00 -1.237438E+00 -7.656521E-03 -3.011678E+00 -4.535250E-02 -9.785441E+01 -4.787751E+01 -1.149776E+00 -6.609946E-03 -2.798358E+00 -3.915419E-02 -2.160533E+02 -2.334013E+02 -3.295823E-01 -5.431557E-04 -8.155283E-01 -3.325636E-03 -1.143707E+02 -6.541399E+01 -1.547017E+00 -1.197080E-02 -4.302951E+00 -9.261162E-02 -6.838436E+01 -2.338484E+01 -2.545955E+01 -3.241965E+00 -6.196345E+01 -1.920339E+01 -4.349538E+01 -9.459686E+00 -6.486469E+00 -2.103927E-01 -1.578677E+01 -1.246237E+00 -2.963397E+01 -4.390897E+00 -9.626025E-01 -4.633085E-03 -2.342782E+00 -2.744353E-02 -3.778382E+01 -7.138181E+00 -1.261908E+00 -7.962318E-03 -3.071232E+00 -4.716386E-02 -9.777704E+01 -4.780184E+01 -1.151442E+00 -6.629123E-03 -2.802415E+00 -3.926779E-02 -2.118771E+02 -2.244662E+02 -3.242060E-01 -5.255844E-04 -8.022250E-01 -3.218051E-03 -1.126075E+02 -6.341165E+01 -1.530758E+00 -1.172145E-02 -4.257726E+00 -9.068250E-02 +6.851755E+01 +2.347625E+01 +2.543244E+01 +3.235138E+00 +6.189746E+01 +1.916296E+01 +4.353807E+01 +9.478290E+00 +6.473201E+00 +2.095347E-01 +1.575448E+01 +1.241154E+00 +2.964329E+01 +4.393655E+00 +9.600630E-01 +4.608668E-03 +2.336601E+00 +2.729890E-02 +3.779660E+01 +7.143001E+00 +1.258574E+00 +7.920313E-03 +3.063118E+00 +4.691505E-02 +9.776873E+01 +4.779372E+01 +1.147984E+00 +6.589359E-03 +2.793996E+00 +3.903225E-02 +2.117587E+02 +2.242166E+02 +3.231403E-01 +5.221406E-04 +7.995881E-01 +3.196965E-03 +1.125788E+02 +6.338145E+01 +1.526548E+00 +1.165771E-02 +4.246015E+00 +9.018945E-02 +1.132350E+02 +6.411155E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361464E+01 +1.437278E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123071E+01 +4.876810E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117909E+01 +8.478672E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856285E+01 +4.857335E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895450E+02 +1.796425E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710717E+01 +4.716318E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911301E+01 +1.747298E+01 +2.186903E+01 +2.391846E+00 +5.322484E+01 +1.416782E+01 +4.091074E+01 +8.368698E+00 +6.081162E+00 +1.849173E-01 +1.480033E+01 +1.095336E+00 +2.921050E+01 +4.266292E+00 +9.468909E-01 +4.483065E-03 +2.304543E+00 +2.655491E-02 +3.714364E+01 +6.898322E+00 +1.237440E+00 +7.656535E-03 +3.011680E+00 +4.535258E-02 +9.785450E+01 +4.787760E+01 +1.149777E+00 +6.609958E-03 +2.798361E+00 +3.915427E-02 +2.160535E+02 +2.334017E+02 +3.295826E-01 +5.431567E-04 +8.155291E-01 +3.325642E-03 +1.143708E+02 +6.541413E+01 +1.547019E+00 +1.197082E-02 +4.302955E+00 +9.261180E-02 +6.838444E+01 +2.338489E+01 +2.545958E+01 +3.241970E+00 +6.196352E+01 +1.920343E+01 +4.349543E+01 +9.459705E+00 +6.486476E+00 +2.103931E-01 +1.578678E+01 +1.246239E+00 +2.963399E+01 +4.390905E+00 +9.626034E-01 +4.633094E-03 +2.342784E+00 +2.744358E-02 +3.778386E+01 +7.138194E+00 +1.261909E+00 +7.962333E-03 +3.071235E+00 +4.716395E-02 +9.777713E+01 +4.780194E+01 +1.151443E+00 +6.629136E-03 +2.802417E+00 +3.926787E-02 +2.118773E+02 +2.244667E+02 +3.242063E-01 +5.255855E-04 +8.022257E-01 +3.218057E-03 +1.126076E+02 +6.341177E+01 +1.530759E+00 +1.172147E-02 +4.257730E+00 +9.068268E-02 tally 2: 3.727213E-01 6.946060E-04 @@ -183,9 +183,9 @@ tally 2: 2.305197E-02 2.656966E-06 8.001084E-03 -3.200867E-07 +3.200868E-07 1.273400E-03 -8.107735E-09 +8.107736E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -214,10 +214,10 @@ tally 2: 1.163478E-04 2.058070E-02 2.117825E-06 -7.143330E-03 +7.143331E-03 2.551359E-07 1.136885E-03 -6.462534E-09 +6.462535E-09 3.721894E-01 6.926247E-04 8.037378E-01 @@ -231,6 +231,6 @@ tally 2: 2.301907E-02 2.649387E-06 7.989664E-03 -3.191736E-07 +3.191737E-07 1.271582E-03 -8.084606E-09 +8.084607E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat index 934aa0bb4e0..5d21c6febfc 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.857313E+01 -2.351436E+01 -2.545329E+01 -3.240447E+00 -6.194820E+01 -1.919440E+01 -4.357930E+01 -9.496249E+00 -6.479343E+00 -2.099326E-01 -1.576943E+01 -1.243511E+00 -2.967500E+01 -4.403058E+00 -9.610902E-01 -4.618536E-03 -2.339101E+00 -2.735735E-02 -3.783713E+01 -7.158328E+00 -1.259925E+00 -7.937318E-03 -3.066405E+00 -4.701577E-02 -9.787794E+01 -4.790055E+01 -1.149266E+00 -6.604089E-03 -2.797118E+00 -3.911950E-02 -2.120015E+02 -2.247312E+02 -3.235092E-01 -5.233335E-04 -8.005010E-01 -3.204269E-03 -1.127013E+02 -6.351950E+01 -1.528196E+00 -1.168290E-02 -4.250600E+00 -9.038432E-02 -1.133347E+02 -6.422456E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366664E+01 -1.440067E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126452E+01 -4.887375E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122419E+01 -8.497255E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867383E+01 -4.868280E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897631E+02 -1.800561E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721376E+01 -4.726677E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.915985E+01 -1.750069E+01 -2.188655E+01 -2.395681E+00 -5.326748E+01 -1.419053E+01 -4.094945E+01 -8.384540E+00 -6.086930E+00 -1.852683E-01 -1.481437E+01 -1.097415E+00 -2.924165E+01 -4.275395E+00 -9.479013E-01 -4.492638E-03 -2.307002E+00 -2.661161E-02 -3.718322E+01 -6.913032E+00 -1.238760E+00 -7.672882E-03 -3.014894E+00 -4.544942E-02 -9.796347E+01 -4.798428E+01 -1.151057E+00 -6.624691E-03 -2.801478E+00 -3.924154E-02 -2.163011E+02 -2.339368E+02 -3.299585E-01 -5.443962E-04 -8.164591E-01 -3.333231E-03 -1.144952E+02 -6.555647E+01 -1.548688E+00 -1.199666E-02 -4.307596E+00 -9.281167E-02 -6.843986E+01 -2.342281E+01 -2.548043E+01 -3.247285E+00 -6.201427E+01 -1.923491E+01 -4.353660E+01 -9.477621E+00 -6.492628E+00 -2.107925E-01 -1.580176E+01 -1.248604E+00 -2.966568E+01 -4.400301E+00 -9.636332E-01 -4.643013E-03 -2.345290E+00 -2.750234E-02 -3.782436E+01 -7.153506E+00 -1.263263E+00 -7.979425E-03 -3.074529E+00 -4.726518E-02 -9.788634E+01 -4.790877E+01 -1.152730E+00 -6.643954E-03 -2.805548E+00 -3.935564E-02 -2.121203E+02 -2.249818E+02 -3.245765E-01 -5.267864E-04 -8.031417E-01 -3.225410E-03 -1.127302E+02 -6.354990E+01 -1.532413E+00 -1.174680E-02 -4.262329E+00 -9.087867E-02 +6.857321E+01 +2.351441E+01 +2.545331E+01 +3.240452E+00 +6.194827E+01 +1.919443E+01 +4.357935E+01 +9.496270E+00 +6.479351E+00 +2.099331E-01 +1.576944E+01 +1.243514E+00 +2.967503E+01 +4.403069E+00 +9.610914E-01 +4.618547E-03 +2.339104E+00 +2.735741E-02 +3.783717E+01 +7.158344E+00 +1.259926E+00 +7.937337E-03 +3.066408E+00 +4.701588E-02 +9.787805E+01 +4.790066E+01 +1.149267E+00 +6.604105E-03 +2.797121E+00 +3.911960E-02 +2.120018E+02 +2.247317E+02 +3.235096E-01 +5.233348E-04 +8.005019E-01 +3.204276E-03 +1.127015E+02 +6.351966E+01 +1.528198E+00 +1.168293E-02 +4.250605E+00 +9.038454E-02 +1.133348E+02 +6.422471E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366670E+01 +1.440070E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126455E+01 +4.887386E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122424E+01 +8.497275E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867395E+01 +4.868292E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897633E+02 +1.800565E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721388E+01 +4.726689E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915992E+01 +1.750072E+01 +2.188657E+01 +2.395685E+00 +5.326754E+01 +1.419056E+01 +4.094949E+01 +8.384559E+00 +6.086937E+00 +1.852687E-01 +1.481439E+01 +1.097417E+00 +2.924168E+01 +4.275405E+00 +9.479024E-01 +4.492648E-03 +2.307005E+00 +2.661167E-02 +3.718326E+01 +6.913048E+00 +1.238761E+00 +7.672900E-03 +3.014897E+00 +4.544952E-02 +9.796358E+01 +4.798440E+01 +1.151059E+00 +6.624706E-03 +2.801481E+00 +3.924163E-02 +2.163013E+02 +2.339374E+02 +3.299589E-01 +5.443975E-04 +8.164601E-01 +3.333239E-03 +1.144953E+02 +6.555663E+01 +1.548689E+00 +1.199669E-02 +4.307601E+00 +9.281190E-02 +6.843995E+01 +2.342287E+01 +2.548046E+01 +3.247292E+00 +6.201435E+01 +1.923495E+01 +4.353665E+01 +9.477643E+00 +6.492636E+00 +2.107930E-01 +1.580178E+01 +1.248607E+00 +2.966572E+01 +4.400311E+00 +9.636344E-01 +4.643024E-03 +2.345293E+00 +2.750240E-02 +3.782441E+01 +7.153523E+00 +1.263264E+00 +7.979443E-03 +3.074533E+00 +4.726529E-02 +9.788645E+01 +4.790889E+01 +1.152731E+00 +6.643969E-03 +2.805551E+00 +3.935573E-02 +2.121205E+02 +2.249823E+02 +3.245768E-01 +5.267876E-04 +8.031427E-01 +3.225417E-03 +1.127304E+02 +6.355006E+01 +1.532415E+00 +1.174683E-02 +4.262334E+00 +9.087889E-02 tally 2: 3.727215E-01 6.946067E-04 @@ -182,10 +182,10 @@ tally 2: 1.459700E-04 2.305255E-02 2.657101E-06 -8.001572E-03 -3.201258E-07 +8.001573E-03 +3.201259E-07 1.273562E-03 -8.109799E-09 +8.109801E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -216,8 +216,8 @@ tally 2: 2.117932E-06 7.143764E-03 2.551668E-07 -1.137028E-03 -6.464168E-09 +1.137029E-03 +6.464170E-09 3.721896E-01 6.926253E-04 8.037386E-01 @@ -230,7 +230,7 @@ tally 2: 1.455537E-04 2.301965E-02 2.649522E-06 -7.990151E-03 +7.990152E-03 3.192126E-07 1.271744E-03 -8.086663E-09 +8.086665E-09 From e9f53483bed257ec12e31a972e1c905658cc4962 Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 14 Jan 2026 13:26:02 -0600 Subject: [PATCH 51/64] implement density multipliers for time-dependent machinery --- src/random_ray/flat_source_domain.cpp | 30 +++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index d0b4456e6cc..c803eac7a57 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -144,10 +144,9 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) nu_sigma_f = nu_sigma_f_[material * negroups_ + g_in]; chi = chi_[material * negroups_ + g_out]; } - nu_sigma_f *= density_mult; scatter_source += sigma_s * scalar_flux; if (settings::create_fission_neutrons) { - fission_source += nu_sigma_f * scalar_flux * chi; + fission_source += nu_sigma_f * density_mult * scalar_flux * chi; } } total_source = (scatter_source + fission_source * inverse_k_eff); @@ -233,6 +232,7 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( int64_t sr, double volume, int g) { int material = source_regions_.material(sr); + double density_mult = source_regions_.density_mult(sr); if (material == MATERIAL_VOID) { source_regions_.scalar_flux_new(sr, g) /= volume; if (settings::run_mode == RunMode::FIXED_SOURCE) { @@ -241,19 +241,17 @@ void FlatSourceDomain::set_flux_to_flux_plus_source( source_regions_.volume_sq(sr); } } else { - double sigma_t = sigma_t_[material * negroups_ + g] * - source_regions_.density_mult(sr); + double sigma_t = sigma_t_[material * negroups_ + g] * density_mult; source_regions_.scalar_flux_new(sr, g) /= (sigma_t * volume); source_regions_.scalar_flux_new(sr, g) += source_regions_.source(sr, g); } if (settings::kinetic_simulation && !simulation::is_initial_condition) { - double inverse_vbar = - inverse_vbar_[source_regions_.material(sr) * negroups_ + g]; + double inverse_vbar = inverse_vbar_[material * negroups_ + g]; double scalar_flux_rhs_bd = source_regions_.scalar_flux_rhs_bd(sr, g); double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; // TODO: Add support for expicit void regions - double sigma_t = sigma_t_[material * negroups_ + g]; + double sigma_t = sigma_t_[material * negroups_ + g] * density_mult; source_regions_.scalar_flux_new(sr, g) -= scalar_flux_rhs_bd * inverse_vbar / sigma_t; source_regions_.scalar_flux_new(sr, g) /= 1 + A0 * inverse_vbar / sigma_t; @@ -1469,12 +1467,12 @@ void FlatSourceDomain::set_adjoint_sources() #pragma omp parallel for for (int64_t sr = 0; sr < n_source_regions(); sr++) { int material = source_regions_.material(sr); + double density_mult = source_regions_.density_mult(sr); if (material == MATERIAL_VOID) { continue; } for (int g = 0; g < negroups_; g++) { - double sigma_t = - sigma_t_[material * negroups_ + g] * source_regions_.density_mult(sr); + double sigma_t = sigma_t_[material * negroups_ + g] * density_mult; source_regions_.external_source(sr, g) /= sigma_t; } } @@ -1951,10 +1949,12 @@ void FlatSourceDomain::compute_single_phi_prime(SourceRegionHandle& srh) double A0 = (bd_coefficients_first_order_.at(RandomRay::bd_order_))[0] / settings::dt; int material = srh.material(); + double density_mult = srh.density_mult(); for (int g = 0; g < negroups_; g++) { double inverse_vbar = inverse_vbar_[material * negroups_ + g]; // TODO: add support for explicit void - double sigma_t = sigma_t_[material * negroups_ + g]; + double sigma_t = sigma_t_[material * negroups_ + g] * density_mult; + ; double scalar_flux_time_derivative = A0 * srh.scalar_flux_old(g) + srh.scalar_flux_rhs_bd(g); @@ -1970,10 +1970,11 @@ void FlatSourceDomain::compute_single_T1(SourceRegionHandle& srh) double B0 = (bd_coefficients_second_order_.at(RandomRay::bd_order_))[0] / (settings::dt * settings::dt); int material = srh.material(); + double density_mult = srh.density_mult(); for (int g = 0; g < negroups_; g++) { double inverse_vbar = inverse_vbar_[material * negroups_ + g]; // TODO: add support for explicit void - double sigma_t = sigma_t_[material * negroups_ + g]; + double sigma_t = sigma_t_[material * negroups_ + g] * density_mult; // Multiply out sigma_t to correctly compute the derivative term float source_time_derivative = @@ -1999,6 +2000,7 @@ void FlatSourceDomain::compute_single_delayed_fission_source( } int material = srh.material(); + double density_mult = srh.density_mult(); if (material != MATERIAL_VOID) { double inverse_k_eff = 1.0 / k_eff_; for (int dg = 0; dg < ndgroups_; dg++) { @@ -2008,7 +2010,8 @@ void FlatSourceDomain::compute_single_delayed_fission_source( for (int g = 0; g < negroups_; g++) { double scalar_flux = scalar_flux = srh.scalar_flux_new(g); double nu_d_sigma_f = nu_d_sigma_f_[material * negroups_ * ndgroups_ + - dg * negroups_ + g]; + dg * negroups_ + g] * + density_mult; srh.delayed_fission_source(dg) += nu_d_sigma_f * scalar_flux; } srh.delayed_fission_source(dg) *= inverse_k_eff; @@ -2158,8 +2161,9 @@ void FlatSourceDomain::store_time_step_quantities(bool increment_not_initialize) if (RandomRay::time_method_ == RandomRayTimeMethod::PROPAGATION) { // Multiply out sigma_t to store the base source int material = source_regions_.material(sr); + double density_mult = source_regions_.density_mult(sr); // TODO: add support for explicit void regions - double sigma_t = sigma_t_[source_regions_.material(sr) * negroups_ + g]; + double sigma_t = sigma_t_[material * negroups_ + g] * density_mult; float source = source_regions_.source_final(sr, g) * sigma_t; add_value_to_bd_vector(source_regions_.source_bd(sr, g), source, increment_not_initialize, RandomRay::bd_order_); From 349679067ef2f553dc1ccf0f87ca51341e0a0755 Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 14 Jan 2026 14:00:10 -0600 Subject: [PATCH 52/64] fix incorrect header printed --- .../openmc/random_ray/random_ray_simulation.h | 3 +- src/random_ray/random_ray_simulation.cpp | 29 +++++++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/include/openmc/random_ray/random_ray_simulation.h b/include/openmc/random_ray/random_ray_simulation.h index ff93c9bf93a..7d4733a9e68 100644 --- a/include/openmc/random_ray/random_ray_simulation.h +++ b/include/openmc/random_ray/random_ray_simulation.h @@ -21,7 +21,6 @@ class RandomRaySimulation { // Methods void apply_fixed_sources_and_mesh_domains(); void prepare_fixed_sources_adjoint(); - void print_random_ray_headers(); void run_single_simulation(); void random_ray_adjoint(); void kinetic_initial_condition(); @@ -82,7 +81,7 @@ void openmc_reset_random_ray(); //! Write data related to randaom ray to statepoint //! \param[in] group HDF5 group void write_random_ray_hdf5(hid_t group); -void print_random_ray_headers(bool& adjoint_needed); +void print_adjoint_header(); // Functions for kinetic simulations void set_time_dependent_settings(); diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index 45b9d12bacb..c1a5293f6ef 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -29,8 +29,11 @@ void openmc_run_random_ray() ////////////////////////////////////////////////////////// if (mpi::master) { - bool adjoint_needed = FlatSourceDomain::adjoint_; - print_random_ray_headers(adjoint_needed); + if (FlatSourceDomain::adjoint_) { + FlatSourceDomain::adjoint_ = false; + openmc::print_adjoint_header(); + FlatSourceDomain::adjoint_ = true; + } } // Initialize OpenMC general data structures @@ -383,15 +386,14 @@ void write_random_ray_hdf5(hid_t group) close_group(random_ray_group); } -void print_random_ray_headers(bool& adjoint_needed) +void print_adjoint_header() { - // If we're going to do an adjoint simulation afterwards, report that this is - // the initial forward flux solve. - if (adjoint_needed && !FlatSourceDomain::adjoint_) + if (!FlatSourceDomain::adjoint_) + // If we're going to do an adjoint simulation afterwards, report that this + // is the initial forward flux solve. header("FORWARD FLUX SOLVE", 3); - - // Otherwise report that we are doing the adjoint simulation - if (adjoint_needed && FlatSourceDomain::adjoint_) + else + // Otherwise report that we are doing the adjoint simulation header("ADJOINT FLUX SOLVE", 3); } @@ -482,16 +484,11 @@ void RandomRaySimulation::prepare_fixed_sources_adjoint() } } -void RandomRaySimulation::print_random_ray_headers() -{ - openmc::print_random_ray_headers(adjoint_needed_); -} - void RandomRaySimulation::run_single_simulation() { if (!is_first_simulation_) { - if (mpi::master) - print_random_ray_headers(); + if (mpi::master && adjoint_needed_) + openmc::print_adjoint_header(); // Reset the timers and reinitialize the general OpenMC datastructures if // this is after the first simulation From d0e72529672e1f529e40f7341e0fbb0590d77d0b Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 14 Jan 2026 14:28:58 -0600 Subject: [PATCH 53/64] update regression test function names --- tests/regression_tests/random_ray_auto_convert_kinetic/test.py | 2 +- tests/regression_tests/random_ray_k_eff_kinetic/test.py | 2 +- tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py index 34ed2012b1e..df482abc953 100644 --- a/tests/regression_tests/random_ray_auto_convert_kinetic/test.py +++ b/tests/regression_tests/random_ray_auto_convert_kinetic/test.py @@ -30,7 +30,7 @@ def _cleanup(self): ("infinite_medium", "propagation"), ]) -def test_random_ray_auto_convert(generation_method, time_method): +def test_random_ray_auto_convert_kinetic(generation_method, time_method): with change_directory(f'{generation_method}/{time_method}'): openmc.reset_auto_ids() diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_kinetic/test.py index 2037554d295..c8fdc8ea083 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_kinetic/test.py @@ -18,7 +18,7 @@ def _cleanup(self): @pytest.mark.parametrize("time_method", ["isotropic", "propagation"]) -def test_random_ray_time_dependent(time_method): +def test_random_ray_basic_kinetic(time_method): with change_directory(time_method): openmc.reset_auto_ids() model = random_ray_pin_cell(kinetic=True) diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py index 1b082ca6078..d0b8ff53ad4 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/test.py @@ -18,7 +18,7 @@ def _cleanup(self): @pytest.mark.parametrize("time_method", ["isotropic", "propagation"]) -def test_random_ray_k_eff_mesh(time_method): +def test_random_ray_k_eff_mesh_kinetic(time_method): with change_directory(time_method): model = random_ray_lattice(kinetic=True) model.settings.timestep_parameters['n_timesteps'] = 5 From d4b973c436c5b8b298f1342c73c41a310aaa6d26 Mon Sep 17 00:00:00 2001 From: yardasol Date: Mon, 26 Jan 2026 18:48:32 -0600 Subject: [PATCH 54/64] cleanup --- .../openmc/random_ray/flat_source_domain.h | 2 +- include/openmc/random_ray/source_region.h | 62 ++++++++++--------- src/random_ray/flat_source_domain.cpp | 11 ++-- src/random_ray/random_ray_simulation.cpp | 44 ++++++------- src/simulation.cpp | 2 +- 5 files changed, 59 insertions(+), 62 deletions(-) diff --git a/include/openmc/random_ray/flat_source_domain.h b/include/openmc/random_ray/flat_source_domain.h index 4ece73414ae..d627f3c14fc 100644 --- a/include/openmc/random_ray/flat_source_domain.h +++ b/include/openmc/random_ray/flat_source_domain.h @@ -191,7 +191,7 @@ class FlatSourceDomain { // 3D arrays stored in 1D representing values for all materials x energy // groups x delay groups vector nu_d_sigma_f_; - vector chi_d_; + vector chi_d_lambda_; // chi-delayed * lambda in each delay group // 2D arrays stored in 1D representing values for all materials x energy // groups diff --git a/include/openmc/random_ray/source_region.h b/include/openmc/random_ray/source_region.h index 235a38dd49e..e0e83252491 100644 --- a/include/openmc/random_ray/source_region.h +++ b/include/openmc/random_ray/source_region.h @@ -209,10 +209,10 @@ class SourceRegionHandle { // Energy group-wise 2D BD arrays (g x time step) std::deque* scalar_flux_bd_; - std::deque* precursors_bd_; + std::deque* source_bd_; // Delay group-wise 2D BD arrays (dg x time step) - std::deque* source_bd_; + std::deque* precursors_bd_; // Energy group-wise 1D RHS BD arrays double* scalar_flux_rhs_bd_; @@ -374,15 +374,15 @@ class SourceRegionHandle { return scalar_flux_bd_[g]; } + std::deque& source_bd(int g) { return source_bd_[g]; } + const std::deque& source_bd(int g) const { return source_bd_[g]; } + std::deque& precursors_bd(int dg) { return precursors_bd_[dg]; } const std::deque& precursors_bd(int dg) const { return precursors_bd_[dg]; } - std::deque& source_bd(int g) { return source_bd_[g]; } - const std::deque& source_bd(int g) const { return source_bd_[g]; } - double& scalar_flux_rhs_bd(int g) { return scalar_flux_rhs_bd_[g]; } const double scalar_flux_rhs_bd(int g) const { @@ -522,17 +522,17 @@ class SourceRegion { //!< finite number of previous time steps (used for //!< computing the first order (and second order, for SDP) //!< scalar flux time derivative) - vector> - precursors_bd_; //!< The final scalar flux in each energy group from a - //!< finite number of previous time steps (used for - //!< computing the first order source time derivative for - //!< SDP) + vector> + source_bd_; //!< The final scalar flux in each energy group from a + //!< finite number of previous time steps (used for + //!< computing the first order source time derivative for + //!< SDP) // Delay group-wise 2D BD arrays (dg x time step) - vector> - source_bd_; //!< The final precursor population in each energy group from a - //!< finite number of previous time steps (used for computing - //!< the first order precursor time derivative) + vector> + precursors_bd_; //!< The final precursor population in each energy group + //!< from a finite number of previous time steps (used for + //!< computing the first order precursor time derivative) // Energy group-wise 1D RHS BD arrays vector @@ -877,20 +877,6 @@ class SourceRegionContainer { return scalar_flux_bd_[se]; } - std::deque& precursors_bd(int64_t sr, int dg) - { - return precursors_bd_[dindex(sr, dg)]; - } - const std::deque& precursors_bd(int64_t sr, int dg) const - { - return precursors_bd_[dindex(sr, dg)]; - } - std::deque& precursors_bd(int64_t de) { return precursors_bd_[de]; } - const std::deque& precursors_bd(int64_t de) const - { - return precursors_bd_[de]; - } - std::deque& source_bd(int64_t sr, int g) { return source_bd_[index(sr, g)]; @@ -905,6 +891,20 @@ class SourceRegionContainer { return source_bd_[se]; } + std::deque& precursors_bd(int64_t sr, int dg) + { + return precursors_bd_[dindex(sr, dg)]; + } + const std::deque& precursors_bd(int64_t sr, int dg) const + { + return precursors_bd_[dindex(sr, dg)]; + } + std::deque& precursors_bd(int64_t de) { return precursors_bd_[de]; } + const std::deque& precursors_bd(int64_t de) const + { + return precursors_bd_[de]; + } + double& scalar_flux_rhs_bd(int64_t sr, int g) { return scalar_flux_rhs_bd_[index(sr, g)]; @@ -1067,11 +1067,13 @@ class SourceRegionContainer { vector precursors_new_; vector precursors_final_; - // SoA energy group-wise 3D BD arrays (sr x g/dg X timestep) flattened to 2D + // SoA energy group-wise 3D BD arrays (sr x g X timestep) flattened to 2D vector> scalar_flux_bd_; - vector> precursors_bd_; vector> source_bd_; + // SoA delay group-wise 3D BD arrays (sr x dg X timestep) flattened to 2D + vector> precursors_bd_; + // SoA energy group-wise 2D RHS BD arrays flattened to 1D vector scalar_flux_rhs_bd_; vector source_rhs_bd_; diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 0fba53d553b..b4309f64b92 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -158,11 +158,10 @@ void FlatSourceDomain::update_single_neutron_source(SourceRegionHandle& srh) settings::create_delayed_neutrons) { double delayed_source = 0.0; for (int dg = 0; dg < ndgroups_; dg++) { - double chi_d = - chi_d_[material * negroups_ * ndgroups_ + dg * negroups_ + g_out]; - double lambda = lambda_[material * ndgroups_ + dg]; + double chi_d_lambda = chi_d_lambda_[material * negroups_ * ndgroups_ + + dg * negroups_ + g_out]; double precursors = srh.precursors_old(dg); - delayed_source += chi_d * precursors * lambda; + delayed_source += chi_d_lambda * precursors; } total_source += delayed_source; } @@ -1400,13 +1399,13 @@ void FlatSourceDomain::flatten_xs() // material is fissionable but has very small sigma_f. chi_d = 0.0; } - chi_d_.push_back(chi_d); + chi_d_lambda_.push_back(chi_d * lambda); } } else { lambda_.push_back(0); for (int g_out = 0; g_out < negroups_; g_out++) { nu_d_sigma_f_.push_back(0); - chi_d_.push_back(0); + chi_d_lambda_.push_back(0); } } } diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index 6326ca9c438..7409e117a84 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -510,24 +510,23 @@ void RandomRaySimulation::prepare_adjoint_simulation() // TODO: Add support for time-dependent restart void RandomRaySimulation::kinetic_single_time_step(int i) { - if (i == -1) { - // Set flag for k_eff correction if initial condition - simulation::k_eff_correction = true; - - // Store average keff from initial simulation - static_avg_k_eff_ = simulation::keff; - } - // Increment time step simulation::current_timestep = i + 1; - if (i == -1) - // Current time is zero for initial condition - simulation::current_time = 0; - else - // Else, increment the current time + if (i >= 0) + // Increment the current time simulation::current_time += settings::dt; - domain_->k_eff_ = static_avg_k_eff_; + // Set eigenvalue if needed + if (settings::run_mode == RunMode::EIGENVALUE) { + if (i == -1) { + // Set flag for k_eff correction if initial condition + simulation::k_eff_correction = true; + + // Store average keff from initial simulation + static_avg_k_eff_ = simulation::keff; + } + domain_->k_eff_ = static_avg_k_eff_; + } domain_->source_regions_.adjoint_reset(); domain_->propagate_final_quantities(); domain_->source_regions_.time_step_reset(); @@ -543,25 +542,22 @@ void RandomRaySimulation::kinetic_single_time_step(int i) // Run the initial condition simulate(); - if (i == -1) + if (i == -1) { // Initialize the BD arrays if initial condition domain_->store_time_step_quantities(false); - else + // Reset flags for kinetic simulation if initial condition + simulation::is_initial_condition = false; + simulation::k_eff_correction = false; + } else { // Else, store final quantities for the current time step domain_->store_time_step_quantities(); + } // Rename statepoint and tallies file for the current time step rename_time_step_file(fmt::format("statepoint.{0}", settings::n_batches), ".h5", simulation::current_timestep); - if (settings::output_tallies) { + if (settings::output_tallies) rename_time_step_file("tallies", ".out", simulation::current_timestep); - } - - if (i == -1) { - // Reset flags for kinetic simulation if initial condition - simulation::is_initial_condition = false; - simulation::k_eff_correction = false; - } } void RandomRaySimulation::simulate() diff --git a/src/simulation.cpp b/src/simulation.cpp index 7fd325593d0..06648277c13 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -338,7 +338,7 @@ vector work_index; bool is_initial_condition {true}; int current_timestep; -double current_time; +double current_time {0.0}; bool k_eff_correction {false}; } // namespace simulation From a00842ffb1e697f880f2c19bb8cc736efb5d1c84 Mon Sep 17 00:00:00 2001 From: John Tramm Date: Tue, 17 Feb 2026 09:50:38 -0600 Subject: [PATCH 55/64] Replace xtensor with internal Tensor/View classes (#3805) Co-authored-by: John Tramm --- .gitmodules | 6 - CMakeLists.txt | 19 +- cmake/OpenMCConfig.cmake.in | 2 - docs/source/quickinstall.rst | 2 +- include/openmc/bremsstrahlung.h | 12 +- include/openmc/distribution_energy.h | 8 +- include/openmc/eigenvalue.h | 4 +- include/openmc/hdf5_interface.h | 108 +- include/openmc/material.h | 4 +- include/openmc/mesh.h | 16 +- include/openmc/mgxs.h | 4 +- include/openmc/nuclide.h | 2 +- include/openmc/photon.h | 40 +- include/openmc/plot.h | 10 +- .../openmc/random_ray/flat_source_domain.h | 4 +- include/openmc/scattdata.h | 42 +- include/openmc/secondary_correlated.h | 8 +- include/openmc/secondary_kalbach.h | 12 +- include/openmc/secondary_thermal.h | 16 +- include/openmc/tallies/tally.h | 18 +- include/openmc/tensor.h | 1185 +++++++++++++++++ include/openmc/thermal.h | 2 +- include/openmc/urr.h | 8 +- include/openmc/volume_calc.h | 2 +- include/openmc/weight_windows.h | 19 +- include/openmc/wmp.h | 6 +- include/openmc/xml_interface.h | 8 +- include/openmc/xsdata.h | 26 +- src/bank.cpp | 1 + src/bremsstrahlung.cpp | 6 +- src/cmfd_solver.cpp | 34 +- src/cross_sections.cpp | 2 +- src/distribution_angle.cpp | 13 +- src/distribution_energy.cpp | 18 +- src/eigenvalue.cpp | 17 +- src/endf.cpp | 15 +- src/finalize.cpp | 4 +- src/hdf5_interface.cpp | 22 +- src/material.cpp | 43 +- src/mesh.cpp | 131 +- src/mgxs.cpp | 40 +- src/nuclide.cpp | 26 +- src/output.cpp | 2 +- src/photon.cpp | 81 +- src/physics.cpp | 7 +- src/physics_mg.cpp | 2 +- src/plot.cpp | 30 +- src/random_ray/flat_source_domain.cpp | 4 +- src/random_ray/random_ray.cpp | 2 + src/scattdata.cpp | 88 +- src/secondary_correlated.cpp | 34 +- src/secondary_kalbach.cpp | 23 +- src/secondary_thermal.cpp | 14 +- src/simulation.cpp | 4 +- src/source.cpp | 7 +- src/state_point.cpp | 55 +- src/tallies/filter_cell_instance.cpp | 3 +- src/tallies/filter_meshmaterial.cpp | 4 +- src/tallies/tally.cpp | 64 +- src/tallies/tally_scoring.cpp | 1 + src/tallies/trigger.cpp | 2 +- src/thermal.cpp | 11 +- src/track_output.cpp | 2 +- src/urr.cpp | 4 +- src/volume_calc.cpp | 14 +- src/weight_windows.cpp | 128 +- src/wmp.cpp | 14 +- src/xsdata.cpp | 534 +++++--- tests/cpp_unit_tests/CMakeLists.txt | 1 + tests/cpp_unit_tests/test_tensor.cpp | 987 ++++++++++++++ tests/regression_tests/cpp_driver/driver.cpp | 2 + vendor/xtensor | 1 - vendor/xtl | 1 - 73 files changed, 3155 insertions(+), 936 deletions(-) create mode 100644 include/openmc/tensor.h create mode 100644 tests/cpp_unit_tests/test_tensor.cpp delete mode 160000 vendor/xtensor delete mode 160000 vendor/xtl diff --git a/.gitmodules b/.gitmodules index f84d09bb1f9..2bc12389436 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,6 @@ [submodule "vendor/pugixml"] path = vendor/pugixml url = https://github.com/zeux/pugixml.git -[submodule "vendor/xtensor"] - path = vendor/xtensor - url = https://github.com/xtensor-stack/xtensor.git -[submodule "vendor/xtl"] - path = vendor/xtl - url = https://github.com/xtensor-stack/xtl.git [submodule "vendor/fmt"] path = vendor/fmt url = https://github.com/fmtlib/fmt.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 87b8789d101..cbf07808df7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,23 +266,6 @@ else() endif() endif() -#=============================================================================== -# xtensor header-only library -#=============================================================================== - -if(OPENMC_FORCE_VENDORED_LIBS) - add_subdirectory(vendor/xtl) - set(xtl_DIR ${CMAKE_CURRENT_BINARY_DIR}/vendor/xtl) - add_subdirectory(vendor/xtensor) -else() - find_package_write_status(xtensor) - if (NOT xtensor_FOUND) - add_subdirectory(vendor/xtl) - set(xtl_DIR ${CMAKE_CURRENT_BINARY_DIR}/vendor/xtl) - add_subdirectory(vendor/xtensor) - endif() -endif() - #=============================================================================== # Catch2 library #=============================================================================== @@ -495,7 +478,7 @@ endif() # target_link_libraries treats any arguments starting with - but not -l as # linker flags. Thus, we can pass both linker flags and libraries together. target_link_libraries(libopenmc ${ldflags} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} - xtensor fmt::fmt ${CMAKE_DL_LIBS}) + fmt::fmt ${CMAKE_DL_LIBS}) if(TARGET pugixml::pugixml) target_link_libraries(libopenmc pugixml::pugixml) diff --git a/cmake/OpenMCConfig.cmake.in b/cmake/OpenMCConfig.cmake.in index 837a39c7833..cc837bba711 100644 --- a/cmake/OpenMCConfig.cmake.in +++ b/cmake/OpenMCConfig.cmake.in @@ -5,8 +5,6 @@ get_filename_component(_OPENMC_PREFIX "${OpenMC_CMAKE_DIR}/../../.." ABSOLUTE) find_package(fmt CONFIG REQUIRED HINTS ${_OPENMC_PREFIX}) find_package(pugixml CONFIG REQUIRED HINTS ${_OPENMC_PREFIX}) -find_package(xtl CONFIG REQUIRED HINTS ${_OPENMC_PREFIX}) -find_package(xtensor CONFIG REQUIRED HINTS ${_OPENMC_PREFIX}) if(@OPENMC_USE_DAGMC@) find_package(DAGMC REQUIRED HINTS @DAGMC_DIR@) endif() diff --git a/docs/source/quickinstall.rst b/docs/source/quickinstall.rst index 0f887940ea5..6cb774b5b07 100644 --- a/docs/source/quickinstall.rst +++ b/docs/source/quickinstall.rst @@ -119,7 +119,7 @@ packages should be installed, for example in Homebrew via: .. code-block:: sh - brew install llvm cmake xtensor hdf5 python libomp libpng + brew install llvm cmake hdf5 python libomp libpng The compiler provided by the above LLVM package should be used in place of the one provisioned by XCode, which does not support the multithreading library used diff --git a/include/openmc/bremsstrahlung.h b/include/openmc/bremsstrahlung.h index 2f7e41bf087..d3b5868317a 100644 --- a/include/openmc/bremsstrahlung.h +++ b/include/openmc/bremsstrahlung.h @@ -3,7 +3,7 @@ #include "openmc/particle.h" -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" namespace openmc { @@ -14,9 +14,9 @@ namespace openmc { class BremsstrahlungData { public: // Data - xt::xtensor pdf; //!< Bremsstrahlung energy PDF - xt::xtensor cdf; //!< Bremsstrahlung energy CDF - xt::xtensor yield; //!< Photon yield + tensor::Tensor pdf; //!< Bremsstrahlung energy PDF + tensor::Tensor cdf; //!< Bremsstrahlung energy CDF + tensor::Tensor yield; //!< Photon yield }; class Bremsstrahlung { @@ -32,9 +32,9 @@ class Bremsstrahlung { namespace data { -extern xt::xtensor +extern tensor::Tensor ttb_e_grid; //! energy T of incident electron in [eV] -extern xt::xtensor +extern tensor::Tensor ttb_k_grid; //! reduced energy W/T of emitted photon } // namespace data diff --git a/include/openmc/distribution_energy.h b/include/openmc/distribution_energy.h index 9b08ed039dc..efacb913196 100644 --- a/include/openmc/distribution_energy.h +++ b/include/openmc/distribution_energy.h @@ -5,7 +5,7 @@ #define OPENMC_DISTRIBUTION_ENERGY_H #include "hdf5.h" -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include "openmc/constants.h" #include "openmc/endf.h" @@ -86,9 +86,9 @@ class ContinuousTabular : public EnergyDistribution { struct CTTable { Interpolation interpolation; //!< Interpolation law int n_discrete; //!< Number of of discrete energies - xt::xtensor e_out; //!< Outgoing energies in [eV] - xt::xtensor p; //!< Probability density - xt::xtensor c; //!< Cumulative distribution + tensor::Tensor e_out; //!< Outgoing energies in [eV] + tensor::Tensor p; //!< Probability density + tensor::Tensor c; //!< Cumulative distribution }; int n_region_; //!< Number of inteprolation regions diff --git a/include/openmc/eigenvalue.h b/include/openmc/eigenvalue.h index b456fee21eb..43874767609 100644 --- a/include/openmc/eigenvalue.h +++ b/include/openmc/eigenvalue.h @@ -6,7 +6,7 @@ #include // for int64_t -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include #include "openmc/array.h" @@ -24,7 +24,7 @@ namespace simulation { extern double keff_generation; //!< Single-generation k on each processor extern array k_sum; //!< Used to reduce sum and sum_sq extern vector entropy; //!< Shannon entropy at each generation -extern xt::xtensor source_frac; //!< Source fraction for UFS +extern tensor::Tensor source_frac; //!< Source fraction for UFS } // namespace simulation diff --git a/include/openmc/hdf5_interface.h b/include/openmc/hdf5_interface.h index 28b0d2b113d..93e4bfc820a 100644 --- a/include/openmc/hdf5_interface.h +++ b/include/openmc/hdf5_interface.h @@ -11,8 +11,7 @@ #include "hdf5.h" #include "hdf5_hl.h" -#include "xtensor/xadapt.hpp" -#include "xtensor/xarray.hpp" +#include "openmc/tensor.h" #include "openmc/array.h" #include "openmc/error.h" @@ -166,24 +165,19 @@ void read_attribute(hid_t obj_id, const char* name, vector& vec) read_attr(obj_id, name, H5TypeMap::type_id, vec.data()); } -// Generic array version +// Tensor version template -void read_attribute(hid_t obj_id, const char* name, xt::xarray& arr) +void read_attribute(hid_t obj_id, const char* name, tensor::Tensor& tensor) { - // Get shape of attribute array + // Get shape of attribute auto shape = attribute_shape(obj_id, name); - // Allocate new array to read data into - std::size_t size = 1; - for (const auto x : shape) - size *= x; - vector buffer(size); + // Resize tensor and read data directly + vector tshape(shape.begin(), shape.end()); + tensor.resize(tshape); // Read data from attribute - read_attr(obj_id, name, H5TypeMap::type_id, buffer.data()); - - // Adapt array into xarray - arr = xt::adapt(buffer, shape); + read_attr(obj_id, name, H5TypeMap::type_id, tensor.data()); } // overload for std::string @@ -290,61 +284,32 @@ void read_dataset( } template -void read_dataset(hid_t dset, xt::xarray& arr, bool indep = false) +void read_dataset(hid_t dset, tensor::Tensor& tensor, bool indep = false) { // Get shape of dataset vector shape = object_shape(dset); - // Allocate space in the array to read data into - std::size_t size = 1; - for (const auto x : shape) - size *= x; - arr.resize(shape); + // Resize tensor and read data directly + vector tshape(shape.begin(), shape.end()); + tensor.resize(tshape); - // Read data from attribute + // Read data from dataset read_dataset_lowlevel( - dset, nullptr, H5TypeMap::type_id, H5S_ALL, indep, arr.data()); + dset, nullptr, H5TypeMap::type_id, H5S_ALL, indep, tensor.data()); } template<> void read_dataset( - hid_t dset, xt::xarray>& arr, bool indep); + hid_t dset, tensor::Tensor>& tensor, bool indep); template void read_dataset( - hid_t obj_id, const char* name, xt::xarray& arr, bool indep = false) -{ - // Open dataset and read array - hid_t dset = open_dataset(obj_id, name); - read_dataset(dset, arr, indep); - close_dataset(dset); -} - -template -void read_dataset( - hid_t obj_id, const char* name, xt::xtensor& arr, bool indep = false) + hid_t obj_id, const char* name, tensor::Tensor& tensor, bool indep = false) { - // Open dataset and read array + // Open dataset and read tensor hid_t dset = open_dataset(obj_id, name); - - // Get shape of dataset - vector hsize_t_shape = object_shape(dset); + read_dataset(dset, tensor, indep); close_dataset(dset); - - // cast from hsize_t to size_t - vector shape(hsize_t_shape.size()); - for (int i = 0; i < shape.size(); i++) { - shape[i] = static_cast(hsize_t_shape[i]); - } - - // Allocate new xarray to read data into - xt::xarray xarr(shape); - - // Read data from the dataset - read_dataset(obj_id, name, xarr); - - // Copy into xtensor - arr = xarr; } // overload for Position @@ -358,31 +323,22 @@ inline void read_dataset( r.z = x[2]; } -template +template inline void read_dataset_as_shape( - hid_t obj_id, const char* name, xt::xtensor& arr, bool indep = false) + hid_t obj_id, const char* name, tensor::Tensor& tensor, bool indep = false) { hid_t dset = open_dataset(obj_id, name); - // Allocate new array to read data into - std::size_t size = 1; - for (const auto x : arr.shape()) - size *= x; - vector buffer(size); - - // Read data from attribute + // Read data directly into pre-shaped tensor read_dataset_lowlevel( - dset, nullptr, H5TypeMap::type_id, H5S_ALL, indep, buffer.data()); - - // Adapt into xarray - arr = xt::adapt(buffer, arr.shape()); + dset, nullptr, H5TypeMap::type_id, H5S_ALL, indep, tensor.data()); close_dataset(dset); } -template -inline void read_nd_vector(hid_t obj_id, const char* name, - xt::xtensor& result, bool must_have = false) +template +inline void read_nd_tensor(hid_t obj_id, const char* name, + tensor::Tensor& result, bool must_have = false) { if (object_exists(obj_id, name)) { read_dataset_as_shape(obj_id, name, result, true); @@ -496,12 +452,16 @@ inline void write_dataset( false, buffer.data()); } -// Template for xarray, xtensor, etc. -template -inline void write_dataset( - hid_t obj_id, const char* name, const xt::xcontainer& arr) +// Template for Tensor and StaticTensor2D. A SFINAE guard is used here to +// prevent this template from matching vector/string types that have their own +// overloads above. A generic Container parameter avoids duplicating the body +// for both Tensor and StaticTensor2D. +template>::value>> +inline void write_dataset(hid_t obj_id, const char* name, const Container& arr) { - using T = typename D::value_type; + using T = typename std::decay_t::value_type; auto s = arr.shape(); vector dims {s.cbegin(), s.cend()}; write_dataset_lowlevel(obj_id, dims.size(), dims.data(), name, diff --git a/include/openmc/material.h b/include/openmc/material.h index f55a43d625e..0a61d8fe53f 100644 --- a/include/openmc/material.h +++ b/include/openmc/material.h @@ -5,8 +5,8 @@ #include #include "openmc/span.h" +#include "openmc/tensor.h" #include "pugixml.hpp" -#include "xtensor/xtensor.hpp" #include #include "openmc/bremsstrahlung.h" @@ -189,7 +189,7 @@ class Material { vector nuclide_; //!< Indices in nuclides vector vector element_; //!< Indices in elements vector NCrystalMat ncrystal_mat_; //!< NCrystal material object - xt::xtensor atom_density_; //!< Nuclide atom density in [atom/b-cm] + tensor::Tensor atom_density_; //!< Nuclide atom density in [atom/b-cm] double density_; //!< Total atom density in [atom/b-cm] double density_gpcc_; //!< Total atom density in [g/cm^3] double charge_density_; //!< Total charge density in [e/b-cm] diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 2936d3ab1bd..8c02da764ae 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -8,8 +8,8 @@ #include #include "hdf5.h" +#include "openmc/tensor.h" #include "pugixml.hpp" -#include "xtensor/xtensor.hpp" #include "openmc/bounding_box.h" #include "openmc/error.h" @@ -252,8 +252,8 @@ class Mesh { virtual Position upper_right() const = 0; // Data members - xt::xtensor lower_left_; //!< Lower-left coordinates of mesh - xt::xtensor upper_right_; //!< Upper-right coordinates of mesh + tensor::Tensor lower_left_; //!< Lower-left coordinates of mesh + tensor::Tensor upper_right_; //!< Upper-right coordinates of mesh int id_ {-1}; //!< Mesh ID std::string name_; //!< User-specified name int n_dimension_ {-1}; //!< Number of dimensions @@ -316,7 +316,7 @@ class StructuredMesh : public Mesh { //! \param[in] Pointer to bank sites //! \param[in] Number of bank sites //! \param[out] Whether any bank sites are outside the mesh - xt::xtensor count_sites( + tensor::Tensor count_sites( const SourceSite* bank, int64_t length, bool* outside) const; //! Get bin given mesh indices @@ -387,8 +387,8 @@ class StructuredMesh : public Mesh { //! Get a label for the mesh bin std::string bin_label(int bin) const override; - //! Get shape as xt::xtensor - xt::xtensor get_x_shape() const; + //! Get mesh dimensions as a tensor + tensor::Tensor get_shape_tensor() const; double volume(int bin) const override { @@ -483,7 +483,7 @@ class RegularMesh : public StructuredMesh { //! \param[in] bank Array of bank sites //! \param[out] Whether any bank sites are outside the mesh //! \return Array indicating number of sites in each mesh/energy bin - xt::xtensor count_sites( + tensor::Tensor count_sites( const SourceSite* bank, int64_t length, bool* outside) const; //! Return the volume for a given mesh index @@ -494,7 +494,7 @@ class RegularMesh : public StructuredMesh { // Data members double volume_frac_; //!< Volume fraction of each mesh element double element_volume_; //!< Volume of each mesh element - xt::xtensor width_; //!< Width of each mesh element + tensor::Tensor width_; //!< Width of each mesh element }; class RectilinearMesh : public StructuredMesh { diff --git a/include/openmc/mgxs.h b/include/openmc/mgxs.h index 9b1602f299a..34f373b33aa 100644 --- a/include/openmc/mgxs.h +++ b/include/openmc/mgxs.h @@ -6,7 +6,7 @@ #include -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include "openmc/constants.h" #include "openmc/hdf5_interface.h" @@ -22,7 +22,7 @@ namespace openmc { class Mgxs { private: - xt::xtensor kTs; // temperature in eV (k * T) + tensor::Tensor kTs; // temperature in eV (k * T) AngleDistributionType scatter_format; // flag for if this is legendre, histogram, or tabular int num_groups; // number of energy groups diff --git a/include/openmc/nuclide.h b/include/openmc/nuclide.h index 60b88a153bc..86d71424a72 100644 --- a/include/openmc/nuclide.h +++ b/include/openmc/nuclide.h @@ -96,7 +96,7 @@ class Nuclide { // Temperature dependent cross section data vector kTs_; //!< temperatures in eV (k*T) vector grid_; //!< Energy grid at each temperature - vector> xs_; //!< Cross sections at each temperature + vector> xs_; //!< Cross sections at each temperature // Multipole data unique_ptr multipole_; diff --git a/include/openmc/photon.h b/include/openmc/photon.h index f6f28a4df1d..93c6dba53f5 100644 --- a/include/openmc/photon.h +++ b/include/openmc/photon.h @@ -6,7 +6,7 @@ #include "openmc/particle.h" #include "openmc/vector.h" -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include #include @@ -62,14 +62,14 @@ class PhotonInteraction { int64_t index_; //!< Index in global elements vector // Microscopic cross sections - xt::xtensor energy_; - xt::xtensor coherent_; - xt::xtensor incoherent_; - xt::xtensor photoelectric_total_; - xt::xtensor pair_production_total_; - xt::xtensor pair_production_electron_; - xt::xtensor pair_production_nuclear_; - xt::xtensor heating_; + tensor::Tensor energy_; + tensor::Tensor coherent_; + tensor::Tensor incoherent_; + tensor::Tensor photoelectric_total_; + tensor::Tensor pair_production_total_; + tensor::Tensor pair_production_electron_; + tensor::Tensor pair_production_nuclear_; + tensor::Tensor heating_; // Form factors Tabulated1D incoherent_form_factor_; @@ -81,27 +81,27 @@ class PhotonInteraction { // stored separately to improve memory access pattern when calculating the // total cross section vector shells_; - xt::xtensor cross_sections_; + tensor::Tensor cross_sections_; // Compton profile data - xt::xtensor profile_pdf_; - xt::xtensor profile_cdf_; - xt::xtensor binding_energy_; - xt::xtensor electron_pdf_; + tensor::Tensor profile_pdf_; + tensor::Tensor profile_cdf_; + tensor::Tensor binding_energy_; + tensor::Tensor electron_pdf_; // Map subshells from Compton profile data obtained from Biggs et al, // "Hartree-Fock Compton profiles for the elements" to ENDF/B atomic // relaxation data - xt::xtensor subshell_map_; + tensor::Tensor subshell_map_; // Stopping power data double I_; // mean excitation energy - xt::xtensor n_electrons_; - xt::xtensor ionization_energy_; - xt::xtensor stopping_power_radiative_; + tensor::Tensor n_electrons_; + tensor::Tensor ionization_energy_; + tensor::Tensor stopping_power_radiative_; // Bremsstrahlung scaled DCS - xt::xtensor dcs_; + tensor::Tensor dcs_; // Whether atomic relaxation data is present bool has_atomic_relaxation_ {false}; @@ -137,7 +137,7 @@ void free_memory_photon(); namespace data { -extern xt::xtensor +extern tensor::Tensor compton_profile_pz; //! Compton profile momentum grid //! Photon interaction data for each element diff --git a/include/openmc/plot.h b/include/openmc/plot.h index 7e27679eabb..6a0fd1a8924 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -6,8 +6,8 @@ #include #include +#include "openmc/tensor.h" #include "pugixml.hpp" -#include "xtensor/xarray.hpp" #include "hdf5.h" #include "openmc/cell.h" @@ -88,6 +88,8 @@ const RGBColor BLACK {0, 0, 0}; * is designed to be implemented by classes that produce plot-relevant data * which can be visualized. */ + +typedef tensor::Tensor ImageData; class PlottableInterface { private: void set_id(pugi::xml_node plot_node); @@ -129,7 +131,7 @@ class PlottableInterface { vector colors_; // Plot colors }; -typedef xt::xtensor ImageData; +typedef tensor::Tensor ImageData; struct IdData { // Constructor @@ -140,7 +142,7 @@ struct IdData { void set_overlap(size_t y, size_t x); // Members - xt::xtensor data_; //!< 2D array of cell & material ids + tensor::Tensor data_; //!< 2D array of cell & material ids }; struct PropertyData { @@ -152,7 +154,7 @@ struct PropertyData { void set_overlap(size_t y, size_t x); // Members - xt::xtensor data_; //!< 2D array of temperature & density data + tensor::Tensor data_; //!< 2D array of temperature & density data }; //=============================================================================== diff --git a/include/openmc/random_ray/flat_source_domain.h b/include/openmc/random_ray/flat_source_domain.h index d627f3c14fc..ab5b302b3c0 100644 --- a/include/openmc/random_ray/flat_source_domain.h +++ b/include/openmc/random_ray/flat_source_domain.h @@ -224,10 +224,10 @@ class FlatSourceDomain { // Volumes for each tally and bin/score combination. This intermediate data // structure is used when tallying quantities that must be normalized by // volume (i.e., flux). The vector is index by tally index, while the inner 2D - // xtensor is indexed by bin index and score index in a similar manner to the + // tensor is indexed by bin index and score index in a similar manner to the // results tensor in the Tally class, though without the third dimension, as // SUM and SUM_SQ do not need to be tracked. - vector> tally_volumes_; + vector> tally_volumes_; }; // class FlatSourceDomain diff --git a/include/openmc/scattdata.h b/include/openmc/scattdata.h index a75ef09d97b..bea881402ac 100644 --- a/include/openmc/scattdata.h +++ b/include/openmc/scattdata.h @@ -4,7 +4,7 @@ #ifndef OPENMC_SCATTDATA_H #define OPENMC_SCATTDATA_H -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include "openmc/constants.h" #include "openmc/vector.h" @@ -26,23 +26,23 @@ class ScattData { protected: //! \brief Initializes the attributes of the base class. - void base_init(int order, const xt::xtensor& in_gmin, - const xt::xtensor& in_gmax, const double_2dvec& in_energy, + void base_init(int order, const tensor::Tensor& in_gmin, + const tensor::Tensor& in_gmax, const double_2dvec& in_energy, const double_2dvec& in_mult); //! \brief Combines microscopic ScattDatas into a macroscopic one. void base_combine(size_t max_order, size_t order_dim, const vector& those_scatts, const vector& scalars, - xt::xtensor& in_gmin, xt::xtensor& in_gmax, + tensor::Tensor& in_gmin, tensor::Tensor& in_gmax, double_2dvec& sparse_mult, double_3dvec& sparse_scatter); public: double_2dvec energy; // Normalized p0 matrix for sampling Eout double_2dvec mult; // nu-scatter multiplication (nu-scatt/scatt) double_3dvec dist; // Angular distribution - xt::xtensor gmin; // minimum outgoing group - xt::xtensor gmax; // maximum outgoing group - xt::xtensor scattxs; // Isotropic Sigma_{s,g_{in}} + tensor::Tensor gmin; // minimum outgoing group + tensor::Tensor gmax; // maximum outgoing group + tensor::Tensor scattxs; // Isotropic Sigma_{s,g_{in}} //! \brief Calculates the value of normalized f(mu). //! @@ -72,8 +72,8 @@ class ScattData { //! @param in_gmax List of maximum outgoing groups for every incoming group //! @param in_mult Input sparse multiplicity matrix //! @param coeffs Input sparse scattering matrix - virtual void init(const xt::xtensor& in_gmin, - const xt::xtensor& in_gmax, const double_2dvec& in_mult, + virtual void init(const tensor::Tensor& in_gmin, + const tensor::Tensor& in_gmax, const double_2dvec& in_mult, const double_3dvec& coeffs) = 0; //! \brief Combines the microscopic data. @@ -96,7 +96,7 @@ class ScattData { //! @param max_order If Legendre this is the maximum value of "n" in "Pn" //! requested; ignored otherwise. //! @return The dense scattering matrix. - virtual xt::xtensor get_matrix(size_t max_order) = 0; + virtual tensor::Tensor get_matrix(size_t max_order) = 0; //! \brief Samples the outgoing energy from the ScattData info. //! @@ -135,8 +135,8 @@ class ScattDataLegendre : public ScattData { ScattDataLegendre& leg, ScattDataTabular& tab); public: - void init(const xt::xtensor& in_gmin, - const xt::xtensor& in_gmax, const double_2dvec& in_mult, + void init(const tensor::Tensor& in_gmin, + const tensor::Tensor& in_gmax, const double_2dvec& in_mult, const double_3dvec& coeffs) override; void combine(const vector& those_scatts, @@ -153,7 +153,7 @@ class ScattDataLegendre : public ScattData { size_t get_order() override { return dist[0][0].size() - 1; }; - xt::xtensor get_matrix(size_t max_order) override; + tensor::Tensor get_matrix(size_t max_order) override; }; //============================================================================== @@ -164,13 +164,13 @@ class ScattDataLegendre : public ScattData { class ScattDataHistogram : public ScattData { protected: - xt::xtensor mu; // Angle distribution mu bin boundaries + tensor::Tensor mu; // Angle distribution mu bin boundaries double dmu; // Quick storage of the mu spacing double_3dvec fmu; // The angular distribution histogram public: - void init(const xt::xtensor& in_gmin, - const xt::xtensor& in_gmax, const double_2dvec& in_mult, + void init(const tensor::Tensor& in_gmin, + const tensor::Tensor& in_gmax, const double_2dvec& in_mult, const double_3dvec& coeffs) override; void combine(const vector& those_scatts, @@ -183,7 +183,7 @@ class ScattDataHistogram : public ScattData { size_t get_order() override { return dist[0][0].size(); }; - xt::xtensor get_matrix(size_t max_order) override; + tensor::Tensor get_matrix(size_t max_order) override; }; //============================================================================== @@ -194,7 +194,7 @@ class ScattDataHistogram : public ScattData { class ScattDataTabular : public ScattData { protected: - xt::xtensor mu; // Angle distribution mu grid points + tensor::Tensor mu; // Angle distribution mu grid points double dmu; // Quick storage of the mu spacing double_3dvec fmu; // The angular distribution function @@ -204,8 +204,8 @@ class ScattDataTabular : public ScattData { ScattDataLegendre& leg, ScattDataTabular& tab); public: - void init(const xt::xtensor& in_gmin, - const xt::xtensor& in_gmax, const double_2dvec& in_mult, + void init(const tensor::Tensor& in_gmin, + const tensor::Tensor& in_gmax, const double_2dvec& in_mult, const double_3dvec& coeffs) override; void combine(const vector& those_scatts, @@ -218,7 +218,7 @@ class ScattDataTabular : public ScattData { size_t get_order() override { return dist[0][0].size(); }; - xt::xtensor get_matrix(size_t max_order) override; + tensor::Tensor get_matrix(size_t max_order) override; }; //============================================================================== diff --git a/include/openmc/secondary_correlated.h b/include/openmc/secondary_correlated.h index 6905c38e369..b4b7f8480f5 100644 --- a/include/openmc/secondary_correlated.h +++ b/include/openmc/secondary_correlated.h @@ -5,7 +5,7 @@ #define OPENMC_SECONDARY_CORRELATED_H #include "hdf5.h" -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include "openmc/angle_energy.h" #include "openmc/distribution.h" @@ -25,9 +25,9 @@ class CorrelatedAngleEnergy : public AngleEnergy { struct CorrTable { int n_discrete; //!< Number of discrete lines Interpolation interpolation; //!< Interpolation law - xt::xtensor e_out; //!< Outgoing energies [eV] - xt::xtensor p; //!< Probability density - xt::xtensor c; //!< Cumulative distribution + tensor::Tensor e_out; //!< Outgoing energies [eV] + tensor::Tensor p; //!< Probability density + tensor::Tensor c; //!< Cumulative distribution vector> angle; //!< Angle distribution }; diff --git a/include/openmc/secondary_kalbach.h b/include/openmc/secondary_kalbach.h index 83806d35248..c9c5849bc77 100644 --- a/include/openmc/secondary_kalbach.h +++ b/include/openmc/secondary_kalbach.h @@ -5,7 +5,7 @@ #define OPENMC_SECONDARY_KALBACH_H #include "hdf5.h" -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include "openmc/angle_energy.h" #include "openmc/constants.h" @@ -37,11 +37,11 @@ class KalbachMann : public AngleEnergy { struct KMTable { int n_discrete; //!< Number of discrete lines Interpolation interpolation; //!< Interpolation law - xt::xtensor e_out; //!< Outgoing energies [eV] - xt::xtensor p; //!< Probability density - xt::xtensor c; //!< Cumulative distribution - xt::xtensor r; //!< Pre-compound fraction - xt::xtensor a; //!< Parameterized function + tensor::Tensor e_out; //!< Outgoing energies [eV] + tensor::Tensor p; //!< Probability density + tensor::Tensor c; //!< Cumulative distribution + tensor::Tensor r; //!< Pre-compound fraction + tensor::Tensor a; //!< Parameterized function }; int n_region_; //!< Number of interpolation regions diff --git a/include/openmc/secondary_thermal.h b/include/openmc/secondary_thermal.h index 5b18902afbb..4f33c0e763c 100644 --- a/include/openmc/secondary_thermal.h +++ b/include/openmc/secondary_thermal.h @@ -9,7 +9,7 @@ #include "openmc/secondary_correlated.h" #include "openmc/vector.h" -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include namespace openmc { @@ -83,7 +83,7 @@ class IncoherentElasticAEDiscrete : public AngleEnergy { private: const vector& energy_; //!< Energies at which cosines are tabulated - xt::xtensor mu_out_; //!< Cosines for each incident energy + tensor::Tensor mu_out_; //!< Cosines for each incident energy }; //============================================================================== @@ -109,9 +109,9 @@ class IncoherentInelasticAEDiscrete : public AngleEnergy { private: const vector& energy_; //!< Incident energies - xt::xtensor + tensor::Tensor energy_out_; //!< Outgoing energies for each incident energy - xt::xtensor + tensor::Tensor mu_out_; //!< Outgoing cosines for each incident/outgoing energy bool skewed_; //!< Whether outgoing energy distribution is skewed }; @@ -139,10 +139,10 @@ class IncoherentInelasticAE : public AngleEnergy { //! Secondary energy/angle distribution struct DistEnergySab { std::size_t n_e_out; //!< Number of outgoing energies - xt::xtensor e_out; //!< Outgoing energies - xt::xtensor e_out_pdf; //!< Probability density function - xt::xtensor e_out_cdf; //!< Cumulative distribution function - xt::xtensor mu; //!< Equiprobable angles at each outgoing energy + tensor::Tensor e_out; //!< Outgoing energies + tensor::Tensor e_out_pdf; //!< Probability density function + tensor::Tensor e_out_cdf; //!< Cumulative distribution function + tensor::Tensor mu; //!< Equiprobable angles at each outgoing energy }; vector energy_; //!< Incident energies diff --git a/include/openmc/tallies/tally.h b/include/openmc/tallies/tally.h index 374daff92a0..6161f823be1 100644 --- a/include/openmc/tallies/tally.h +++ b/include/openmc/tallies/tally.h @@ -8,9 +8,8 @@ #include "openmc/tallies/trigger.h" #include "openmc/vector.h" +#include "openmc/tensor.h" #include "pugixml.hpp" -#include "xtensor/xfixed.hpp" -#include "xtensor/xtensor.hpp" #include #include @@ -55,7 +54,7 @@ class Tally { void set_nuclides(const vector& nuclides); - const xt::xtensor& results() const { return results_; } + const tensor::Tensor& results() const { return results_; } //! returns vector of indices corresponding to the tally this is called on const vector& filters() const { return filters_; } @@ -125,7 +124,7 @@ class Tally { int score_index(const std::string& score) const; //! Tally results reshaped according to filter sizes - xt::xarray get_reshaped_data() const; + tensor::Tensor get_reshaped_data() const; //! A string representing the i-th score on this tally std::string score_name(int score_idx) const; @@ -160,7 +159,7 @@ class Tally { //! combination of filters (e.g. specific cell, specific energy group, etc.) //! and the second dimension of the array is for scores (e.g. flux, total //! reaction rate, fission reaction rate, etc.) - xt::xtensor results_; + tensor::Tensor results_; //! True if this tally should be written to statepoint files bool writable_ {true}; @@ -220,8 +219,7 @@ extern vector time_grid; namespace simulation { //! Global tallies (such as k-effective estimators) -extern xt::xtensor_fixed> - global_tallies; +extern tensor::StaticTensor2D global_tallies; //! Number of realizations for global tallies extern "C" int32_t n_realizations; @@ -257,12 +255,6 @@ double distance_to_time_boundary(double time, double speed); //! Determine which tallies should be active void setup_active_tallies(); -// Alias for the type returned by xt::adapt(...). N is the dimension of the -// multidimensional array -template -using adaptor_type = - xt::xtensor_adaptor, N>; - #ifdef OPENMC_MPI //! Collect all tally results onto master process void reduce_tally_results(); diff --git a/include/openmc/tensor.h b/include/openmc/tensor.h new file mode 100644 index 00000000000..9d428aaebdd --- /dev/null +++ b/include/openmc/tensor.h @@ -0,0 +1,1185 @@ +//! \file tensor.h +//! \brief Multi-dimensional tensor types for OpenMC. +//! +//! Tensor is the primary type: a dynamic-rank owning container that stores +//! elements contiguously in row-major order. View is a lightweight +//! non-owning reference into a Tensor's storage, returned by the slice() +//! method and flat(). StaticTensor2D is a small stack-allocated 2D +//! array used only for simulation::global_tallies. +//! +//! Slicing follows numpy conventions: each axis takes an index (rank-reducing), +//! All (keep entire axis), or Range (keep sub-range). For example, +//! arr.slice(0, all, range(2, 5)) is equivalent to numpy's arr[0, :, 2:5]. +//! +//! View is declared before Tensor because Tensor's methods return View objects. + +#ifndef OPENMC_TENSOR_H +#define OPENMC_TENSOR_H + +#include "openmc/vector.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace openmc { +namespace tensor { + +//============================================================================== +// Forward declarations +//============================================================================== + +template +class Tensor; + +template +class StaticTensor2D; + +//============================================================================== +// Storage type mapping +// +// std::vector is a bit-packed specialization that returns proxy objects +// instead of real references, which breaks generic code. storage_type_map +// redirects bool to unsigned char so that Tensor stores one byte per +// element with normal reference semantics. +//============================================================================== + +template +struct storage_type_map { + using type = T; +}; +template<> +struct storage_type_map { + using type = unsigned char; +}; +template +using storage_type = typename storage_type_map::type; + +//============================================================================== +// Slice argument types +// +// Used with the variadic slice() method on Tensor, View, and StaticTensor2D. +// Each argument corresponds to one axis: a plain integer fixes that axis at +// a single index (rank-reducing), All keeps the entire axis, and Range keeps +// a sub-range. +//============================================================================== + +//! Keep an entire axis (equivalent to numpy's ':' or xtensor's xt::all()) +struct All {}; +constexpr All all {}; + +//! Sub-range along an axis [start, end) +struct Range { + size_t start; + size_t end; // SIZE_MAX means "to end of axis" +}; + +//! Create a Range [start, end) +inline Range range(size_t start, size_t end) +{ + return {start, end}; +} + +//! Create a Range [0, end) +inline Range range(size_t end) +{ + return {0, end}; +} + +namespace detail { + +//! Internal: normalized representation of a per-axis slice argument +struct SliceArg { + enum Kind { INDEX, ALL, RANGE } kind; + size_t start; + size_t end; +}; + +inline SliceArg to_slice_arg(All) +{ + return {SliceArg::ALL, 0, 0}; +} +inline SliceArg to_slice_arg(Range r) +{ + return {SliceArg::RANGE, r.start, r.end}; +} + +template +inline + typename std::enable_if::value || std::is_enum::value, + SliceArg>::type + to_slice_arg(I i) +{ + return {SliceArg::INDEX, static_cast(i), 0}; +} + +//! Result of a slice computation: pointer offset + new shape/strides +struct SliceResult { + size_t ptr_offset; + vector shape; + vector strides; +}; + +//! Compute the result of applying slice arguments to shape/strides +template +SliceResult compute_slice(const vector& shape, + const vector& strides, First first, Rest... rest) +{ + const size_t n = 1 + sizeof...(Rest); + SliceArg args[1 + sizeof...(Rest)] = { + to_slice_arg(first), to_slice_arg(rest)...}; + + size_t offset = 0; + vector new_shape; + vector new_strides; + + for (size_t a = 0; a < n; ++a) { + switch (args[a].kind) { + case SliceArg::INDEX: + offset += args[a].start * strides[a]; + break; + case SliceArg::ALL: + new_shape.push_back(shape[a]); + new_strides.push_back(strides[a]); + break; + case SliceArg::RANGE: { + offset += args[a].start * strides[a]; + size_t end = (args[a].end == SIZE_MAX) ? shape[a] : args[a].end; + new_shape.push_back(end - args[a].start); + new_strides.push_back(strides[a]); + break; + } + } + } + + // Trailing axes not covered by arguments are implicitly All. + // This matches numpy: a[i] on a 2D array returns a 1D row. + for (size_t a = n; a < shape.size(); ++a) { + new_shape.push_back(shape[a]); + new_strides.push_back(strides[a]); + } + + return {offset, std::move(new_shape), std::move(new_strides)}; +} + +} // namespace detail + +//============================================================================== +// View: a non-owning N-dimensional view into a tensor's storage. +// +// Holds a base pointer, shape, and strides (in elements). Supports arbitrary +// rank and multi-axis slicing via the variadic slice() method. +//============================================================================== + +template +class View { +public: + //-------------------------------------------------------------------------- + // Constructors + + View(T* data, vector shape, vector strides) + : data_(data), shape_(std::move(shape)), strides_(std::move(strides)) + {} + + // Explicitly default copy/move constructors (declaring copy assignment + // below would otherwise suppress the implicit move constructor). + View(const View&) = default; + View(View&&) = default; + + //-------------------------------------------------------------------------- + // Indexing + + //! Multi-index element access (1D, 2D, 3D, ...) + template + T& operator()(Indices... indices) + { + const size_t idx[] = {static_cast(indices)...}; + size_t off = 0; + for (size_t d = 0; d < sizeof...(Indices); ++d) + off += idx[d] * strides_[d]; + return data_[off]; + } + + template + const T& operator()(Indices... indices) const + { + const size_t idx[] = {static_cast(indices)...}; + size_t off = 0; + for (size_t d = 0; d < sizeof...(Indices); ++d) + off += idx[d] * strides_[d]; + return data_[off]; + } + + //! Flat logical index (row-major order) + T& operator[](size_t i) { return data_[flat_to_offset(i)]; } + const T& operator[](size_t i) const { return data_[flat_to_offset(i)]; } + + //-------------------------------------------------------------------------- + // Accessors + + size_t size() const + { + size_t s = 1; + for (auto d : shape_) + s *= d; + return s; + } + size_t ndim() const { return shape_.size(); } + size_t shape(size_t axis) const { return shape_[axis]; } + const vector& shape_vec() const { return shape_; } + T* data() { return data_; } + const T* data() const { return data_; } + + //-------------------------------------------------------------------------- + // View accessors + + //! Multi-axis slice. Each argument corresponds to one axis and is either: + //! - an integer (fixes that axis, rank-reducing) + //! - All (keeps entire axis) + //! - Range (keeps sub-range along that axis) + //! Example: v.slice(0, all, range(2, 5)) == numpy v[0, :, 2:5] + template + View slice(First first, Rest... rest) + { + auto r = detail::compute_slice(shape_, strides_, first, rest...); + return {data_ + r.ptr_offset, std::move(r.shape), std::move(r.strides)}; + } + + template + View slice(First first, Rest... rest) const + { + auto r = detail::compute_slice(shape_, strides_, first, rest...); + return {data_ + r.ptr_offset, std::move(r.shape), std::move(r.strides)}; + } + + //-------------------------------------------------------------------------- + // Assignment operators + + //! Copy assignment: element-wise deep copy (writes through data pointer). + //! Without this, the compiler's implicit copy assignment just copies the + //! View metadata (pointer, shape, strides) instead of the viewed data. + View& operator=(const View& other) + { + size_t n = size(); + for (size_t i = 0; i < n; ++i) + data_[flat_to_offset(i)] = other[i]; + return *this; + } + + //! Fill all elements with a scalar + View& operator=(T val) + { + size_t n = size(); + for (size_t i = 0; i < n; ++i) + data_[flat_to_offset(i)] = val; + return *this; + } + + //! Assignment from initializer_list (for 1D views) + View& operator=(std::initializer_list vals) + { + auto it = vals.begin(); + for (size_t i = 0; i < size() && it != vals.end(); ++i, ++it) + data_[flat_to_offset(i)] = *it; + return *this; + } + + //! Assignment from another View + template + View& operator=(const View& other) + { + size_t n = size(); + for (size_t i = 0; i < n; ++i) + data_[flat_to_offset(i)] = other[i]; + return *this; + } + + //! Assignment from Tensor (forward-declared, defined after Tensor) + template + View& operator=(const Tensor& other); + + //! Compound addition from Tensor (forward-declared, defined after Tensor) + template + View& operator+=(const Tensor& o); + + //! Compound multiply by scalar + View& operator*=(T val) + { + size_t n = size(); + for (size_t i = 0; i < n; ++i) + data_[flat_to_offset(i)] *= val; + return *this; + } + + //! Compound divide by scalar + View& operator/=(T val) + { + size_t n = size(); + for (size_t i = 0; i < n; ++i) + data_[flat_to_offset(i)] /= val; + return *this; + } + + //-------------------------------------------------------------------------- + // Reductions + + //! Sum of all elements + T sum() const + { + // remove_const needed so accumulator is mutable when T is const-qualified + std::remove_const_t s = 0; + size_t n = size(); + for (size_t i = 0; i < n; ++i) + s += data_[flat_to_offset(i)]; + return s; + } + + //-------------------------------------------------------------------------- + // Iterators + // + // Lightweight row-major iterator parameterized on pointer type (Ptr). + // Stores a flat logical position and converts to a physical offset on each + // dereference via divmod over shape/strides. For contiguous 1D views (the + // common case) the divmod chain reduces to a single multiply-by-1, which + // the compiler optimizes away. + // + // view_iterator = mutable iterator (from non-const View) + // view_iterator = read-only iterator (from const View) + + template + class view_iterator { + Ptr base_; + size_t count_; + const size_t* shape_; + const size_t* strides_; + size_t ndim_; + + public: + using iterator_category = std::random_access_iterator_tag; + using value_type = std::remove_const_t; + using difference_type = std::ptrdiff_t; + using pointer = Ptr; + using reference = decltype(*std::declval()); + + view_iterator(Ptr base, size_t count, const View* v) + : base_(base), count_(count), shape_(v->shape_.data()), + strides_(v->strides_.data()), ndim_(v->shape_.size()) + {} + + reference operator*() const { return base_[offset()]; } + reference operator[](difference_type n) const + { + return base_[offset_of(count_ + n)]; + } + view_iterator& operator++() + { + ++count_; + return *this; + } + view_iterator operator++(int) + { + auto tmp = *this; + ++count_; + return tmp; + } + view_iterator& operator--() + { + --count_; + return *this; + } + view_iterator operator+(difference_type n) const + { + auto tmp = *this; + tmp.count_ += n; + return tmp; + } + view_iterator operator-(difference_type n) const + { + auto tmp = *this; + tmp.count_ -= n; + return tmp; + } + difference_type operator-(const view_iterator& o) const + { + return static_cast(count_) - + static_cast(o.count_); + } + view_iterator& operator+=(difference_type n) + { + count_ += n; + return *this; + } + view_iterator& operator-=(difference_type n) + { + count_ -= n; + return *this; + } + bool operator==(const view_iterator& o) const { return count_ == o.count_; } + bool operator!=(const view_iterator& o) const { return count_ != o.count_; } + bool operator<(const view_iterator& o) const { return count_ < o.count_; } + bool operator>(const view_iterator& o) const { return count_ > o.count_; } + bool operator<=(const view_iterator& o) const { return count_ <= o.count_; } + bool operator>=(const view_iterator& o) const { return count_ >= o.count_; } + friend view_iterator operator+(difference_type n, const view_iterator& it) + { + return it + n; + } + + private: + size_t offset() const { return offset_of(count_); } + size_t offset_of(size_t flat) const + { + size_t off = 0; + for (int d = static_cast(ndim_) - 1; d >= 0; --d) { + off += (flat % shape_[d]) * strides_[d]; + flat /= shape_[d]; + } + return off; + } + }; + + using iterator = view_iterator; + using const_iterator = view_iterator; + + iterator begin() { return {data_, 0, this}; } + iterator end() { return {data_, size(), this}; } + const_iterator begin() const { return cbegin(); } + const_iterator end() const { return cend(); } + const_iterator cbegin() const { return {data_, 0, this}; } + const_iterator cend() const { return {data_, size(), this}; } + +private: + //! Convert a logical flat index (row-major) to a physical element offset + size_t flat_to_offset(size_t flat) const + { + size_t off = 0; + for (int d = static_cast(shape_.size()) - 1; d >= 0; --d) { + off += (flat % shape_[d]) * strides_[d]; + flat /= shape_[d]; + } + return off; + } + + T* data_; + vector shape_; + vector strides_; +}; + +//============================================================================== +// Tensor: dynamic-rank N-dimensional tensor. +// +// Stores elements in a contiguous row-major vector> +// with a dynamic shape. +//============================================================================== + +template +class Tensor { +public: + using value_type = T; + using stored_type = storage_type; + using iterator = typename vector::iterator; + using const_iterator = typename vector::const_iterator; + + //-------------------------------------------------------------------------- + // Constructors + + Tensor() = default; + + //! Construct with shape (uninitialized for arithmetic types via vector + //! resize) + explicit Tensor(vector shape) + : shape_(std::move(shape)), data_(compute_size()) + {} + + //! Construct with shape and fill value + Tensor(vector shape, T fill) + : shape_(std::move(shape)), data_(compute_size(), fill) + {} + + //! Construct from initializer_list shape + explicit Tensor(std::initializer_list shape) + : shape_(shape), data_(compute_size()) + {} + + //! Construct from initializer_list shape with fill + Tensor(std::initializer_list shape, T fill) + : shape_(shape), data_(compute_size(), fill) + {} + + //! 1D copy from raw pointer + count + Tensor(const T* ptr, size_t count) : shape_({count}), data_(ptr, ptr + count) + {} + + //! Copy from View (preserves view's shape) + template + explicit Tensor(const View& v) : shape_(v.shape_vec()) + { + size_t n = v.size(); + data_.resize(n); + for (size_t i = 0; i < n; ++i) + data_[i] = v[i]; + } + + //-------------------------------------------------------------------------- + // Assignment + + //! Assignment from View + template + Tensor& operator=(const View& v) + { + shape_ = v.shape_vec(); + size_t n = v.size(); + data_.resize(n); + for (size_t i = 0; i < n; ++i) + data_[i] = v[i]; + return *this; + } + + //! Assignment from initializer_list of values (1D) + Tensor& operator=(std::initializer_list vals) + { + shape_ = {vals.size()}; + data_.assign(vals.begin(), vals.end()); + return *this; + } + + //-------------------------------------------------------------------------- + // Accessors + + stored_type* data() { return data_.data(); } + const stored_type* data() const { return data_.data(); } + size_t size() const { return data_.size(); } + const vector& shape() const { return shape_; } + size_t shape(size_t dim) const + { + return dim < shape_.size() ? shape_[dim] : 0; + } + size_t ndim() const { return shape_.size(); } + bool empty() const { return data_.empty(); } + + //-------------------------------------------------------------------------- + // Indexing (row-major) + + template + stored_type& operator()(Indices... indices) + { + const size_t idx[] = {static_cast(indices)...}; + size_t off = 0; + for (size_t d = 0; d < sizeof...(Indices); ++d) + off = off * shape_[d] + idx[d]; + return data_[off]; + } + + template + const stored_type& operator()(Indices... indices) const + { + const size_t idx[] = {static_cast(indices)...}; + size_t off = 0; + for (size_t d = 0; d < sizeof...(Indices); ++d) + off = off * shape_[d] + idx[d]; + return data_[off]; + } + + stored_type& operator[](size_t i) { return data_[i]; } + const stored_type& operator[](size_t i) const { return data_[i]; } + + //! First and last element + stored_type& front() { return data_.front(); } + const stored_type& front() const { return data_.front(); } + stored_type& back() { return data_.back(); } + const stored_type& back() const { return data_.back(); } + + //-------------------------------------------------------------------------- + // Iterators + + iterator begin() { return data_.begin(); } + iterator end() { return data_.end(); } + const_iterator begin() const { return data_.begin(); } + const_iterator end() const { return data_.end(); } + const_iterator cbegin() const { return data_.cbegin(); } + const_iterator cend() const { return data_.cend(); } + + //-------------------------------------------------------------------------- + // Mutation + + void resize(const vector& shape) + { + shape_ = shape; + data_.resize(compute_size()); + } + + void resize(std::initializer_list shape) + { + shape_.assign(shape.begin(), shape.end()); + data_.resize(compute_size()); + } + + void reshape(const vector& new_shape) { shape_ = new_shape; } + + void fill(T val) { std::fill(data_.begin(), data_.end(), val); } + + //-------------------------------------------------------------------------- + // View accessors + + //! Fix one axis at a given index, returning an (N-1)-dimensional view + //! Multi-axis slice. Each argument corresponds to one axis and is either: + //! - an integer (fixes that axis, rank-reducing) + //! - All (keeps entire axis) + //! - Range (keeps sub-range along that axis) + //! Example: t.slice(0, all, range(2, 5)) == numpy t[0, :, 2:5] + template + View slice(First first, Rest... rest) + { + auto strides = compute_strides(); + auto r = detail::compute_slice(shape_, strides, first, rest...); + return { + data_.data() + r.ptr_offset, std::move(r.shape), std::move(r.strides)}; + } + + template + View slice(First first, Rest... rest) const + { + auto strides = compute_strides(); + auto r = detail::compute_slice(shape_, strides, first, rest...); + return { + data_.data() + r.ptr_offset, std::move(r.shape), std::move(r.strides)}; + } + + //! Flat 1D view of all elements + View flat() + { + return {data_.data(), {data_.size()}, {size_t(1)}}; + } + View flat() const + { + return {data_.data(), {data_.size()}, {size_t(1)}}; + } + + //-------------------------------------------------------------------------- + // Reductions and transforms + + //! Sum of all elements + T sum() const + { + T s = T(0); + for (size_t i = 0; i < data_.size(); ++i) + s += data_[i]; + return s; + } + + //! Sum along an axis, reducing rank by 1 (defined out-of-line below) + Tensor sum(size_t axis) const; + + //! Product of all elements + T prod() const + { + T p = T(1); + for (size_t i = 0; i < data_.size(); ++i) + p *= data_[i]; + return p; + } + + //! True if any element is nonzero + bool any() const + { + for (size_t i = 0; i < data_.size(); ++i) + if (data_[i]) + return true; + return false; + } + + //! True if all elements are nonzero + bool all() const + { + for (size_t i = 0; i < data_.size(); ++i) + if (!data_[i]) + return false; + return true; + } + + //! Flat index of the minimum element + size_t argmin() const + { + return static_cast(std::distance(data_.data(), + std::min_element(data_.data(), data_.data() + data_.size()))); + } + + //! Reverse element order along an axis (e.g. flip(0) reverses rows) + Tensor flip(size_t axis) const + { + size_t outer_size = 1; + for (size_t d = 0; d < axis; ++d) + outer_size *= shape_[d]; + size_t axis_size = shape_[axis]; + size_t inner_size = 1; + for (size_t d = axis + 1; d < shape_.size(); ++d) + inner_size *= shape_[d]; + + Tensor r(shape_); + for (size_t o = 0; o < outer_size; ++o) + for (size_t a = 0; a < axis_size; ++a) + for (size_t i = 0; i < inner_size; ++i) + r.data_[(o * axis_size + (axis_size - 1 - a)) * inner_size + i] = + data_[(o * axis_size + a) * inner_size + i]; + return r; + } + + //-------------------------------------------------------------------------- + // Operators + + Tensor& operator+=(T val) + { + for (auto& x : data_) + x += val; + return *this; + } + Tensor& operator-=(T val) + { + for (auto& x : data_) + x -= val; + return *this; + } + Tensor& operator*=(T val) + { + for (auto& x : data_) + x *= val; + return *this; + } + Tensor& operator/=(T val) + { + for (auto& x : data_) + x /= val; + return *this; + } + Tensor& operator+=(const Tensor& o) + { + for (size_t i = 0; i < data_.size(); ++i) + data_[i] += o.data_[i]; + return *this; + } + + Tensor operator+(const Tensor& o) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data_[i] = data_[i] + o.data_[i]; + return r; + } + Tensor operator-(const Tensor& o) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data_[i] = data_[i] - o.data_[i]; + return r; + } + Tensor operator/(const Tensor& o) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data_[i] = data_[i] / o.data_[i]; + return r; + } + + Tensor operator+(T val) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data_[i] = data_[i] + val; + return r; + } + Tensor operator-(T val) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data_[i] = data_[i] - val; + return r; + } + Tensor operator*(T val) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data_[i] = data_[i] * val; + return r; + } + + Tensor operator<=(T val) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data()[i] = data_[i] <= val; + return r; + } + Tensor operator<(T val) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data()[i] = data_[i] < val; + return r; + } + Tensor operator>=(T val) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data()[i] = data_[i] >= val; + return r; + } + Tensor operator>(T val) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data()[i] = data_[i] > val; + return r; + } + Tensor operator<(const Tensor& o) const + { + Tensor r(shape_); + for (size_t i = 0; i < data_.size(); ++i) + r.data()[i] = data_[i] < o.data_[i]; + return r; + } + +private: + size_t compute_size() const + { + size_t s = 1; + for (auto d : shape_) + s *= d; + return s; + } + + //! Compute row-major strides from shape + vector compute_strides() const + { + vector strides(shape_.size()); + if (!shape_.empty()) { + strides.back() = 1; + for (int d = static_cast(shape_.size()) - 2; d >= 0; --d) + strides[d] = strides[d + 1] * shape_[d + 1]; + } + return strides; + } + + //-------------------------------------------------------------------------- + // Data members + + vector shape_; + vector> data_; +}; + +//============================================================================== +// Non-member operators (scalar op tensor) +//============================================================================== + +template +Tensor operator*(T val, const Tensor& arr) +{ + return arr * val; +} + +template +Tensor operator+(T val, const Tensor& arr) +{ + return arr + val; +} + +// Mixed-type arithmetic: Tensor op Tensor -> Tensor +// A SFINAE guard is used here, as without !is_same Tensor * Tensor +// would be ambiguous between the member operator* and this non-member function. +template::value>> +Tensor operator*(const Tensor& a, const Tensor& b) +{ + Tensor r(a.shape()); + for (size_t i = 0; i < a.size(); ++i) + r.data()[i] = + static_cast(a.data()[i]) * static_cast(b.data()[i]); + return r; +} + +// Same SFINAE guard as operator* above. +template::value>> +Tensor operator/(const Tensor& a, const Tensor& b) +{ + Tensor r(a.shape()); + for (size_t i = 0; i < a.size(); ++i) + r.data()[i] = + static_cast(a.data()[i]) / static_cast(b.data()[i]); + return r; +} + +//============================================================================== +// Out-of-line method definitions (require complete types) +//============================================================================== + +template +template +View& View::operator=(const Tensor& other) +{ + size_t n = size(); + for (size_t i = 0; i < n; ++i) + data_[flat_to_offset(i)] = static_cast(other.data()[i]); + return *this; +} + +template +template +View& View::operator+=(const Tensor& o) +{ + size_t n = size(); + for (size_t i = 0; i < n; ++i) + data_[flat_to_offset(i)] += o.data()[i]; + return *this; +} + +template +Tensor Tensor::sum(size_t axis) const +{ + // Build output shape (all dims except the summed axis) + vector out_shape; + for (size_t d = 0; d < shape_.size(); ++d) + if (d != axis) + out_shape.push_back(shape_[d]); + + // Split dimensions into three zones: outer | axis | inner + size_t outer_size = 1; + for (size_t d = 0; d < axis; ++d) + outer_size *= shape_[d]; + size_t axis_size = shape_[axis]; + size_t inner_size = 1; + for (size_t d = axis + 1; d < shape_.size(); ++d) + inner_size *= shape_[d]; + + Tensor result(out_shape, T(0)); + for (size_t o = 0; o < outer_size; ++o) + for (size_t a = 0; a < axis_size; ++a) + for (size_t i = 0; i < inner_size; ++i) + result.data()[o * inner_size + i] += + data_[(o * axis_size + a) * inner_size + i]; + + return result; +} + +//============================================================================== +// StaticTensor2D: compile-time fixed 2D tensor. +//============================================================================== + +template +class StaticTensor2D { +public: + using value_type = T; + + //-------------------------------------------------------------------------- + // Indexing + + //! Templated to accept enum class indices (e.g. GlobalTally, TallyResult) + //! which don't implicitly convert to integer types. + template + T& operator()(I0 i, I1 j) + { + return data_[static_cast(i) * C + static_cast(j)]; + } + template + const T& operator()(I0 i, I1 j) const + { + return data_[static_cast(i) * C + static_cast(j)]; + } + + //-------------------------------------------------------------------------- + // Accessors + + T* data() { return data_; } + const T* data() const { return data_; } + constexpr size_t size() const { return R * C; } + std::array shape() const { return {R, C}; } + + //-------------------------------------------------------------------------- + // Mutation + + void fill(T val) { std::fill(data_, data_ + R * C, val); } + + //-------------------------------------------------------------------------- + // Iterators + + T* begin() { return data_; } + T* end() { return data_ + R * C; } + const T* begin() const { return data_; } + const T* end() const { return data_ + R * C; } + + //-------------------------------------------------------------------------- + // View accessors + + //! Multi-axis slice (same interface as Tensor/View). + template + View slice(First first, Rest... rest) + { + vector sh = {R, C}; + vector st = {C, 1}; + auto r = detail::compute_slice(sh, st, first, rest...); + return {data_ + r.ptr_offset, std::move(r.shape), std::move(r.strides)}; + } + template + View slice(First first, Rest... rest) const + { + vector sh = {R, C}; + vector st = {C, 1}; + auto r = detail::compute_slice(sh, st, first, rest...); + return {data_ + r.ptr_offset, std::move(r.shape), std::move(r.strides)}; + } + + //! Flat view (1D, contiguous) + View flat() { return {data_, {R * C}, {size_t(1)}}; } + View flat() const { return {data_, {R * C}, {size_t(1)}}; } + +private: + //-------------------------------------------------------------------------- + // Data members + + T data_[R * C] = {}; +}; + +//============================================================================== +// Non-member functions +//============================================================================== + +template +Tensor zeros(std::initializer_list shape) +{ + vector s(shape); + return Tensor(std::move(s), T(0)); +} + +template +Tensor zeros(const vector& shape) +{ + return Tensor(shape, T(0)); +} + +template +Tensor ones(std::initializer_list shape) +{ + vector s(shape); + return Tensor(std::move(s), T(1)); +} + +template +Tensor ones(const vector& shape) +{ + return Tensor(shape, T(1)); +} + +template +Tensor zeros_like(const Tensor& o) +{ + return Tensor(o.shape(), T(0)); +} + +template +Tensor full_like(const Tensor& o, V val) +{ + return Tensor(o.shape(), static_cast(val)); +} + +//! Return a 1D tensor of n evenly spaced values from start to stop (inclusive) +template +Tensor linspace(T start, T stop, size_t n) +{ + Tensor result({n}); + if (n < 2) { + result[0] = start; + return result; + } + for (size_t i = 0; i < n; ++i) { + result[i] = + start + static_cast(i) * (stop - start) / static_cast(n - 1); + } + return result; +} + +//! Concatenate two 1D tensors end-to-end +template +Tensor concatenate(const Tensor& a, const Tensor& b) +{ + size_t total = a.size() + b.size(); + Tensor result({total}); + std::copy(a.data(), a.data() + a.size(), result.data()); + std::copy(b.data(), b.data() + b.size(), result.data() + a.size()); + return result; +} + +//! Element-wise natural logarithm +template +Tensor log(const Tensor& a) +{ + Tensor r(a.shape()); + for (size_t i = 0; i < a.size(); ++i) + r.data()[i] = std::log(a.data()[i]); + return r; +} + +//! Element-wise absolute value +template +Tensor abs(const Tensor& a) +{ + Tensor r(a.shape()); + for (size_t i = 0; i < a.size(); ++i) + r.data()[i] = std::abs(a.data()[i]); + return r; +} + +//! Element-wise conditional: select from true_val where cond is true, +//! otherwise use false_val +template +Tensor where( + const Tensor& cond, const Tensor& true_val, V false_val) +{ + Tensor r(cond.shape()); + for (size_t i = 0; i < cond.size(); ++i) + r.data()[i] = + cond.data()[i] ? true_val.data()[i] : static_cast(false_val); + return r; +} + +//! Replace NaN/Inf values with finite substitutes +template +Tensor nan_to_num(const Tensor& a, T nan_val = T(0), + T posinf_val = std::numeric_limits::max(), + T neginf_val = std::numeric_limits::lowest()) +{ + Tensor r(a.shape()); + for (size_t i = 0; i < a.size(); ++i) { + T val = a.data()[i]; + if (std::isnan(val)) + r.data()[i] = nan_val; + else if (std::isinf(val)) + r.data()[i] = val > 0 ? posinf_val : neginf_val; + else + r.data()[i] = val; + } + return r; +} + +//============================================================================== +// Type traits +//============================================================================== + +//! Type trait that is true for Tensor and StaticTensor2D. +//! Used by hdf5_interface.h to select the correct write_dataset overload. +template +struct is_tensor : std::false_type {}; + +template +struct is_tensor> : std::true_type {}; + +template +struct is_tensor> : std::true_type {}; + +} // namespace tensor +} // namespace openmc + +#endif // OPENMC_TENSOR_H diff --git a/include/openmc/thermal.h b/include/openmc/thermal.h index de0767d0af0..86254b92314 100644 --- a/include/openmc/thermal.h +++ b/include/openmc/thermal.h @@ -5,7 +5,7 @@ #include #include -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include "openmc/angle_energy.h" #include "openmc/endf.h" diff --git a/include/openmc/urr.h b/include/openmc/urr.h index 1e603715847..d40c2aff7e0 100644 --- a/include/openmc/urr.h +++ b/include/openmc/urr.h @@ -3,7 +3,7 @@ #ifndef OPENMC_URR_H #define OPENMC_URR_H -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include "openmc/constants.h" #include "openmc/hdf5_interface.h" @@ -40,11 +40,11 @@ class UrrData { * below, obviously, values of the CDF are stored. For the xs_values * variable, the columns line up with the index of cdf_values. */ - xt::xtensor cdf_values_; // Note: must be row major! - xt::xtensor xs_values_; + tensor::Tensor cdf_values_; // Note: must be row major! + tensor::Tensor xs_values_; // Number of points in the CDF - auto n_cdf() const { return cdf_values_.shape()[1]; } + auto n_cdf() const { return cdf_values_.shape(1); } //! \brief Load the URR data from the provided HDF5 group explicit UrrData(hid_t group_id); diff --git a/include/openmc/volume_calc.h b/include/openmc/volume_calc.h index fa8d3d65ece..9d3f1d02615 100644 --- a/include/openmc/volume_calc.h +++ b/include/openmc/volume_calc.h @@ -12,8 +12,8 @@ #include "openmc/tallies/trigger.h" #include "openmc/vector.h" +#include "openmc/tensor.h" #include "pugixml.hpp" -#include "xtensor/xtensor.hpp" #ifdef _OPENMP #include #endif diff --git a/include/openmc/weight_windows.h b/include/openmc/weight_windows.h index 7638155228e..6270823e61d 100644 --- a/include/openmc/weight_windows.h +++ b/include/openmc/weight_windows.h @@ -146,7 +146,10 @@ class WeightWindows { void set_bounds(const xt::xtensor& lower_ww_bounds, const xt::xtensor& upper_bounds); - void set_bounds(const xt::xtensor& lower_bounds, double ratio); + void set_bounds(const tensor::Tensor& lower_ww_bounds, + const tensor::Tensor& upper_bounds); + + void set_bounds(const tensor::Tensor& lower_bounds, double ratio); void set_bounds( span lower_bounds, span upper_bounds); @@ -182,11 +185,11 @@ class WeightWindows { const std::unique_ptr& mesh() const { return model::meshes[mesh_idx_]; } - const xt::xtensor& lower_ww_bounds() const { return lower_ww_; } - xt::xtensor& lower_ww_bounds() { return lower_ww_; } + const tensor::Tensor& lower_ww_bounds() const { return lower_ww_; } + tensor::Tensor& lower_ww_bounds() { return lower_ww_; } - const xt::xtensor& upper_ww_bounds() const { return upper_ww_; } - xt::xtensor& upper_ww_bounds() { return upper_ww_; } + const tensor::Tensor& upper_ww_bounds() const { return upper_ww_; } + tensor::Tensor& upper_ww_bounds() { return upper_ww_; } ParticleType particle_type() const { return particle_type_; } @@ -198,10 +201,10 @@ class WeightWindows { ParticleType particle_type_ { ParticleType::neutron}; //!< Particle type to apply weight windows to vector energy_bounds_; //!< Energy boundaries [eV] - xt::xtensor lower_ww_; //!< Lower weight window bounds (shape: + tensor::Tensor lower_ww_; //!< Lower weight window bounds (shape: //!< energy_bins, mesh_bins (k, j, i)) - xt::xtensor - upper_ww_; //!< Upper weight window bounds (shape: energy_bins, mesh_bins) + tensor::Tensor upper_ww_; //!< Upper weight window bounds (shape: + //!< energy_bins, mesh_bins) double survival_ratio_ {3.0}; //!< Survival weight ratio double max_lb_ratio_ {1.0}; //!< Maximum lower bound to particle weight ratio double weight_cutoff_ {DEFAULT_WEIGHT_CUTOFF}; //!< Weight cutoff diff --git a/include/openmc/wmp.h b/include/openmc/wmp.h index 6a4abd86714..5cc04e59594 100644 --- a/include/openmc/wmp.h +++ b/include/openmc/wmp.h @@ -2,7 +2,7 @@ #define OPENMC_WMP_H #include "hdf5.h" -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include #include @@ -78,9 +78,9 @@ class WindowedMultipole { int fit_order_; //!< Order of the fit bool fissionable_; //!< Is the nuclide fissionable? vector window_info_; // Information about a window - xt::xtensor + tensor::Tensor curvefit_; // Curve fit coefficients (window, poly order, reaction) - xt::xtensor, 2> data_; //!< Poles and residues + tensor::Tensor> data_; //!< Poles and residues // Constant data static constexpr int MAX_POLY_COEFFICIENTS = diff --git a/include/openmc/xml_interface.h b/include/openmc/xml_interface.h index f49613ecde1..17a34e5c77a 100644 --- a/include/openmc/xml_interface.h +++ b/include/openmc/xml_interface.h @@ -5,9 +5,8 @@ #include // for stringstream #include +#include "openmc/tensor.h" #include "pugixml.hpp" -#include "xtensor/xadapt.hpp" -#include "xtensor/xarray.hpp" #include "openmc/position.h" #include "openmc/vector.h" @@ -42,12 +41,11 @@ vector get_node_array( } template -xt::xarray get_node_xarray( +tensor::Tensor get_node_tensor( pugi::xml_node node, const char* name, bool lowercase = false) { vector v = get_node_array(node, name, lowercase); - vector shape = {v.size()}; - return xt::adapt(v, shape); + return tensor::Tensor(v.data(), v.size()); } std::vector get_node_position_array( diff --git a/include/openmc/xsdata.h b/include/openmc/xsdata.h index 134f738fa08..aaa964b9c76 100644 --- a/include/openmc/xsdata.h +++ b/include/openmc/xsdata.h @@ -4,7 +4,7 @@ #ifndef OPENMC_XSDATA_H #define OPENMC_XSDATA_H -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include "openmc/hdf5_interface.h" #include "openmc/memory.h" @@ -69,29 +69,29 @@ class XsData { public: // The following quantities have the following dimensions: // [angle][incoming group] - xt::xtensor total; - xt::xtensor absorption; - xt::xtensor nu_fission; - xt::xtensor prompt_nu_fission; - xt::xtensor kappa_fission; - xt::xtensor fission; - xt::xtensor inverse_velocity; + tensor::Tensor total; + tensor::Tensor absorption; + tensor::Tensor nu_fission; + tensor::Tensor prompt_nu_fission; + tensor::Tensor kappa_fission; + tensor::Tensor fission; + tensor::Tensor inverse_velocity; // decay_rate has the following dimensions: // [angle][delayed group] - xt::xtensor decay_rate; + tensor::Tensor decay_rate; // delayed_nu_fission has the following dimensions: // [angle][delayed group][incoming group] - xt::xtensor delayed_nu_fission; + tensor::Tensor delayed_nu_fission; // chi has the following dimensions: // [angle][incoming group][outgoing group] - xt::xtensor chi; + tensor::Tensor chi; // chi_prompt has the following dimensions: // [angle][incoming group][outgoing group] - xt::xtensor chi_prompt; + tensor::Tensor chi_prompt; // chi_delayed has the following dimensions: // [angle][incoming group][outgoing group][delayed group] - xt::xtensor chi_delayed; + tensor::Tensor chi_delayed; // scatter has the following dimensions: [angle] vector> scatter; diff --git a/src/bank.cpp b/src/bank.cpp index 33790379b85..5afdc2ecab7 100644 --- a/src/bank.cpp +++ b/src/bank.cpp @@ -7,6 +7,7 @@ #include "openmc/vector.h" #include +#include namespace openmc { diff --git a/src/bremsstrahlung.cpp b/src/bremsstrahlung.cpp index a2320e0b469..6a051a178be 100644 --- a/src/bremsstrahlung.cpp +++ b/src/bremsstrahlung.cpp @@ -6,7 +6,7 @@ #include "openmc/search.h" #include "openmc/settings.h" -#include "xtensor/xmath.hpp" +#include "openmc/tensor.h" namespace openmc { @@ -16,8 +16,8 @@ namespace openmc { namespace data { -xt::xtensor ttb_e_grid; -xt::xtensor ttb_k_grid; +tensor::Tensor ttb_e_grid; +tensor::Tensor ttb_k_grid; vector ttb; } // namespace data diff --git a/src/cmfd_solver.cpp b/src/cmfd_solver.cpp index 943042f67e7..714a5bf3ac5 100644 --- a/src/cmfd_solver.cpp +++ b/src/cmfd_solver.cpp @@ -5,7 +5,7 @@ #ifdef _OPENMP #include #endif -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include "openmc/bank.h" #include "openmc/capi.h" @@ -36,7 +36,7 @@ double spectral; int nx, ny, nz, ng; -xt::xtensor indexmap; +tensor::Tensor indexmap; int use_all_threads; @@ -79,15 +79,14 @@ int get_cmfd_energy_bin(const double E) // COUNT_BANK_SITES bins fission sites according to CMFD mesh and energy //============================================================================== -xt::xtensor count_bank_sites( - xt::xtensor& bins, bool* outside) +tensor::Tensor count_bank_sites( + tensor::Tensor& bins, bool* outside) { // Determine shape of array for counts std::size_t cnt_size = cmfd::nx * cmfd::ny * cmfd::nz * cmfd::ng; - vector cnt_shape = {cnt_size}; // Create array of zeros - xt::xarray cnt {cnt_shape, 0.0}; + tensor::Tensor cnt = tensor::zeros({cnt_size}); bool outside_ = false; auto bank_size = simulation::source_bank.size(); @@ -113,29 +112,22 @@ xt::xtensor count_bank_sites( bins[i] = mesh_bin * cmfd::ng + energy_bin; } - // Create copy of count data. Since ownership will be acquired by xtensor, - // std::allocator must be used to avoid Valgrind mismatched free() / delete - // warnings. int total = cnt.size(); - double* cnt_reduced = std::allocator {}.allocate(total); + tensor::Tensor counts = tensor::zeros({cnt_size}); #ifdef OPENMC_MPI // collect values from all processors MPI_Reduce( - cnt.data(), cnt_reduced, total, MPI_DOUBLE, MPI_SUM, 0, mpi::intracomm); + cnt.data(), counts.data(), total, MPI_DOUBLE, MPI_SUM, 0, mpi::intracomm); // Check if there were sites outside the mesh for any processor MPI_Reduce(&outside_, outside, 1, MPI_C_BOOL, MPI_LOR, 0, mpi::intracomm); #else - std::copy(cnt.data(), cnt.data() + total, cnt_reduced); + std::copy(cnt.data(), cnt.data() + total, counts.data()); *outside = outside_; #endif - // Adapt reduced values in array back into an xarray - auto arr = xt::adapt(cnt_reduced, total, xt::acquire_ownership(), cnt_shape); - xt::xarray counts = arr; - return counts; } @@ -151,19 +143,19 @@ extern "C" void openmc_cmfd_reweight( std::size_t src_size = cmfd::nx * cmfd::ny * cmfd::nz * cmfd::ng; // count bank sites for CMFD mesh, store bins in bank_bins for reweighting - xt::xtensor bank_bins({bank_size}, 0); + tensor::Tensor bank_bins = tensor::zeros({bank_size}); bool sites_outside; - xt::xtensor sourcecounts = + tensor::Tensor sourcecounts = count_bank_sites(bank_bins, &sites_outside); // Compute CMFD weightfactors - xt::xtensor weightfactors = xt::xtensor({src_size}, 1.); + tensor::Tensor weightfactors = tensor::ones({src_size}); if (mpi::master) { if (sites_outside) { fatal_error("Source sites outside of the CMFD mesh"); } - double norm = xt::sum(sourcecounts)() / cmfd::norm; + double norm = sourcecounts.sum() / cmfd::norm; for (int i = 0; i < src_size; i++) { if (sourcecounts[i] > 0 && cmfd_src[i] > 0) { weightfactors[i] = cmfd_src[i] * norm / sourcecounts[i]; @@ -561,7 +553,7 @@ void free_memory_cmfd() cmfd::indices.clear(); cmfd::egrid.clear(); - // Resize xtensors to be empty + // Resize tensors to be empty cmfd::indexmap.resize({0}); // Set pointers to null diff --git a/src/cross_sections.cpp b/src/cross_sections.cpp index b1bfde03d13..ec9da5b8abc 100644 --- a/src/cross_sections.cpp +++ b/src/cross_sections.cpp @@ -254,7 +254,7 @@ void read_ce_cross_sections(const vector>& nuc_temps, if (settings::photon_transport && settings::electron_treatment == ElectronTreatment::TTB) { // Take logarithm of energies since they are log-log interpolated - data::ttb_e_grid = xt::log(data::ttb_e_grid); + data::ttb_e_grid = tensor::log(data::ttb_e_grid); } // Show minimum/maximum temperature diff --git a/src/distribution_angle.cpp b/src/distribution_angle.cpp index 50f1aca112b..3433f269e35 100644 --- a/src/distribution_angle.cpp +++ b/src/distribution_angle.cpp @@ -2,8 +2,7 @@ #include // for abs, copysign -#include "xtensor/xarray.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/endf.h" #include "openmc/hdf5_interface.h" @@ -30,7 +29,7 @@ AngleDistribution::AngleDistribution(hid_t group) hid_t dset = open_dataset(group, "mu"); read_attribute(dset, "offsets", offsets); read_attribute(dset, "interpolation", interp); - xt::xarray temp; + tensor::Tensor temp; read_dataset(dset, temp); close_dataset(dset); @@ -41,13 +40,13 @@ AngleDistribution::AngleDistribution(hid_t group) if (i < n_energy - 1) { n = offsets[i + 1] - j; } else { - n = temp.shape()[1] - j; + n = temp.shape(1) - j; } // Create and initialize tabular distribution - auto xs = xt::view(temp, 0, xt::range(j, j + n)); - auto ps = xt::view(temp, 1, xt::range(j, j + n)); - auto cs = xt::view(temp, 2, xt::range(j, j + n)); + tensor::View xs = temp.slice(0, tensor::range(j, j + n)); + tensor::View ps = temp.slice(1, tensor::range(j, j + n)); + tensor::View cs = temp.slice(2, tensor::range(j, j + n)); vector x {xs.begin(), xs.end()}; vector p {ps.begin(), ps.end()}; vector c {cs.begin(), cs.end()}; diff --git a/src/distribution_energy.cpp b/src/distribution_energy.cpp index a4a5ce9e1b6..2f8e6cf1a99 100644 --- a/src/distribution_energy.cpp +++ b/src/distribution_energy.cpp @@ -4,7 +4,7 @@ #include // for size_t #include // for back_inserter -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/endf.h" #include "openmc/hdf5_interface.h" @@ -60,11 +60,11 @@ ContinuousTabular::ContinuousTabular(hid_t group) hid_t dset = open_dataset(group, "energy"); // Get interpolation parameters - xt::xarray temp; + tensor::Tensor temp; read_attribute(dset, "interpolation", temp); - auto temp_b = xt::view(temp, 0); // view of breakpoints - auto temp_i = xt::view(temp, 1); // view of interpolation parameters + tensor::View temp_b = temp.slice(0); // breakpoints + tensor::View temp_i = temp.slice(1); // interpolation parameters std::copy(temp_b.begin(), temp_b.end(), std::back_inserter(breakpoints_)); for (const auto i : temp_i) @@ -85,7 +85,7 @@ ContinuousTabular::ContinuousTabular(hid_t group) read_attribute(dset, "interpolation", interp); read_attribute(dset, "n_discrete_lines", n_discrete); - xt::xarray eout; + tensor::Tensor eout; read_dataset(dset, eout); close_dataset(dset); @@ -96,7 +96,7 @@ ContinuousTabular::ContinuousTabular(hid_t group) if (i < n_energy - 1) { n = offsets[i + 1] - j; } else { - n = eout.shape()[1] - j; + n = eout.shape(1) - j; } // Assign interpolation scheme and number of discrete lines @@ -105,15 +105,15 @@ ContinuousTabular::ContinuousTabular(hid_t group) d.n_discrete = n_discrete[i]; // Copy data - d.e_out = xt::view(eout, 0, xt::range(j, j + n)); - d.p = xt::view(eout, 1, xt::range(j, j + n)); + d.e_out = eout.slice(0, tensor::range(j, j + n)); + d.p = eout.slice(1, tensor::range(j, j + n)); // To get answers that match ACE data, for now we still use the tabulated // CDF values that were passed through to the HDF5 library. At a later // time, we can remove the CDF values from the HDF5 library and // reconstruct them using the PDF if (true) { - d.c = xt::view(eout, 2, xt::range(j, j + n)); + d.c = eout.slice(2, tensor::range(j, j + n)); } else { // Calculate cumulative distribution function -- discrete portion for (int k = 0; k < d.n_discrete; ++k) { diff --git a/src/eigenvalue.cpp b/src/eigenvalue.cpp index 2fb9dabf16d..018e890f373 100644 --- a/src/eigenvalue.cpp +++ b/src/eigenvalue.cpp @@ -1,9 +1,6 @@ #include "openmc/eigenvalue.h" -#include "xtensor/xbuilder.hpp" -#include "xtensor/xmath.hpp" -#include "xtensor/xtensor.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/array.h" #include "openmc/bank.h" @@ -39,7 +36,7 @@ namespace simulation { double keff_generation; array k_sum; vector entropy; -xt::xtensor source_frac; +tensor::Tensor source_frac; } // namespace simulation @@ -452,7 +449,7 @@ int openmc_get_keff(double* k_combined) const auto& gt = simulation::global_tallies; array kv {}; - xt::xtensor cov = xt::zeros({3, 3}); + tensor::Tensor cov = tensor::zeros({3, 3}); kv[0] = gt(GlobalTally::K_COLLISION, TallyResult::SUM) / n; kv[1] = gt(GlobalTally::K_ABSORPTION, TallyResult::SUM) / n; kv[2] = gt(GlobalTally::K_TRACKLENGTH, TallyResult::SUM) / n; @@ -591,7 +588,7 @@ void shannon_entropy() { // Get source weight in each mesh bin bool sites_outside; - xt::xtensor p = + tensor::Tensor p = simulation::entropy_mesh->count_sites(simulation::fission_bank.data(), simulation::fission_bank.size(), &sites_outside); @@ -603,7 +600,7 @@ void shannon_entropy() if (mpi::master) { // Normalize to total weight of bank sites - p /= xt::sum(p); + p /= p.sum(); // Sum values to obtain Shannon entropy double H = 0.0; @@ -627,7 +624,7 @@ void ufs_count_sites() std::size_t n = simulation::ufs_mesh->n_bins(); double vol_frac = simulation::ufs_mesh->volume_frac_; - simulation::source_frac = xt::xtensor({n}, vol_frac); + simulation::source_frac = tensor::Tensor({n}, vol_frac); } else { // count number of source sites in each ufs mesh cell @@ -649,7 +646,7 @@ void ufs_count_sites() #endif // Normalize to total weight to get fraction of source in each cell - double total = xt::sum(simulation::source_frac)(); + double total = simulation::source_frac.sum(); simulation::source_frac /= total; // Since the total starting weight is not equal to n_particles, we need to diff --git a/src/endf.cpp b/src/endf.cpp index c0c1d2e7e8b..b298ebe01f9 100644 --- a/src/endf.cpp +++ b/src/endf.cpp @@ -5,8 +5,7 @@ #include // for back_inserter #include // for runtime_error -#include "xtensor/xarray.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/array.h" #include "openmc/constants.h" @@ -153,11 +152,11 @@ Tabulated1D::Tabulated1D(hid_t dset) for (const auto i : int_temp) int_.push_back(int2interp(i)); - xt::xarray arr; + tensor::Tensor arr; read_dataset(dset, arr); - auto xs = xt::view(arr, 0); - auto ys = xt::view(arr, 1); + tensor::View xs = arr.slice(0); + tensor::View ys = arr.slice(1); std::copy(xs.begin(), xs.end(), std::back_inserter(x_)); std::copy(ys.begin(), ys.end(), std::back_inserter(y_)); @@ -229,12 +228,12 @@ double Tabulated1D::operator()(double x) const CoherentElasticXS::CoherentElasticXS(hid_t dset) { // Read 2D array from dataset - xt::xarray arr; + tensor::Tensor arr; read_dataset(dset, arr); // Get views for Bragg edges and structure factors - auto E = xt::view(arr, 0); - auto s = xt::view(arr, 1); + tensor::View E = arr.slice(0); + tensor::View s = arr.slice(1); // Copy Bragg edges and partial sums of structure factors std::copy(E.begin(), E.end(), std::back_inserter(bragg_edges_)); diff --git a/src/finalize.cpp b/src/finalize.cpp index 344eaa1a0a7..4117167b4a4 100644 --- a/src/finalize.cpp +++ b/src/finalize.cpp @@ -29,7 +29,7 @@ #include "openmc/volume_calc.h" #include "openmc/weight_windows.h" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" namespace openmc { @@ -200,7 +200,7 @@ int openmc_reset() // Reset global tallies simulation::n_realizations = 0; - xt::view(simulation::global_tallies, xt::all()) = 0.0; + simulation::global_tallies.fill(0.0); simulation::k_col_abs = 0.0; simulation::k_col_tra = 0.0; diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index c56d485e281..00c6a4399c0 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -4,8 +4,7 @@ #include #include -#include "xtensor/xarray.hpp" -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include #include "hdf5.h" @@ -466,22 +465,19 @@ void read_dataset_lowlevel(hid_t obj_id, const char* name, hid_t mem_type_id, } template<> -void read_dataset(hid_t dset, xt::xarray>& arr, bool indep) +void read_dataset( + hid_t dset, tensor::Tensor>& tensor, bool indep) { // Get shape of dataset vector shape = object_shape(dset); - // Allocate new array to read data into - std::size_t size = 1; - for (const auto x : shape) - size *= x; - vector> buffer(size); + // Resize tensor and read data directly + vector tshape(shape.begin(), shape.end()); + tensor.resize(tshape); - // Read data from attribute - read_complex(dset, nullptr, buffer.data(), indep); - - // Adapt into xarray - arr = xt::adapt(buffer, shape); + // Read data from dataset + read_complex(dset, nullptr, + reinterpret_cast*>(tensor.data()), indep); } void read_double(hid_t obj_id, const char* name, double* buffer, bool indep) diff --git a/src/material.cpp b/src/material.cpp index 156b149caa1..2bf1465179f 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -8,9 +8,7 @@ #include #include -#include "xtensor/xbuilder.hpp" -#include "xtensor/xoperation.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/capi.h" #include "openmc/container_util.h" @@ -275,7 +273,7 @@ Material::Material(pugi::xml_node node) // allocate arrays in Material object auto n = names.size(); nuclide_.reserve(n); - atom_density_ = xt::empty({n}); + atom_density_ = tensor::Tensor({n}); if (settings::photon_transport) element_.reserve(n); @@ -349,14 +347,14 @@ Material::Material(pugi::xml_node node) // Check to make sure either all atom percents or all weight percents are // given - if (!(xt::all(atom_density_ >= 0.0) || xt::all(atom_density_ <= 0.0))) { + if (!((atom_density_ >= 0.0).all() || (atom_density_ <= 0.0).all())) { fatal_error( "Cannot mix atom and weight percents in material " + std::to_string(id_)); } // Determine density if it is a sum value if (sum_density) - density_ = xt::sum(atom_density_)(); + density_ = atom_density_.sum(); if (check_for_node(node, "temperature")) { temperature_ = std::stod(get_node_value(node, "temperature")); @@ -496,7 +494,7 @@ void Material::normalize_density() // determine normalized atom percents. if given atom percents, this is // straightforward. if given weight percents, the value is w/awr and is // divided by sum(w/awr) - atom_density_ /= xt::sum(atom_density_)(); + atom_density_ /= atom_density_.sum(); // Change density in g/cm^3 to atom/b-cm. Since all values are now in // atom percent, the sum needs to be re-evaluated as 1/sum(x*awr) @@ -705,14 +703,14 @@ void Material::init_bremsstrahlung() bool positron = (particle == 1); // Allocate arrays for TTB data - ttb->pdf = xt::zeros({n_e, n_e}); - ttb->cdf = xt::zeros({n_e, n_e}); - ttb->yield = xt::zeros({n_e}); + ttb->pdf = tensor::zeros({n_e, n_e}); + ttb->cdf = tensor::zeros({n_e, n_e}); + ttb->yield = tensor::zeros({n_e}); // Allocate temporary arrays - xt::xtensor stopping_power_collision({n_e}, 0.0); - xt::xtensor stopping_power_radiative({n_e}, 0.0); - xt::xtensor dcs({n_e, n_k}, 0.0); + auto stopping_power_collision = tensor::zeros({n_e}); + auto stopping_power_radiative = tensor::zeros({n_e}); + auto dcs = tensor::zeros({n_e, n_k}); double Z_eq_sq = 0.0; double sum_density = 0.0; @@ -762,18 +760,18 @@ void Material::init_bremsstrahlung() 1.0595e-3 * std::pow(t, 5) + 7.0568e-5 * std::pow(t, 6) - 1.808e-6 * std::pow(t, 7)); stopping_power_radiative(i) *= r; - auto dcs_i = xt::view(dcs, i, xt::all()); + tensor::View dcs_i = dcs.slice(i); dcs_i *= r; } } // Total material stopping power - xt::xtensor stopping_power = + tensor::Tensor stopping_power = stopping_power_collision + stopping_power_radiative; // Loop over photon energies - xt::xtensor f({n_e}, 0.0); - xt::xtensor z({n_e}, 0.0); + auto f = tensor::zeros({n_e}); + auto z = tensor::zeros({n_e}); for (int i = 0; i < n_e - 1; ++i) { double w = data::ttb_e_grid(i); @@ -861,7 +859,8 @@ void Material::init_bremsstrahlung() } // Use logarithm of number yield since it is log-log interpolated - ttb->yield = xt::where(ttb->yield > 0.0, xt::log(ttb->yield), -500.0); + ttb->yield = + tensor::where(ttb->yield > 0.0, tensor::log(ttb->yield), -500.0); } } @@ -1043,7 +1042,7 @@ void Material::set_density(double density, const std::string& units) density_ = density; // Determine normalized atom percents - double sum_percent = xt::sum(atom_density_)(); + double sum_percent = atom_density_.sum(); atom_density_ /= sum_percent; // Recalculate nuclide atom densities based on given density @@ -1084,7 +1083,7 @@ void Material::set_densities( if (n != nuclide_.size()) { nuclide_.resize(n); - atom_density_ = xt::zeros({n}); + atom_density_ = tensor::zeros({n}); if (settings::photon_transport) element_.resize(n); } @@ -1245,8 +1244,8 @@ void Material::add_nuclide(const std::string& name, double density) auto n = nuclide_.size(); // Create copy of atom_density_ array with one extra entry - xt::xtensor atom_density = xt::zeros({n}); - xt::view(atom_density, xt::range(0, n - 1)) = atom_density_; + tensor::Tensor atom_density = tensor::zeros({n}); + atom_density.slice(tensor::range(0, n - 1)) = atom_density_; atom_density(n - 1) = density; atom_density_ = atom_density; diff --git a/src/mesh.cpp b/src/mesh.cpp index 6ee15b9c18b..7906b150419 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -4,6 +4,7 @@ #define _USE_MATH_DEFINES // to make M_PI declared in Intel and MSVC compilers #include // for ceil #include // for size_t +#include // for accumulate #include #ifdef _MSC_VER @@ -14,13 +15,7 @@ #include "mpi.h" #endif -#include "xtensor/xadapt.hpp" -#include "xtensor/xbuilder.hpp" -#include "xtensor/xeval.hpp" -#include "xtensor/xmath.hpp" -#include "xtensor/xsort.hpp" -#include "xtensor/xtensor.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include // for fmt #include "openmc/capi.h" @@ -615,11 +610,9 @@ std::string StructuredMesh::bin_label(int bin) const } } -xt::xtensor StructuredMesh::get_x_shape() const +tensor::Tensor StructuredMesh::get_shape_tensor() const { - // because method is const, shape_ is const as well and can't be adapted - auto tmp_shape = shape_; - return xt::adapt(tmp_shape, {n_dimension_}); + return tensor::Tensor(shape_.data(), static_cast(n_dimension_)); } Position StructuredMesh::sample_element( @@ -804,10 +797,11 @@ void UnstructuredMesh::to_hdf5_inner(hid_t mesh_group) const write_dataset(mesh_group, "length_multiplier", length_multiplier_); // write vertex coordinates - xt::xtensor vertices({static_cast(this->n_vertices()), 3}); + tensor::Tensor vertices( + {static_cast(this->n_vertices()), static_cast(3)}); for (int i = 0; i < this->n_vertices(); i++) { auto v = this->vertex(i); - xt::view(vertices, i, xt::all()) = xt::xarray({v.x, v.y, v.z}); + vertices.slice(i) = {v.x, v.y, v.z}; } write_dataset(mesh_group, "vertices", vertices); @@ -815,8 +809,10 @@ void UnstructuredMesh::to_hdf5_inner(hid_t mesh_group) const // write element types and connectivity vector volumes; - xt::xtensor connectivity({static_cast(this->n_bins()), 8}); - xt::xtensor elem_types({static_cast(this->n_bins()), 1}); + tensor::Tensor connectivity( + {static_cast(this->n_bins()), static_cast(8)}); + tensor::Tensor elem_types( + {static_cast(this->n_bins()), static_cast(1)}); for (int i = 0; i < this->n_bins(); i++) { auto conn = this->connectivity(i); @@ -824,21 +820,18 @@ void UnstructuredMesh::to_hdf5_inner(hid_t mesh_group) const // write linear tet element if (conn.size() == 4) { - xt::view(elem_types, i, xt::all()) = - static_cast(ElementType::LINEAR_TET); - xt::view(connectivity, i, xt::all()) = - xt::xarray({conn[0], conn[1], conn[2], conn[3], -1, -1, -1, -1}); + elem_types.slice(i) = static_cast(ElementType::LINEAR_TET); + connectivity.slice(i) = { + conn[0], conn[1], conn[2], conn[3], -1, -1, -1, -1}; // write linear hex element } else if (conn.size() == 8) { - xt::view(elem_types, i, xt::all()) = - static_cast(ElementType::LINEAR_HEX); - xt::view(connectivity, i, xt::all()) = xt::xarray({conn[0], conn[1], - conn[2], conn[3], conn[4], conn[5], conn[6], conn[7]}); + elem_types.slice(i) = static_cast(ElementType::LINEAR_HEX); + connectivity.slice(i) = { + conn[0], conn[1], conn[2], conn[3], conn[4], conn[5], conn[6], conn[7]}; } else { num_elem_skipped++; - xt::view(elem_types, i, xt::all()) = - static_cast(ElementType::UNSUPPORTED); - xt::view(connectivity, i, xt::all()) = -1; + elem_types.slice(i) = static_cast(ElementType::UNSUPPORTED); + connectivity.slice(i) = -1; } } @@ -939,7 +932,7 @@ int StructuredMesh::n_surface_bins() const return 4 * n_dimension_ * n_bins(); } -xt::xtensor StructuredMesh::count_sites( +tensor::Tensor StructuredMesh::count_sites( const SourceSite* bank, int64_t length, bool* outside) const { // Determine shape of array for counts @@ -947,7 +940,7 @@ xt::xtensor StructuredMesh::count_sites( vector shape = {m}; // Create array of zeros - xt::xarray cnt {shape, 0.0}; + auto cnt = tensor::zeros(shape); bool outside_ = false; for (int64_t i = 0; i < length; i++) { @@ -966,31 +959,25 @@ xt::xtensor StructuredMesh::count_sites( cnt(mesh_bin) += site.wgt; } - // Create copy of count data. Since ownership will be acquired by xtensor, - // std::allocator must be used to avoid Valgrind mismatched free() / delete - // warnings. + // Create reduced count data + auto counts = tensor::zeros(shape); int total = cnt.size(); - double* cnt_reduced = std::allocator {}.allocate(total); #ifdef OPENMC_MPI // collect values from all processors MPI_Reduce( - cnt.data(), cnt_reduced, total, MPI_DOUBLE, MPI_SUM, 0, mpi::intracomm); + cnt.data(), counts.data(), total, MPI_DOUBLE, MPI_SUM, 0, mpi::intracomm); // Check if there were sites outside the mesh for any processor if (outside) { MPI_Reduce(&outside_, outside, 1, MPI_C_BOOL, MPI_LOR, 0, mpi::intracomm); } #else - std::copy(cnt.data(), cnt.data() + total, cnt_reduced); + std::copy(cnt.data(), cnt.data() + total, counts.data()); if (outside) *outside = outside_; #endif - // Adapt reduced values in array back into an xarray - auto arr = xt::adapt(cnt_reduced, total, xt::acquire_ownership(), shape); - xt::xarray counts = arr; - return counts; } @@ -1183,10 +1170,10 @@ void StructuredMesh::surface_bins_crossed( int RegularMesh::set_grid() { - auto shape = xt::adapt(shape_, {n_dimension_}); + tensor::Tensor shape(shape_.data(), static_cast(n_dimension_)); // Check that dimensions are all greater than zero - if (xt::any(shape <= 0)) { + if ((shape <= 0).any()) { set_errmsg("All entries for a regular mesh dimensions " "must be positive."); return OPENMC_E_INVALID_ARGUMENT; @@ -1208,13 +1195,13 @@ int RegularMesh::set_grid() } // Check for negative widths - if (xt::any(width_ < 0.0)) { + if ((width_ < 0.0).any()) { set_errmsg("Cannot have a negative width on a regular mesh."); return OPENMC_E_INVALID_ARGUMENT; } // Set width and upper right coordinate - upper_right_ = xt::eval(lower_left_ + shape * width_); + upper_right_ = lower_left_ + shape * width_; } else if (upper_right_.size() > 0) { @@ -1226,7 +1213,7 @@ int RegularMesh::set_grid() } // Check that upper-right is above lower-left - if (xt::any(upper_right_ < lower_left_)) { + if ((upper_right_ < lower_left_).any()) { set_errmsg( "The upper_right coordinates of a regular mesh must be greater than " "the lower_left coordinates."); @@ -1234,11 +1221,11 @@ int RegularMesh::set_grid() } // Set width - width_ = xt::eval((upper_right_ - lower_left_) / shape); + width_ = (upper_right_ - lower_left_) / shape; } // Set material volumes - volume_frac_ = 1.0 / xt::prod(shape)(); + volume_frac_ = 1.0 / shape.prod(); element_volume_ = 1.0; for (int i = 0; i < n_dimension_; i++) { @@ -1254,7 +1241,7 @@ RegularMesh::RegularMesh(pugi::xml_node node) : StructuredMesh {node} fatal_error("Must specify on a regular mesh."); } - xt::xtensor shape = get_node_xarray(node, "dimension"); + tensor::Tensor shape = get_node_tensor(node, "dimension"); int n = n_dimension_ = shape.size(); if (n != 1 && n != 2 && n != 3) { fatal_error("Mesh must be one, two, or three dimensions."); @@ -1264,7 +1251,7 @@ RegularMesh::RegularMesh(pugi::xml_node node) : StructuredMesh {node} // Check for lower-left coordinates if (check_for_node(node, "lower_left")) { // Read mesh lower-left corner location - lower_left_ = get_node_xarray(node, "lower_left"); + lower_left_ = get_node_tensor(node, "lower_left"); } else { fatal_error("Must specify on a mesh."); } @@ -1275,11 +1262,11 @@ RegularMesh::RegularMesh(pugi::xml_node node) : StructuredMesh {node} fatal_error("Cannot specify both and on a mesh."); } - width_ = get_node_xarray(node, "width"); + width_ = get_node_tensor(node, "width"); } else if (check_for_node(node, "upper_right")) { - upper_right_ = get_node_xarray(node, "upper_right"); + upper_right_ = get_node_tensor(node, "upper_right"); } else { fatal_error("Must specify either or on a mesh."); @@ -1297,7 +1284,7 @@ RegularMesh::RegularMesh(hid_t group) : StructuredMesh {group} fatal_error("Must specify on a regular mesh."); } - xt::xtensor shape; + tensor::Tensor shape; read_dataset(group, "dimension", shape); int n = n_dimension_ = shape.size(); if (n != 1 && n != 2 && n != 3) { @@ -1412,13 +1399,13 @@ std::pair, vector> RegularMesh::plot( void RegularMesh::to_hdf5_inner(hid_t mesh_group) const { - write_dataset(mesh_group, "dimension", get_x_shape()); + write_dataset(mesh_group, "dimension", get_shape_tensor()); write_dataset(mesh_group, "lower_left", lower_left_); write_dataset(mesh_group, "upper_right", upper_right_); write_dataset(mesh_group, "width", width_); } -xt::xtensor RegularMesh::count_sites( +tensor::Tensor RegularMesh::count_sites( const SourceSite* bank, int64_t length, bool* outside) const { // Determine shape of array for counts @@ -1426,7 +1413,7 @@ xt::xtensor RegularMesh::count_sites( vector shape = {m}; // Create array of zeros - xt::xarray cnt {shape, 0.0}; + auto cnt = tensor::zeros(shape); bool outside_ = false; for (int64_t i = 0; i < length; i++) { @@ -1445,31 +1432,25 @@ xt::xtensor RegularMesh::count_sites( cnt(mesh_bin) += site.wgt; } - // Create copy of count data. Since ownership will be acquired by xtensor, - // std::allocator must be used to avoid Valgrind mismatched free() / delete - // warnings. + // Create reduced count data + auto counts = tensor::zeros(shape); int total = cnt.size(); - double* cnt_reduced = std::allocator {}.allocate(total); #ifdef OPENMC_MPI // collect values from all processors MPI_Reduce( - cnt.data(), cnt_reduced, total, MPI_DOUBLE, MPI_SUM, 0, mpi::intracomm); + cnt.data(), counts.data(), total, MPI_DOUBLE, MPI_SUM, 0, mpi::intracomm); // Check if there were sites outside the mesh for any processor if (outside) { MPI_Reduce(&outside_, outside, 1, MPI_C_BOOL, MPI_LOR, 0, mpi::intracomm); } #else - std::copy(cnt.data(), cnt.data() + total, cnt_reduced); + std::copy(cnt.data(), cnt.data() + total, counts.data()); if (outside) *outside = outside_; #endif - // Adapt reduced values in array back into an xarray - auto arr = xt::adapt(cnt_reduced, total, xt::acquire_ownership(), shape); - xt::xarray counts = arr; - return counts; } @@ -2539,7 +2520,7 @@ extern "C" int openmc_regular_mesh_get_params( return err; RegularMesh* m = dynamic_cast(model::meshes[index].get()); - if (m->lower_left_.dimension() == 0) { + if (m->lower_left_.empty()) { set_errmsg("Mesh parameters have not been set."); return OPENMC_E_ALLOCATE; } @@ -2566,17 +2547,17 @@ extern "C" int openmc_regular_mesh_set_params( vector shape = {static_cast(n)}; if (ll && ur) { - m->lower_left_ = xt::adapt(ll, n, xt::no_ownership(), shape); - m->upper_right_ = xt::adapt(ur, n, xt::no_ownership(), shape); - m->width_ = (m->upper_right_ - m->lower_left_) / m->get_x_shape(); + m->lower_left_ = tensor::Tensor(ll, n); + m->upper_right_ = tensor::Tensor(ur, n); + m->width_ = (m->upper_right_ - m->lower_left_) / m->get_shape_tensor(); } else if (ll && width) { - m->lower_left_ = xt::adapt(ll, n, xt::no_ownership(), shape); - m->width_ = xt::adapt(width, n, xt::no_ownership(), shape); - m->upper_right_ = m->lower_left_ + m->get_x_shape() * m->width_; + m->lower_left_ = tensor::Tensor(ll, n); + m->width_ = tensor::Tensor(width, n); + m->upper_right_ = m->lower_left_ + m->get_shape_tensor() * m->width_; } else if (ur && width) { - m->upper_right_ = xt::adapt(ur, n, xt::no_ownership(), shape); - m->width_ = xt::adapt(width, n, xt::no_ownership(), shape); - m->lower_left_ = m->upper_right_ - m->get_x_shape() * m->width_; + m->upper_right_ = tensor::Tensor(ur, n); + m->width_ = tensor::Tensor(width, n); + m->lower_left_ = m->upper_right_ - m->get_shape_tensor() * m->width_; } else { set_errmsg("At least two parameters must be specified."); return OPENMC_E_INVALID_ARGUMENT; @@ -2586,7 +2567,7 @@ extern "C" int openmc_regular_mesh_set_params( // TODO: incorporate this into method in RegularMesh that can be called from // here and from constructor - m->volume_frac_ = 1.0 / xt::prod(m->get_x_shape())(); + m->volume_frac_ = 1.0 / m->get_shape_tensor().prod(); m->element_volume_ = 1.0; for (int i = 0; i < m->n_dimension_; i++) { m->element_volume_ *= m->width_[i]; @@ -2635,7 +2616,7 @@ int openmc_structured_mesh_get_grid_impl(int32_t index, double** grid_x, return err; C* m = dynamic_cast(model::meshes[index].get()); - if (m->lower_left_.dimension() == 0) { + if (m->lower_left_.empty()) { set_errmsg("Mesh parameters have not been set."); return OPENMC_E_ALLOCATE; } diff --git a/src/mgxs.cpp b/src/mgxs.cpp index e02dbbddc9f..9a81c03e52f 100644 --- a/src/mgxs.cpp +++ b/src/mgxs.cpp @@ -5,10 +5,7 @@ #include #include -#include "xtensor/xadapt.hpp" -#include "xtensor/xmath.hpp" -#include "xtensor/xsort.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include #include "openmc/error.h" @@ -32,8 +29,7 @@ void Mgxs::init(const std::string& in_name, double in_awr, // Set the metadata name = in_name; awr = in_awr; - // TODO: Remove adapt when in_KTs is an xtensor - kTs = xt::adapt(in_kTs); + kTs = tensor::Tensor(in_kTs.data(), in_kTs.size()); fissionable = in_fissionable; scatter_format = in_scatter_format; xs.resize(in_kTs.size()); @@ -72,7 +68,7 @@ void Mgxs::metadata_from_hdf5(hid_t xs_id, const vector& temperature, } get_datasets(kT_group, dset_names); vector shape = {num_temps}; - xt::xarray temps_available(shape); + tensor::Tensor temps_available(shape); for (int i = 0; i < num_temps; i++) { read_double(kT_group, dset_names[i], &temps_available[i], true); @@ -100,19 +96,7 @@ void Mgxs::metadata_from_hdf5(hid_t xs_id, const vector& temperature, // Determine actual temperatures to read for (const auto& T : temperature) { // Determine the closest temperature value - // NOTE: the below block could be replaced with the following line, - // though this gives a runtime error if using LLVM 20 or newer, - // likely due to a bug in xtensor. - // auto i_closest = xt::argmin(xt::abs(temps_available - T))[0]; - double closest = std::numeric_limits::max(); - int i_closest = 0; - for (int i = 0; i < temps_available.size(); i++) { - double diff = std::abs(temps_available[i] - T); - if (diff < closest) { - closest = diff; - i_closest = i; - } - } + auto i_closest = tensor::abs(temps_available - T).argmin(); double temp_actual = temps_available[i_closest]; if (std::fabs(temp_actual - T) < settings::temperature_tolerance) { @@ -347,7 +331,7 @@ Mgxs::Mgxs(const std::string& in_name, const vector& mat_kTs, for (int m = 0; m < micros.size(); m++) { switch (settings::temperature_method) { case TemperatureMethod::NEAREST: { - micro_t[m] = xt::argmin(xt::abs(micros[m]->kTs - temp_desired))[0]; + micro_t[m] = tensor::abs(micros[m]->kTs - temp_desired).argmin(); auto temp_actual = micros[m]->kTs[micro_t[m]]; if (std::abs(temp_actual - temp_desired) >= @@ -360,7 +344,7 @@ Mgxs::Mgxs(const std::string& in_name, const vector& mat_kTs, case TemperatureMethod::INTERPOLATION: // Get a list of bounding temperatures for each actual temperature // present in the model - for (int k = 0; k < micros[m]->kTs.shape()[0] - 1; k++) { + for (int k = 0; k < micros[m]->kTs.shape(0) - 1; k++) { if ((micros[m]->kTs[k] <= temp_desired) && (temp_desired < micros[m]->kTs[k + 1])) { micro_t[m] = k; @@ -473,7 +457,7 @@ double Mgxs::get_xs(MgxsType xstype, int gin, const int* gout, const double* mu, val = xs_t->delayed_nu_fission(a, *dg, gin); } else { val = 0.; - for (int d = 0; d < xs_t->delayed_nu_fission.shape()[1]; d++) { + for (int d = 0; d < xs_t->delayed_nu_fission.shape(1); d++) { val += xs_t->delayed_nu_fission(a, d, gin); } } @@ -505,7 +489,7 @@ double Mgxs::get_xs(MgxsType xstype, int gin, const int* gout, const double* mu, } else { // provide an outgoing group-wise sum val = 0.; - for (int g = 0; g < xs_t->chi_prompt.shape()[2]; g++) { + for (int g = 0; g < xs_t->chi_prompt.shape(2); g++) { val += xs_t->chi_prompt(a, gin, g); } } @@ -525,13 +509,13 @@ double Mgxs::get_xs(MgxsType xstype, int gin, const int* gout, const double* mu, } else { if (dg != nullptr) { val = 0.; - for (int g = 0; g < xs_t->delayed_nu_fission.shape()[2]; g++) { + for (int g = 0; g < xs_t->delayed_nu_fission.shape(2); g++) { val += xs_t->delayed_nu_fission(a, *dg, gin, g); } } else { val = 0.; - for (int g = 0; g < xs_t->delayed_nu_fission.shape()[2]; g++) { - for (int d = 0; d < xs_t->delayed_nu_fission.shape()[3]; d++) { + for (int g = 0; g < xs_t->delayed_nu_fission.shape(2); g++) { + for (int d = 0; d < xs_t->delayed_nu_fission.shape(3); d++) { val += xs_t->delayed_nu_fission(a, d, gin, g); } } @@ -679,7 +663,7 @@ bool Mgxs::equiv(const Mgxs& that) int Mgxs::get_temperature_index(double sqrtkT) const { - return xt::argmin(xt::abs(kTs - sqrtkT * sqrtkT))[0]; + return tensor::abs(kTs - sqrtkT * sqrtkT).argmin(); } //============================================================================== diff --git a/src/nuclide.cpp b/src/nuclide.cpp index 5ae6e30ee24..c6fdb4e3e1b 100644 --- a/src/nuclide.cpp +++ b/src/nuclide.cpp @@ -17,8 +17,7 @@ #include -#include "xtensor/xbuilder.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include // for sort, min_element #include @@ -361,8 +360,7 @@ void Nuclide::create_derived( { for (const auto& grid : grid_) { // Allocate and initialize cross section - array shape {grid.energy.size(), 5}; - xs_.emplace_back(shape, 0.0); + xs_.push_back(tensor::zeros({grid.energy.size(), 5})); } reaction_index_.fill(C_NONE); @@ -375,9 +373,8 @@ void Nuclide::create_derived( for (int t = 0; t < kTs_.size(); ++t) { int j = rx->xs_[t].threshold; int n = rx->xs_[t].value.size(); - auto xs = xt::adapt(rx->xs_[t].value); - auto pprod = xt::view(xs_[t], xt::range(j, j + n), XS_PHOTON_PROD); - + auto xs = tensor::Tensor( + rx->xs_[t].value.data(), rx->xs_[t].value.size()); for (const auto& p : rx->products_) { if (p.particle_ == ParticleType::photon) { for (int k = 0; k < n; ++k) { @@ -396,7 +393,7 @@ void Nuclide::create_derived( } } - pprod[k] += f * xs[k] * (*p.yield_)(E); + xs_[t](j + k, XS_PHOTON_PROD) += f * xs[k] * (*p.yield_)(E); } } } @@ -406,20 +403,17 @@ void Nuclide::create_derived( continue; // Add contribution to total cross section - auto total = xt::view(xs_[t], xt::range(j, j + n), XS_TOTAL); - total += xs; + xs_[t].slice(tensor::range(j, j + n), XS_TOTAL) += xs; // Add contribution to absorption cross section - auto absorption = xt::view(xs_[t], xt::range(j, j + n), XS_ABSORPTION); if (is_disappearance(rx->mt_)) { - absorption += xs; + xs_[t].slice(tensor::range(j, j + n), XS_ABSORPTION) += xs; } if (is_fission(rx->mt_)) { fissionable_ = true; - auto fission = xt::view(xs_[t], xt::range(j, j + n), XS_FISSION); - fission += xs; - absorption += xs; + xs_[t].slice(tensor::range(j, j + n), XS_FISSION) += xs; + xs_[t].slice(tensor::range(j, j + n), XS_ABSORPTION) += xs; // Keep track of fission reactions if (t == 0) { @@ -510,7 +504,7 @@ void Nuclide::init_grid() double spacing = std::log(E_max / E_min) / M; // Create equally log-spaced energy grid - auto umesh = xt::linspace(0.0, M * spacing, M + 1); + auto umesh = tensor::linspace(0.0, M * spacing, M + 1); for (auto& grid : grid_) { // Resize array for storing grid indices diff --git a/src/output.cpp b/src/output.cpp index e954923a3e2..5e2561cf3f1 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -17,7 +17,7 @@ #ifdef _OPENMP #include #endif -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/capi.h" #include "openmc/cell.h" diff --git a/src/photon.cpp b/src/photon.cpp index 4926e3eae6a..f7a5530da30 100644 --- a/src/photon.cpp +++ b/src/photon.cpp @@ -13,11 +13,7 @@ #include "openmc/search.h" #include "openmc/settings.h" -#include "xtensor/xbuilder.hpp" -#include "xtensor/xmath.hpp" -#include "xtensor/xoperation.hpp" -#include "xtensor/xslice.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include #include @@ -33,7 +29,7 @@ constexpr int PhotonInteraction::MAX_STACK_SIZE; namespace data { -xt::xtensor compton_profile_pz; +tensor::Tensor compton_profile_pz; std::unordered_map element_map; vector> elements; @@ -46,8 +42,6 @@ vector> elements; PhotonInteraction::PhotonInteraction(hid_t group) { - using namespace xt::placeholders; - // Set index of element in global vector index_ = data::elements.size(); @@ -96,7 +90,7 @@ PhotonInteraction::PhotonInteraction(hid_t group) read_dataset(rgroup, "xs", pair_production_electron_); close_group(rgroup); } else { - pair_production_electron_ = xt::zeros_like(energy_); + pair_production_electron_ = tensor::zeros_like(energy_); } // Read pair production @@ -105,7 +99,7 @@ PhotonInteraction::PhotonInteraction(hid_t group) read_dataset(rgroup, "xs", pair_production_nuclear_); close_group(rgroup); } else { - pair_production_nuclear_ = xt::zeros_like(energy_); + pair_production_nuclear_ = tensor::zeros_like(energy_); } // Read photoelectric @@ -119,7 +113,7 @@ PhotonInteraction::PhotonInteraction(hid_t group) read_dataset(rgroup, "xs", heating_); close_group(rgroup); } else { - heating_ = xt::zeros_like(energy_); + heating_ = tensor::zeros_like(energy_); } // Read subshell photoionization cross section and atomic relaxation data @@ -133,7 +127,7 @@ PhotonInteraction::PhotonInteraction(hid_t group) } shells_.resize(n_shell); - cross_sections_ = xt::zeros({energy_.size(), n_shell}); + cross_sections_ = tensor::zeros({energy_.size(), n_shell}); // Create mapping from designator to index std::unordered_map shell_map; @@ -168,15 +162,17 @@ PhotonInteraction::PhotonInteraction(hid_t group) } // Read subshell cross section - xt::xtensor xs; + tensor::Tensor xs; dset = open_dataset(tgroup, "xs"); read_attribute(dset, "threshold_idx", shell.threshold); close_dataset(dset); read_dataset(tgroup, "xs", xs); auto cross_section = - xt::view(cross_sections_, xt::range(shell.threshold, _), i); - cross_section = xt::where(xs > 0, xt::log(xs), 0); + cross_sections_.slice(tensor::range(static_cast(shell.threshold), + cross_sections_.shape(0)), + i); + cross_section = tensor::where(xs > 0, tensor::log(xs), 0); if (object_exists(tgroup, "transitions")) { // Determine dimensions of transitions @@ -186,11 +182,12 @@ PhotonInteraction::PhotonInteraction(hid_t group) int n_transition = dims[0]; if (n_transition > 0) { - xt::xtensor matrix; + tensor::Tensor matrix; read_dataset(tgroup, "transitions", matrix); // Transition probability normalization - double norm = xt::sum(xt::col(matrix, 3))(); + double norm = + tensor::Tensor(matrix.slice(tensor::all, 3)).sum(); shell.transitions.resize(n_transition); for (int j = 0; j < n_transition; ++j) { @@ -220,7 +217,7 @@ PhotonInteraction::PhotonInteraction(hid_t group) // Read electron shell PDF and binding energies read_dataset(rgroup, "num_electrons", electron_pdf_); - electron_pdf_ /= xt::sum(electron_pdf_); + electron_pdf_ /= electron_pdf_.sum(); read_dataset(rgroup, "binding_energy", binding_energy_); // Read Compton profiles @@ -238,7 +235,7 @@ PhotonInteraction::PhotonInteraction(hid_t group) auto is_close = [](double a, double b) { return std::abs(a - b) / a < FP_REL_PRECISION; }; - subshell_map_ = xt::full_like(binding_energy_, -1); + subshell_map_ = tensor::Tensor(binding_energy_.shape(), -1); for (int i = 0; i < binding_energy_.size(); ++i) { double E_b = binding_energy_[i]; if (i < n_shell && is_close(E_b, shells_[i].binding_energy)) { @@ -257,7 +254,7 @@ PhotonInteraction::PhotonInteraction(hid_t group) // Create Compton profile CDF auto n_profile = data::compton_profile_pz.size(); auto n_shell_compton = profile_pdf_.shape(0); - profile_cdf_ = xt::empty({n_shell_compton, n_profile}); + profile_cdf_ = tensor::Tensor({n_shell_compton, n_profile}); for (int i = 0; i < n_shell_compton; ++i) { double c = 0.0; profile_cdf_(i, 0) = 0.0; @@ -276,11 +273,11 @@ PhotonInteraction::PhotonInteraction(hid_t group) // Read bremsstrahlung scaled DCS rgroup = open_group(group, "bremsstrahlung"); read_dataset(rgroup, "dcs", dcs_); - auto n_e = dcs_.shape()[0]; - auto n_k = dcs_.shape()[1]; + auto n_e = dcs_.shape(0); + auto n_k = dcs_.shape(1); // Get energy grids used for bremsstrahlung DCS and for stopping powers - xt::xtensor electron_energy; + tensor::Tensor electron_energy; read_dataset(rgroup, "electron_energy", electron_energy); if (data::ttb_k_grid.size() == 0) { read_dataset(rgroup, "photon_energy", data::ttb_k_grid); @@ -305,12 +302,12 @@ PhotonInteraction::PhotonInteraction(hid_t group) (std::log(E(i_grid + 1)) - std::log(E(i_grid))); // Interpolate bremsstrahlung DCS at the cutoff energy and truncate - xt::xtensor dcs({n_e - i_grid, n_k}); + tensor::Tensor dcs({n_e - i_grid, n_k}); for (int i = 0; i < n_k; ++i) { double y = std::exp( std::log(dcs_(i_grid, i)) + f * (std::log(dcs_(i_grid + 1, i)) - std::log(dcs_(i_grid, i)))); - auto col_i = xt::view(dcs, xt::all(), i); + tensor::View col_i = dcs.slice(tensor::all, i); col_i(0) = y; for (int j = i_grid + 1; j < n_e; ++j) { col_i(j - i_grid) = dcs_(j, i); @@ -318,9 +315,11 @@ PhotonInteraction::PhotonInteraction(hid_t group) } dcs_ = dcs; - xt::xtensor frst {cutoff}; - electron_energy = xt::concatenate(xt::xtuple( - frst, xt::view(electron_energy, xt::range(i_grid + 1, n_e)))); + tensor::Tensor frst({static_cast(1)}); + frst(0) = cutoff; + tensor::Tensor rest(electron_energy.slice( + tensor::range(i_grid + 1, electron_energy.size()))); + electron_energy = tensor::concatenate(frst, rest); } // Set incident particle energy grid @@ -329,7 +328,8 @@ PhotonInteraction::PhotonInteraction(hid_t group) } // Calculate the radiative stopping power - stopping_power_radiative_ = xt::empty({data::ttb_e_grid.size()}); + stopping_power_radiative_ = + tensor::Tensor({data::ttb_e_grid.size()}); for (int i = 0; i < data::ttb_e_grid.size(); ++i) { // Integrate over reduced photon energy double c = 0.0; @@ -354,14 +354,15 @@ PhotonInteraction::PhotonInteraction(hid_t group) // values below exp(-499) we store the log as -900, for which exp(-900) // evaluates to zero. double limit = std::exp(-499.0); - energy_ = xt::log(energy_); - coherent_ = xt::where(coherent_ > limit, xt::log(coherent_), -900.0); - incoherent_ = xt::where(incoherent_ > limit, xt::log(incoherent_), -900.0); - photoelectric_total_ = xt::where( - photoelectric_total_ > limit, xt::log(photoelectric_total_), -900.0); - pair_production_total_ = xt::where( - pair_production_total_ > limit, xt::log(pair_production_total_), -900.0); - heating_ = xt::where(heating_ > limit, xt::log(heating_), -900.0); + energy_ = tensor::log(energy_); + coherent_ = tensor::where(coherent_ > limit, tensor::log(coherent_), -900.0); + incoherent_ = + tensor::where(incoherent_ > limit, tensor::log(incoherent_), -900.0); + photoelectric_total_ = tensor::where( + photoelectric_total_ > limit, tensor::log(photoelectric_total_), -900.0); + pair_production_total_ = tensor::where(pair_production_total_ > limit, + tensor::log(pair_production_total_), -900.0); + heating_ = tensor::where(heating_ > limit, tensor::log(heating_), -900.0); } PhotonInteraction::~PhotonInteraction() @@ -512,7 +513,7 @@ void PhotonInteraction::compton_doppler( c = prn(seed) * c_max; // Determine pz corresponding to sampled cdf value - auto cdf_shell = xt::view(profile_cdf_, shell, xt::all()); + tensor::View cdf_shell = profile_cdf_.slice(shell); int i = lower_bound_index(cdf_shell.cbegin(), cdf_shell.cend(), c); double pz_l = data::compton_profile_pz(i); double pz_r = data::compton_profile_pz(i + 1); @@ -608,8 +609,8 @@ void PhotonInteraction::calculate_xs(Particle& p) const // Calculate microscopic photoelectric cross section xs.photoelectric = 0.0; - const auto& xs_lower = xt::row(cross_sections_, i_grid); - const auto& xs_upper = xt::row(cross_sections_, i_grid + 1); + tensor::View xs_lower = cross_sections_.slice(i_grid); + tensor::View xs_upper = cross_sections_.slice(i_grid + 1); for (int i = 0; i < xs_upper.size(); ++i) if (xs_lower(i) != 0) diff --git a/src/physics.cpp b/src/physics.cpp index 41509af97be..2b8af14397d 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -30,9 +30,9 @@ #include +#include "openmc/tensor.h" #include // for max, min, max_element #include // for sqrt, exp, log, abs, copysign -#include namespace openmc { @@ -371,8 +371,9 @@ void sample_photon_reaction(Particle& p) // cross sections int i_grid = micro.index_grid; double f = micro.interp_factor; - const auto& xs_lower = xt::row(element.cross_sections_, i_grid); - const auto& xs_upper = xt::row(element.cross_sections_, i_grid + 1); + tensor::View xs_lower = element.cross_sections_.slice(i_grid); + tensor::View xs_upper = + element.cross_sections_.slice(i_grid + 1); for (int i_shell = 0; i_shell < element.shells_.size(); ++i_shell) { const auto& shell {element.shells_[i_shell]}; diff --git a/src/physics_mg.cpp b/src/physics_mg.cpp index 4c28cb1795a..6d6a77672cd 100644 --- a/src/physics_mg.cpp +++ b/src/physics_mg.cpp @@ -2,7 +2,7 @@ #include -#include "xtensor/xarray.hpp" +#include "openmc/tensor.h" #include #include "openmc/bank.h" diff --git a/src/plot.cpp b/src/plot.cpp index 2cadc48cefe..eaadb25453d 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -7,8 +7,7 @@ #include #include -#include "xtensor/xmanipulation.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include #include #ifdef USE_LIBPNG @@ -73,7 +72,8 @@ void IdData::set_value(size_t y, size_t x, const GeometryState& p, int level) void IdData::set_overlap(size_t y, size_t x) { - xt::view(data_, y, x, xt::all()) = OVERLAP; + for (size_t k = 0; k < data_.shape(2); ++k) + data_(y, x, k) = OVERLAP; } PropertyData::PropertyData(size_t h_res, size_t v_res) @@ -743,14 +743,14 @@ void output_ppm(const std::string& filename, const ImageData& data) // Write header of << "P6\n"; - of << data.shape()[0] << " " << data.shape()[1] << "\n"; + of << data.shape(0) << " " << data.shape(1) << "\n"; of << "255\n"; of.close(); of.open(fname, std::ios::binary | std::ios::app); // Write color for each pixel - for (int y = 0; y < data.shape()[1]; y++) { - for (int x = 0; x < data.shape()[0]; x++) { + for (int y = 0; y < data.shape(1); y++) { + for (int x = 0; x < data.shape(0); x++) { RGBColor rgb = data(x, y); of << rgb.red << rgb.green << rgb.blue; } @@ -782,8 +782,8 @@ void output_png(const std::string& filename, const ImageData& data) png_init_io(png_ptr, fp); // Write header (8 bit colour depth) - int width = data.shape()[0]; - int height = data.shape()[1]; + int width = data.shape(0); + int height = data.shape(1); png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); png_write_info(png_ptr, info_ptr); @@ -984,9 +984,14 @@ void Plot::create_voxel() const // select only cell/material ID data and flip the y-axis int idx = color_by_ == PlotColorBy::cells ? 0 : 2; - xt::xtensor data_slice = - xt::view(ids.data_, xt::all(), xt::all(), idx); - xt::xtensor data_flipped = xt::flip(data_slice, 0); + // Extract 2D slice at index idx from 3D data + size_t rows = ids.data_.shape(0); + size_t cols = ids.data_.shape(1); + tensor::Tensor data_slice({rows, cols}); + for (size_t r = 0; r < rows; ++r) + for (size_t c = 0; c < cols; ++c) + data_slice(r, c) = ids.data_(r, c, idx); + tensor::Tensor data_flipped = data_slice.flip(0); // Write to HDF5 dataset voxel_write_slice(z, dspace, dset, memspace, data_flipped.data()); @@ -1228,7 +1233,8 @@ void WireframeRayTracePlot::create_output() const // This array marks where the initial wireframe was drawn. We convolve it with // a filter that gets adjusted with the wireframe thickness in order to // thicken the lines. - xt::xtensor wireframe_initial({width, height}, 0); + tensor::Tensor wireframe_initial( + {static_cast(width), static_cast(height)}, 0); /* Holds all of the track segments for the current rendered line of pixels. * old_segments holds a copy of this_line_segments from the previous line. diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index b4309f64b92..880f9f0856c 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace openmc { @@ -69,8 +70,7 @@ FlatSourceDomain::FlatSourceDomain() // Create a new 2D tensor with the same size as the first // two dimensions of the 3D tensor - tally_volumes_[i] = - xt::xtensor::from_shape({shape[0], shape[1]}); + tally_volumes_[i] = tensor::Tensor({shape[0], shape[1]}); } } diff --git a/src/random_ray/random_ray.cpp b/src/random_ray/random_ray.cpp index 796fd9c3f0f..4a6ece709b9 100644 --- a/src/random_ray/random_ray.cpp +++ b/src/random_ray/random_ray.cpp @@ -10,6 +10,8 @@ #include "openmc/settings.h" #include "openmc/simulation.h" +#include + #include "openmc/distribution_spatial.h" #include "openmc/random_dist.h" #include "openmc/source.h" diff --git a/src/scattdata.cpp b/src/scattdata.cpp index 21b18cbd923..9aa09956d50 100644 --- a/src/scattdata.cpp +++ b/src/scattdata.cpp @@ -4,8 +4,7 @@ #include #include -#include "xtensor/xbuilder.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/constants.h" #include "openmc/error.h" @@ -19,8 +18,8 @@ namespace openmc { // ScattData base-class methods //============================================================================== -void ScattData::base_init(int order, const xt::xtensor& in_gmin, - const xt::xtensor& in_gmax, const double_2dvec& in_energy, +void ScattData::base_init(int order, const tensor::Tensor& in_gmin, + const tensor::Tensor& in_gmax, const double_2dvec& in_energy, const double_2dvec& in_mult) { size_t groups = in_energy.size(); @@ -63,23 +62,26 @@ void ScattData::base_init(int order, const xt::xtensor& in_gmin, void ScattData::base_combine(size_t max_order, size_t order_dim, const vector& those_scatts, const vector& scalars, - xt::xtensor& in_gmin, xt::xtensor& in_gmax, + tensor::Tensor& in_gmin, tensor::Tensor& in_gmax, double_2dvec& sparse_mult, double_3dvec& sparse_scatter) { size_t groups = those_scatts[0]->energy.size(); // Now allocate and zero our storage spaces - xt::xtensor this_nuscatt_matrix({groups, groups, order_dim}, 0.); - xt::xtensor this_nuscatt_P0({groups, groups}, 0.); - xt::xtensor this_scatt_P0({groups, groups}, 0.); - xt::xtensor this_mult({groups, groups}, 1.); + tensor::Tensor this_nuscatt_matrix = + tensor::zeros({groups, groups, order_dim}); + tensor::Tensor this_nuscatt_P0 = + tensor::zeros({groups, groups}); + tensor::Tensor this_scatt_P0 = + tensor::zeros({groups, groups}); + tensor::Tensor this_mult = tensor::ones({groups, groups}); // Build the dense scattering and multiplicity matrices for (int i = 0; i < those_scatts.size(); i++) { ScattData* that = those_scatts[i]; // Build the dense matrix for that object - xt::xtensor that_matrix = that->get_matrix(max_order); + tensor::Tensor that_matrix = that->get_matrix(max_order); // Now add that to this for the nu-scatter matrix this_nuscatt_matrix += scalars[i] * that_matrix; @@ -97,7 +99,7 @@ void ScattData::base_combine(size_t max_order, size_t order_dim, // Now we have the dense nuscatt and scatt, we can easily compute the // multiplicity matrix by dividing the two and fixing any nans - this_mult = xt::nan_to_num(this_nuscatt_P0 / this_scatt_P0); + this_mult = tensor::nan_to_num(this_nuscatt_P0 / this_scatt_P0); // We have the data, now we need to convert to a jagged array and then use // the initialize function to store it on the object. @@ -106,7 +108,7 @@ void ScattData::base_combine(size_t max_order, size_t order_dim, int gmin_; for (gmin_ = 0; gmin_ < groups; gmin_++) { bool non_zero = false; - for (int l = 0; l < this_nuscatt_matrix.shape()[2]; l++) { + for (int l = 0; l < this_nuscatt_matrix.shape(2); l++) { if (this_nuscatt_matrix(gin, gmin_, l) != 0.) { non_zero = true; break; @@ -118,7 +120,7 @@ void ScattData::base_combine(size_t max_order, size_t order_dim, int gmax_; for (gmax_ = groups - 1; gmax_ >= 0; gmax_--) { bool non_zero = false; - for (int l = 0; l < this_nuscatt_matrix.shape()[2]; l++) { + for (int l = 0; l < this_nuscatt_matrix.shape(2); l++) { if (this_nuscatt_matrix(gin, gmax_, l) != 0.) { non_zero = true; break; @@ -143,8 +145,8 @@ void ScattData::base_combine(size_t max_order, size_t order_dim, sparse_mult[gin].resize(gmax_ - gmin_ + 1); int i_gout = 0; for (int gout = gmin_; gout <= gmax_; gout++) { - sparse_scatter[gin][i_gout].resize(this_nuscatt_matrix.shape()[2]); - for (int l = 0; l < this_nuscatt_matrix.shape()[2]; l++) { + sparse_scatter[gin][i_gout].resize(this_nuscatt_matrix.shape(2)); + for (int l = 0; l < this_nuscatt_matrix.shape(2); l++) { sparse_scatter[gin][i_gout][l] = this_nuscatt_matrix(gin, gout, l); } sparse_mult[gin][i_gout] = this_mult(gin, gout); @@ -227,8 +229,8 @@ double ScattData::get_xs( // ScattDataLegendre methods //============================================================================== -void ScattDataLegendre::init(const xt::xtensor& in_gmin, - const xt::xtensor& in_gmax, const double_2dvec& in_mult, +void ScattDataLegendre::init(const tensor::Tensor& in_gmin, + const tensor::Tensor& in_gmax, const double_2dvec& in_mult, const double_3dvec& coeffs) { size_t groups = coeffs.size(); @@ -239,7 +241,7 @@ void ScattDataLegendre::init(const xt::xtensor& in_gmin, // Get the scattering cross section value by summing the un-normalized P0 // coefficient in the variable matrix over all outgoing groups. - scattxs = xt::zeros({groups}); + scattxs = tensor::zeros({groups}); for (int gin = 0; gin < groups; gin++) { int num_groups = in_gmax[gin] - in_gmin[gin] + 1; for (int i_gout = 0; i_gout < num_groups; i_gout++) { @@ -386,8 +388,8 @@ void ScattDataLegendre::combine( size_t groups = those_scatts[0]->energy.size(); - xt::xtensor in_gmin({groups}, 0); - xt::xtensor in_gmax({groups}, 0); + tensor::Tensor in_gmin({groups}, 0); + tensor::Tensor in_gmax({groups}, 0); double_3dvec sparse_scatter(groups); double_2dvec sparse_mult(groups); @@ -404,12 +406,13 @@ void ScattDataLegendre::combine( //============================================================================== -xt::xtensor ScattDataLegendre::get_matrix(size_t max_order) +tensor::Tensor ScattDataLegendre::get_matrix(size_t max_order) { // Get the sizes and initialize the data to 0 size_t groups = energy.size(); size_t order_dim = max_order + 1; - xt::xtensor matrix({groups, groups, order_dim}, 0.); + tensor::Tensor matrix = + tensor::zeros({groups, groups, order_dim}); for (int gin = 0; gin < groups; gin++) { for (int i_gout = 0; i_gout < energy[gin].size(); i_gout++) { @@ -427,8 +430,8 @@ xt::xtensor ScattDataLegendre::get_matrix(size_t max_order) // ScattDataHistogram methods //============================================================================== -void ScattDataHistogram::init(const xt::xtensor& in_gmin, - const xt::xtensor& in_gmax, const double_2dvec& in_mult, +void ScattDataHistogram::init(const tensor::Tensor& in_gmin, + const tensor::Tensor& in_gmax, const double_2dvec& in_mult, const double_3dvec& coeffs) { size_t groups = coeffs.size(); @@ -439,7 +442,7 @@ void ScattDataHistogram::init(const xt::xtensor& in_gmin, // Get the scattering cross section value by summing the distribution // over all the histogram bins in angle and outgoing energy groups - scattxs = xt::zeros({groups}); + scattxs = tensor::zeros({groups}); for (int gin = 0; gin < groups; gin++) { for (int i_gout = 0; i_gout < matrix[gin].size(); i_gout++) { scattxs[gin] += std::accumulate( @@ -468,7 +471,7 @@ void ScattDataHistogram::init(const xt::xtensor& in_gmin, ScattData::base_init(order, in_gmin, in_gmax, in_energy, in_mult); // Build the angular distribution mu values - mu = xt::linspace(-1., 1., order + 1); + mu = tensor::linspace(-1., 1., order + 1); dmu = 2. / order; // Calculate f(mu) and integrate it so we can avoid rejection sampling @@ -513,7 +516,7 @@ double ScattDataHistogram::calc_f(int gin, int gout, double mu) int imu; if (mu == 1.) { // use size -2 to have the index one before the end - imu = this->mu.shape()[0] - 2; + imu = this->mu.shape(0) - 2; } else { imu = std::floor((mu + 1.) / dmu + 1.) - 1; } @@ -559,13 +562,13 @@ void ScattDataHistogram::sample( //============================================================================== -xt::xtensor ScattDataHistogram::get_matrix(size_t max_order) +tensor::Tensor ScattDataHistogram::get_matrix(size_t max_order) { // Get the sizes and initialize the data to 0 size_t groups = energy.size(); // We ignore the requested order for Histogram and Tabular representations size_t order_dim = get_order(); - xt::xtensor matrix({groups, groups, order_dim}, 0); + tensor::Tensor matrix({groups, groups, order_dim}, 0); for (int gin = 0; gin < groups; gin++) { for (int i_gout = 0; i_gout < energy[gin].size(); i_gout++) { @@ -600,8 +603,8 @@ void ScattDataHistogram::combine( size_t groups = those_scatts[0]->energy.size(); - xt::xtensor in_gmin({groups}, 0); - xt::xtensor in_gmax({groups}, 0); + tensor::Tensor in_gmin({groups}, 0); + tensor::Tensor in_gmax({groups}, 0); double_3dvec sparse_scatter(groups); double_2dvec sparse_mult(groups); @@ -620,8 +623,8 @@ void ScattDataHistogram::combine( // ScattDataTabular methods //============================================================================== -void ScattDataTabular::init(const xt::xtensor& in_gmin, - const xt::xtensor& in_gmax, const double_2dvec& in_mult, +void ScattDataTabular::init(const tensor::Tensor& in_gmin, + const tensor::Tensor& in_gmax, const double_2dvec& in_mult, const double_3dvec& coeffs) { size_t groups = coeffs.size(); @@ -631,12 +634,12 @@ void ScattDataTabular::init(const xt::xtensor& in_gmin, double_3dvec matrix = coeffs; // Build the angular distribution mu values - mu = xt::linspace(-1., 1., order); + mu = tensor::linspace(-1., 1., order); dmu = 2. / (order - 1); // Get the scattering cross section value by integrating the distribution // over all mu points and then combining over all outgoing groups - scattxs = xt::zeros({groups}); + scattxs = tensor::zeros({groups}); for (int gin = 0; gin < groups; gin++) { for (int i_gout = 0; i_gout < matrix[gin].size(); i_gout++) { for (int imu = 1; imu < order; imu++) { @@ -713,7 +716,7 @@ double ScattDataTabular::calc_f(int gin, int gout, double mu) int imu; if (mu == 1.) { // use size -2 to have the index one before the end - imu = this->mu.shape()[0] - 2; + imu = this->mu.shape(0) - 2; } else { imu = std::floor((mu + 1.) / dmu + 1.) - 1; } @@ -734,7 +737,7 @@ void ScattDataTabular::sample( sample_energy(gin, gout, i_gout, seed); // Determine the outgoing cosine bin - int NP = this->mu.shape()[0]; + int NP = this->mu.shape(0); double xi = prn(seed); double c_k = dist[gin][i_gout][0]; @@ -776,13 +779,14 @@ void ScattDataTabular::sample( //============================================================================== -xt::xtensor ScattDataTabular::get_matrix(size_t max_order) +tensor::Tensor ScattDataTabular::get_matrix(size_t max_order) { // Get the sizes and initialize the data to 0 size_t groups = energy.size(); // We ignore the requested order for Histogram and Tabular representations size_t order_dim = get_order(); - xt::xtensor matrix({groups, groups, order_dim}, 0.); + tensor::Tensor matrix = + tensor::zeros({groups, groups, order_dim}); for (int gin = 0; gin < groups; gin++) { for (int i_gout = 0; i_gout < energy[gin].size(); i_gout++) { @@ -816,8 +820,8 @@ void ScattDataTabular::combine( size_t groups = those_scatts[0]->energy.size(); - xt::xtensor in_gmin({groups}, 0); - xt::xtensor in_gmax({groups}, 0); + tensor::Tensor in_gmin({groups}, 0); + tensor::Tensor in_gmax({groups}, 0); double_3dvec sparse_scatter(groups); double_2dvec sparse_mult(groups); @@ -854,7 +858,7 @@ void convert_legendre_to_tabular(ScattDataLegendre& leg, ScattDataTabular& tab) tab.scattxs = leg.scattxs; // Build mu and dmu - tab.mu = xt::linspace(-1., 1., n_mu); + tab.mu = tensor::linspace(-1., 1., n_mu); tab.dmu = 2. / (n_mu - 1); // Calculate f(mu) and integrate it so we can avoid rejection sampling diff --git a/src/secondary_correlated.cpp b/src/secondary_correlated.cpp index e820419b484..cc0ab8af19f 100644 --- a/src/secondary_correlated.cpp +++ b/src/secondary_correlated.cpp @@ -5,8 +5,7 @@ #include // for size_t #include // for back_inserter -#include "xtensor/xarray.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/endf.h" #include "openmc/hdf5_interface.h" @@ -26,11 +25,11 @@ CorrelatedAngleEnergy::CorrelatedAngleEnergy(hid_t group) hid_t dset = open_dataset(group, "energy"); // Get interpolation parameters - xt::xarray temp; + tensor::Tensor temp; read_attribute(dset, "interpolation", temp); - auto temp_b = xt::view(temp, 0); // view of breakpoints - auto temp_i = xt::view(temp, 1); // view of interpolation parameters + tensor::View temp_b = temp.slice(0); // breakpoints + tensor::View temp_i = temp.slice(1); // interpolation parameters std::copy(temp_b.begin(), temp_b.end(), std::back_inserter(breakpoints_)); for (const auto i : temp_i) @@ -51,12 +50,12 @@ CorrelatedAngleEnergy::CorrelatedAngleEnergy(hid_t group) read_attribute(dset, "interpolation", interp); read_attribute(dset, "n_discrete_lines", n_discrete); - xt::xarray eout; + tensor::Tensor eout; read_dataset(dset, eout); close_dataset(dset); // Read angle distributions - xt::xarray mu; + tensor::Tensor mu; read_dataset(group, "mu", mu); for (int i = 0; i < n_energy; ++i) { @@ -66,7 +65,7 @@ CorrelatedAngleEnergy::CorrelatedAngleEnergy(hid_t group) if (i < n_energy - 1) { n = offsets[i + 1] - j; } else { - n = eout.shape()[1] - j; + n = eout.shape(1) - j; } // Assign interpolation scheme and number of discrete lines @@ -75,9 +74,9 @@ CorrelatedAngleEnergy::CorrelatedAngleEnergy(hid_t group) d.n_discrete = n_discrete[i]; // Copy data - d.e_out = xt::view(eout, 0, xt::range(j, j + n)); - d.p = xt::view(eout, 1, xt::range(j, j + n)); - d.c = xt::view(eout, 2, xt::range(j, j + n)); + d.e_out = eout.slice(0, tensor::range(j, j + n)); + d.p = eout.slice(1, tensor::range(j, j + n)); + d.c = eout.slice(2, tensor::range(j, j + n)); // To get answers that match ACE data, for now we still use the tabulated // CDF values that were passed through to the HDF5 library. At a later @@ -119,10 +118,10 @@ CorrelatedAngleEnergy::CorrelatedAngleEnergy(hid_t group) // Determine offset and size of distribution int offset_mu = std::lround(eout(4, offsets[i] + j)); int m; - if (offsets[i] + j + 1 < eout.shape()[1]) { + if (offsets[i] + j + 1 < eout.shape(1)) { m = std::lround(eout(4, offsets[i] + j + 1)) - offset_mu; } else { - m = mu.shape()[1] - offset_mu; + m = mu.shape(1) - offset_mu; } // For incoherent inelastic thermal scattering, the angle distributions @@ -133,9 +132,12 @@ CorrelatedAngleEnergy::CorrelatedAngleEnergy(hid_t group) interp_mu = 1; auto interp = int2interp(interp_mu); - auto xs = xt::view(mu, 0, xt::range(offset_mu, offset_mu + m)); - auto ps = xt::view(mu, 1, xt::range(offset_mu, offset_mu + m)); - auto cs = xt::view(mu, 2, xt::range(offset_mu, offset_mu + m)); + tensor::View xs = + mu.slice(0, tensor::range(offset_mu, offset_mu + m)); + tensor::View ps = + mu.slice(1, tensor::range(offset_mu, offset_mu + m)); + tensor::View cs = + mu.slice(2, tensor::range(offset_mu, offset_mu + m)); vector x {xs.begin(), xs.end()}; vector p {ps.begin(), ps.end()}; diff --git a/src/secondary_kalbach.cpp b/src/secondary_kalbach.cpp index 6ac91e665b9..8470c8c18e6 100644 --- a/src/secondary_kalbach.cpp +++ b/src/secondary_kalbach.cpp @@ -5,8 +5,7 @@ #include // for size_t #include // for back_inserter -#include "xtensor/xarray.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/hdf5_interface.h" #include "openmc/math_functions.h" @@ -27,11 +26,11 @@ KalbachMann::KalbachMann(hid_t group) hid_t dset = open_dataset(group, "energy"); // Get interpolation parameters - xt::xarray temp; + tensor::Tensor temp; read_attribute(dset, "interpolation", temp); - auto temp_b = xt::view(temp, 0); // view of breakpoints - auto temp_i = xt::view(temp, 1); // view of interpolation parameters + tensor::View temp_b = temp.slice(0); // breakpoints + tensor::View temp_i = temp.slice(1); // interpolation parameters std::copy(temp_b.begin(), temp_b.end(), std::back_inserter(breakpoints_)); for (const auto i : temp_i) @@ -52,7 +51,7 @@ KalbachMann::KalbachMann(hid_t group) read_attribute(dset, "interpolation", interp); read_attribute(dset, "n_discrete_lines", n_discrete); - xt::xarray eout; + tensor::Tensor eout; read_dataset(dset, eout); close_dataset(dset); @@ -63,7 +62,7 @@ KalbachMann::KalbachMann(hid_t group) if (i < n_energy - 1) { n = offsets[i + 1] - j; } else { - n = eout.shape()[1] - j; + n = eout.shape(1) - j; } // Assign interpolation scheme and number of discrete lines @@ -72,11 +71,11 @@ KalbachMann::KalbachMann(hid_t group) d.n_discrete = n_discrete[i]; // Copy data - d.e_out = xt::view(eout, 0, xt::range(j, j + n)); - d.p = xt::view(eout, 1, xt::range(j, j + n)); - d.c = xt::view(eout, 2, xt::range(j, j + n)); - d.r = xt::view(eout, 3, xt::range(j, j + n)); - d.a = xt::view(eout, 4, xt::range(j, j + n)); + d.e_out = eout.slice(0, tensor::range(j, j + n)); + d.p = eout.slice(1, tensor::range(j, j + n)); + d.c = eout.slice(2, tensor::range(j, j + n)); + d.r = eout.slice(3, tensor::range(j, j + n)); + d.a = eout.slice(4, tensor::range(j, j + n)); // To get answers that match ACE data, for now we still use the tabulated // CDF values that were passed through to the HDF5 library. At a later diff --git a/src/secondary_thermal.cpp b/src/secondary_thermal.cpp index 030d398aabe..2ab7d8a63e1 100644 --- a/src/secondary_thermal.cpp +++ b/src/secondary_thermal.cpp @@ -5,7 +5,7 @@ #include "openmc/random_lcg.h" #include "openmc/search.h" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include #include // for log, exp @@ -85,7 +85,7 @@ void IncoherentElasticAEDiscrete::sample( // incoming energies. // Sample outgoing cosine bin - int n_mu = mu_out_.shape()[1]; + int n_mu = mu_out_.shape(1); int k = prn(seed) * n_mu; // Rather than use the sampled discrete mu directly, it is smeared over @@ -145,7 +145,7 @@ void IncoherentInelasticAEDiscrete::sample( // probability of 1). Otherwise, each bin is equally probable. int j; - int n = energy_out_.shape()[1]; + int n = energy_out_.shape(1); if (!skewed_) { // All bins equally likely j = prn(seed) * n; @@ -178,7 +178,7 @@ void IncoherentInelasticAEDiscrete::sample( E_out = (1 - f) * E_ij + f * E_i1j; // Sample outgoing cosine bin - int m = mu_out_.shape()[2]; + int m = mu_out_.shape(2); int k = prn(seed) * m; // Determine outgoing cosine corresponding to E_in[i] and E_in[i+1] @@ -218,11 +218,11 @@ IncoherentInelasticAE::IncoherentInelasticAE(hid_t group) // On first pass, allocate space for angles if (j == 0) { auto n_mu = adist->x().size(); - d.mu = xt::empty({d.n_e_out, n_mu}); + d.mu = tensor::Tensor({d.n_e_out, n_mu}); } // Copy outgoing angles - auto mu_j = xt::view(d.mu, j); + tensor::View mu_j = d.mu.slice(j); std::copy(adist->x().begin(), adist->x().end(), mu_j.begin()); } } @@ -287,7 +287,7 @@ void IncoherentInelasticAE::sample( } // Sample outgoing cosine bin - int n_mu = distribution_[l].mu.shape()[1]; + int n_mu = distribution_[l].mu.shape(1); std::size_t k = prn(seed) * n_mu; // Rather than use the sampled discrete mu directly, it is smeared over diff --git a/src/simulation.cpp b/src/simulation.cpp index 06648277c13..7e4c6201318 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -30,7 +30,7 @@ #ifdef _OPENMP #include #endif -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #ifdef OPENMC_MPI #include @@ -431,7 +431,7 @@ void finalize_batch() // Reset global tally results if (simulation::current_batch <= settings::n_inactive) { - xt::view(simulation::global_tallies, xt::all()) = 0.0; + simulation::global_tallies.fill(0.0); simulation::n_realizations = 0; } diff --git a/src/source.cpp b/src/source.cpp index b30b964d39c..19b826b0487 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -10,7 +10,7 @@ #include // for dlopen, dlsym, dlclose, dlerror #endif -#include "xtensor/xadapt.hpp" +#include "openmc/tensor.h" #include #include "openmc/bank.h" @@ -393,8 +393,9 @@ SourceSite IndependentSource::sample(uint64_t* seed) const auto p = static_cast(particle_); auto energy_ptr = dynamic_cast(energy_.get()); if (energy_ptr) { - auto energies = xt::adapt(energy_ptr->x()); - if (xt::any(energies > data::energy_max[p])) { + auto energies = + tensor::Tensor(energy_ptr->x().data(), energy_ptr->x().size()); + if ((energies > data::energy_max[p]).any()) { fatal_error("Source energy above range of energies of at least " "one cross section table"); } diff --git a/src/state_point.cpp b/src/state_point.cpp index 294cd45c7f6..6ba4e043cfc 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -4,8 +4,7 @@ #include // for int64_t #include -#include "xtensor/xbuilder.hpp" // for empty_like -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include #include "openmc/bank.h" @@ -303,8 +302,8 @@ extern "C" int openmc_statepoint_write(const char* filename, bool* write_source) std::string name = "tally " + std::to_string(tally->id_); hid_t tally_group = open_group(tallies_group, name.c_str()); auto& results = tally->results_; - write_tally_results(tally_group, results.shape()[0], - results.shape()[1], results.shape()[2], results.data()); + write_tally_results(tally_group, results.shape(0), results.shape(1), + results.shape(2), results.data()); close_group(tally_group); } } else { @@ -550,8 +549,8 @@ extern "C" int openmc_statepoint_load(const char* filename) tally->writable_ = false; } else { auto& results = tally->results_; - read_tally_results(tally_group, results.shape()[0], - results.shape()[1], results.shape()[2], results.data()); + read_tally_results(tally_group, results.shape(0), results.shape(1), + results.shape(2), results.data()); read_dataset(tally_group, "n_realizations", tally->n_realizations_); close_group(tally_group); @@ -843,7 +842,7 @@ void write_unstructured_mesh_results() // construct result vectors vector mean_vec(umesh->n_bins()), std_dev_vec(umesh->n_bins()); - for (int j = 0; j < tally->results_.shape()[0]; j++) { + for (int j = 0; j < tally->results_.shape(0); j++) { // get the volume for this bin double volume = umesh->volume(j); // compute the mean @@ -905,7 +904,7 @@ void write_tally_results_nr(hid_t file_id) #ifdef OPENMC_MPI // Reduce global tallies - xt::xtensor gt_reduced = xt::empty_like(gt); + tensor::Tensor gt_reduced({N_GLOBAL_TALLIES, 3}); MPI_Reduce(gt.data(), gt_reduced.data(), gt.size(), MPI_DOUBLE, MPI_SUM, 0, mpi::intracomm); @@ -934,13 +933,18 @@ void write_tally_results_nr(hid_t file_id) write_attribute(file_id, "tallies_present", 1); } - // Get view of accumulated tally values - auto values_view = xt::view(t->results_, xt::all(), xt::all(), - xt::range(static_cast(TallyResult::SUM), - static_cast(TallyResult::SUM_SQ) + 1)); - - // Make copy of tally values in contiguous array - xt::xtensor values = values_view; + // Copy the SUM and SUM_SQ columns from the tally results into a + // contiguous array for MPI reduction + const int r_start = static_cast(TallyResult::SUM); + const int r_end = static_cast(TallyResult::SUM_SQ) + 1; + const size_t r_count = r_end - r_start; + const size_t ni = t->results_.shape(0); + const size_t nj = t->results_.shape(1); + tensor::Tensor values({ni, nj, r_count}); + for (size_t i = 0; i < ni; i++) + for (size_t j = 0; j < nj; j++) + for (size_t r = 0; r < r_count; r++) + values(i, j, r) = t->results_(i, j, r_start + r); if (mpi::master) { // Open group for tally @@ -954,19 +958,22 @@ void write_tally_results_nr(hid_t file_id) MPI_SUM, 0, mpi::intracomm); #endif - // At the end of the simulation, store the results back in the - // regular TallyResults array + // At the end of the simulation, store the reduced results back + // into the tally results array if (simulation::current_batch == settings::n_max_batches || simulation::satisfy_triggers) { - values_view = values; + for (size_t i = 0; i < ni; i++) + for (size_t j = 0; j < nj; j++) + for (size_t r = 0; r < r_count; r++) + t->results_(i, j, r_start + r) = values(i, j, r); } - // Put in temporary tally result - xt::xtensor results_copy = xt::zeros_like(t->results_); - auto copy_view = xt::view(results_copy, xt::all(), xt::all(), - xt::range(static_cast(TallyResult::SUM), - static_cast(TallyResult::SUM_SQ) + 1)); - copy_view = values; + // Put reduced values into a full-sized copy for writing to HDF5 + tensor::Tensor results_copy = tensor::zeros_like(t->results_); + for (size_t i = 0; i < ni; i++) + for (size_t j = 0; j < nj; j++) + for (size_t r = 0; r < r_count; r++) + results_copy(i, j, r_start + r) = values(i, j, r); // Write reduced tally results to file auto shape = results_copy.shape(); diff --git a/src/tallies/filter_cell_instance.cpp b/src/tallies/filter_cell_instance.cpp index 316a758d11a..928bfb6c5e7 100644 --- a/src/tallies/filter_cell_instance.cpp +++ b/src/tallies/filter_cell_instance.cpp @@ -9,6 +9,7 @@ #include "openmc/cell.h" #include "openmc/error.h" #include "openmc/geometry.h" +#include "openmc/tensor.h" #include "openmc/xml_interface.h" namespace openmc { @@ -108,7 +109,7 @@ void CellInstanceFilter::to_statepoint(hid_t filter_group) const { Filter::to_statepoint(filter_group); size_t n = cell_instances_.size(); - xt::xtensor data({n, 2}); + tensor::Tensor data({n, 2}); for (int64_t i = 0; i < n; ++i) { const auto& x = cell_instances_[i]; data(i, 0) = model::cells[x.index_cell]->id_; diff --git a/src/tallies/filter_meshmaterial.cpp b/src/tallies/filter_meshmaterial.cpp index 6e1f30380f6..b45bb4164eb 100644 --- a/src/tallies/filter_meshmaterial.cpp +++ b/src/tallies/filter_meshmaterial.cpp @@ -1,5 +1,6 @@ #include "openmc/tallies/filter_meshmaterial.h" +#include #include // for move #include @@ -10,6 +11,7 @@ #include "openmc/error.h" #include "openmc/material.h" #include "openmc/mesh.h" +#include "openmc/tensor.h" #include "openmc/xml_interface.h" namespace openmc { @@ -161,7 +163,7 @@ void MeshMaterialFilter::to_statepoint(hid_t filter_group) const write_dataset(filter_group, "mesh", model::meshes[mesh_]->id_); size_t n = bins_.size(); - xt::xtensor data({n, 2}); + tensor::Tensor data({n, 2}); for (int64_t i = 0; i < n; ++i) { const auto& x = bins_[i]; data(i, 0) = x.index_element; diff --git a/src/tallies/tally.cpp b/src/tallies/tally.cpp index 6d798bc9385..f5ef863ec8d 100644 --- a/src/tallies/tally.cpp +++ b/src/tallies/tally.cpp @@ -35,9 +35,7 @@ #include "openmc/tallies/filter_time.h" #include "openmc/xml_interface.h" -#include "xtensor/xadapt.hpp" -#include "xtensor/xbuilder.hpp" // for empty_like -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include #include // for max, set_union @@ -69,7 +67,7 @@ vector time_grid; } // namespace model namespace simulation { -xt::xtensor_fixed> global_tallies; +tensor::StaticTensor2D global_tallies; int32_t n_realizations {0}; } // namespace simulation @@ -818,9 +816,11 @@ void Tally::init_results() { int n_scores = scores_.size() * nuclides_.size(); if (higher_moments_) { - results_ = xt::empty({n_filter_bins_, n_scores, 5}); + results_ = tensor::Tensor({static_cast(n_filter_bins_), + static_cast(n_scores), size_t {5}}); } else { - results_ = xt::empty({n_filter_bins_, n_scores, 3}); + results_ = tensor::Tensor({static_cast(n_filter_bins_), + static_cast(n_scores), size_t {3}}); } } @@ -828,7 +828,7 @@ void Tally::reset() { n_realizations_ = 0; if (results_.size() != 0) { - xt::view(results_, xt::all()) = 0.0; + results_.fill(0.0); } } @@ -863,9 +863,9 @@ void Tally::accumulate() if (higher_moments_) { #pragma omp parallel for // filter bins (specific cell, energy bins) - for (int i = 0; i < results_.shape()[0]; ++i) { + for (int i = 0; i < results_.shape(0); ++i) { // score bins (flux, total reaction rate, fission reaction rate, etc.) - for (int j = 0; j < results_.shape()[1]; ++j) { + for (int j = 0; j < results_.shape(1); ++j) { double val = results_(i, j, TallyResult::VALUE) * norm; double val2 = val * val; results_(i, j, TallyResult::VALUE) = 0.0; @@ -878,9 +878,9 @@ void Tally::accumulate() } else { #pragma omp parallel for // filter bins (specific cell, energy bins) - for (int i = 0; i < results_.shape()[0]; ++i) { + for (int i = 0; i < results_.shape(0); ++i) { // score bins (flux, total reaction rate, fission reaction rate, etc.) - for (int j = 0; j < results_.shape()[1]; ++j) { + for (int j = 0; j < results_.shape(1); ++j) { double val = results_(i, j, TallyResult::VALUE) * norm; results_(i, j, TallyResult::VALUE) = 0.0; results_(i, j, TallyResult::SUM) += val; @@ -900,18 +900,18 @@ int Tally::score_index(const std::string& score) const return -1; } -xt::xarray Tally::get_reshaped_data() const +tensor::Tensor Tally::get_reshaped_data() const { - std::vector shape; + vector shape; for (auto f : filters()) { shape.push_back(model::tally_filters[f]->n_bins()); } // add number of scores and nuclides to tally - shape.push_back(results_.shape()[1]); - shape.push_back(results_.shape()[2]); + shape.push_back(results_.shape(1)); + shape.push_back(results_.shape(2)); - xt::xarray reshaped_results = results_; + tensor::Tensor reshaped_results = results_; reshaped_results.reshape(shape); return reshaped_results; } @@ -1016,13 +1016,14 @@ void reduce_tally_results() // Skip any tallies that are not active auto& tally {model::tallies[i_tally]}; - // Get view of accumulated tally values - auto values_view = xt::view(tally->results_, xt::all(), xt::all(), - static_cast(TallyResult::VALUE)); + // Extract 2D view of the VALUE column from the 3D results tensor, + // then copy into a contiguous array for MPI reduction + const int val_idx = static_cast(TallyResult::VALUE); + tensor::View val_view = + tally->results_.slice(tensor::all, tensor::all, val_idx); + tensor::Tensor values(val_view); - // Make copy of tally values in contiguous array - xt::xtensor values = values_view; - xt::xtensor values_reduced = xt::empty_like(values); + tensor::Tensor values_reduced(values.shape()); // Reduce contiguous set of tally results MPI_Reduce(values.data(), values_reduced.data(), values.size(), @@ -1030,9 +1031,9 @@ void reduce_tally_results() // Transfer values on master and reset on other ranks if (mpi::master) { - values_view = values_reduced; + val_view = values_reduced; } else { - values_view = 0.0; + val_view = 0.0; } } } @@ -1040,14 +1041,13 @@ void reduce_tally_results() // Note that global tallies are *always* reduced even when no_reduce option // is on. - // Get view of global tally values + // Get reference to global tallies auto& gt = simulation::global_tallies; - auto gt_values_view = - xt::view(gt, xt::all(), static_cast(TallyResult::VALUE)); + const int val_col = static_cast(TallyResult::VALUE); - // Make copy of values in contiguous array - xt::xtensor gt_values = gt_values_view; - xt::xtensor gt_values_reduced = xt::empty_like(gt_values); + // Copy VALUE column into contiguous array for MPI reduction + tensor::Tensor gt_values(gt.slice(tensor::all, val_col)); + tensor::Tensor gt_values_reduced({size_t {N_GLOBAL_TALLIES}}); // Reduce contiguous data MPI_Reduce(gt_values.data(), gt_values_reduced.data(), N_GLOBAL_TALLIES, @@ -1055,9 +1055,9 @@ void reduce_tally_results() // Transfer values on master and reset on other ranks if (mpi::master) { - gt_values_view = gt_values_reduced; + gt.slice(tensor::all, val_col) = gt_values_reduced; } else { - gt_values_view = 0.0; + gt.slice(tensor::all, val_col) = 0.0; } // We also need to determine the total starting weight of particles from the diff --git a/src/tallies/tally_scoring.cpp b/src/tallies/tally_scoring.cpp index 67e851644a9..bda9e82537b 100644 --- a/src/tallies/tally_scoring.cpp +++ b/src/tallies/tally_scoring.cpp @@ -20,6 +20,7 @@ #include "openmc/tallies/filter_delayedgroup.h" #include "openmc/tallies/filter_energy.h" +#include #include namespace openmc { diff --git a/src/tallies/trigger.cpp b/src/tallies/trigger.cpp index f1f83e2982c..6c54edd5e1d 100644 --- a/src/tallies/trigger.cpp +++ b/src/tallies/trigger.cpp @@ -71,7 +71,7 @@ void check_tally_triggers(double& ratio, int& tally_id, int& score) continue; const auto& results = t.results_; - for (auto filter_index = 0; filter_index < results.shape()[0]; + for (auto filter_index = 0; filter_index < results.shape(0); ++filter_index) { // Compute the tally uncertainty metrics. auto uncert_pair = diff --git a/src/thermal.cpp b/src/thermal.cpp index cbe0983ed65..6ed59f68693 100644 --- a/src/thermal.cpp +++ b/src/thermal.cpp @@ -3,12 +3,7 @@ #include // for sort, move, min, max, find #include // for round, sqrt, abs -#include "xtensor/xarray.hpp" -#include "xtensor/xbuilder.hpp" -#include "xtensor/xmath.hpp" -#include "xtensor/xsort.hpp" -#include "xtensor/xtensor.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include #include "openmc/constants.h" @@ -55,7 +50,7 @@ ThermalScattering::ThermalScattering( // Determine temperatures available auto dset_names = dataset_names(kT_group); auto n = dset_names.size(); - auto temps_available = xt::empty({n}); + auto temps_available = tensor::Tensor({n}); for (int i = 0; i < dset_names.size(); ++i) { // Read temperature value double T; @@ -82,7 +77,7 @@ ThermalScattering::ThermalScattering( // Determine actual temperatures to read for (const auto& T : temperature) { - auto i_closest = xt::argmin(xt::abs(temps_available - T))[0]; + auto i_closest = tensor::abs(temps_available - T).argmin(); auto temp_actual = temps_available[i_closest]; if (std::abs(temp_actual - T) < settings::temperature_tolerance) { if (std::find(temps_to_read.begin(), temps_to_read.end(), diff --git a/src/track_output.cpp b/src/track_output.cpp index f4344d50f74..ec8b02e84b5 100644 --- a/src/track_output.cpp +++ b/src/track_output.cpp @@ -8,7 +8,7 @@ #include "openmc/simulation.h" #include "openmc/vector.h" -#include "xtensor/xtensor.hpp" +#include "openmc/tensor.h" #include #include diff --git a/src/urr.cpp b/src/urr.cpp index 02cef228099..b791eecb0da 100644 --- a/src/urr.cpp +++ b/src/urr.cpp @@ -25,7 +25,7 @@ UrrData::UrrData(hid_t group_id) // Read URR tables. The HDF5 format is a little // different from how we want it laid out in memory. // This array used to be called "prob_". - xt::xtensor tmp_prob; + tensor::Tensor tmp_prob; read_dataset(group_id, "table", tmp_prob); auto shape = tmp_prob.shape(); @@ -38,7 +38,7 @@ UrrData::UrrData(hid_t group_id) xs_values_.resize({n_energy, n_cdf_values}); // Now fill in the values. Using manual loops here since we might - // not have fancy xtensor slicing code written for GPU tensors. + // not have fancy tensor slicing code written for GPU tensors. // The below enum gives how URR tables are laid out in our HDF5 tables. enum class URRTableParam { CUM_PROB, diff --git a/src/volume_calc.cpp b/src/volume_calc.cpp index 1deffb80488..f675ae78a2e 100644 --- a/src/volume_calc.cpp +++ b/src/volume_calc.cpp @@ -17,8 +17,7 @@ #include "openmc/timer.h" #include "openmc/xml_interface.h" -#include "xtensor/xadapt.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include #include // for copy @@ -242,7 +241,8 @@ vector VolumeCalculation::execute() const // non-zero auto n_nuc = settings::run_CE ? data::nuclides.size() : data::mg.nuclides_.size(); - xt::xtensor atoms({n_nuc, 2}, 0.0); + auto atoms = + tensor::zeros({static_cast(n_nuc), size_t {2}}); #ifdef OPENMC_MPI if (mpi::master) { @@ -452,9 +452,11 @@ void VolumeCalculation::to_hdf5( } // Create array of total # of atoms with uncertainty for each nuclide - xt::xtensor atom_data({n_nuc, 2}); - xt::view(atom_data, xt::all(), 0) = xt::adapt(result.atoms); - xt::view(atom_data, xt::all(), 1) = xt::adapt(result.uncertainty); + tensor::Tensor atom_data({static_cast(n_nuc), size_t {2}}); + for (size_t k = 0; k < static_cast(n_nuc); ++k) { + atom_data(k, 0) = result.atoms[k]; + atom_data(k, 1) = result.uncertainty[k]; + } // Write results write_dataset(group_id, "nuclides", nucnames); diff --git a/src/weight_windows.cpp b/src/weight_windows.cpp index 4838e459152..7d98e2a3f3a 100644 --- a/src/weight_windows.cpp +++ b/src/weight_windows.cpp @@ -6,12 +6,7 @@ #include #include -#include "xtensor/xdynamic_view.hpp" -#include "xtensor/xindex_view.hpp" -#include "xtensor/xio.hpp" -#include "xtensor/xmasked_view.hpp" -#include "xtensor/xnoalias.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/error.h" #include "openmc/file_utils.h" @@ -265,8 +260,12 @@ WeightWindows* WeightWindows::from_hdf5( } wws->set_mesh(model::mesh_map[mesh_id]); - wws->lower_ww_ = xt::empty(wws->bounds_size()); - wws->upper_ww_ = xt::empty(wws->bounds_size()); + wws->lower_ww_ = + tensor::Tensor({static_cast(wws->bounds_size()[0]), + static_cast(wws->bounds_size()[1])}); + wws->upper_ww_ = + tensor::Tensor({static_cast(wws->bounds_size()[0]), + static_cast(wws->bounds_size()[1])}); read_dataset(ww_group, "lower_ww_bounds", wws->lower_ww_); read_dataset(ww_group, "upper_ww_bounds", wws->upper_ww_); @@ -298,9 +297,11 @@ void WeightWindows::allocate_ww_bounds() "Size of weight window bounds is zero for WeightWindows {}", id()); warning(msg); } - lower_ww_ = xt::empty(shape); + lower_ww_ = tensor::Tensor({static_cast(shape[0]), + static_cast(shape[1]), static_cast(shape[2])}); lower_ww_.fill(-1); - upper_ww_ = xt::empty(shape); + upper_ww_ = tensor::Tensor({static_cast(shape[0]), + static_cast(shape[1]), static_cast(shape[2])}); upper_ww_.fill(-1); } @@ -446,8 +447,8 @@ void WeightWindows::check_bounds(const T& bounds) const } } -void WeightWindows::set_bounds(const xt::xtensor& lower_bounds, - const xt::xtensor& upper_bounds) +void WeightWindows::set_bounds(const tensor::Tensor& lower_bounds, + const tensor::Tensor& upper_bounds) { this->check_bounds(lower_bounds, upper_bounds); @@ -458,7 +459,7 @@ void WeightWindows::set_bounds(const xt::xtensor& lower_bounds, } void WeightWindows::set_bounds( - const xt::xtensor& lower_bounds, double ratio) + const tensor::Tensor& lower_bounds, double ratio) { this->check_bounds(lower_bounds); @@ -473,14 +474,16 @@ void WeightWindows::set_bounds( { check_bounds(lower_bounds, upper_bounds); auto shape = this->bounds_size(); - lower_ww_ = xt::empty(shape); - upper_ww_ = xt::empty(shape); - - // set new weight window values - xt::view(lower_ww_, xt::all()) = - xt::adapt(lower_bounds.data(), lower_ww_.shape()); - xt::view(upper_ww_, xt::all()) = - xt::adapt(upper_bounds.data(), upper_ww_.shape()); + lower_ww_ = tensor::Tensor({static_cast(shape[0]), + static_cast(shape[1]), static_cast(shape[2])}); + upper_ww_ = tensor::Tensor({static_cast(shape[0]), + static_cast(shape[1]), static_cast(shape[2])}); + + // Copy weight window values from input spans into the tensors + std::copy(lower_bounds.data(), lower_bounds.data() + lower_ww_.size(), + lower_ww_.data()); + std::copy(upper_bounds.data(), upper_bounds.data() + upper_ww_.size(), + upper_ww_.data()); } void WeightWindows::set_bounds(span lower_bounds, double ratio) @@ -488,14 +491,16 @@ void WeightWindows::set_bounds(span lower_bounds, double ratio) this->check_bounds(lower_bounds); auto shape = this->bounds_size(); - lower_ww_ = xt::empty(shape); - upper_ww_ = xt::empty(shape); - - // set new weight window values - xt::view(lower_ww_, xt::all()) = - xt::adapt(lower_bounds.data(), lower_ww_.shape()); - xt::view(upper_ww_, xt::all()) = - xt::adapt(lower_bounds.data(), upper_ww_.shape()); + lower_ww_ = tensor::Tensor({static_cast(shape[0]), + static_cast(shape[1]), static_cast(shape[2])}); + upper_ww_ = tensor::Tensor({static_cast(shape[0]), + static_cast(shape[1]), static_cast(shape[2])}); + + // Copy lower bounds into both arrays, then scale upper by ratio + std::copy(lower_bounds.data(), lower_bounds.data() + lower_ww_.size(), + lower_ww_.data()); + std::copy(lower_bounds.data(), lower_bounds.data() + upper_ww_.size(), + upper_ww_.data()); upper_ww_ *= ratio; } @@ -508,8 +513,8 @@ void WeightWindows::update_weights(const Tally* tally, const std::string& value, this->check_tally_update_compatibility(tally); // Dimensions of weight window arrays - int e_bins = lower_ww_.shape()[0]; - int64_t mesh_bins = lower_ww_.shape()[1]; + int e_bins = lower_ww_.shape(0); + int64_t mesh_bins = lower_ww_.shape(1); // Initialize weight window arrays to -1.0 by default #pragma omp parallel for collapse(2) schedule(static) @@ -586,25 +591,13 @@ void WeightWindows::update_weights(const Tally* tally, const std::string& value, std::find(filter_types.begin(), filter_types.end(), FilterType::MESH) - filter_types.begin(); - // get a fully reshaped view of the tally according to tally ordering of - // filters - auto tally_values = xt::reshape_view(results_arr, shape); - - // get a that is (particle, energy, mesh, scores, values) - auto transposed_view = xt::transpose(tally_values, transpose); - - // determine the dimension and index of the particle data int particle_idx = 0; if (tally->has_filter(FilterType::PARTICLE)) { - // get the particle filter auto pf = tally->get_filter(); const auto& particles = pf->particles(); - // find the index of the particle that matches these weight windows auto p_it = std::find(particles.begin(), particles.end(), this->particle_type_); - // if the particle filter doesn't have particle data for the particle - // used on this weight windows instance, report an error if (p_it == particles.end()) { auto msg = fmt::format("Particle type '{}' not present on Filter {} for " "Tally {} used to update WeightWindows {}", @@ -613,17 +606,47 @@ void WeightWindows::update_weights(const Tally* tally, const std::string& value, fatal_error(msg); } - // use the index of the particle in the filter to down-select data later particle_idx = p_it - particles.begin(); } - // down-select data based on particle and score - auto sum = xt::dynamic_view( - transposed_view, {particle_idx, xt::all(), xt::all(), score_index, - static_cast(TallyResult::SUM)}); - auto sum_sq = xt::dynamic_view( - transposed_view, {particle_idx, xt::all(), xt::all(), score_index, - static_cast(TallyResult::SUM_SQ)}); + // The tally results array is 3D: (n_filter_combos, n_scores, n_result_types). + // The first dimension is a row-major flattening of up to 3 filter dimensions + // (particle, energy, mesh) whose storage order depends on which filters + // the tally has. We need to map our desired indices (particle, energy, mesh) + // into the correct flat filter combination index. + // + // transpose[i] tells us which storage position holds dimension i: + // i=0 -> particle, i=1 -> energy, i=2 -> mesh + // shape[j] gives the number of bins for filter storage position j. + + // Row-major strides for the 3 filter dimensions + const int stride0 = shape[1] * shape[2]; + const int stride1 = shape[2]; + + tensor::Tensor sum( + {static_cast(e_bins), static_cast(mesh_bins)}); + tensor::Tensor sum_sq( + {static_cast(e_bins), static_cast(mesh_bins)}); + + const int i_sum = static_cast(TallyResult::SUM); + const int i_sum_sq = static_cast(TallyResult::SUM_SQ); + + for (int e = 0; e < e_bins; e++) { + for (int64_t m = 0; m < mesh_bins; m++) { + // Place particle, energy, mesh, and time indices into their storage + // positions + std::array idx = {0, 0, 0}; + idx[transpose[0]] = particle_idx; + idx[transpose[1]] = e; + idx[transpose[2]] = static_cast(m); + + // Compute flat filter combination index (row-major over filter dims) + int flat = idx[0] * stride0 + idx[1] * stride1 + idx[2]; + + sum(e, m) = results(flat, score_index, i_sum); + sum_sq(e, m) = results(flat, score_index, i_sum_sq); + } + } int n = tally->n_realizations_; ////////////////////////////////////////////// @@ -1150,7 +1173,8 @@ extern "C" int openmc_weight_windows_set_bounds(int32_t index, return err; const auto& wws = variance_reduction::weight_windows[index]; - wws->set_bounds({lower_bounds, size}, {upper_bounds, size}); + wws->set_bounds(span(lower_bounds, size), + span(upper_bounds, size)); return 0; } diff --git a/src/wmp.cpp b/src/wmp.cpp index e9c4fb5e3e6..6f72e1ba4cc 100644 --- a/src/wmp.cpp +++ b/src/wmp.cpp @@ -33,22 +33,22 @@ WindowedMultipole::WindowedMultipole(hid_t group) // Read the "data" array. Use its shape to figure out the number of poles // and residue types in this data. read_dataset(group, "data", data_); - int n_residues = data_.shape()[1] - 1; + int n_residues = data_.shape(1) - 1; // Check to see if this data includes fission residues. fissionable_ = (n_residues == 3); // Read the "windows" array and use its shape to figure out the number of // windows. - xt::xtensor windows; + tensor::Tensor windows; read_dataset(group, "windows", windows); - int n_windows = windows.shape()[0]; + int n_windows = windows.shape(0); windows -= 1; // Adjust to 0-based indices // Read the "broaden_poly" arrays. - xt::xtensor broaden_poly; + tensor::Tensor broaden_poly; read_dataset(group, "broaden_poly", broaden_poly); - if (n_windows != broaden_poly.shape()[0]) { + if (n_windows != broaden_poly.shape(0)) { fatal_error("broaden_poly array shape is not consistent with the windows " "array shape in WMP library for " + name_ + "."); @@ -56,12 +56,12 @@ WindowedMultipole::WindowedMultipole(hid_t group) // Read the "curvefit" array. read_dataset(group, "curvefit", curvefit_); - if (n_windows != curvefit_.shape()[0]) { + if (n_windows != curvefit_.shape(0)) { fatal_error("curvefit array shape is not consistent with the windows " "array shape in WMP library for " + name_ + "."); } - fit_order_ = curvefit_.shape()[1] - 1; + fit_order_ = curvefit_.shape(1) - 1; // Check the code is compiling to work with sufficiently high fit order if (fit_order_ + 1 > MAX_POLY_COEFFICIENTS) { diff --git a/src/xsdata.cpp b/src/xsdata.cpp index 5ce320b6400..7b958b52bb0 100644 --- a/src/xsdata.cpp +++ b/src/xsdata.cpp @@ -5,10 +5,7 @@ #include #include -#include "xtensor/xbuilder.hpp" -#include "xtensor/xindex_view.hpp" -#include "xtensor/xmath.hpp" -#include "xtensor/xview.hpp" +#include "openmc/tensor.h" #include "openmc/constants.h" #include "openmc/error.h" @@ -37,33 +34,33 @@ XsData::XsData(bool fissionable, AngleDistributionType scatter_format, } // allocate all [temperature][angle][in group] quantities vector shape {n_ang, n_g_}; - total = xt::zeros(shape); - absorption = xt::zeros(shape); - inverse_velocity = xt::zeros(shape); + total = tensor::zeros(shape); + absorption = tensor::zeros(shape); + inverse_velocity = tensor::zeros(shape); if (fissionable) { - fission = xt::zeros(shape); - nu_fission = xt::zeros(shape); - prompt_nu_fission = xt::zeros(shape); - kappa_fission = xt::zeros(shape); + fission = tensor::zeros(shape); + nu_fission = tensor::zeros(shape); + prompt_nu_fission = tensor::zeros(shape); + kappa_fission = tensor::zeros(shape); } // allocate decay_rate; [temperature][angle][delayed group] shape[1] = n_dg_; - decay_rate = xt::zeros(shape); + decay_rate = tensor::zeros(shape); if (fissionable) { shape = {n_ang, n_dg_, n_g_}; // allocate delayed_nu_fission; [temperature][angle][delay group][in group] - delayed_nu_fission = xt::zeros(shape); + delayed_nu_fission = tensor::zeros(shape); // chi and chi_prompt; [temperature][angle][in group][out group] shape = {n_ang, n_g_, n_g_}; - chi = xt::zeros(shape); - chi_prompt = xt::zeros(shape); + chi = tensor::zeros(shape); + chi_prompt = tensor::zeros(shape); // chi_delayed; [temperature][angle][delay group][in group][out group] shape = {n_ang, n_dg_, n_g_, n_g_}; - chi_delayed = xt::zeros(shape); + chi_delayed = tensor::zeros(shape); } for (int a = 0; a < n_ang; a++) { @@ -86,28 +83,30 @@ void XsData::from_hdf5(hid_t xsdata_grp, bool fissionable, { // Reconstruct the dimension information so it doesn't need to be passed size_t n_ang = n_pol * n_azi; - size_t energy_groups = total.shape()[1]; + size_t energy_groups = total.shape(1); // Set the fissionable-specific data if (fissionable) { fission_from_hdf5(xsdata_grp, n_ang, is_isotropic); } // Get the non-fission-specific data - read_nd_vector(xsdata_grp, "decay-rate", decay_rate); - read_nd_vector(xsdata_grp, "absorption", absorption, true); - read_nd_vector(xsdata_grp, "inverse-velocity", inverse_velocity); + read_nd_tensor(xsdata_grp, "decay-rate", decay_rate); + read_nd_tensor(xsdata_grp, "absorption", absorption, true); + read_nd_tensor(xsdata_grp, "inverse-velocity", inverse_velocity); // Get scattering data scatter_from_hdf5( xsdata_grp, n_ang, scatter_format, final_scatter_format, order_data); - // Check absorption to ensure it is not 0 since it is often the - // denominator in tally methods - xt::filtration(absorption, xt::equal(absorption, 0.)) = 1.e-10; + // Replace zero absorption values with a small number to avoid + // division by zero in tally methods + for (size_t i = 0; i < absorption.size(); i++) + if (absorption.data()[i] == 0.0) + absorption.data()[i] = 1.e-10; // Get or calculate the total x/s if (object_exists(xsdata_grp, "total")) { - read_nd_vector(xsdata_grp, "total", total); + read_nd_tensor(xsdata_grp, "total", total); } else { for (size_t a = 0; a < n_ang; a++) { for (size_t gin = 0; gin < energy_groups; gin++) { @@ -116,8 +115,11 @@ void XsData::from_hdf5(hid_t xsdata_grp, bool fissionable, } } - // Fix if total is 0, since it is in the denominator when tallying - xt::filtration(total, xt::equal(total, 0.)) = 1.e-10; + // Replace zero total cross sections with a small number to avoid + // division by zero in tally methods + for (size_t i = 0; i < total.size(); i++) + if (total.data()[i] == 0.0) + total.data()[i] = 1.e-10; } //============================================================================== @@ -128,26 +130,33 @@ void XsData::fission_vector_beta_from_hdf5( // Data is provided as nu-fission and chi with a beta for delayed info // Get chi - xt::xtensor temp_chi({n_ang, n_g_}, 0.); - read_nd_vector(xsdata_grp, "chi", temp_chi, true); + tensor::Tensor temp_chi = tensor::zeros({n_ang, n_g_}); + read_nd_tensor(xsdata_grp, "chi", temp_chi, true); - // Normalize chi by summing over the outgoing groups for each incoming angle - temp_chi /= xt::view(xt::sum(temp_chi, {1}), xt::all(), xt::newaxis()); - - // Store chi in chi - chi = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::all()); + // Normalize chi so it sums to 1 over outgoing groups for each angle + for (size_t a = 0; a < n_ang; a++) { + tensor::View row = temp_chi.slice(a); + row /= row.sum(); + } - // Now every incoming group in prompt_chi and delayed_chi is the normalized - // chi we just made // TODO: This is incorrect!! This makes chi_prompt and chi_delayed identical - // to chi. - chi_prompt = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::all()); - chi_delayed = - xt::view(temp_chi, xt::all(), xt::newaxis(), xt::newaxis(), xt::all()); + // Replicate the energy spectrum across all incoming groups — the + // spectrum is independent of the incoming neutron energy + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g_; gin++) { + chi.slice(a, gin) = temp_chi.slice(a); + chi_prompt.slice(a, gin) = temp_chi.slice(a); + } + + // Same spectrum for delayed neutrons, replicated across delayed groups + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) + for (size_t gin = 0; gin < n_g_; gin++) + chi_delayed.slice(a, d, gin) = temp_chi.slice(a); // Get nu-fission - xt::xtensor temp_nufiss({n_ang, n_g_}, 0.); - read_nd_vector(xsdata_grp, "nu-fission", temp_nufiss, true); + tensor::Tensor temp_nufiss = tensor::zeros({n_ang, n_g_}); + read_nd_tensor(xsdata_grp, "nu-fission", temp_nufiss, true); // Get beta (strategy will depend upon the number of dimensions in beta) hid_t beta_dset = open_dataset(xsdata_grp, "beta"); @@ -157,26 +166,39 @@ void XsData::fission_vector_beta_from_hdf5( if (!is_isotropic) ndim_target += 2; if (beta_ndims == ndim_target) { - xt::xtensor temp_beta({n_ang, n_dg_}, 0.); - read_nd_vector(xsdata_grp, "beta", temp_beta, true); - - // Set prompt_nu_fission = (1. - beta_total)*nu_fission - prompt_nu_fission = temp_nufiss * (1. - xt::sum(temp_beta, {1})); - - // Set delayed_nu_fission as beta * nu_fission - delayed_nu_fission = - xt::view(temp_beta, xt::all(), xt::all(), xt::newaxis()) * - xt::view(temp_nufiss, xt::all(), xt::newaxis(), xt::all()); + tensor::Tensor temp_beta = tensor::zeros({n_ang, n_dg_}); + read_nd_tensor(xsdata_grp, "beta", temp_beta, true); + + // prompt_nu_fission = (1 - sum_of_beta) * nu_fission + auto beta_sum = temp_beta.sum(1); + for (size_t a = 0; a < n_ang; a++) + for (size_t g = 0; g < n_g_; g++) + prompt_nu_fission(a, g) = temp_nufiss(a, g) * (1.0 - beta_sum(a)); + + // Delayed nu-fission is the outer product of the delayed neutron + // fraction (beta) and the fission production rate (nu-fission) + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) + for (size_t g = 0; g < n_g_; g++) + delayed_nu_fission(a, d, g) = temp_beta(a, d) * temp_nufiss(a, g); } else if (beta_ndims == ndim_target + 1) { - xt::xtensor temp_beta({n_ang, n_dg_, n_g_}, 0.); - read_nd_vector(xsdata_grp, "beta", temp_beta, true); - - // Set prompt_nu_fission = (1. - beta_total)*nu_fission - prompt_nu_fission = temp_nufiss * (1. - xt::sum(temp_beta, {1})); - - // Set delayed_nu_fission as beta * nu_fission - delayed_nu_fission = - temp_beta * xt::view(temp_nufiss, xt::all(), xt::newaxis(), xt::all()); + tensor::Tensor temp_beta = + tensor::zeros({n_ang, n_dg_, n_g_}); + read_nd_tensor(xsdata_grp, "beta", temp_beta, true); + + // prompt_nu_fission = (1 - sum_of_beta) * nu_fission + // Here beta is energy-dependent, so sum over delayed groups (axis 1) + auto beta_sum = temp_beta.sum(1); + for (size_t a = 0; a < n_ang; a++) + for (size_t g = 0; g < n_g_; g++) + prompt_nu_fission(a, g) = temp_nufiss(a, g) * (1.0 - beta_sum(a, g)); + + // Delayed nu-fission: beta is already energy-dependent [n_ang, n_dg, n_g], + // so scale each delayed group's beta by the total nu-fission for that group + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) + for (size_t g = 0; g < n_g_; g++) + delayed_nu_fission(a, d, g) = temp_beta(a, d, g) * temp_nufiss(a, g); } } @@ -184,42 +206,58 @@ void XsData::fission_vector_no_beta_from_hdf5(hid_t xsdata_grp, size_t n_ang) { // If chi is included in the dataset, we should store it! if (object_exists(xsdata_grp, "chi")) { - xt::xtensor temp_chi({n_ang, n_g_}, 0.); - read_nd_vector(xsdata_grp, "chi", temp_chi, true); + tensor::Tensor temp_chi = tensor::zeros({n_ang, n_g_}); + read_nd_tensor(xsdata_grp, "chi", temp_chi, true); // Normalize chi by summing over the outgoing groups for each incoming angle - temp_chi /= xt::view(xt::sum(temp_chi, {1}), xt::all(), xt::newaxis()); - // Now every incoming group in self.chi is the normalized chi we just made - chi = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::all()); + for (size_t a = 0; a < n_ang; a++) { + tensor::View row = temp_chi.slice(a); + row /= row.sum(); + } + + // Replicate the spectrum across all incoming groups + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g_; gin++) + chi.slice(a, gin) = temp_chi.slice(a); } // Data is provided separately as prompt + delayed nu-fission and chi // Get chi-prompt - xt::xtensor temp_chi_p({n_ang, n_g_}, 0.); - read_nd_vector(xsdata_grp, "chi-prompt", temp_chi_p, true); + tensor::Tensor temp_chi_p = tensor::zeros({n_ang, n_g_}); + read_nd_tensor(xsdata_grp, "chi-prompt", temp_chi_p, true); - // Normalize chi-prompt by summing over the outgoing groups for each incoming - // angle - temp_chi_p /= xt::view(xt::sum(temp_chi_p, {1}), xt::all(), xt::newaxis()); + // Normalize prompt chi so it sums to 1 over outgoing groups for each angle + for (size_t a = 0; a < n_ang; a++) { + tensor::View row = temp_chi_p.slice(a); + row /= row.sum(); + } // Get chi-delayed - xt::xtensor temp_chi_d({n_ang, n_dg_, n_g_}, 0.); - read_nd_vector(xsdata_grp, "chi-delayed", temp_chi_d, true); + tensor::Tensor temp_chi_d = + tensor::zeros({n_ang, n_dg_, n_g_}); + read_nd_tensor(xsdata_grp, "chi-delayed", temp_chi_d, true); + + // Normalize delayed chi so it sums to 1 over outgoing groups for each + // angle and delayed group + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) { + tensor::View row = temp_chi_d.slice(a, d); + row /= row.sum(); + } - // Normalize chi-delayed by summing over the outgoing groups for each incoming - // angle - temp_chi_d /= - xt::view(xt::sum(temp_chi_d, {2}), xt::all(), xt::all(), xt::newaxis()); + // Replicate the prompt spectrum across all incoming groups + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g_; gin++) + chi_prompt.slice(a, gin) = temp_chi_p.slice(a); - // Now assign the prompt and delayed chis by replicating for each incoming - // group - // - chi_prompt = xt::view(temp_chi_p, xt::all(), xt::newaxis(), xt::all()); - chi_delayed = - xt::view(temp_chi_d, xt::all(), xt::all(), xt::newaxis(), xt::all()); + // Replicate the delayed spectrum across all incoming groups + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) + for (size_t gin = 0; gin < n_g_; gin++) + chi_delayed.slice(a, d, gin) = temp_chi_d.slice(a, d); // Get prompt and delayed nu-fission directly - read_nd_vector(xsdata_grp, "prompt-nu-fission", prompt_nu_fission, true); - read_nd_vector(xsdata_grp, "delayed-nu-fission", delayed_nu_fission, true); + read_nd_tensor(xsdata_grp, "prompt-nu-fission", prompt_nu_fission, true); + read_nd_tensor(xsdata_grp, "delayed-nu-fission", delayed_nu_fission, true); } // TODO: Add machinery to read chi @@ -229,18 +267,24 @@ void XsData::fission_vector_no_delayed_from_hdf5(hid_t xsdata_grp, size_t n_ang) // Therefore, the code only considers the data as prompt. // Get chi - xt::xtensor temp_chi({n_ang, n_g_}, 0.); - read_nd_vector(xsdata_grp, "chi", temp_chi, true); + tensor::Tensor temp_chi = tensor::zeros({n_ang, n_g_}); + read_nd_tensor(xsdata_grp, "chi", temp_chi, true); - // Normalize chi by summing over the outgoing groups for each incoming angle - temp_chi /= xt::view(xt::sum(temp_chi, {1}), xt::all(), xt::newaxis()); + // Normalize chi so it sums to 1 over outgoing groups for each angle + for (size_t a = 0; a < n_ang; a++) { + tensor::View row = temp_chi.slice(a); + row /= row.sum(); + } - // Now every incoming group in self.chi is the normalized chi we just made - chi = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::all()); - chi_prompt = xt::view(temp_chi, xt::all(), xt::newaxis(), xt::all()); + // Replicate the energy spectrum across all incoming groups + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g_; gin++) { + chi.slice(a, gin) = temp_chi.slice(a); + chi_prompt.slice(a, gin) = temp_chi.slice(a); + } // Get nu-fission directly - read_nd_vector(xsdata_grp, "nu-fission", prompt_nu_fission, true); + read_nd_tensor(xsdata_grp, "nu-fission", prompt_nu_fission, true); } //============================================================================== @@ -252,8 +296,9 @@ void XsData::fission_matrix_beta_from_hdf5( // Data is provided as nu-fission and chi with a beta for delayed info // Get nu-fission matrix - xt::xtensor temp_matrix({n_ang, n_g_, n_g_}, 0.); - read_nd_vector(xsdata_grp, "nu-fission", temp_matrix, true); + tensor::Tensor temp_matrix = + tensor::zeros({n_ang, n_g_, n_g_}); + read_nd_tensor(xsdata_grp, "nu-fission", temp_matrix, true); // Get beta (strategy will depend upon the number of dimensions in beta) hid_t beta_dset = open_dataset(xsdata_grp, "beta"); @@ -263,65 +308,92 @@ void XsData::fission_matrix_beta_from_hdf5( if (!is_isotropic) ndim_target += 2; if (beta_ndims == ndim_target) { - xt::xtensor temp_beta({n_ang, n_dg_}, 0.); - read_nd_vector(xsdata_grp, "beta", temp_beta, true); - - xt::xtensor temp_beta_sum({n_ang}, 0.); - temp_beta_sum = xt::sum(temp_beta, {1}); - - // prompt_nu_fission is the sum of this matrix over outgoing groups and - // multiplied by (1 - beta_sum) - prompt_nu_fission = xt::sum(temp_matrix, {2}) * (1. - temp_beta_sum); - - // Store chi-prompt - chi_prompt = - xt::view(1.0 - temp_beta_sum, xt::all(), xt::newaxis(), xt::newaxis()) * - temp_matrix; - - // delayed_nu_fission is the sum of this matrix over outgoing groups and - // multiplied by beta - delayed_nu_fission = - xt::view(temp_beta, xt::all(), xt::all(), xt::newaxis()) * - xt::view(xt::sum(temp_matrix, {2}), xt::all(), xt::newaxis(), xt::all()); - - // Store chi-delayed - chi_delayed = - xt::view(temp_beta, xt::all(), xt::all(), xt::newaxis(), xt::newaxis()) * - xt::view(temp_matrix, xt::all(), xt::newaxis(), xt::all(), xt::all()); + tensor::Tensor temp_beta = tensor::zeros({n_ang, n_dg_}); + read_nd_tensor(xsdata_grp, "beta", temp_beta, true); + + auto beta_sum = temp_beta.sum(1); + auto matrix_gout_sum = temp_matrix.sum(2); + + // prompt_nu_fission = sum_gout(matrix) * (1 - beta_total) + for (size_t a = 0; a < n_ang; a++) + for (size_t g = 0; g < n_g_; g++) + prompt_nu_fission(a, g) = matrix_gout_sum(a, g) * (1.0 - beta_sum(a)); + + // chi_prompt = (1 - beta_total) * nu-fission matrix (unnormalized) + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g_; gin++) + for (size_t gout = 0; gout < n_g_; gout++) + chi_prompt(a, gin, gout) = + (1.0 - beta_sum(a)) * temp_matrix(a, gin, gout); + + // Delayed nu-fission is the outer product of the delayed neutron + // fraction (beta) and the total fission rate summed over outgoing groups + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) + for (size_t g = 0; g < n_g_; g++) + delayed_nu_fission(a, d, g) = temp_beta(a, d) * matrix_gout_sum(a, g); + + // chi_delayed = beta * nu-fission matrix, expanded across delayed groups + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) + for (size_t gin = 0; gin < n_g_; gin++) + for (size_t gout = 0; gout < n_g_; gout++) + chi_delayed(a, d, gin, gout) = + temp_beta(a, d) * temp_matrix(a, gin, gout); } else if (beta_ndims == ndim_target + 1) { - xt::xtensor temp_beta({n_ang, n_dg_, n_g_}, 0.); - read_nd_vector(xsdata_grp, "beta", temp_beta, true); - - xt::xtensor temp_beta_sum({n_ang, n_g_}, 0.); - temp_beta_sum = xt::sum(temp_beta, {1}); - - // prompt_nu_fission is the sum of this matrix over outgoing groups and - // multiplied by (1 - beta_sum) - prompt_nu_fission = xt::sum(temp_matrix, {2}) * (1. - temp_beta_sum); - - // Store chi-prompt - chi_prompt = - xt::view(1.0 - temp_beta_sum, xt::all(), xt::all(), xt::newaxis()) * - temp_matrix; - - // delayed_nu_fission is the sum of this matrix over outgoing groups and - // multiplied by beta - delayed_nu_fission = temp_beta * xt::view(xt::sum(temp_matrix, {2}), - xt::all(), xt::newaxis(), xt::all()); - - // Store chi-delayed - chi_delayed = - xt::view(temp_beta, xt::all(), xt::all(), xt::all(), xt::newaxis()) * - xt::view(temp_matrix, xt::all(), xt::newaxis(), xt::all(), xt::all()); + tensor::Tensor temp_beta = + tensor::zeros({n_ang, n_dg_, n_g_}); + read_nd_tensor(xsdata_grp, "beta", temp_beta, true); + + auto beta_sum = temp_beta.sum(1); + auto matrix_gout_sum = temp_matrix.sum(2); + + // prompt_nu_fission = sum_gout(matrix) * (1 - beta_total) + // Here beta is energy-dependent, so beta_sum is 2D [n_ang, n_g] + for (size_t a = 0; a < n_ang; a++) + for (size_t g = 0; g < n_g_; g++) + prompt_nu_fission(a, g) = + matrix_gout_sum(a, g) * (1.0 - beta_sum(a, g)); + + // chi_prompt = (1 - beta_sum) * nu-fission matrix (unnormalized) + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g_; gin++) + for (size_t gout = 0; gout < n_g_; gout++) + chi_prompt(a, gin, gout) = + (1.0 - beta_sum(a, gin)) * temp_matrix(a, gin, gout); + + // Delayed nu-fission: beta is energy-dependent [n_ang, n_dg, n_g], + // scale by total fission rate summed over outgoing groups + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) + for (size_t g = 0; g < n_g_; g++) + delayed_nu_fission(a, d, g) = + temp_beta(a, d, g) * matrix_gout_sum(a, g); + + // chi_delayed = beta * nu-fission matrix, expanded across delayed groups + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) + for (size_t gin = 0; gin < n_g_; gin++) + for (size_t gout = 0; gout < n_g_; gout++) + chi_delayed(a, d, gin, gout) = + temp_beta(a, d, gin) * temp_matrix(a, gin, gout); } - // Normalize both chis - chi_prompt /= - xt::view(xt::sum(chi_prompt, {2}), xt::all(), xt::all(), xt::newaxis()); + // Normalize chi_prompt so it sums to 1 over outgoing groups + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g_; gin++) { + tensor::View row = chi_prompt.slice(a, gin); + row /= row.sum(); + } - chi_delayed /= xt::view( - xt::sum(chi_delayed, {3}), xt::all(), xt::all(), xt::all(), xt::newaxis()); + // Normalize chi_delayed so it sums to 1 over outgoing groups + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) + for (size_t gin = 0; gin < n_g_; gin++) { + tensor::View row = chi_delayed.slice(a, d, gin); + row /= row.sum(); + } } // TODO: Add machinery to read chi @@ -330,28 +402,36 @@ void XsData::fission_matrix_no_beta_from_hdf5(hid_t xsdata_grp, size_t n_ang) // Data is provided separately as prompt + delayed nu-fission and chi // Get the prompt nu-fission matrix - xt::xtensor temp_matrix_p({n_ang, n_g_, n_g_}, 0.); - read_nd_vector(xsdata_grp, "prompt-nu-fission", temp_matrix_p, true); + tensor::Tensor temp_matrix_p = + tensor::zeros({n_ang, n_g_, n_g_}); + read_nd_tensor(xsdata_grp, "prompt-nu-fission", temp_matrix_p, true); // prompt_nu_fission is the sum over outgoing groups - prompt_nu_fission = xt::sum(temp_matrix_p, {2}); + prompt_nu_fission = temp_matrix_p.sum(2); - // chi_prompt is this matrix but normalized over outgoing groups, which we - // have already stored in prompt_nu_fission - chi_prompt = temp_matrix_p / - xt::view(prompt_nu_fission, xt::all(), xt::all(), xt::newaxis()); + // chi_prompt is the nu-fission matrix normalized over outgoing groups + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g_; gin++) + for (size_t gout = 0; gout < n_g_; gout++) + chi_prompt(a, gin, gout) = + temp_matrix_p(a, gin, gout) / prompt_nu_fission(a, gin); // Get the delayed nu-fission matrix - xt::xtensor temp_matrix_d({n_ang, n_dg_, n_g_, n_g_}, 0.); - read_nd_vector(xsdata_grp, "delayed-nu-fission", temp_matrix_d, true); + tensor::Tensor temp_matrix_d = + tensor::zeros({n_ang, n_dg_, n_g_, n_g_}); + read_nd_tensor(xsdata_grp, "delayed-nu-fission", temp_matrix_d, true); // delayed_nu_fission is the sum over outgoing groups - delayed_nu_fission = xt::sum(temp_matrix_d, {3}); - - // chi_delayed is this matrix but normalized over outgoing groups, which we - // have already stored in delayed_nu_fission - chi_delayed = temp_matrix_d / xt::view(delayed_nu_fission, xt::all(), - xt::all(), xt::all(), xt::newaxis()); + delayed_nu_fission = temp_matrix_d.sum(3); + + // chi_delayed is the delayed nu-fission matrix normalized over outgoing + // groups + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg_; d++) + for (size_t gin = 0; gin < n_g_; gin++) + for (size_t gout = 0; gout < n_g_; gout++) + chi_delayed(a, d, gin, gout) = + temp_matrix_d(a, d, gin, gout) / delayed_nu_fission(a, d, gin); } // TODO: Add machinery to read chi @@ -361,16 +441,19 @@ void XsData::fission_matrix_no_delayed_from_hdf5(hid_t xsdata_grp, size_t n_ang) // Therefore, the code only considers the data as prompt. // Get nu-fission matrix - xt::xtensor temp_matrix({n_ang, n_g_, n_g_}, 0.); - read_nd_vector(xsdata_grp, "nu-fission", temp_matrix, true); + tensor::Tensor temp_matrix = + tensor::zeros({n_ang, n_g_, n_g_}); + read_nd_tensor(xsdata_grp, "nu-fission", temp_matrix, true); // prompt_nu_fission is the sum over outgoing groups - prompt_nu_fission = xt::sum(temp_matrix, {2}); - - // chi_prompt is this matrix but normalized over outgoing groups, which we - // have already stored in prompt_nu_fission - chi_prompt = temp_matrix / - xt::view(prompt_nu_fission, xt::all(), xt::all(), xt::newaxis()); + prompt_nu_fission = temp_matrix.sum(2); + + // chi_prompt is the nu-fission matrix normalized over outgoing groups + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g_; gin++) + for (size_t gout = 0; gout < n_g_; gout++) + chi_prompt(a, gin, gout) = + temp_matrix(a, gin, gout) / prompt_nu_fission(a, gin); } //============================================================================== @@ -379,8 +462,8 @@ void XsData::fission_from_hdf5( hid_t xsdata_grp, size_t n_ang, bool is_isotropic) { // Get the fission and kappa_fission data xs; these are optional - read_nd_vector(xsdata_grp, "fission", fission); - read_nd_vector(xsdata_grp, "kappa-fission", kappa_fission); + read_nd_tensor(xsdata_grp, "fission", fission); + read_nd_tensor(xsdata_grp, "kappa-fission", kappa_fission); // Get the data; the strategy for doing so depends on if the data is provided // as a nu-fission matrix or a set of chi and nu-fission vectors @@ -411,7 +494,7 @@ void XsData::fission_from_hdf5( if (n_dg_ == 0) { nu_fission = prompt_nu_fission; } else { - nu_fission = prompt_nu_fission + xt::sum(delayed_nu_fission, {1}); + nu_fission = prompt_nu_fission + delayed_nu_fission.sum(1); } } @@ -427,10 +510,10 @@ void XsData::scatter_from_hdf5(hid_t xsdata_grp, size_t n_ang, hid_t scatt_grp = open_group(xsdata_grp, "scatter_data"); // Get the outgoing group boundary indices - xt::xtensor gmin({n_ang, n_g_}, 0.); - read_nd_vector(scatt_grp, "g_min", gmin, true); - xt::xtensor gmax({n_ang, n_g_}, 0.); - read_nd_vector(scatt_grp, "g_max", gmax, true); + tensor::Tensor gmin = tensor::zeros({n_ang, n_g_}); + read_nd_tensor(scatt_grp, "g_min", gmin, true); + tensor::Tensor gmax = tensor::zeros({n_ang, n_g_}); + read_nd_tensor(scatt_grp, "g_max", gmax, true); // Make gmin and gmax start from 0 vice 1 as they do in the library gmin -= 1; @@ -438,11 +521,11 @@ void XsData::scatter_from_hdf5(hid_t xsdata_grp, size_t n_ang, // Now use this info to find the length of a vector to hold the flattened // data. - size_t length = order_data * xt::sum(gmax - gmin + 1)(); + size_t length = order_data * (gmax - gmin + 1).sum(); double_4dvec input_scatt(n_ang, double_3dvec(n_g_)); - xt::xtensor temp_arr({length}, 0.); - read_nd_vector(scatt_grp, "scatter_matrix", temp_arr, true); + tensor::Tensor temp_arr = tensor::zeros({length}); + read_nd_tensor(scatt_grp, "scatter_matrix", temp_arr, true); // Compare the number of orders given with the max order of the problem; // strip off the superfluous orders if needed @@ -474,7 +557,7 @@ void XsData::scatter_from_hdf5(hid_t xsdata_grp, size_t n_ang, double_3dvec temp_mult(n_ang, double_2dvec(n_g_)); if (object_exists(scatt_grp, "multiplicity_matrix")) { temp_arr.resize({length / order_data}); - read_nd_vector(scatt_grp, "multiplicity_matrix", temp_arr); + read_nd_tensor(scatt_grp, "multiplicity_matrix", temp_arr); // convert the flat temp_arr to a jagged array for passing to scatt data size_t temp_idx = 0; @@ -504,8 +587,8 @@ void XsData::scatter_from_hdf5(hid_t xsdata_grp, size_t n_ang, final_scatter_format == AngleDistributionType::TABULAR) { for (size_t a = 0; a < n_ang; a++) { ScattDataLegendre legendre_scatt; - xt::xtensor in_gmin = xt::view(gmin, a, xt::all()); - xt::xtensor in_gmax = xt::view(gmax, a, xt::all()); + tensor::Tensor in_gmin(gmin.slice(a)); + tensor::Tensor in_gmax(gmax.slice(a)); legendre_scatt.init(in_gmin, in_gmax, temp_mult[a], input_scatt[a]); @@ -519,8 +602,8 @@ void XsData::scatter_from_hdf5(hid_t xsdata_grp, size_t n_ang, // We are sticking with the current representation // Initialize the ScattData object with this data for (size_t a = 0; a < n_ang; a++) { - xt::xtensor in_gmin = xt::view(gmin, a, xt::all()); - xt::xtensor in_gmax = xt::view(gmax, a, xt::all()); + tensor::Tensor in_gmin(gmin.slice(a)); + tensor::Tensor in_gmax(gmax.slice(a)); scatter[a]->init(in_gmin, in_gmax, temp_mult[a], input_scatt[a]); } } @@ -542,38 +625,81 @@ void XsData::combine( if (i == 0) { inverse_velocity = that->inverse_velocity; } - if (that->prompt_nu_fission.shape()[0] > 0) { + if (!that->prompt_nu_fission.empty()) { nu_fission += scalar * that->nu_fission; prompt_nu_fission += scalar * that->prompt_nu_fission; kappa_fission += scalar * that->kappa_fission; fission += scalar * that->fission; delayed_nu_fission += scalar * that->delayed_nu_fission; + // This may throw an error in some cases. Need a check for if // chi exists! chi += scalar * that->chi; - - chi_prompt += scalar * - xt::view(xt::sum(that->prompt_nu_fission, {1}), xt::all(), - xt::newaxis(), xt::newaxis()) * - that->chi_prompt; - chi_delayed += scalar * - xt::view(xt::sum(that->delayed_nu_fission, {2}), xt::all(), - xt::all(), xt::newaxis(), xt::newaxis()) * - that->chi_delayed; + // Accumulate chi_prompt weighted by total prompt nu-fission + // (summed over energy groups) for this constituent + { + auto pnf_sum = that->prompt_nu_fission.sum(1); + size_t n_ang = chi_prompt.shape(0); + size_t n_g = chi_prompt.shape(1); + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g; gin++) + for (size_t gout = 0; gout < n_g; gout++) + chi_prompt(a, gin, gout) += + scalar * pnf_sum(a) * that->chi_prompt(a, gin, gout); + } + // Accumulate chi_delayed weighted by total delayed nu-fission + // (summed over energy groups) for this constituent + { + auto dnf_sum = that->delayed_nu_fission.sum(2); + size_t n_ang = chi_delayed.shape(0); + size_t n_dg = chi_delayed.shape(1); + size_t n_g = chi_delayed.shape(2); + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg; d++) + for (size_t gin = 0; gin < n_g; gin++) + for (size_t gout = 0; gout < n_g; gout++) + chi_delayed(a, d, gin, gout) += + scalar * dnf_sum(a, d) * that->chi_delayed(a, d, gin, gout); + } } decay_rate += scalar * that->decay_rate; } - // Ensure chi, chi_prompt, and chi_delayed are normalized to 1 for each - // azimuthal angle and delayed group (for chi_delayed) - chi /= xt::view(xt::sum(chi, {2}), xt::all(), xt::all(), xt::newaxis()); - chi_prompt /= - xt::view(xt::sum(chi_prompt, {2}), xt::all(), xt::all(), xt::newaxis()); - chi_delayed /= xt::view( - xt::sum(chi_delayed, {3}), xt::all(), xt::all(), xt::all(), xt::newaxis()); + // Normalize chi so it sums to 1 over outgoing groups + { + size_t n_ang = chi.shape(0); + size_t n_g = chi.shape(1); + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g; gin++) { + tensor::View row = chi.slice(a, gin); + row /= row.sum(); + } + } + // Normalize chi_prompt so it sums to 1 over outgoing groups + { + size_t n_ang = chi_prompt.shape(0); + size_t n_g = chi_prompt.shape(1); + for (size_t a = 0; a < n_ang; a++) + for (size_t gin = 0; gin < n_g; gin++) { + tensor::View row = chi_prompt.slice(a, gin); + row /= row.sum(); + } + } + // Normalize chi_delayed so it sums to 1 over outgoing groups + { + size_t n_ang = chi_delayed.shape(0); + size_t n_dg = chi_delayed.shape(1); + size_t n_g = chi_delayed.shape(2); + for (size_t a = 0; a < n_ang; a++) + for (size_t d = 0; d < n_dg; d++) + for (size_t gin = 0; gin < n_g; gin++) { + tensor::View row = chi_delayed.slice(a, d, gin); + row /= row.sum(); + } + } // Allow the ScattData object to combine itself - for (size_t a = 0; a < total.shape()[0]; a++) { + for (size_t a = 0; a < total.shape(0); a++) { // Build vector of the scattering objects to incorporate vector those_scatts(those_xs.size()); for (size_t i = 0; i < those_xs.size(); i++) { diff --git a/tests/cpp_unit_tests/CMakeLists.txt b/tests/cpp_unit_tests/CMakeLists.txt index a930c009f00..bf2da611536 100644 --- a/tests/cpp_unit_tests/CMakeLists.txt +++ b/tests/cpp_unit_tests/CMakeLists.txt @@ -8,6 +8,7 @@ set(TEST_NAMES test_mcpl_stat_sum test_mesh test_region + test_tensor # Add additional unit test files here ) diff --git a/tests/cpp_unit_tests/test_tensor.cpp b/tests/cpp_unit_tests/test_tensor.cpp new file mode 100644 index 00000000000..6eae1cea6a4 --- /dev/null +++ b/tests/cpp_unit_tests/test_tensor.cpp @@ -0,0 +1,987 @@ +#include +#include + +#include +#include + +#include "openmc/tensor.h" + +using namespace openmc; +using namespace openmc::tensor; + +// ============================================================================ +// Tensor constructors +// ============================================================================ + +TEST_CASE("Tensor default constructor") +{ + Tensor t; + REQUIRE(t.size() == 0); + REQUIRE(t.empty()); + REQUIRE(t.shape().empty()); +} + +TEST_CASE("Tensor shape constructor") +{ + Tensor t1({5}); + REQUIRE(t1.size() == 5); + REQUIRE(t1.shape().size() == 1); + REQUIRE(t1.shape(0) == 5); + + Tensor t2({3, 4}); + REQUIRE(t2.size() == 12); + REQUIRE(t2.shape().size() == 2); + REQUIRE(t2.shape(0) == 3); + REQUIRE(t2.shape(1) == 4); + + Tensor t3({2, 3, 4}); + REQUIRE(t3.size() == 24); + REQUIRE(t3.shape().size() == 3); +} + +TEST_CASE("Tensor shape + fill constructor") +{ + Tensor t({2, 3}, 7.0); + REQUIRE(t.size() == 6); + for (size_t i = 0; i < t.size(); ++i) + REQUIRE(t[i] == 7.0); +} + +TEST_CASE("Tensor pointer constructor") +{ + double vals[] = {1.0, 2.0, 3.0, 4.0}; + Tensor t(vals, 4); + REQUIRE(t.size() == 4); + REQUIRE(t.shape(0) == 4); + REQUIRE(t[0] == 1.0); + REQUIRE(t[1] == 2.0); + REQUIRE(t[2] == 3.0); + REQUIRE(t[3] == 4.0); +} + +TEST_CASE("Tensor copy and move") +{ + Tensor a({2, 3}, 5.0); + Tensor b(a); + REQUIRE(b.size() == 6); + REQUIRE(b(0, 0) == 5.0); + // Modifying copy doesn't affect original + b(0, 0) = 99.0; + REQUIRE(a(0, 0) == 5.0); + + Tensor c(std::move(b)); + REQUIRE(c(0, 0) == 99.0); + REQUIRE(c.size() == 6); +} + +// ============================================================================ +// Tensor indexing +// ============================================================================ + +TEST_CASE("Tensor 1D indexing") +{ + Tensor t({4}, 0); + t[0] = 10; + t[1] = 20; + t[2] = 30; + t[3] = 40; + REQUIRE(t(0) == 10); + REQUIRE(t(1) == 20); + REQUIRE(t(2) == 30); + REQUIRE(t(3) == 40); +} + +TEST_CASE("Tensor 2D indexing (row-major)") +{ + // Layout: [[1, 2, 3], [4, 5, 6]] + Tensor t({2, 3}, 0); + int val = 1; + for (size_t i = 0; i < 2; ++i) + for (size_t j = 0; j < 3; ++j) + t(i, j) = val++; + + REQUIRE(t(0, 0) == 1); + REQUIRE(t(0, 2) == 3); + REQUIRE(t(1, 0) == 4); + REQUIRE(t(1, 2) == 6); + // Flat index should match row-major order + REQUIRE(t[0] == 1); + REQUIRE(t[3] == 4); + REQUIRE(t[5] == 6); +} + +TEST_CASE("Tensor 3D indexing") +{ + // 2x3x4 tensor + Tensor t({2, 3, 4}, 0); + t(1, 2, 3) = 42; + // Flat index: 1*12 + 2*4 + 3 = 23 + REQUIRE(t[23] == 42); + REQUIRE(t(1, 2, 3) == 42); +} + +// ============================================================================ +// Tensor assignment +// ============================================================================ + +TEST_CASE("Tensor initializer_list assignment") +{ + Tensor t; + t = {1.0, 2.0, 3.0}; + REQUIRE(t.size() == 3); + REQUIRE(t.shape(0) == 3); + REQUIRE(t[0] == 1.0); + REQUIRE(t[2] == 3.0); +} + +// ============================================================================ +// Tensor mutation +// ============================================================================ + +TEST_CASE("Tensor resize") +{ + Tensor t({2, 3}, 1.0); + REQUIRE(t.size() == 6); + t.resize({4, 5}); + REQUIRE(t.size() == 20); + REQUIRE(t.shape(0) == 4); + REQUIRE(t.shape(1) == 5); +} + +TEST_CASE("Tensor reshape") +{ + Tensor t({12}, 0); + for (size_t i = 0; i < 12; ++i) + t[i] = static_cast(i); + + t.reshape({3, 4}); + REQUIRE(t.shape(0) == 3); + REQUIRE(t.shape(1) == 4); + REQUIRE(t.size() == 12); + // Data unchanged, just reinterpreted + REQUIRE(t(0, 0) == 0); + REQUIRE(t(1, 0) == 4); // row 1, col 0 = flat index 4 + REQUIRE(t(2, 3) == 11); // row 2, col 3 = flat index 11 +} + +TEST_CASE("Tensor fill") +{ + Tensor t({3, 3}, 0.0); + t.fill(42.0); + for (size_t i = 0; i < t.size(); ++i) + REQUIRE(t[i] == 42.0); +} + +// ============================================================================ +// Tensor iterators +// ============================================================================ + +TEST_CASE("Tensor iterators") +{ + Tensor t({4}, 0); + t = {10, 20, 30, 40}; + int sum = 0; + for (auto val : t) + sum += val; + REQUIRE(sum == 100); +} + +// ============================================================================ +// Tensor reductions +// ============================================================================ + +TEST_CASE("Tensor sum (full)") +{ + Tensor t({3}, 0.0); + t = {1.0, 2.0, 3.0}; + REQUIRE(t.sum() == 6.0); +} + +TEST_CASE("Tensor sum (axis) on 2D") +{ + // [[1, 2, 3], + // [4, 5, 6]] + Tensor t({2, 3}, 0); + int v = 1; + for (size_t i = 0; i < 2; ++i) + for (size_t j = 0; j < 3; ++j) + t(i, j) = v++; + + // Sum along axis 0 -> [5, 7, 9] + Tensor s0 = t.sum(0); + REQUIRE(s0.size() == 3); + REQUIRE(s0[0] == 5); + REQUIRE(s0[1] == 7); + REQUIRE(s0[2] == 9); + + // Sum along axis 1 -> [6, 15] + Tensor s1 = t.sum(1); + REQUIRE(s1.size() == 2); + REQUIRE(s1[0] == 6); + REQUIRE(s1[1] == 15); +} + +TEST_CASE("Tensor sum (axis) on 3D") +{ + // 2x3x2 tensor filled with sequential values 1..12 + Tensor t({2, 3, 2}, 0); + int v = 1; + for (size_t i = 0; i < 2; ++i) + for (size_t j = 0; j < 3; ++j) + for (size_t k = 0; k < 2; ++k) + t(i, j, k) = v++; + + // Sum along axis 1 (middle) -> 2x2, each sums 3 values + // [0,0]: t(0,0,0)+t(0,1,0)+t(0,2,0) = 1+3+5 = 9 + // [0,1]: t(0,0,1)+t(0,1,1)+t(0,2,1) = 2+4+6 = 12 + // [1,0]: t(1,0,0)+t(1,1,0)+t(1,2,0) = 7+9+11 = 27 + // [1,1]: t(1,0,1)+t(1,1,1)+t(1,2,1) = 8+10+12 = 30 + Tensor s = t.sum(1); + REQUIRE(s.shape(0) == 2); + REQUIRE(s.shape(1) == 2); + REQUIRE(s(0, 0) == 9); + REQUIRE(s(0, 1) == 12); + REQUIRE(s(1, 0) == 27); + REQUIRE(s(1, 1) == 30); +} + +TEST_CASE("Tensor prod") +{ + Tensor t({4}, 0); + t = {1, 2, 3, 4}; + REQUIRE(t.prod() == 24); +} + +TEST_CASE("Tensor any and all") +{ + Tensor t({4}, false); + REQUIRE(!t.any()); + REQUIRE(!t.all()); + + // Set one element true + t.data()[0] = true; + REQUIRE(t.any()); + REQUIRE(!t.all()); + + // Set all true + for (size_t i = 0; i < t.size(); ++i) + t.data()[i] = true; + REQUIRE(t.any()); + REQUIRE(t.all()); +} + +TEST_CASE("Tensor argmin") +{ + Tensor t({5}, 0.0); + t = {3.0, 1.0, 4.0, 0.5, 2.0}; + REQUIRE(t.argmin() == 3); +} + +TEST_CASE("Tensor flip") +{ + Tensor t({5}, 0); + t = {1, 2, 3, 4, 5}; + Tensor f = t.flip(0); + REQUIRE(f[0] == 5); + REQUIRE(f[1] == 4); + REQUIRE(f[2] == 3); + REQUIRE(f[3] == 2); + REQUIRE(f[4] == 1); +} + +TEST_CASE("Tensor flip 2D") +{ + // [[1, 2], [3, 4], [5, 6]] + Tensor t({3, 2}, 0); + t(0, 0) = 1; + t(0, 1) = 2; + t(1, 0) = 3; + t(1, 1) = 4; + t(2, 0) = 5; + t(2, 1) = 6; + + // Flip axis 0 reverses rows -> [[5,6],[3,4],[1,2]] + Tensor f = t.flip(0); + REQUIRE(f(0, 0) == 5); + REQUIRE(f(0, 1) == 6); + REQUIRE(f(1, 0) == 3); + REQUIRE(f(2, 0) == 1); +} + +// ============================================================================ +// Tensor operators +// ============================================================================ + +TEST_CASE("Tensor scalar compound assignment") +{ + Tensor t({3}, 0.0); + t = {2.0, 4.0, 6.0}; + + t += 1.0; + REQUIRE(t[0] == 3.0); + REQUIRE(t[1] == 5.0); + + t -= 1.0; + REQUIRE(t[0] == 2.0); + + t *= 3.0; + REQUIRE(t[0] == 6.0); + REQUIRE(t[1] == 12.0); + + t /= 2.0; + REQUIRE(t[0] == 3.0); + REQUIRE(t[1] == 6.0); +} + +TEST_CASE("Tensor element-wise arithmetic") +{ + Tensor a({3}, 0.0); + Tensor b({3}, 0.0); + a = {1.0, 2.0, 3.0}; + b = {4.0, 5.0, 6.0}; + + Tensor c = a + b; + REQUIRE(c[0] == 5.0); + REQUIRE(c[1] == 7.0); + REQUIRE(c[2] == 9.0); + + c = a - b; + REQUIRE(c[0] == -3.0); + + c = a / b; + REQUIRE(c[0] == 0.25); +} + +TEST_CASE("Tensor scalar arithmetic") +{ + Tensor a({3}, 0.0); + a = {1.0, 2.0, 3.0}; + + Tensor b = a + 10.0; + REQUIRE(b[0] == 11.0); + REQUIRE(b[2] == 13.0); + + b = a - 1.0; + REQUIRE(b[0] == 0.0); + + b = a * 2.0; + REQUIRE(b[0] == 2.0); + REQUIRE(b[2] == 6.0); + + // Non-member scalar * tensor (commutativity) + b = 2.0 * a; + REQUIRE(b[0] == 2.0); + REQUIRE(b[2] == 6.0); + + // Non-member scalar + tensor + b = 10.0 + a; + REQUIRE(b[0] == 11.0); +} + +TEST_CASE("Tensor compound addition with tensor") +{ + Tensor a({3}, 0.0); + Tensor b({3}, 0.0); + a = {1.0, 2.0, 3.0}; + b = {10.0, 20.0, 30.0}; + a += b; + REQUIRE(a[0] == 11.0); + REQUIRE(a[1] == 22.0); + REQUIRE(a[2] == 33.0); +} + +TEST_CASE("Tensor comparison operators") +{ + Tensor t({4}, 0.0); + t = {1.0, 2.0, 3.0, 4.0}; + + Tensor r = t < 3.0; + REQUIRE(r.data()[0] == true); + REQUIRE(r.data()[1] == true); + REQUIRE(r.data()[2] == false); + REQUIRE(r.data()[3] == false); + + r = t >= 3.0; + REQUIRE(r.data()[0] == false); + REQUIRE(r.data()[2] == true); + REQUIRE(r.data()[3] == true); + + r = t <= 2.0; + REQUIRE(r.data()[0] == true); + REQUIRE(r.data()[1] == true); + REQUIRE(r.data()[2] == false); + + r = t > 3.0; + REQUIRE(r.data()[0] == false); + REQUIRE(r.data()[3] == true); +} + +TEST_CASE("Tensor element-wise comparison") +{ + Tensor a({3}, 0.0); + Tensor b({3}, 0.0); + a = {1.0, 5.0, 3.0}; + b = {2.0, 4.0, 3.0}; + + Tensor r = a < b; + REQUIRE(r.data()[0] == true); + REQUIRE(r.data()[1] == false); + REQUIRE(r.data()[2] == false); +} + +TEST_CASE("Tensor mixed-type multiply") +{ + Tensor a({3}, 0); + Tensor b({3}, 0.0); + a = {2, 3, 4}; + b = {1.5, 2.5, 3.5}; + + Tensor c = a * b; + REQUIRE(c[0] == 3.0); + REQUIRE(c[1] == 7.5); + REQUIRE(c[2] == 14.0); +} + +TEST_CASE("Tensor mixed-type divide") +{ + Tensor a({3}, 0.0); + Tensor b({3}, 0); + a = {10.0, 20.0, 30.0}; + b = {2, 4, 5}; + + Tensor c = a / b; + REQUIRE(c[0] == 5.0); + REQUIRE(c[1] == 5.0); + REQUIRE(c[2] == 6.0); +} + +// ============================================================================ +// Tensor bool specialization +// ============================================================================ + +TEST_CASE("Tensor storage") +{ + // Tensor uses unsigned char internally to avoid std::vector proxy + Tensor t({4}, false); + t.data()[0] = true; + t.data()[2] = true; + REQUIRE(t.any()); + REQUIRE(!t.all()); + REQUIRE(t.data()[0] == true); + REQUIRE(t.data()[1] == false); +} + +// ============================================================================ +// View (via Tensor accessors) +// ============================================================================ + +TEST_CASE("Tensor slice axis 0 (2D)") +{ + // [[1, 2, 3], [4, 5, 6]] + Tensor t({2, 3}, 0); + int v = 1; + for (size_t i = 0; i < 2; ++i) + for (size_t j = 0; j < 3; ++j) + t(i, j) = v++; + + auto r0 = t.slice(0); + REQUIRE(r0.size() == 3); + REQUIRE(r0[0] == 1); + REQUIRE(r0[1] == 2); + REQUIRE(r0[2] == 3); + + auto r1 = t.slice(1); + REQUIRE(r1[0] == 4); + REQUIRE(r1[1] == 5); + REQUIRE(r1[2] == 6); + + // Writing through view modifies the tensor + r0[1] = 99; + REQUIRE(t(0, 1) == 99); +} + +TEST_CASE("Tensor slice axis 1 (2D)") +{ + // [[1, 2], [3, 4], [5, 6]] + Tensor t({3, 2}, 0); + t(0, 0) = 1; + t(0, 1) = 2; + t(1, 0) = 3; + t(1, 1) = 4; + t(2, 0) = 5; + t(2, 1) = 6; + + auto c0 = t.slice(all, 0); + REQUIRE(c0.size() == 3); + REQUIRE(c0[0] == 1); + REQUIRE(c0[1] == 3); + REQUIRE(c0[2] == 5); + + auto c1 = t.slice(all, 1); + REQUIRE(c1[0] == 2); + REQUIRE(c1[1] == 4); + REQUIRE(c1[2] == 6); + + // Write through column view + c1[0] = 77; + REQUIRE(t(0, 1) == 77); +} + +TEST_CASE("Tensor slice with range") +{ + Tensor t({6}, 0); + t = {10, 20, 30, 40, 50, 60}; + + // range(start, end) + auto s = t.slice(range(1, 4)); + REQUIRE(s.size() == 3); + REQUIRE(s[0] == 20); + REQUIRE(s[1] == 30); + REQUIRE(s[2] == 40); + + // range(end) from start — range(3) means [0, 3) + auto s2 = t.slice(range(3)); + REQUIRE(s2.size() == 3); + REQUIRE(s2[0] == 10); + REQUIRE(s2[2] == 30); + + // range(start, SIZE_MAX) to end + auto s3 = t.slice(range(3, 6)); + REQUIRE(s3.size() == 3); + REQUIRE(s3[0] == 40); + REQUIRE(s3[2] == 60); + + // Write through slice + s[0] = 99; + REQUIRE(t[1] == 99); +} + +TEST_CASE("Tensor flat view") +{ + Tensor t({2, 3}, 0); + int v = 1; + for (size_t i = 0; i < 2; ++i) + for (size_t j = 0; j < 3; ++j) + t(i, j) = v++; + + auto f = t.flat(); + REQUIRE(f.size() == 6); + REQUIRE(f[0] == 1); + REQUIRE(f[5] == 6); +} + +TEST_CASE("Tensor slice on 3D") +{ + // 2x3x4 tensor + Tensor t({2, 3, 4}, 0); + int v = 0; + for (size_t i = 0; i < 2; ++i) + for (size_t j = 0; j < 3; ++j) + for (size_t k = 0; k < 4; ++k) + t(i, j, k) = v++; + + // slice(1) -> fix axis 0 at 1 -> 3x4 view + auto s = t.slice(1); + REQUIRE(s.size() == 12); + // t(1,0,0) = 12, t(1,0,1) = 13, ... + REQUIRE(s(0, 0) == 12); + REQUIRE(s(0, 1) == 13); + REQUIRE(s(2, 3) == 23); + + // slice(all, 2) -> fix axis 1 at 2 -> 2x4 view + auto s2 = t.slice(all, 2); + REQUIRE(s2.size() == 8); + // t(0,2,0)=8, t(0,2,1)=9, t(1,2,0)=20 + REQUIRE(s2(0, 0) == 8); + REQUIRE(s2(0, 1) == 9); + REQUIRE(s2(1, 0) == 20); +} + +TEST_CASE("Tensor multi-axis slice") +{ + // 2x3x4 tensor with sequential values + Tensor t({2, 3, 4}, 0); + int v = 0; + for (size_t i = 0; i < 2; ++i) + for (size_t j = 0; j < 3; ++j) + for (size_t k = 0; k < 4; ++k) + t(i, j, k) = v++; + + // slice(1, 2) -> fix axes 0 and 1 -> 1D view of 4 elements + // Equivalent to numpy t[1, 2, :] -> t(1,2,0..3) = [20, 21, 22, 23] + auto s = t.slice(1, 2); + REQUIRE(s.size() == 4); + REQUIRE(s[0] == 20); + REQUIRE(s[1] == 21); + REQUIRE(s[3] == 23); + + // slice(all, 1, range(1, 3)) -> keep axis 0, fix axis 1, range on axis 2 + // Equivalent to numpy t[:, 1, 1:3] + // t(0,1,1)=5, t(0,1,2)=6, t(1,1,1)=17, t(1,1,2)=18 + auto s2 = t.slice(all, 1, range(1, 3)); + REQUIRE(s2.size() == 4); + REQUIRE(s2.ndim() == 2); + REQUIRE(s2(0, 0) == 5); + REQUIRE(s2(0, 1) == 6); + REQUIRE(s2(1, 0) == 17); + REQUIRE(s2(1, 1) == 18); + + // slice(0, range(0, 2)) -> fix axis 0 at 0, range on axis 1 + // Equivalent to numpy t[0, 0:2, :] -> shape (2, 4) + auto s3 = t.slice(0, range(0, 2)); + REQUIRE(s3.ndim() == 2); + REQUIRE(s3.shape(0) == 2); + REQUIRE(s3.shape(1) == 4); + REQUIRE(s3(0, 0) == 0); // t(0,0,0) + REQUIRE(s3(1, 3) == 7); // t(0,1,3) +} + +// ============================================================================ +// View assignment and arithmetic +// ============================================================================ + +TEST_CASE("View scalar assignment (fill)") +{ + Tensor t({2, 3}, 0.0); + auto r = t.slice(0); + r = 7.0; + REQUIRE(t(0, 0) == 7.0); + REQUIRE(t(0, 1) == 7.0); + REQUIRE(t(0, 2) == 7.0); + REQUIRE(t(1, 0) == 0.0); // Other row unchanged +} + +TEST_CASE("View initializer_list assignment") +{ + Tensor t({2, 3}, 0.0); + auto r = t.slice(1); + r = {10.0, 20.0, 30.0}; + REQUIRE(t(1, 0) == 10.0); + REQUIRE(t(1, 1) == 20.0); + REQUIRE(t(1, 2) == 30.0); +} + +TEST_CASE("View copy assignment (deep copy)") +{ + Tensor t({2, 3}, 0.0); + t.slice(0) = {1.0, 2.0, 3.0}; + t.slice(1) = {4.0, 5.0, 6.0}; + + // Copy row 0 into row 1 + t.slice(1) = t.slice(0); + REQUIRE(t(1, 0) == 1.0); + REQUIRE(t(1, 1) == 2.0); + REQUIRE(t(1, 2) == 3.0); +} + +TEST_CASE("View compound operators") +{ + Tensor t({2, 3}, 0.0); + t.slice(0) = {1.0, 2.0, 3.0}; + + t.slice(0) *= 2.0; + REQUIRE(t(0, 0) == 2.0); + REQUIRE(t(0, 1) == 4.0); + + t.slice(0) /= 2.0; + REQUIRE(t(0, 0) == 1.0); + REQUIRE(t(0, 1) == 2.0); +} + +TEST_CASE("View assignment from tensor") +{ + Tensor t({2, 3}, 0.0); + Tensor vals({3}, 0.0); + vals = {7.0, 8.0, 9.0}; + + t.slice(1) = vals; + REQUIRE(t(1, 0) == 7.0); + REQUIRE(t(1, 1) == 8.0); + REQUIRE(t(1, 2) == 9.0); +} + +TEST_CASE("View compound addition from tensor") +{ + Tensor t({2, 3}, 0.0); + t.slice(0) = {1.0, 2.0, 3.0}; + Tensor vals({3}, 0.0); + vals = {10.0, 20.0, 30.0}; + + t.slice(0) += vals; + REQUIRE(t(0, 0) == 11.0); + REQUIRE(t(0, 1) == 22.0); + REQUIRE(t(0, 2) == 33.0); +} + +TEST_CASE("View sum") +{ + Tensor t({2, 3}, 0.0); + t.slice(0) = {1.0, 2.0, 3.0}; + t.slice(1) = {4.0, 5.0, 6.0}; + + REQUIRE(t.slice(0).sum() == 6.0); + REQUIRE(t.slice(1).sum() == 15.0); +} + +TEST_CASE("View iteration") +{ + Tensor t({2, 3}, 0); + t.slice(0) = {1, 2, 3}; + + int sum = 0; + for (auto val : t.slice(0)) + sum += val; + REQUIRE(sum == 6); +} + +TEST_CASE("View sub-slice") +{ + Tensor t({6}, 0); + t = {10, 20, 30, 40, 50, 60}; + + auto s = t.slice(range(1, 5)); // [20, 30, 40, 50] + auto ss = s.slice(range(1, 3)); // [30, 40] + REQUIRE(ss.size() == 2); + REQUIRE(ss[0] == 30); + REQUIRE(ss[1] == 40); +} + +TEST_CASE("Tensor from View") +{ + Tensor t({2, 3}, 0.0); + t.slice(0) = {1.0, 2.0, 3.0}; + + // Construct a new tensor from a view (copies data) + Tensor t2(t.slice(0)); + REQUIRE(t2.size() == 3); + REQUIRE(t2[0] == 1.0); + REQUIRE(t2[2] == 3.0); + + // Modifying the new tensor doesn't affect the original + t2[0] = 99.0; + REQUIRE(t(0, 0) == 1.0); +} + +// ============================================================================ +// Const View +// ============================================================================ + +TEST_CASE("Const tensor produces const views") +{ + Tensor t({2, 3}, 0.0); + int v = 1; + for (size_t i = 0; i < 2; ++i) + for (size_t j = 0; j < 3; ++j) + t(i, j) = v++; + + const Tensor& ct = t; + auto r = ct.slice(0); // View + REQUIRE(r[0] == 1.0); + REQUIRE(r[2] == 3.0); + + auto c = ct.slice(all, 1); + REQUIRE(c[0] == 2.0); + REQUIRE(c[1] == 5.0); +} + +// ============================================================================ +// StaticTensor2D +// ============================================================================ + +TEST_CASE("StaticTensor2D basics") +{ + StaticTensor2D t; + REQUIRE(t.size() == 12); + REQUIRE(t.shape()[0] == 3); + REQUIRE(t.shape()[1] == 4); + + // Default-initialized to zero + REQUIRE(t(0, 0) == 0.0); + + t(1, 2) = 42.0; + REQUIRE(t(1, 2) == 42.0); + // Flat data: row 1, col 2 = index 1*4 + 2 = 6 + REQUIRE(t.data()[6] == 42.0); +} + +TEST_CASE("StaticTensor2D fill") +{ + StaticTensor2D t; + t.fill(5); + for (size_t i = 0; i < t.size(); ++i) + REQUIRE(t.data()[i] == 5); +} + +TEST_CASE("StaticTensor2D iteration") +{ + StaticTensor2D t; + t.fill(1); + int sum = 0; + for (auto val : t) + sum += val; + REQUIRE(sum == 6); +} + +TEST_CASE("StaticTensor2D slice") +{ + StaticTensor2D t; + t(0, 0) = 1; + t(0, 1) = 2; + t(1, 0) = 3; + t(1, 1) = 4; + t(2, 0) = 5; + t(2, 1) = 6; + + // slice(1) = row 1 (fix axis 0 at 1) + auto r1 = t.slice(1); + REQUIRE(r1.size() == 2); + REQUIRE(r1[0] == 3); + REQUIRE(r1[1] == 4); + + // slice(all, 0) = column 0 (fix axis 1 at 0) + auto c0 = t.slice(all, 0); + REQUIRE(c0.size() == 3); + REQUIRE(c0[0] == 1); + REQUIRE(c0[1] == 3); + REQUIRE(c0[2] == 5); +} + +TEST_CASE("StaticTensor2D flat view") +{ + StaticTensor2D t; + t(0, 0) = 1.0; + t(0, 1) = 2.0; + t(1, 0) = 3.0; + t(1, 1) = 4.0; + + auto f = t.flat(); + REQUIRE(f.size() == 4); + f = 0.0; + REQUIRE(t(0, 0) == 0.0); + REQUIRE(t(1, 1) == 0.0); +} + +// ============================================================================ +// Non-member functions +// ============================================================================ + +TEST_CASE("zeros") +{ + auto t = zeros({3, 4}); + REQUIRE(t.size() == 12); + for (size_t i = 0; i < t.size(); ++i) + REQUIRE(t[i] == 0.0); +} + +TEST_CASE("zeros_like") +{ + Tensor a({2, 5}, 7.0); + auto b = zeros_like(a); + REQUIRE(b.size() == 10); + REQUIRE(b.shape(0) == 2); + REQUIRE(b.shape(1) == 5); + for (size_t i = 0; i < b.size(); ++i) + REQUIRE(b[i] == 0.0); +} + +TEST_CASE("full_like") +{ + Tensor a({4}, 0); + auto b = full_like(a, 42); + REQUIRE(b.size() == 4); + for (size_t i = 0; i < b.size(); ++i) + REQUIRE(b[i] == 42); +} + +TEST_CASE("linspace") +{ + auto t = linspace(0.0, 1.0, 5); + REQUIRE(t.size() == 5); + REQUIRE(t[0] == 0.0); + REQUIRE(t[4] == 1.0); + REQUIRE_THAT(t[1], Catch::Matchers::WithinRel(0.25, 1e-12)); + REQUIRE_THAT(t[2], Catch::Matchers::WithinRel(0.5, 1e-12)); + REQUIRE_THAT(t[3], Catch::Matchers::WithinRel(0.75, 1e-12)); +} + +TEST_CASE("concatenate") +{ + Tensor a({3}, 0); + Tensor b({2}, 0); + a = {1, 2, 3}; + b = {4, 5}; + + auto c = concatenate(a, b); + REQUIRE(c.size() == 5); + REQUIRE(c[0] == 1); + REQUIRE(c[2] == 3); + REQUIRE(c[3] == 4); + REQUIRE(c[4] == 5); +} + +TEST_CASE("log") +{ + Tensor t({3}, 0.0); + t = {1.0, std::exp(1.0), std::exp(2.0)}; + + auto r = log(t); + REQUIRE_THAT(r[0], Catch::Matchers::WithinAbs(0.0, 1e-12)); + REQUIRE_THAT(r[1], Catch::Matchers::WithinAbs(1.0, 1e-12)); + REQUIRE_THAT(r[2], Catch::Matchers::WithinAbs(2.0, 1e-12)); +} + +TEST_CASE("abs") +{ + Tensor t({4}, 0.0); + t = {-3.0, -1.0, 0.0, 2.0}; + + auto r = abs(t); + REQUIRE(r[0] == 3.0); + REQUIRE(r[1] == 1.0); + REQUIRE(r[2] == 0.0); + REQUIRE(r[3] == 2.0); +} + +TEST_CASE("where") +{ + Tensor cond({4}, false); + cond.data()[0] = true; + cond.data()[2] = true; + + Tensor vals({4}, 0.0); + vals = {10.0, 20.0, 30.0, 40.0}; + + auto r = where(cond, vals, -1.0); + REQUIRE(r[0] == 10.0); + REQUIRE(r[1] == -1.0); + REQUIRE(r[2] == 30.0); + REQUIRE(r[3] == -1.0); +} + +TEST_CASE("nan_to_num") +{ + Tensor t({4}, 0.0); + t[0] = 1.0; + t[1] = std::nan(""); + t[2] = std::numeric_limits::infinity(); + t[3] = -std::numeric_limits::infinity(); + + auto r = nan_to_num(t); + REQUIRE(r[0] == 1.0); + REQUIRE(r[1] == 0.0); // NaN -> 0 + REQUIRE(r[2] == std::numeric_limits::max()); // +inf -> max + REQUIRE(r[3] == std::numeric_limits::lowest()); // -inf -> lowest +} + +// ============================================================================ +// is_tensor trait +// ============================================================================ + +TEST_CASE("is_tensor trait") +{ + REQUIRE(is_tensor>::value); + REQUIRE(is_tensor>::value); + REQUIRE(is_tensor>::value); + REQUIRE(!is_tensor::value); + REQUIRE(!is_tensor>::value); +} diff --git a/tests/regression_tests/cpp_driver/driver.cpp b/tests/regression_tests/cpp_driver/driver.cpp index a99c97b64e4..a6c3e651037 100644 --- a/tests/regression_tests/cpp_driver/driver.cpp +++ b/tests/regression_tests/cpp_driver/driver.cpp @@ -2,6 +2,8 @@ #include #endif +#include + #include "openmc/capi.h" #include "openmc/cell.h" #include "openmc/error.h" diff --git a/vendor/xtensor b/vendor/xtensor deleted file mode 160000 index 3634f2ded19..00000000000 --- a/vendor/xtensor +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3634f2ded19e0cf38208c8b86cea9e1d7c8e397d diff --git a/vendor/xtl b/vendor/xtl deleted file mode 160000 index a7c1c5444df..00000000000 --- a/vendor/xtl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a7c1c5444dfc57f76620391af4c94785ff82c8d6 From b34a5c94ec3374fa7f68cd30bfec25f6f885e1e0 Mon Sep 17 00:00:00 2001 From: yardasol Date: Wed, 25 Mar 2026 15:29:57 -0500 Subject: [PATCH 56/64] fast forward to use updated functions; add some missing flow control --- .../openmc/random_ray/random_ray_simulation.h | 3 +- include/openmc/random_ray/source_region.h | 1 + src/random_ray/random_ray_simulation.cpp | 128 +++++++++--------- src/random_ray/source_region.cpp | 13 +- src/settings.cpp | 7 + 5 files changed, 83 insertions(+), 69 deletions(-) diff --git a/include/openmc/random_ray/random_ray_simulation.h b/include/openmc/random_ray/random_ray_simulation.h index 745fc66c020..0d64de8e239 100644 --- a/include/openmc/random_ray/random_ray_simulation.h +++ b/include/openmc/random_ray/random_ray_simulation.h @@ -21,9 +21,10 @@ class RandomRaySimulation { // Methods void apply_fixed_sources_and_mesh_domains(); void prepare_fixed_sources_adjoint(); - void kinetic_single_time_step(int i); void prepare_adjoint_simulation(); void simulate(); + void initialize_time_step(int i); + void finalize_time_step(); void output_simulation_results() const; void instability_check( int64_t n_hits, double k_eff, double& avg_miss_rate) const; diff --git a/include/openmc/random_ray/source_region.h b/include/openmc/random_ray/source_region.h index 5fa3d6663f1..7789c4a7f95 100644 --- a/include/openmc/random_ray/source_region.h +++ b/include/openmc/random_ray/source_region.h @@ -996,6 +996,7 @@ class SourceRegionContainer { bool& is_linear() { return is_linear_; } const bool is_linear() const { return is_linear_; } SourceRegionHandle get_source_region_handle(int64_t sr); + void simulation_reset(); void adjoint_reset(); //--------------------------------------------------------------------------- diff --git a/src/random_ray/random_ray_simulation.cpp b/src/random_ray/random_ray_simulation.cpp index 445f915c5b4..8fde63a34da 100644 --- a/src/random_ray/random_ray_simulation.cpp +++ b/src/random_ray/random_ray_simulation.cpp @@ -438,6 +438,9 @@ void RandomRaySimulation::prepare_fixed_sources_adjoint() void RandomRaySimulation::prepare_adjoint_simulation() { + // Reset all simulation values + domain_->source_regions_.simulation_reset(); + // Configure the domain for adjoint simulation FlatSourceDomain::adjoint_ = true; @@ -454,59 +457,6 @@ void RandomRaySimulation::prepare_adjoint_simulation() domain_->nu_sigma_f_.swap(domain_->chi_); } -// TODO: Add support for time-dependent restart -void RandomRaySimulation::kinetic_single_time_step(int i) -{ - // Increment time step - simulation::current_timestep = i + 1; - if (i >= 0) - // Increment the current time - simulation::current_time += settings::dt; - - // Set eigenvalue if needed - if (settings::run_mode == RunMode::EIGENVALUE) { - if (i == -1) { - // Set flag for k_eff correction if initial condition - simulation::k_eff_correction = true; - - // Store average keff from initial simulation - static_avg_k_eff_ = simulation::keff; - } - domain_->k_eff_ = static_avg_k_eff_; - } - domain_->source_regions_.adjoint_reset(); - domain_->propagate_final_quantities(); - domain_->source_regions_.time_step_reset(); - - if (i >= 0) { - // Compute RHS backward differences - domain_->compute_rhs_bd_quantities(); - - // Update time dependent cross section based on the density - domain_->update_material_density(i); - } - - // Run the initial condition - simulate(); - - if (i == -1) { - // Initialize the BD arrays if initial condition - domain_->store_time_step_quantities(false); - // Reset flags for kinetic simulation if initial condition - simulation::is_initial_condition = false; - simulation::k_eff_correction = false; - } else { - // Else, store final quantities for the current time step - domain_->store_time_step_quantities(); - } - - // Rename statepoint and tallies file for the current time step - rename_time_step_file(fmt::format("statepoint.{0}", settings::n_batches), - ".h5", simulation::current_timestep); - if (settings::output_tallies) - rename_time_step_file("tallies", ".out", simulation::current_timestep); -} - void RandomRaySimulation::simulate() { if (!is_first_simulation_) { @@ -580,11 +530,11 @@ void RandomRaySimulation::simulate() domain_->apply_transport_stabilization(); if (settings::run_mode == RunMode::EIGENVALUE) { - // Compute random ray k-eff - if (!settings::kinetic_simulation || - settings::kinetic_simulation && simulation::is_initial_condition) { + // Compute random ray k-eff for initial condition. + // This keff will be preserved + if (simulation::is_initial_condition) { domain_->compute_k_eff(); - if (simulation::k_eff_correction) { + if (settings::kinetic_simulation && simulation::k_eff_correction) { static_fission_rate_.push_back(domain_->fission_rate_); static_k_eff_.push_back(domain_->k_eff_); } @@ -655,6 +605,51 @@ void RandomRaySimulation::simulate() is_first_simulation_ = false; } +void RandomRaySimulation::initialize_time_step(int i) +{ + if (simulation::k_eff_correction) + static_avg_k_eff_ = simulation::keff; + domain_->k_eff_ = static_avg_k_eff_; + + // Increment current timestep and simuation time + simulation::current_timestep = i + 1; + + // Propagate previous converted solution for kinetic simulation + domain_->source_regions_.simulation_reset(); + domain_->propagate_final_quantities(); + domain_->source_regions_.time_step_reset(); + + if (!simulation::is_initial_condition) { + // Compute RHS backward differences + domain_->compute_rhs_bd_quantities(); + + // Update time dependent cross section based on the density + domain_->update_material_density(i); + + simulation::current_time += settings::dt; + } +} + +void RandomRaySimulation::finalize_time_step() +{ + if (simulation::is_initial_condition) { + // Initialize the BD arrays if initial condition + domain_->store_time_step_quantities(false); + // Toggle off initial condition and source correction + simulation::is_initial_condition = false; + simulation::k_eff_correction = false; + } else { + // Else, store final quantities for the current time step + domain_->store_time_step_quantities(); + } + + // Rename statepoint and tallies file for the current time step + rename_time_step_file(fmt::format("statepoint.{0}", settings::n_batches), + ".h5", simulation::current_timestep); + if (settings::output_tallies) + rename_time_step_file("tallies", ".out", simulation::current_timestep); +} + void RandomRaySimulation::output_simulation_results() const { // Print random ray results @@ -861,7 +856,6 @@ void openmc_run_random_ray() ////////////////////////////////////////////////////////// // Run forward simulation ////////////////////////////////////////////////////////// - if (openmc::mpi::master) { if (openmc::FlatSourceDomain::adjoint_) { openmc::FlatSourceDomain::adjoint_ = false; @@ -883,14 +877,22 @@ void openmc_run_random_ray() // Initialize fixed sources, if present sim.apply_fixed_sources_and_mesh_domains(); - // Run initial random ray simulation + // Simulate single random ray simulation (static case) + // OR get an initial estimate for scattering and fission + // distributions (if fissile material exist), + // and k-eff (if kinetic eigenvalue simulation) sim.simulate(); if (openmc::settings::kinetic_simulation) { - // Timestepping loop, including k-eff correction initial - // condition (i = -1) - for (int i = -1; i < openmc::settings::n_timesteps; i++) - sim.kinetic_single_time_step(i); + // Toggle initial condition source correction + openmc::simulation::k_eff_correction = true; + int i_start = -1; + // Timestepping loop, + for (int i = i_start; i < openmc::settings::n_timesteps; i++) { + sim.initialize_time_step(i); + sim.simulate(); + sim.finalize_time_step(); + } } ////////////////////////////////////////////////////////// diff --git a/src/random_ray/source_region.cpp b/src/random_ray/source_region.cpp index 3bf6b958d2b..6f13cc56b12 100644 --- a/src/random_ray/source_region.cpp +++ b/src/random_ray/source_region.cpp @@ -364,7 +364,7 @@ SourceRegionHandle SourceRegionContainer::get_source_region_handle(int64_t sr) return handle; } -void SourceRegionContainer::adjoint_reset() +void SourceRegionContainer::simulation_reset() { std::fill(n_hits_.begin(), n_hits_.end(), 0); std::fill(volume_.begin(), volume_.end(), 0.0); @@ -372,9 +372,6 @@ void SourceRegionContainer::adjoint_reset() std::fill(volume_sq_.begin(), volume_sq_.end(), 0.0); std::fill(volume_sq_t_.begin(), volume_sq_t_.end(), 0.0); std::fill(volume_naive_.begin(), volume_naive_.end(), 0.0); - std::fill( - external_source_present_.begin(), external_source_present_.end(), 0); - std::fill(external_source_.begin(), external_source_.end(), 0.0); std::fill(centroid_.begin(), centroid_.end(), Position {0.0, 0.0, 0.0}); std::fill(centroid_iteration_.begin(), centroid_iteration_.end(), Position {0.0, 0.0, 0.0}); @@ -390,7 +387,6 @@ void SourceRegionContainer::adjoint_reset() } std::fill(scalar_flux_new_.begin(), scalar_flux_new_.end(), 0.0); std::fill(source_.begin(), source_.end(), 0.0f); - std::fill(external_source_.begin(), external_source_.end(), 0.0f); std::fill(source_gradients_.begin(), source_gradients_.end(), MomentArray {0.0, 0.0, 0.0}); std::fill(flux_moments_old_.begin(), flux_moments_old_.end(), @@ -424,6 +420,13 @@ void SourceRegionContainer::adjoint_reset() } } +void SourceRegionContainer::adjoint_reset() +{ + std::fill( + external_source_present_.begin(), external_source_present_.end(), 0); + std::fill(external_source_.begin(), external_source_.end(), 0.0f); +} + //----------------------------------------------------------------------------- // Methods for kinetic simulations diff --git a/src/settings.cpp b/src/settings.cpp index b35cfe4f454..977251526f2 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -381,6 +381,9 @@ void get_run_parameters(pugi::xml_node node_base) if (check_for_node(random_ray_node, "adjoint")) { FlatSourceDomain::adjoint_ = get_node_value_bool(random_ray_node, "adjoint"); + if (FlatSourceDomain::adjoint_ && kinetic_simulation) { + fatal_error("Adjoint kinetic simulations are currently unsupported ."); + } } if (check_for_node(random_ray_node, "sample_method")) { std::string temp_str = @@ -1343,6 +1346,10 @@ void read_settings_xml(pugi::xml_node root) // Create weight window generator objects if (check_for_node(root, "weight_window_generators")) { + if (kinetic_simulation) { + fatal_error("Weight window generation is currently unsupported in kinetic" + " random ray solver mode."); + } auto wwgs_node = root.child("weight_window_generators"); for (pugi::xml_node node_wwg : wwgs_node.children("weight_windows_generator")) { From e8230d32dc7105ead57fe092b4bfbd7c50e65a37 Mon Sep 17 00:00:00 2001 From: yardasol Date: Thu, 26 Mar 2026 14:19:11 -0500 Subject: [PATCH 57/64] fix dagmc unit test --- tests/unit_tests/dagmc/test_convert_to_multigroup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit_tests/dagmc/test_convert_to_multigroup.py b/tests/unit_tests/dagmc/test_convert_to_multigroup.py index 069dc658e52..d76c4eff215 100644 --- a/tests/unit_tests/dagmc/test_convert_to_multigroup.py +++ b/tests/unit_tests/dagmc/test_convert_to_multigroup.py @@ -16,7 +16,7 @@ def test_convert_to_multigroup_without_particles_batches(run_in_tmpdir): """Test that convert_to_multigroup works with DAGMC model without setting particles/batches beforehand.""" openmc.reset_auto_ids() - + mat = openmc.Material(name="mat") mat.add_nuclide("Fe56", 1.0) mat.set_density("g/cm3", 7.0) @@ -33,7 +33,7 @@ def test_convert_to_multigroup_without_particles_batches(run_in_tmpdir): model.settings = openmc.Settings() # Note: no particles or batches set! model.settings.run_mode = 'fixed source' - + # Create a point source my_source = openmc.IndependentSource() my_source.space = openmc.stats.Point((0.25, 0.25, 0.25)) @@ -44,7 +44,7 @@ def test_convert_to_multigroup_without_particles_batches(run_in_tmpdir): # convert_to_multigroup handles initialization internally using non-transport mode model.convert_to_multigroup( method='material_wise', - groups='CASMO-2', + energy_groups='CASMO-2', nparticles=10, overwrite_mgxs_library=True ) From e64b793de7fa3d6ed61ce4906daf630c1e1458db Mon Sep 17 00:00:00 2001 From: yardasol Date: Thu, 26 Mar 2026 14:21:03 -0500 Subject: [PATCH 58/64] remove cruft file --- openmc/model/model-copy.py | 2629 ------------------------------------ 1 file changed, 2629 deletions(-) delete mode 100644 openmc/model/model-copy.py diff --git a/openmc/model/model-copy.py b/openmc/model/model-copy.py deleted file mode 100644 index 53e68463f79..00000000000 --- a/openmc/model/model-copy.py +++ /dev/null @@ -1,2629 +0,0 @@ -from __future__ import annotations -from collections.abc import Callable, Iterable, Sequence -import copy -from dataclasses import dataclass, field -from functools import cache -from pathlib import Path -import math -from numbers import Integral, Real -import random -import re -from tempfile import NamedTemporaryFile, TemporaryDirectory -from typing import Any, Protocol -import warnings - -import h5py -import lxml.etree as ET -import numpy as np -from scipy.optimize import curve_fit - -import openmc -import openmc._xml as xml -from openmc.dummy_comm import DummyCommunicator -from openmc.executor import _process_CLI_arguments -from openmc.checkvalue import check_type, check_value, PathLike -from openmc.exceptions import InvalidIDError -from openmc.plots import add_plot_params, _BASIS_INDICES, id_map_to_rgb -from openmc.utility_funcs import change_directory - - -# Protocol for a function that is passed to search_keff -class ModelModifier(Protocol): - def __call__(self, val: float, **kwargs: Any) -> None: - ... - - -class Model: - """Model container. - - This class can be used to store instances of :class:`openmc.Geometry`, - :class:`openmc.Materials`, :class:`openmc.Settings`, - :class:`openmc.Tallies`, and :class:`openmc.Plots`, thus making a complete - model. The :meth:`Model.export_to_xml` method will export XML files for all - attributes that have been set. If the :attr:`Model.materials` attribute is - not set, it will attempt to create a ``materials.xml`` file based on all - materials appearing in the geometry. - - .. versionchanged:: 0.13.0 - The model information can now be loaded in to OpenMC directly via - openmc.lib - - Parameters - ---------- - geometry : openmc.Geometry, optional - Geometry information - materials : openmc.Materials, optional - Materials information - settings : openmc.Settings, optional - Settings information - tallies : openmc.Tallies, optional - Tallies information - plots : openmc.Plots, optional - Plot information - - Attributes - ---------- - geometry : openmc.Geometry - Geometry information - materials : openmc.Materials - Materials information - settings : openmc.Settings - Settings information - tallies : openmc.Tallies - Tallies information - plots : openmc.Plots - Plot information - - """ - - def __init__( - self, - geometry: openmc.Geometry | None = None, - materials: openmc.Materials | None = None, - settings: openmc.Settings | None = None, - tallies: openmc.Tallies | None = None, - plots: openmc.Plots | None = None, - ): - self.geometry = openmc.Geometry() if geometry is None else geometry - self.materials = openmc.Materials() if materials is None else materials - self.settings = openmc.Settings() if settings is None else settings - self.tallies = openmc.Tallies() if tallies is None else tallies - self.plots = openmc.Plots() if plots is None else plots - - @property - def geometry(self) -> openmc.Geometry: - return self._geometry - - @geometry.setter - def geometry(self, geometry): - check_type('geometry', geometry, openmc.Geometry) - self._geometry = geometry - - @property - def materials(self) -> openmc.Materials: - return self._materials - - @materials.setter - def materials(self, materials): - check_type('materials', materials, Iterable, openmc.Material) - if isinstance(materials, openmc.Materials): - self._materials = materials - else: - if not hasattr(self, '_materials'): - self._materials = openmc.Materials() - del self._materials[:] - for mat in materials: - self._materials.append(mat) - - @property - def settings(self) -> openmc.Settings: - return self._settings - - @settings.setter - def settings(self, settings): - check_type('settings', settings, openmc.Settings) - self._settings = settings - - @property - def tallies(self) -> openmc.Tallies: - return self._tallies - - @tallies.setter - def tallies(self, tallies): - check_type('tallies', tallies, Iterable, openmc.Tally) - if isinstance(tallies, openmc.Tallies): - self._tallies = tallies - else: - if not hasattr(self, '_tallies'): - self._tallies = openmc.Tallies() - del self._tallies[:] - for tally in tallies: - self._tallies.append(tally) - - @property - def plots(self) -> openmc.Plots: - return self._plots - - @plots.setter - def plots(self, plots): - check_type('plots', plots, Iterable, openmc.PlotBase) - if isinstance(plots, openmc.Plots): - self._plots = plots - else: - if not hasattr(self, '_plots'): - self._plots = openmc.Plots() - del self._plots[:] - for plot in plots: - self._plots.append(plot) - - @property - def bounding_box(self) -> openmc.BoundingBox: - return self.geometry.bounding_box - - @property - def is_initialized(self) -> bool: - try: - import openmc.lib - return openmc.lib.is_initialized - except ImportError: - return False - - @property - @cache - def _materials_by_id(self) -> dict: - """Dictionary mapping material ID --> material""" - if self.materials: - mats = self.materials - else: - mats = self.geometry.get_all_materials().values() - return {mat.id: mat for mat in mats} - - @property - @cache - def _cells_by_id(self) -> dict: - """Dictionary mapping cell ID --> cell""" - cells = self.geometry.get_all_cells() - return {cell.id: cell for cell in cells.values()} - - @property - @cache - def _cells_by_name(self) -> dict[int, openmc.Cell]: - # Get the names maps, but since names are not unique, store a set for - # each name key. In this way when the user requests a change by a name, - # the change will be applied to all of the same name. - result = {} - for cell in self.geometry.get_all_cells().values(): - if cell.name not in result: - result[cell.name] = set() - result[cell.name].add(cell) - return result - - @property - @cache - def _materials_by_name(self) -> dict[int, openmc.Material]: - if self.materials is None: - mats = self.geometry.get_all_materials().values() - else: - mats = self.materials - result = {} - for mat in mats: - if mat.name not in result: - result[mat.name] = set() - result[mat.name].add(mat) - return result - - # TODO: This should really get incorporated in lower-level calls to - # get_all_materials, but right now it requires information from the Model object - def _get_all_materials(self) -> dict[int, openmc.Material]: - """Get all materials including those in DAGMC universes - - Returns - ------- - dict - Dictionary mapping material ID to material instances - """ - # Get all materials from the Geometry object - materials = self.geometry.get_all_materials() - - # Account for materials in DAGMC universes - for cell in self.geometry.get_all_cells().values(): - if isinstance(cell.fill, openmc.DAGMCUniverse): - names = cell.fill.material_names - materials.update({ - mat.id: mat for mat in self.materials if mat.name in names - }) - - return materials - - def add_kinetics_parameters_tallies(self, num_groups: int | None = None): - """Add tallies for calculating kinetics parameters using the IFP method. - - This method adds tallies to the model for calculating two kinetics - parameters, the generation time and the effective delayed neutron - fraction (beta effective). After a model is run, these parameters can be - determined through the :meth:`openmc.StatePoint.ifp_results` method. - - Parameters - ---------- - num_groups : int, optional - Number of precursor groups to filter the delayed neutron fraction. - If None, only the total effective delayed neutron fraction is - tallied. - - """ - if not any('ifp-time-numerator' in t.scores for t in self.tallies): - gen_time_tally = openmc.Tally(name='IFP time numerator') - gen_time_tally.scores = ['ifp-time-numerator'] - self.tallies.append(gen_time_tally) - if not any('ifp-beta-numerator' in t.scores for t in self.tallies): - beta_tally = openmc.Tally(name='IFP beta numerator') - beta_tally.scores = ['ifp-beta-numerator'] - if num_groups is not None: - beta_tally.filters = [openmc.DelayedGroupFilter( - list(range(1, num_groups + 1)))] - self.tallies.append(beta_tally) - if not any('ifp-denominator' in t.scores for t in self.tallies): - denom_tally = openmc.Tally(name='IFP denominator') - denom_tally.scores = ['ifp-denominator'] - self.tallies.append(denom_tally) - - @classmethod - def from_xml( - cls, - geometry: PathLike = "geometry.xml", - materials: PathLike = "materials.xml", - settings: PathLike = "settings.xml", - tallies: PathLike = "tallies.xml", - plots: PathLike = "plots.xml", - ) -> Model: - """Create model from existing XML files - - Parameters - ---------- - geometry : PathLike - Path to geometry.xml file - materials : PathLike - Path to materials.xml file - settings : PathLike - Path to settings.xml file - tallies : PathLike - Path to tallies.xml file - - .. versionadded:: 0.13.0 - plots : PathLike - Path to plots.xml file - - .. versionadded:: 0.13.0 - - Returns - ------- - openmc.model.Model - Model created from XML files - - """ - materials = openmc.Materials.from_xml(materials) - geometry = openmc.Geometry.from_xml(geometry, materials) - settings = openmc.Settings.from_xml(settings) - tallies = openmc.Tallies.from_xml( - tallies) if Path(tallies).exists() else None - plots = openmc.Plots.from_xml(plots) if Path(plots).exists() else None - return cls(geometry, materials, settings, tallies, plots) - - @classmethod - def from_model_xml(cls, path: PathLike = "model.xml") -> Model: - """Create model from single XML file - - .. versionadded:: 0.13.3 - - Parameters - ---------- - path : PathLike - Path to model.xml file - """ - parser = ET.XMLParser(huge_tree=True) - tree = ET.parse(path, parser=parser) - root = tree.getroot() - - model = cls() - - meshes = {} - model.settings = openmc.Settings.from_xml_element( - root.find('settings'), meshes) - model.materials = openmc.Materials.from_xml_element( - root.find('materials')) - model.geometry = openmc.Geometry.from_xml_element( - root.find('geometry'), model.materials) - - if root.find('tallies') is not None: - model.tallies = openmc.Tallies.from_xml_element( - root.find('tallies'), meshes) - - if root.find('plots') is not None: - model.plots = openmc.Plots.from_xml_element(root.find('plots')) - - return model - - def init_lib( - self, - threads: int | None = None, - geometry_debug: bool = False, - restart_file: PathLike | None = None, - tracks: bool = False, - output: bool = True, - event_based: bool | None = None, - intracomm=None, - directory: PathLike | None = None, - ): - """Initializes the model in memory via the C API - - .. versionadded:: 0.13.0 - - Parameters - ---------- - threads : int, optional - Number of OpenMP threads. If OpenMC is compiled with OpenMP - threading enabled, the default is implementation-dependent but is - usually equal to the number of hardware threads available - (or a value set by the :envvar:`OMP_NUM_THREADS` environment - variable). - geometry_debug : bool, optional - Turn on geometry debugging during simulation. Defaults to False. - restart_file : PathLike, optional - Path to restart file to use - tracks : bool, optional - Enables the writing of particles tracks. The number of particle - tracks written to tracks.h5 is limited to 1000 unless - Settings.max_tracks is set. Defaults to False. - output : bool - Capture OpenMC output from standard out - event_based : None or bool, optional - Turns on event-based parallelism if True. If None, the value in - the Settings will be used. - intracomm : mpi4py.MPI.Intracomm or None, optional - MPI intracommunicator - directory : PathLike or None, optional - Directory to write XML files to. Defaults to None. - """ - - import openmc.lib - - # TODO: right now the only way to set most of the above parameters via - # the C API are at initialization time despite use-cases existing to - # set them for individual runs. For now this functionality is exposed - # where it exists (here in init), but in the future the functionality - # should be exposed so that it can be accessed via model.run(...) - - args = _process_CLI_arguments( - volume=False, geometry_debug=geometry_debug, - restart_file=restart_file, threads=threads, tracks=tracks, - event_based=event_based, path_input=directory) - - # Args adds the openmc_exec command in the first entry; remove it - args = args[1:] - - self.finalize_lib() - - # The Model object needs to be aware of the communicator so it can - # use it in certain cases, therefore lets store the communicator - if intracomm is not None: - self._intracomm = intracomm - else: - self._intracomm = DummyCommunicator() - - if self._intracomm.rank == 0: - if directory is not None: - self.export_to_xml(directory=directory) - else: - self.export_to_xml() - self._intracomm.barrier() - - # We cannot pass DummyCommunicator to openmc.lib.init so pass instead - # the user-provided intracomm which will either be None or an mpi4py - # communicator - openmc.lib.init(args=args, intracomm=intracomm, output=output) - - def sync_dagmc_universes(self): - """Synchronize all DAGMC universes in the current geometry. - - This method iterates over all DAGMC universes in the geometry and - synchronizes their cells with the current material assignments. Requires - that the model has been initialized via :meth:`Model.init_lib`. - - .. versionadded:: 0.15.1 - - """ - if self.is_initialized: - if self.materials: - materials = self.materials - else: - materials = list(self.geometry.get_all_materials().values()) - for univ in self.geometry.get_all_universes().values(): - if isinstance(univ, openmc.DAGMCUniverse): - univ.sync_dagmc_cells(materials) - else: - raise ValueError("The model must be initialized before calling " - "this method") - - def finalize_lib(self): - """Finalize simulation and free memory allocated for the C API - - .. versionadded:: 0.13.0 - - """ - - import openmc.lib - - openmc.lib.finalize() - - def deplete( - self, - method: str = "cecm", - final_step: bool = True, - operator_kwargs: dict | None = None, - directory: PathLike = ".", - output: bool = True, - **integrator_kwargs, - ): - """Deplete model using specified timesteps/power - - .. versionchanged:: 0.13.0 - The *final_step*, *operator_kwargs*, *directory*, and *output* - arguments were added. - - Parameters - ---------- - timesteps : iterable of float or iterable of tuple - Array of timesteps. Note that values are not cumulative. The units are - specified by the `timestep_units` argument when `timesteps` is an - iterable of float. Alternatively, units can be specified for each step - by passing an iterable of (value, unit) tuples. - method : str - Integration method used for depletion (e.g., 'cecm', 'predictor'). - Defaults to 'cecm'. - final_step : bool, optional - Indicate whether or not a transport solve should be run at the end - of the last timestep. Defaults to running this transport solve. - operator_kwargs : dict - Keyword arguments passed to the depletion operator initializer - (e.g., :func:`openmc.deplete.Operator`) - directory : PathLike, optional - Directory to write XML files to. If it doesn't exist already, it - will be created. Defaults to the current working directory - output : bool - Capture OpenMC output from standard out - integrator_kwargs : dict - Remaining keyword arguments passed to the depletion integrator - (e.g., :class:`openmc.deplete.CECMIntegrator`). - - """ - - if operator_kwargs is None: - op_kwargs = {} - elif isinstance(operator_kwargs, dict): - op_kwargs = operator_kwargs - else: - raise ValueError("operator_kwargs must be a dict or None") - - # Import openmc.deplete here so the Model can be used even if the - # shared library is unavailable. - import openmc.deplete as dep - - # Store whether or not the library was initialized when we started - started_initialized = self.is_initialized - - with change_directory(directory): - with openmc.lib.quiet_dll(output): - # TODO: Support use of IndependentOperator too - depletion_operator = dep.CoupledOperator(self, **op_kwargs) - - # Tell depletion_operator.finalize NOT to clear C API memory when - # it is done - depletion_operator.cleanup_when_done = False - - # Set up the integrator - check_value('method', method, - dep.integrators.integrator_by_name.keys()) - integrator_class = dep.integrators.integrator_by_name[method] - integrator = integrator_class( - depletion_operator, **integrator_kwargs) - - # Now perform the depletion - with openmc.lib.quiet_dll(output): - integrator.integrate(final_step) - - # Now make the python Materials match the C API material data - for mat_id, mat in self._materials_by_id.items(): - if mat.depletable: - # Get the C data - c_mat = openmc.lib.materials[mat_id] - nuclides, densities = c_mat._get_densities() - # And now we can remove isotopes and add these ones in - mat.nuclides.clear() - for nuc, density in zip(nuclides, densities): - mat.add_nuclide(nuc, density) - mat.set_density('atom/b-cm', sum(densities)) - - # If we didnt start intialized, we should cleanup after ourselves - if not started_initialized: - depletion_operator.cleanup_when_done = True - depletion_operator.finalize() - - def _link_geometry_to_filters(self): - """Establishes a link between distribcell filters and the geometry""" - for tally in self.tallies: - for f in tally.filters: - if isinstance(f, openmc.DistribcellFilter): - f._geometry = self.geometry - - def export_to_xml(self, directory: PathLike = '.', remove_surfs: bool = False, - nuclides_to_ignore: Iterable[str] | None = None): - """Export model to separate XML files. - - Parameters - ---------- - directory : PathLike - Directory to write XML files to. If it doesn't exist already, it - will be created. - remove_surfs : bool - Whether or not to remove redundant surfaces from the geometry when - exporting. - - .. versionadded:: 0.13.1 - nuclides_to_ignore : list of str - Nuclides to ignore when exporting to XML. - - """ - # Create directory if required - d = Path(directory) - if not d.is_dir(): - d.mkdir(parents=True, exist_ok=True) - - self.settings.export_to_xml(d) - self.geometry.export_to_xml(d, remove_surfs=remove_surfs) - - # If a materials collection was specified, export it. Otherwise, look - # for all materials in the geometry and use that to automatically build - # a collection. - if self.materials: - self.materials.export_to_xml( - d, nuclides_to_ignore=nuclides_to_ignore) - else: - materials = openmc.Materials(self.geometry.get_all_materials() - .values()) - materials.export_to_xml(d, nuclides_to_ignore=nuclides_to_ignore) - - if self.tallies: - self.tallies.export_to_xml(d) - if self.plots: - self.plots.export_to_xml(d) - - self._link_geometry_to_filters() - - def export_to_model_xml(self, path: PathLike = 'model.xml', remove_surfs: bool = False, - nuclides_to_ignore: Iterable[str] | None = None): - """Export model to a single XML file. - - .. versionadded:: 0.13.3 - - Parameters - ---------- - path : str or PathLike - Location of the XML file to write (default is 'model.xml'). Can be a - directory or file path. - remove_surfs : bool - Whether or not to remove redundant surfaces from the geometry when - exporting. - nuclides_to_ignore : list of str - Nuclides to ignore when exporting to XML. - - """ - xml_path = Path(path) - # if the provided path doesn't end with the XML extension, assume the - # input path is meant to be a directory. If the directory does not - # exist, create it and place a 'model.xml' file there. - if not str(xml_path).endswith('.xml'): - if not xml_path.exists(): - xml_path.mkdir(parents=True, exist_ok=True) - elif not xml_path.is_dir(): - raise FileExistsError( - f"File exists and is not a directory: '{xml_path}'") - xml_path /= 'model.xml' - # if this is an XML file location and the file's parent directory does - # not exist, create it before continuing - elif not xml_path.parent.exists(): - xml_path.parent.mkdir(parents=True, exist_ok=True) - - if remove_surfs: - warnings.warn("remove_surfs kwarg will be deprecated soon, please " - "set the Geometry.merge_surfaces attribute instead.") - self.geometry.merge_surfaces = True - - # provide a memo to track which meshes have been written - mesh_memo = set() - settings_element = self.settings.to_xml_element(mesh_memo) - geometry_element = self.geometry.to_xml_element() - - xml.clean_indentation(geometry_element, level=1) - xml.clean_indentation(settings_element, level=1) - - # If a materials collection was specified, export it. Otherwise, look - # for all materials in the geometry and use that to automatically build - # a collection. - if self.materials: - materials = self.materials - else: - materials = openmc.Materials(self.geometry.get_all_materials() - .values()) - - with open(xml_path, 'w', encoding='utf-8', errors='xmlcharrefreplace') as fh: - # write the XML header - fh.write("\n") - fh.write("\n") - # Write the materials collection to the open XML file first. - # This will write the XML header also - materials._write_xml(fh, False, level=1, - nuclides_to_ignore=nuclides_to_ignore) - # Write remaining elements as a tree - fh.write(ET.tostring(geometry_element, encoding="unicode")) - fh.write(ET.tostring(settings_element, encoding="unicode")) - - if self.tallies: - tallies_element = self.tallies.to_xml_element(mesh_memo) - xml.clean_indentation( - tallies_element, level=1, trailing_indent=self.plots) - fh.write(ET.tostring(tallies_element, encoding="unicode")) - if self.plots: - plots_element = self.plots.to_xml_element() - xml.clean_indentation( - plots_element, level=1, trailing_indent=False) - fh.write(ET.tostring(plots_element, encoding="unicode")) - fh.write("\n") - - self._link_geometry_to_filters() - - def import_properties(self, filename: PathLike): - """Import physical properties - - .. versionchanged:: 0.13.0 - This method now updates values as loaded in memory with the C API - - Parameters - ---------- - filename : PathLike - Path to properties HDF5 file - - See Also - -------- - openmc.lib.export_properties - - """ - import openmc.lib - - cells = self.geometry.get_all_cells() - materials = self.geometry.get_all_materials() - - with h5py.File(filename, 'r') as fh: - cells_group = fh['geometry/cells'] - - # Make sure number of cells matches - n_cells = fh['geometry'].attrs['n_cells'] - if n_cells != len(cells): - raise ValueError("Number of cells in properties file doesn't " - "match current model.") - - # Update temperatures and densities for cells filled with materials - for name, group in cells_group.items(): - cell_id = int(name.split()[1]) - cell = cells[cell_id] - if cell.fill_type in ('material', 'distribmat'): - temperature = group['temperature'][()] - cell.temperature = temperature - if self.is_initialized: - lib_cell = openmc.lib.cells[cell_id] - if temperature.size > 1: - for i, T in enumerate(temperature): - lib_cell.set_temperature(T, i) - else: - lib_cell.set_temperature(temperature[0]) - - if group['density']: - density = group['density'][()] - if density.size > 1: - cell.density = [rho for rho in density] - else: - cell.density = density - if self.is_initialized: - lib_cell = openmc.lib.cells[cell_id] - if density.size > 1: - for i, rho in enumerate(density): - lib_cell.set_density(rho, i) - else: - lib_cell.set_density(density[0]) - - # Make sure number of materials matches - mats_group = fh['materials'] - n_cells = mats_group.attrs['n_materials'] - if n_cells != len(materials): - raise ValueError("Number of materials in properties file " - "doesn't match current model.") - - # Update material densities - for name, group in mats_group.items(): - mat_id = int(name.split()[1]) - atom_density = group.attrs['atom_density'] - materials[mat_id].set_density('atom/b-cm', atom_density) - if self.is_initialized: - C_mat = openmc.lib.materials[mat_id] - C_mat.set_density(atom_density, 'atom/b-cm') - - def run( - self, - particles: int | None = None, - threads: int | None = None, - geometry_debug: bool = False, - restart_file: PathLike | None = None, - tracks: bool = False, - output: bool = True, - cwd: PathLike = ".", - openmc_exec: PathLike = "openmc", - mpi_args: Iterable[str] = None, - event_based: bool | None = None, - export_model_xml: bool = True, - apply_tally_results: bool = False, - **export_kwargs, - ) -> Path: - """Run OpenMC - - If the C API has been initialized, then the C API is used, otherwise, - this method creates the XML files and runs OpenMC via a system call. In - both cases this method returns the path to the last statepoint file - generated. - - .. versionchanged:: 0.12 - Instead of returning the final k-effective value, this function now - returns the path to the final statepoint written. - - .. versionchanged:: 0.13.0 - This method can utilize the C API for execution - - Parameters - ---------- - particles : int, optional - Number of particles to simulate per generation. - threads : int, optional - Number of OpenMP threads. If OpenMC is compiled with OpenMP - threading enabled, the default is implementation-dependent but is - usually equal to the number of hardware threads available (or a - value set by the :envvar:`OMP_NUM_THREADS` environment variable). - geometry_debug : bool, optional - Turn on geometry debugging during simulation. Defaults to False. - restart_file : str or PathLike - Path to restart file to use - tracks : bool, optional - Enables the writing of particles tracks. The number of particle - tracks written to tracks.h5 is limited to 1000 unless - Settings.max_tracks is set. Defaults to False. - output : bool, optional - Capture OpenMC output from standard out - cwd : PathLike, optional - Path to working directory to run in. Defaults to the current working - directory. - openmc_exec : str, optional - Path to OpenMC executable. Defaults to 'openmc'. - mpi_args : list of str, optional - MPI execute command and any additional MPI arguments to pass, e.g. - ['mpiexec', '-n', '8']. - event_based : None or bool, optional - Turns on event-based parallelism if True. If None, the value in the - Settings will be used. - export_model_xml : bool, optional - Exports a single model.xml file rather than separate files. Defaults - to True. - - .. versionadded:: 0.13.3 - apply_tally_results : bool - Whether to apply results of the final statepoint file to the - model's tally objects. - - .. versionadded:: 0.15.1 - **export_kwargs - Keyword arguments passed to either :meth:`Model.export_to_model_xml` - or :meth:`Model.export_to_xml`. - - Returns - ------- - Path - Path to the last statepoint written by this run (None if no - statepoint was written) - - """ - - # Setting tstart here ensures we don't pick up any pre-existing - # statepoint files in the output directory -- just in case there are - # differences between the system clock and the filesystem, we get the - # time of a just-created temporary file - with NamedTemporaryFile() as fp: - tstart = Path(fp.name).stat().st_mtime - last_statepoint = None - - # Operate in the provided working directory - with change_directory(cwd): - if self.is_initialized: - # Handle the run options as applicable - # First dont allow ones that must be set via init - for arg_name, arg, default in zip( - ['threads', 'geometry_debug', 'restart_file', 'tracks'], - [threads, geometry_debug, restart_file, tracks], - [None, False, None, False] - ): - if arg != default: - msg = f"{arg_name} must be set via Model.is_initialized(...)" - raise ValueError(msg) - - init_particles = openmc.lib.settings.particles - if particles is not None: - if isinstance(particles, Integral) and particles > 0: - openmc.lib.settings.particles = particles - - init_event_based = openmc.lib.settings.event_based - if event_based is not None: - openmc.lib.settings.event_based = event_based - - # Then run using the C API - openmc.lib.run(output) - - # Reset changes for the openmc.run kwargs handling - openmc.lib.settings.particles = init_particles - openmc.lib.settings.event_based = init_event_based - - else: - # Then run via the command line - if export_model_xml: - self.export_to_model_xml(**export_kwargs) - else: - self.export_to_xml(**export_kwargs) - path_input = export_kwargs.get("path", None) - openmc.run(particles, threads, geometry_debug, restart_file, - tracks, output, Path('.'), openmc_exec, mpi_args, - event_based, path_input) - - # Get output directory and return the last statepoint written - if self.settings.output and 'path' in self.settings.output: - output_dir = Path(self.settings.output['path']) - else: - output_dir = Path.cwd() - for sp in output_dir.glob('statepoint.*.h5'): - mtime = sp.stat().st_mtime - if mtime >= tstart: # >= allows for poor clock resolution - tstart = mtime - last_statepoint = sp - - if apply_tally_results: - self.apply_tally_results(last_statepoint) - - return last_statepoint - - def calculate_volumes( - self, - threads: int | None = None, - output: bool = True, - cwd: PathLike = ".", - openmc_exec: PathLike = "openmc", - mpi_args: list[str] | None = None, - apply_volumes: bool = True, - export_model_xml: bool = True, - **export_kwargs, - ): - """Runs an OpenMC stochastic volume calculation and, if requested, - applies volumes to the model - - .. versionadded:: 0.13.0 - - Parameters - ---------- - threads : int, optional - Number of OpenMP threads. If OpenMC is compiled with OpenMP - threading enabled, the default is implementation-dependent but is - usually equal to the number of hardware threads available (or a - value set by the :envvar:`OMP_NUM_THREADS` environment variable). - This currenty only applies to the case when not using the C API. - output : bool, optional - Capture OpenMC output from standard out - openmc_exec : str, optional - Path to OpenMC executable. Defaults to 'openmc'. - This only applies to the case when not using the C API. - mpi_args : list of str, optional - MPI execute command and any additional MPI arguments to pass, - e.g. ['mpiexec', '-n', '8']. - This only applies to the case when not using the C API. - cwd : str, optional - Path to working directory to run in. Defaults to the current - working directory. - apply_volumes : bool, optional - Whether apply the volume calculation results from this calculation - to the model. Defaults to applying the volumes. - export_model_xml : bool, optional - Exports a single model.xml file rather than separate files. Defaults - to True. - **export_kwargs - Keyword arguments passed to either :meth:`Model.export_to_model_xml` - or :meth:`Model.export_to_xml`. - - """ - - if len(self.settings.volume_calculations) == 0: - # Then there is no volume calculation specified - raise ValueError("The Settings.volume_calculations attribute must" - " be specified before executing this method!") - - with change_directory(cwd): - if self.is_initialized: - if threads is not None: - msg = "Threads must be set via Model.is_initialized(...)" - raise ValueError(msg) - if mpi_args is not None: - msg = "The MPI environment must be set otherwise such as" \ - "with the call to mpi4py" - raise ValueError(msg) - - # Compute the volumes - openmc.lib.calculate_volumes(output) - - else: - if export_model_xml: - self.export_to_model_xml(**export_kwargs) - else: - self.export_to_xml(**export_kwargs) - path_input = export_kwargs.get("path", None) - openmc.calculate_volumes( - threads=threads, output=output, openmc_exec=openmc_exec, - mpi_args=mpi_args, path_input=path_input - ) - - # Now we apply the volumes - if apply_volumes: - # Load the results and add them to the model - for i, vol_calc in enumerate(self.settings.volume_calculations): - vol_calc.load_results(f"volume_{i + 1}.h5") - # First add them to the Python side - if vol_calc.domain_type == "material" and self.materials: - for material in self.materials: - if material.id in vol_calc.volumes: - material.add_volume_information(vol_calc) - else: - self.geometry.add_volume_information(vol_calc) - - # And now repeat for the C API - if self.is_initialized and vol_calc.domain_type == 'material': - # Then we can do this in the C API - for domain_id in vol_calc.ids: - openmc.lib.materials[domain_id].volume = \ - vol_calc.volumes[domain_id].n - - def _set_plot_defaults( - self, - origin: Sequence[float] | None, - width: Sequence[float] | None, - pixels: int | Sequence[int], - basis: str - ): - x, y, _ = _BASIS_INDICES[basis] - - bb = self.bounding_box - # checks to see if bounding box contains -inf or inf values - if np.isinf(bb.extent[basis]).any(): - if origin is None: - origin = (0, 0, 0) - if width is None: - width = (10, 10) - else: - if origin is None: - # if nan values in the bb.center they get replaced with 0.0 - # this happens when the bounding_box contains inf values - with warnings.catch_warnings(): - warnings.simplefilter("ignore", RuntimeWarning) - origin = np.nan_to_num(bb.center) - if width is None: - bb_width = bb.width - width = (bb_width[x], bb_width[y]) - - if isinstance(pixels, int): - aspect_ratio = width[0] / width[1] - pixels_y = math.sqrt(pixels / aspect_ratio) - pixels = (int(pixels / pixels_y), int(pixels_y)) - - return origin, width, pixels - - def id_map( - self, - origin: Sequence[float] | None = None, - width: Sequence[float] | None = None, - pixels: int | Sequence[int] = 40000, - basis: str = 'xy', - color_overlaps: bool = False, - **init_kwargs - ) -> np.ndarray: - """Generate an ID map for domains based on the plot parameters - - If the model is not yet initialized, it will be initialized with - openmc.lib. If the model is initialized, the model will remain - initialized after this method call exits. - - .. versionadded:: 0.15.3 - - Parameters - ---------- - origin : Sequence[float], optional - Origin of the plot. If unspecified, this argument defaults to the - center of the bounding box if the bounding box does not contain inf - values for the provided basis, otherwise (0.0, 0.0, 0.0). - width : Sequence[float], optional - Width of the plot. If unspecified, this argument defaults to the - width of the bounding box if the bounding box does not contain inf - values for the provided basis, otherwise (10.0, 10.0). - pixels : int | Sequence[int], optional - If an iterable of ints is provided then this directly sets the - number of pixels to use in each basis direction. If a single int is - provided then this sets the total number of pixels in the plot and - the number of pixels in each basis direction is calculated from this - total and the image aspect ratio based on the width argument. - basis : {'xy', 'yz', 'xz'}, optional - Basis of the plot. - color_overlaps : bool, optional - Whether to assign unique IDs (-3) to overlapping regions. If False, - overlapping regions will be assigned the ID of the lowest-numbered - cell that occupies that region. Defaults to False. - **init_kwargs - Keyword arguments passed to :meth:`Model.init_lib`. - - Returns - ------- - id_map : numpy.ndarray - A NumPy array with shape (vertical pixels, horizontal pixels, 3) of - OpenMC property IDs with dtype int32. The last dimension of the - array contains cell IDs, cell instances, and material IDs (in that - order). - """ - import openmc.lib - - origin, width, pixels = self._set_plot_defaults( - origin, width, pixels, basis) - - # initialize the openmc.lib.plot._PlotBase object - plot_obj = openmc.lib.plot._PlotBase() - plot_obj.origin = origin - plot_obj.width = width[0] - plot_obj.height = width[1] - plot_obj.h_res = pixels[0] - plot_obj.v_res = pixels[1] - plot_obj.basis = basis - plot_obj.color_overlaps = color_overlaps - - # Silence output by default. Also set arguments to start in volume - # calculation mode to avoid loading cross sections - init_kwargs.setdefault('output', False) - init_kwargs.setdefault('args', ['-c']) - - with openmc.lib.TemporarySession(self, **init_kwargs): - return openmc.lib.id_map(plot_obj) - - @add_plot_params - def plot( - self, - origin: Sequence[float] | None = None, - width: Sequence[float] | None = None, - pixels: int | Sequence[int] = 40000, - basis: str = 'xy', - color_by: str = 'cell', - colors: dict | None = None, - seed: int | None = None, - axes=None, - legend: bool = False, - axis_units: str = 'cm', - outline: bool | str = False, - show_overlaps: bool = False, - overlap_color: Sequence[int] | str = (255, 0, 0), - n_samples: int | None = None, - plane_tolerance: float = 1., - legend_kwargs: dict | None = None, - source_kwargs: dict | None = None, - contour_kwargs: dict | None = None, - **kwargs, - ): - """Display a slice plot of the model. - - .. versionadded:: 0.15.1 - """ - import matplotlib.patches as mpatches - import matplotlib.pyplot as plt - - check_type('n_samples', n_samples, int | None) - check_type('plane_tolerance', plane_tolerance, Real) - if legend_kwargs is None: - legend_kwargs = {} - legend_kwargs.setdefault('bbox_to_anchor', (1.05, 1)) - legend_kwargs.setdefault('loc', 2) - legend_kwargs.setdefault('borderaxespad', 0.0) - if source_kwargs is None: - source_kwargs = {} - source_kwargs.setdefault('marker', 'x') - - # Set indices using basis and create axis labels - x, y, z = _BASIS_INDICES[basis] - xlabel, ylabel = f'{basis[0]} [{axis_units}]', f'{basis[1]} [{axis_units}]' - - # Determine extents of plot - origin, width, pixels = self._set_plot_defaults( - origin, width, pixels, basis) - - axis_scaling_factor = {'km': 0.00001, 'm': 0.01, 'cm': 1, 'mm': 10} - - x_min = (origin[x] - 0.5*width[0]) * axis_scaling_factor[axis_units] - x_max = (origin[x] + 0.5*width[0]) * axis_scaling_factor[axis_units] - y_min = (origin[y] - 0.5*width[1]) * axis_scaling_factor[axis_units] - y_max = (origin[y] + 0.5*width[1]) * axis_scaling_factor[axis_units] - - # Get ID map from the C API - id_map = self.id_map( - origin=origin, - width=width, - pixels=pixels, - basis=basis, - color_overlaps=show_overlaps - ) - - # Generate colors if not provided - if colors is None and seed is not None: - # Use the colorize method to generate random colors - plot = openmc.SlicePlot() - plot.color_by = color_by - plot.colorize(self.geometry, seed=seed) - colors = plot.colors - - # Convert ID map to RGB image - img = id_map_to_rgb( - id_map=id_map, - color_by=color_by, - colors=colors, - overlap_color=overlap_color - ) - - # Create a figure sized such that the size of the axes within - # exactly matches the number of pixels specified - if axes is None: - px = 1/plt.rcParams['figure.dpi'] - fig, axes = plt.subplots() - axes.set_xlabel(xlabel) - axes.set_ylabel(ylabel) - params = fig.subplotpars - width_px = pixels[0]*px/(params.right - params.left) - height_px = pixels[1]*px/(params.top - params.bottom) - fig.set_size_inches(width_px, height_px) - - if outline: - # Combine R, G, B values into a single int for contour detection - rgb = (img * 256).astype(int) - image_value = (rgb[..., 0] << 16) + \ - (rgb[..., 1] << 8) + (rgb[..., 2]) - - # Set default arguments for contour() - if contour_kwargs is None: - contour_kwargs = {} - contour_kwargs.setdefault('colors', 'k') - contour_kwargs.setdefault('linestyles', 'solid') - contour_kwargs.setdefault('algorithm', 'serial') - - axes.contour( - image_value, - origin="upper", - levels=np.unique(image_value), - extent=(x_min, x_max, y_min, y_max), - **contour_kwargs - ) - - # If only showing outline, set the axis limits and aspect explicitly - if outline == 'only': - axes.set_xlim(x_min, x_max) - axes.set_ylim(y_min, y_max) - axes.set_aspect('equal') - - # Add legend showing which colors represent which material or cell - if legend: - if colors is None or len(colors) == 0: - raise ValueError("Must pass 'colors' dictionary if you " - "are adding a legend via legend=True.") - - if color_by == "cell": - expected_key_type = openmc.Cell - else: - expected_key_type = openmc.Material - - patches = [] - for key, color in colors.items(): - if isinstance(key, int): - raise TypeError( - "Cannot use IDs in colors dict for auto legend.") - elif not isinstance(key, expected_key_type): - raise TypeError( - "Color dict key type does not match color_by") - - # this works whether we're doing cells or materials - label = key.name if key.name != '' else key.id - - # matplotlib takes RGB on 0-1 scale rather than 0-255 - if len(color) == 3 and not isinstance(color, str): - scaled_color = ( - color[0]/255, color[1]/255, color[2]/255) - else: - scaled_color = color - - key_patch = mpatches.Patch(color=scaled_color, label=label) - patches.append(key_patch) - - axes.legend(handles=patches, **legend_kwargs) - - # Plot image and return the axes - if outline != 'only': - axes.imshow(img, extent=(x_min, x_max, y_min, y_max), **kwargs) - - if n_samples: - # Sample external source particles - particles = self.sample_external_source(n_samples) - - # Get points within tolerance of the slice plane - slice_value = origin[z] - xs = [] - ys = [] - tol = plane_tolerance - for particle in particles: - if (slice_value - tol < particle.r[z] < slice_value + tol): - xs.append(particle.r[x] * axis_scaling_factor[axis_units]) - ys.append(particle.r[y] * axis_scaling_factor[axis_units]) - axes.scatter(xs, ys, **source_kwargs) - - return axes - - def sample_external_source( - self, - n_samples: int = 1000, - prn_seed: int | None = None, - **init_kwargs - ) -> openmc.ParticleList: - """Sample external source and return source particles. - - .. versionadded:: 0.15.1 - - Parameters - ---------- - n_samples : int - Number of samples - prn_seed : int - Pseudorandom number generator (PRNG) seed; if None, one will be - generated randomly. - **init_kwargs - Keyword arguments passed to :func:`openmc.lib.init` - - Returns - ------- - openmc.ParticleList - List of samples source particles - """ - import openmc.lib - - # Silence output by default. Also set arguments to start in volume - # calculation mode to avoid loading cross sections - init_kwargs.setdefault('output', False) - init_kwargs.setdefault('args', ['-c']) - - with openmc.lib.TemporarySession(self, **init_kwargs): - return openmc.lib.sample_external_source( - n_samples=n_samples, prn_seed=prn_seed - ) - - def apply_tally_results(self, statepoint: PathLike | openmc.StatePoint): - """Apply results from a statepoint to tally objects on the Model - - Parameters - ---------- - statepoint : PathLike or openmc.StatePoint - Statepoint file used to update tally results - """ - self.tallies.add_results(statepoint) - - def plot_geometry( - self, - output: bool = True, - cwd: PathLike = ".", - openmc_exec: PathLike = "openmc", - export_model_xml: bool = True, - **export_kwargs, - ): - """Creates plot images as specified by the Model.plots attribute - - .. versionadded:: 0.13.0 - - Parameters - ---------- - output : bool, optional - Capture OpenMC output from standard out - cwd : PathLike, optional - Path to working directory to run in. Defaults to the current - working directory. - openmc_exec : PathLike, optional - Path to OpenMC executable. Defaults to 'openmc'. - This only applies to the case when not using the C API. - export_model_xml : bool, optional - Exports a single model.xml file rather than separate files. Defaults - to True. - **export_kwargs - Keyword arguments passed to either :meth:`Model.export_to_model_xml` - or :meth:`Model.export_to_xml`. - - """ - - if len(self.plots) == 0: - # Then there is no volume calculation specified - raise ValueError("The Model.plots attribute must be specified " - "before executing this method!") - - with change_directory(cwd): - if self.is_initialized: - # Compute the volumes - openmc.lib.plot_geometry(output) - else: - if export_model_xml: - self.export_to_model_xml(**export_kwargs) - else: - self.export_to_xml(**export_kwargs) - path_input = export_kwargs.get("path", None) - openmc.plot_geometry(output=output, openmc_exec=openmc_exec, - path_input=path_input) - - def _change_py_lib_attribs( - self, - names_or_ids: Iterable[str] | Iterable[int], - value: float | Iterable[float], - obj_type: str, - attrib_name: str, - density_units: str = "atom/b-cm", - ): - # Method to do the same work whether it is a cell or material and - # a temperature or volume - check_type('names_or_ids', names_or_ids, Iterable, (Integral, str)) - check_type('obj_type', obj_type, str) - obj_type = obj_type.lower() - check_value('obj_type', obj_type, ('material', 'cell')) - check_value('attrib_name', attrib_name, - ('temperature', 'volume', 'density', 'rotation', - 'translation')) - # The C API only allows setting density units of atom/b-cm and g/cm3 - check_value('density_units', density_units, ('atom/b-cm', 'g/cm3')) - # The C API has no way to set cell volume or material temperature - # so lets raise exceptions as needed - if obj_type == 'cell' and attrib_name == 'volume': - raise NotImplementedError( - 'Setting a Cell volume is not supported!') - if obj_type == 'material' and attrib_name == 'temperature': - raise NotImplementedError( - 'Setting a material temperature is not supported!') - - # And some items just dont make sense - if obj_type == 'cell' and attrib_name == 'density': - raise ValueError('Cannot set a Cell density!') - if obj_type == 'material' and attrib_name in ('rotation', - 'translation'): - raise ValueError('Cannot set a material rotation/translation!') - - # Set the - if obj_type == 'cell': - by_name = self._cells_by_name - by_id = self._cells_by_id - if self.is_initialized: - obj_by_id = openmc.lib.cells - else: - by_name = self._materials_by_name - by_id = self._materials_by_id - if self.is_initialized: - obj_by_id = openmc.lib.materials - # Get the list of ids to use if converting from names and accepting - # only values that have actual ids - ids = [] - for name_or_id in names_or_ids: - if isinstance(name_or_id, Integral): - if name_or_id in by_id: - ids.append(int(name_or_id)) - else: - cap_obj = obj_type.capitalize() - msg = f'{cap_obj} ID {name_or_id} " \ - "is not present in the model!' - raise InvalidIDError(msg) - elif isinstance(name_or_id, str): - if name_or_id in by_name: - # Then by_name[name_or_id] is a list so we need to add all - # entries - ids.extend([obj.id for obj in by_name[name_or_id]]) - else: - cap_obj = obj_type.capitalize() - msg = f'{cap_obj} {name_or_id} " \ - "is not present in the model!' - raise InvalidIDError(msg) - - # Now perform the change to both python and C API - for id_ in ids: - obj = by_id[id_] - if attrib_name == 'density': - obj.set_density(density_units, value) - else: - setattr(obj, attrib_name, value) - # Next lets keep what is in C API memory up to date as well - if self.is_initialized: - lib_obj = obj_by_id[id_] - if attrib_name == 'density': - lib_obj.set_density(value, density_units) - elif attrib_name == 'temperature': - lib_obj.set_temperature(value) - else: - setattr(lib_obj, attrib_name, value) - - def rotate_cells( - self, names_or_ids: Iterable[str] | Iterable[int], vector: Iterable[float] - ): - """Rotate the identified cell(s) by the specified rotation vector. - The rotation is only applied to cells filled with a universe. - - .. note:: If applying this change to a name that is not unique, then - the change will be applied to all objects of that name. - - .. versionadded:: 0.13.0 - - Parameters - ---------- - names_or_ids : Iterable of str or int - The cell names (if str) or id (if int) that are to be translated - or rotated. This parameter can include a mix of names and ids. - vector : Iterable of float - The rotation vector of length 3 to apply. This array specifies the - angles in degrees about the x, y, and z axes, respectively. - - """ - - self._change_py_lib_attribs(names_or_ids, vector, 'cell', 'rotation') - - def translate_cells( - self, names_or_ids: Iterable[str] | Iterable[int], vector: Iterable[float] - ): - """Translate the identified cell(s) by the specified translation vector. - The translation is only applied to cells filled with a universe. - - .. note:: If applying this change to a name that is not unique, then - the change will be applied to all objects of that name. - - .. versionadded:: 0.13.0 - - Parameters - ---------- - names_or_ids : Iterable of str or int - The cell names (if str) or id (if int) that are to be translated - or rotated. This parameter can include a mix of names and ids. - vector : Iterable of float - The translation vector of length 3 to apply. This array specifies - the x, y, and z dimensions of the translation. - - """ - - self._change_py_lib_attribs(names_or_ids, vector, 'cell', - 'translation') - - def update_densities( - self, - names_or_ids: Iterable[str] | Iterable[int], - density: float, - density_units: str = "atom/b-cm", - ): - """Update the density of a given set of materials to a new value - - .. note:: If applying this change to a name that is not unique, then - the change will be applied to all objects of that name. - - .. versionadded:: 0.13.0 - - Parameters - ---------- - names_or_ids : Iterable of str or int - The material names (if str) or id (if int) that are to be updated. - This parameter can include a mix of names and ids. - density : float - The density to apply in the units specified by `density_units` - density_units : {'atom/b-cm', 'g/cm3'}, optional - Units for `density`. Defaults to 'atom/b-cm' - - """ - - self._change_py_lib_attribs(names_or_ids, density, 'material', - 'density', density_units) - - def update_cell_temperatures( - self, names_or_ids: Iterable[str] | Iterable[int], temperature: float - ): - """Update the temperature of a set of cells to the given value - - .. note:: If applying this change to a name that is not unique, then - the change will be applied to all objects of that name. - - .. versionadded:: 0.13.0 - - Parameters - ---------- - names_or_ids : Iterable of str or int - The cell names (if str) or id (if int) that are to be updated. - This parameter can include a mix of names and ids. - temperature : float - The temperature to apply in units of Kelvin - - """ - - self._change_py_lib_attribs(names_or_ids, temperature, 'cell', - 'temperature') - - def update_material_volumes( - self, names_or_ids: Iterable[str] | Iterable[int], volume: float - ): - """Update the volume of a set of materials to the given value - - .. note:: If applying this change to a name that is not unique, then - the change will be applied to all objects of that name. - - .. versionadded:: 0.13.0 - - Parameters - ---------- - names_or_ids : Iterable of str or int - The material names (if str) or id (if int) that are to be updated. - This parameter can include a mix of names and ids. - volume : float - The volume to apply in units of cm^3 - - """ - - self._change_py_lib_attribs(names_or_ids, volume, 'material', 'volume') - - def differentiate_depletable_mats(self, diff_volume_method: str = None): - """Assign distribmats for each depletable material - - .. versionadded:: 0.14.0 - - .. versionchanged:: 0.15.1 - diff_volume_method default is None, do not set volumes on the new - material ovjects. Is now a convenience method for - differentiate_mats(diff_volume_method, depletable_only=True) - - Parameters - ---------- - diff_volume_method : str - Specifies how the volumes of the new materials should be found. - - None: Do not assign volumes to the new materials (Default) - - 'divide equally': Divide the original material volume equally between the new materials - - 'match cell': Set the volume of the material to the volume of the cell they fill - """ - self.differentiate_mats(diff_volume_method, depletable_only=True) - - def differentiate_mats(self, diff_volume_method: str = None, depletable_only: bool = True): - """Assign distribmats for each material - - .. versionadded:: 0.15.1 - - Parameters - ---------- - diff_volume_method : str - Specifies how the volumes of the new materials should be found. - - None: Do not assign volumes to the new materials (Default) - - 'divide equally': Divide the original material volume equally between the new materials - - 'match cell': Set the volume of the material to the volume of the cell they fill - depletable_only : bool - Default is True, only depletable materials will be differentiated. If False, all materials will be - differentiated. - """ - check_value('volume differentiation method', - diff_volume_method, ("divide equally", "match cell", None)) - - # Count the number of instances for each cell and material - self.geometry.determine_paths(instances_only=True) - - # Get list of materials - if self.materials: - materials = self.materials - else: - materials = list(self.geometry.get_all_materials().values()) - - # Find all or depletable_only materials which have multiple instance - distribmats = set() - for mat in materials: - # Differentiate all materials with multiple instances - diff_mat = mat.num_instances > 1 - # If depletable_only is True, differentiate only depletable materials - if depletable_only: - diff_mat = diff_mat and mat.depletable - if diff_mat: - # Assign volumes to the materials according to requirements - if diff_volume_method == "divide equally": - if mat.volume is None: - raise RuntimeError( - "Volume not specified for " - f"material with ID={mat.id}.") - else: - mat.volume /= mat.num_instances - elif diff_volume_method == "match cell": - for cell in self.geometry.get_all_material_cells().values(): - if cell.fill == mat: - if not cell.volume: - raise ValueError( - f"Volume of cell ID={cell.id} not specified. " - "Set volumes of cells prior to using " - "diff_volume_method='match cell'.") - distribmats.add(mat) - - if not distribmats: - return - - # Assign distribmats to cells - for cell in self.geometry.get_all_material_cells().values(): - if cell.fill in distribmats: - mat = cell.fill - - # Clone materials - if cell.num_instances > 1: - cell.fill = [mat.clone() - for _ in range(cell.num_instances)] - else: - cell.fill = mat.clone() - - # For 'match cell', assign volumes based on the cells - if diff_volume_method == 'match cell': - if cell.fill_type == 'distribmat': - for clone_mat in cell.fill: - clone_mat.volume = cell.volume - else: - cell.fill.volume = cell.volume - - if self.materials is not None: - self.materials = openmc.Materials( - self.geometry.get_all_materials().values() - ) - - def _auto_generate_mgxs_lib( - self, - model: openmc.model.model, - energy_groups: openmc.mgxs.EnergyGroups, - correction: str | none, - directory: pathlike, - kinetic: bool | None = None, - num_delayed_groups: int = 0, - ) -> openmc.mgxs.Library: - """ - Automatically generate a multi-group cross section libray from a model - with the specified group structure. - - Parameters - ---------- - energy_groups : openmc.mgxs.EnergyGroups - Energy group structure for the MGXS. - nparticles : int - Number of particles to simulate per batch when generating MGXS. - mgxs_path : str - Filename for the MGXS HDF5 file. - correction : str - Transport correction to apply to the MGXS. Options are None and - "P0". - directory : str - Directory to run the simulation in, so as to contain XML files. - kinetic : bool, optional - Flag to indicate if kinetic simulation cross sections are needed. - num_delayed_groups : int, optional - Number of delayed groups for kinetic simulations. - - Returns - ------- - mgxs_lib : openmc.mgxs.Library - OpenMC MGXS Library object - """ - - # Initialize MGXS library with a finished OpenMC geometry object - mgxs_lib = openmc.mgxs.Library(model.geometry) - - # Pick energy group structure - mgxs_lib.energy_groups = energy_groups - - if (kinetic): - mgxs_lib.num_delayed_groups = num_delayed_groups - - # Disable transport correction - mgxs_lib.correction = correction - - # Specify needed cross sections for random ray - if correction == 'P0': - mgxs_lib.mgxs_types = [ - 'nu-transport', 'absorption', 'nu-fission', 'fission', - 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' - ] - elif correction is None: - mgxs_lib.mgxs_types = [ - 'total', 'absorption', 'nu-fission', 'fission', - 'consistent nu-scatter matrix', 'multiplicity matrix', 'chi' - ] - if kinetic: - mgxs_lib.mgxs_types += ['chi-prompt', 'chi-delayed', - 'decay-rate', 'inverse-velocity', 'beta'] - - # Specify a "cell" domain type for the cross section tally filters - mgxs_lib.domain_type = "material" - - # Specify the cell domains over which to compute multi-group cross sections - mgxs_lib.domains = model.geometry.get_all_materials().values() - - # Do not compute cross sections on a nuclide-by-nuclide basis - mgxs_lib.by_nuclide = False - - # Check the library - if no errors are raised, then the library is satisfactory. - mgxs_lib.check_library_for_openmc_mgxs() - - # Construct all tallies needed for the multi-group cross section library - mgxs_lib.build_library() - - # Create a "tallies.xml" file for the MGXS Library - mgxs_lib.add_to_tallies(model.tallies, merge=True) - - # Run - statepoint_filename = model.run(cwd=directory) - - # Load MGXS - with openmc.StatePoint(statepoint_filename) as sp: - mgxs_lib.load_from_statepoint(sp) - - return mgxs_lib - - def _create_mgxs_sources( - self, - energy_groups: openmc.mgxs.EnergyGroups, - spatial_dist: openmc.stats.Spatial, - source_energy: openmc.stats.Univariate | None = None, - ) -> list[openmc.IndependentSource]: - """Create a list of independent sources to use with MGXS generation. - - Note that in all cases, a discrete source that is uniform over all - energy groups is created (strength = 0.01) to ensure that total cross - sections are generated for all energy groups. In the case that the user - has provided a source_energy distribution as an argument, an additional - source (strength = 0.99) is created using that energy distribution. If - the user has not provided a source_energy distribution, but the model - has sources defined, and all of those sources are of IndependentSource - type, then additional sources are created based on the model's existing - sources, keeping their energy distributions but replacing their - spatial/angular distributions, with their combined strength being 0.99. - If the user has not provided a source_energy distribution and no sources - are defined on the model and the run mode is 'eigenvalue', then a - default Watt spectrum source (strength = 0.99) is added. - - Parameters - ---------- - energy_groups : openmc.mgxs.EnergyGroups - Energy group structure for the MGXS. - spatial_dist : openmc.stats.Spatial - Spatial distribution to use for all sources. - source_energy : openmc.stats.Univariate, optional - Energy distribution to use when generating MGXS data, replacing any - existing sources in the model. - - Returns - ------- - list[openmc.IndependentSource] - A list of independent sources to use for MGXS generation. - """ - # Make a discrete source that is uniform over the bins of the group structure - midpoints = [] - strengths = [] - for i in range(energy_groups.num_groups): - bounds = energy_groups.get_group_bounds(i+1) - midpoints.append((bounds[0] + bounds[1]) / 2.0) - strengths.append(1.0) - - uniform_energy = openmc.stats.Discrete(x=midpoints, p=strengths) - uniform_distribution = openmc.IndependentSource( - spatial_dist, energy=uniform_energy, strength=0.01) - sources = [uniform_distribution] - - # If the user provided an energy distribution, use that - if source_energy is not None: - user_energy = openmc.IndependentSource( - space=spatial_dist, energy=source_energy, strength=0.99) - sources.append(user_energy) - - # If the user did not provide an energy distribution, create sources - # based on what is in their model, keeping the energy spectrum but - # replacing the spatial/angular distributions. We only do this if ALL - # sources are of IndependentSource type, as we can't pull the energy - # distribution from e.g. CompiledSource or FileSource types. - else: - if self.settings.source is not None: - for src in self.settings.source: - if not isinstance(src, openmc.IndependentSource): - break - else: - n_user_sources = len(self.settings.source) - for src in self.settings.source: - # Create a new IndependentSource with adjusted strength, space, and angle - user_source = openmc.IndependentSource( - space=spatial_dist, - energy=src.energy, - strength=0.99 / n_user_sources - ) - sources.append(user_source) - else: - # No user sources defined. If we are in eigenvalue mode, then use the default Watt spectrum. - if self.settings.run_mode == 'eigenvalue': - watt_energy = openmc.stats.Watt() - watt_source = openmc.IndependentSource( - space=spatial_dist, energy=watt_energy, strength=0.99) - sources.append(watt_source) - - return sources - - def _generate_infinite_medium_mgxs( - self, - energy_groups: openmc.mgxs.EnergyGroups, - nparticles: int, - mgxs_path: PathLike, - correction: str | None, - directory: PathLike, - source_energy: openmc.stats.Univariate | None = None, - kinetic: bool | None = None, - num_delayed_groups: int = 0, - ): - """Generate a MGXS library by running multiple OpenMC simulations, each - representing an infinite medium simulation of a single isolated - material. A discrete source is used to sample particles, with an equal - strength spread across each of the energy groups. This is a highly naive - method that ignores all spatial self shielding effects and all resonance - shielding effects between materials. - - Note that in all cases, a discrete source that is uniform over all - energy groups is created (strength = 0.01) to ensure that total cross - sections are generated for all energy groups. In the case that the user - has provided a source_energy distribution as an argument, an additional - source (strength = 0.99) is created using that energy distribution. If - the user has not provided a source_energy distribution, but the model - has sources defined, and all of those sources are of IndependentSource - type, then additional sources are created based on the model's existing - sources, keeping their energy distributions but replacing their - spatial/angular distributions, with their combined strength being 0.99. - If the user has not provided a source_energy distribution and no sources - are defined on the model and the run mode is 'eigenvalue', then a - default Watt spectrum source (strength = 0.99) is added. - - Parameters - ---------- - energy_groups : openmc.mgxs.EnergyGroups - Energy group structure for the MGXS. - nparticles : int - Number of particles to simulate per batch when generating MGXS. - mgxs_path : str - Filename for the MGXS HDF5 file. - correction : str - Transport correction to apply to the MGXS. Options are None and - "P0". - directory : str - Directory to run the simulation in, so as to contain XML files. - source_energy : openmc.stats.Univariate, optional - Energy distribution to use when generating MGXS data, replacing any - existing sources in the model. - kinetic : bool, optional - Flag to indicate if kinetic simulation cross sections are needed. - num_delayed_groups : int, optional - Number of delayed groups for kinetic simulations. - - """ - mgxs_sets = [] - for material in self.materials: - model = openmc.Model() - - # Set materials on the model - model.materials = [material] - - # Settings - model.settings.batches = 100 - model.settings.particles = nparticles - - model.settings.source = self._create_mgxs_sources( - energy_groups, - spatial_dist=openmc.stats.Point(), - source_energy=source_energy - ) - - model.settings.run_mode = 'fixed source' - model.settings.create_fission_neutrons = False - - model.settings.output = {'summary': True, 'tallies': False} - - # Geometry - box = openmc.model.RectangularPrism( - 100000.0, 100000.0, boundary_type='reflective') - name = material.name - infinite_cell = openmc.Cell(name=name, fill=material, region=-box) - infinite_universe = openmc.Universe( - name=name, cells=[infinite_cell]) - model.geometry.root_universe = infinite_universe - - # Add MGXS Tallies - mgxs_lib = self._auto_generate_mgxs_lib( - model, energy_groups, correction, directory, kinetic, num_delayed_groups) - - # Create a MGXS File which can then be written to disk - mgxs_set = mgxs_lib.get_xsdata(domain=material, xsdata_name=name) - mgxs_sets.append(mgxs_set) - - # Write the file to disk - mgxs_file = openmc.MGXSLibrary( - energy_groups=energy_groups, num_delayed_groups=num_delayed_groups) - for mgxs_set in mgxs_sets: - mgxs_file.add_xsdata(mgxs_set) - mgxs_file.export_to_hdf5(mgxs_path) - - @staticmethod - def _create_stochastic_slab_geometry( - materials: Sequence[openmc.Material], - cell_thickness: float = 1.0, - num_repeats: int = 100, - ) -> tuple[openmc.Geometry, openmc.stats.Box]: - """Create a geometry representing a stochastic "sandwich" of materials in a - layered slab geometry. To reduce the impact of the order of materials in - the slab, the materials are applied to 'num_repeats' different randomly - positioned layers of 'cell_thickness' each. - - Parameters - ---------- - materials : list of openmc.Material - List of materials to assign. Each material will appear exactly num_repeats times, - then the ordering is randomly shuffled. - cell_thickness : float, optional - Thickness of each lattice cell in x (default 1.0 cm). - num_repeats : int, optional - Number of repeats for each material (default 100). - - Returns - ------- - geometry : openmc.Geometry - The constructed geometry. - box : openmc.stats.Box - A spatial sampling distribution covering the full slab domain. - """ - if not materials: - raise ValueError("At least one material must be provided.") - - num_materials = len(materials) - total_cells = num_materials * num_repeats - total_width = total_cells * cell_thickness - - # Generate an infinite cell/universe for each material - universes = [] - for i in range(num_materials): - cell = openmc.Cell(fill=materials[i]) - universes.append(openmc.Universe(cells=[cell])) - - # Make a list of randomized material idx assignments for the stochastic slab - assignments = list(range(num_materials)) * num_repeats - random.seed(42) - random.shuffle(assignments) - - # Create a list of the (randomized) universe assignments to be used - # when defining the problem lattice. - lattice_entries = [universes[m] for m in assignments] - - # Create the RectLattice for the 1D material variation in x. - lattice = openmc.RectLattice() - lattice.pitch = (cell_thickness, total_width, total_width) - lattice.lower_left = (0.0, 0.0, 0.0) - lattice.universes = [[lattice_entries]] - lattice.outer = universes[0] - - # Define the six outer surfaces with reflective boundary conditions - rpp = openmc.model.RectangularParallelepiped( - 0.0, total_width, 0.0, total_width, 0.0, total_width, - boundary_type='reflective' - ) - - # Create an outer cell that fills with the lattice. - outer_cell = openmc.Cell(fill=lattice, region=-rpp) - - # Build the geometry - geometry = openmc.Geometry([outer_cell]) - - # Define the spatial distribution that covers the full cubic domain - box = openmc.stats.Box(*outer_cell.bounding_box) - - return geometry, box - - def _generate_stochastic_slab_mgxs( - self, - energy_groups: openmc.mgxs.EnergyGroups, - nparticles: int, - mgxs_path: PathLike, - correction: str | None, - directory: PathLike, - source_energy: openmc.stats.Univariate | None = None, - kinetic: bool | None = None, - num_delayed_groups: int = 0, - ) -> None: - """Generate MGXS assuming a stochastic "sandwich" of materials in a layered - slab geometry. While geometry-specific spatial shielding effects are not - captured, this method can be useful when the geometry has materials only - found far from the source region that the "material_wise" method would - not be capable of generating cross sections for. Conversely, this method - will generate cross sections for all materials in the problem regardless - of type. If this is a fixed source problem, a discrete source is used to - sample particles, with an equal strength spread across each of the - energy groups. - - Parameters - ---------- - energy_groups : openmc.mgxs.EnergyGroups - Energy group structure for the MGXS. - nparticles : int - Number of particles to simulate per batch when generating MGXS. - mgxs_path : str - Filename for the MGXS HDF5 file. - correction : str - Transport correction to apply to the MGXS. Options are None and - "P0". - directory : str - Directory to run the simulation in, so as to contain XML files. - source_energy : openmc.stats.Univariate, optional - Energy distribution to use when generating MGXS data, replacing any - existing sources in the model. In all cases, a discrete source that - is uniform over all energy groups is created (strength = 0.01) to - ensure that total cross sections are generated for all energy - groups. In the case that the user has provided a source_energy - distribution as an argument, an additional source (strength = 0.99) - is created using that energy distribution. If the user has not - provided a source_energy distribution, but the model has sources - defined, and all of those sources are of IndependentSource type, - then additional sources are created based on the model's existing - sources, keeping their energy distributions but replacing their - spatial/angular distributions, with their combined strength being - 0.99. If the user has not provided a source_energy distribution and - no sources are defined on the model and the run mode is - 'eigenvalue', then a default Watt spectrum source (strength = 0.99) - is added. - kinetic : bool, optional - Flag to indicate if kinetic simulation cross sections are needed. - num_delayed_groups : int, optional - Number of delayed groups for kinetic simulations. - - """ - model = openmc.Model() - model.materials = self.materials - - # Settings - model.settings.batches = 200 - model.settings.inactive = 100 - model.settings.particles = nparticles - model.settings.output = {'summary': True, 'tallies': False} - - # Stochastic slab geometry - model.geometry, spatial_distribution = Model._create_stochastic_slab_geometry( - model.materials) - - # Define the sources - model.settings.source = self._create_mgxs_sources( - energy_groups, - spatial_dist=spatial_distribution, - source_energy=source_energy - ) - - model.settings.run_mode = 'fixed source' - model.settings.create_fission_neutrons = False - - model.settings.output = {'summary': True, 'tallies': False} - - # Add MGXS Tallies - mgxs_lib = self._auto_generate_mgxs_lib( - model, energy_groups, correction, directory, kinetic, num_delayed_groups) - - names = [mat.name for mat in mgxs_lib.domains] - - # Create a MGXS File which can then be written to disk - mgxs_file = mgxs_lib.create_mg_library( - xs_type='macro', xsdata_names=names) - mgxs_file.export_to_hdf5(mgxs_path) - - def _generate_material_wise_mgxs( - self, - energy_groups: openmc.mgxs.EnergyGroups, - nparticles: int, - mgxs_path: PathLike, - correction: str | None, - directory: PathLike, - kinetic: bool | None = None, - num_delayed_groups: int = 0, - ) -> None: - """Generate a material-wise MGXS library for the model by running the - original continuous energy OpenMC simulation of the full material - geometry and source, and tally MGXS data for each material. This method - accurately conserves reaction rates totaled over the entire simulation - domain. However, when the geometry has materials only found far from the - source region, it is possible the Monte Carlo solver may not be able to - score any tallies to these material types, thus resulting in zero cross - section values for these materials. For such cases, the "stochastic - slab" method may be more appropriate. - - Parameters - ---------- - energy_groups : openmc.mgxs.EnergyGroups - Energy group structure for the MGXS. - nparticles : int - Number of particles to simulate per batch when generating MGXS. - mgxs_path : PathLike - Filename for the MGXS HDF5 file. - correction : str - Transport correction to apply to the MGXS. Options are None and - "P0". - directory : PathLike - Directory to run the simulation in, so as to contain XML files. - kinetic : bool, optional - Flag to indicate if kinetic simulation cross sections are needed. - num_delayed_groups : int, optional - Number of delayed groups for kinetic simulations. - - """ - model = copy.deepcopy(self) - model.tallies = openmc.Tallies() - - # Settings - model.settings.batches = 200 - model.settings.inactive = 100 - model.settings.particles = nparticles - model.settings.output = {'summary': True, 'tallies': False} - - # Add MGXS Tallies - mgxs_lib = self._auto_generate_mgxs_lib( - model, energy_groups, correction, directory, kinetic, num_delayed_groups) - - names = [mat.name for mat in mgxs_lib.domains] - - # Create a MGXS File which can then be written to disk - mgxs_file = mgxs_lib.create_mg_library( - xs_type='macro', xsdata_names=names) - mgxs_file.export_to_hdf5(mgxs_path) - - def convert_to_multigroup( - self, - method: str = "material_wise", - energy_groups: str = "CASMO-2", - nparticles: int = 2000, - overwrite_mgxs_library: bool = False, - mgxs_path: PathLike = "mgxs.h5", - correction: str | None = None, - source_energy: openmc.stats.Univariate | None = None, - kinetic: bool | None = None, - num_delayed_groups: int = 0, - ): - """Convert all materials from continuous energy to multigroup. - - If no MGXS data library file is found, generate one using one or more - continuous energy Monte Carlo simulations. - - Parameters - ---------- - method : {"material_wise", "stochastic_slab", "infinite_medium"}, optional - Method to generate the MGXS. - energy_groups : openmc.mgxs.EnergyGroups or str, optional - Energy group structure for the MGXS or the name of the group - structure (based on keys from openmc.mgxs.GROUP_STRUCTURES). - nparticles : int, optional - Number of particles to simulate per batch when generating MGXS. - overwrite_mgxs_library : bool, optional - Whether to overwrite an existing MGXS library file. - mgxs_path : str, optional - Path to the mgxs.h5 library file. - correction : str, optional - Transport correction to apply to the MGXS. Options are None and - "P0". - source_energy : openmc.stats.Univariate, optional - Energy distribution to use when generating MGXS data, replacing any - existing sources in the model. In all cases, a discrete source that - is uniform over all energy groups is created (strength = 0.01) to - ensure that total cross sections are generated for all energy - groups. In the case that the user has provided a source_energy - distribution as an argument, an additional source (strength = 0.99) - is created using that energy distribution. If the user has not - provided a source_energy distribution, but the model has sources - defined, and all of those sources are of IndependentSource type, - then additional sources are created based on the model's existing - sources, keeping their energy distributions but replacing their - spatial/angular distributions, with their combined strength being - 0.99. If the user has not provided a source_energy distribution and - no sources are defined on the model and the run mode is - 'eigenvalue', then a default Watt spectrum source (strength = 0.99) - is added. Note that this argument is only used when using the - "stochastic_slab" or "infinite_medium" MGXS generation methods. - kinetic : bool, optional - Flag to indicate if kinetic simulation cross sections are needed. - num_delayed_groups : int, optional - Number of delayed groups for kinetic simulations. - """ - if isinstance(energy_groups, str): - energy_groups = openmc.mgxs.EnergyGroups(energy_groups) - - # Do all work (including MGXS generation) in a temporary directory - # to avoid polluting the working directory with residual XML files - with TemporaryDirectory() as tmpdir: - - # Determine if there are DAGMC universes in the model. If so, we need to synchronize - # the dagmc materials with cells. - # TODO: Can this be done without having to init/finalize? - for univ in self.geometry.get_all_universes().values(): - if isinstance(univ, openmc.DAGMCUniverse): - self.init_lib(directory=tmpdir) - self.sync_dagmc_universes() - self.finalize_lib() - break - - # Make sure all materials have a name, and that the name is a valid HDF5 - # dataset name - for material in self.materials: - if not material.name or not material.name.strip(): - material.name = f"material {material.id}" - material.name = re.sub(r'[^a-zA-Z0-9]', '_', material.name) - - # If needed, generate the needed MGXS data library file - if not Path(mgxs_path).is_file() or overwrite_mgxs_library: - if method == "infinite_medium": - self._generate_infinite_medium_mgxs( - energy_groups, nparticles, mgxs_path, correction, tmpdir, source_energy, kinetic, num_delayed_groups) - elif method == "material_wise": - self._generate_material_wise_mgxs( - energy_groups, nparticles, mgxs_path, correction, tmpdir, kinetic, num_delayed_groups) - elif method == "stochastic_slab": - self._generate_stochastic_slab_mgxs( - energy_groups, nparticles, mgxs_path, correction, tmpdir, source_energy, kinetic, num_delayed_groups) - else: - raise ValueError( - f'MGXS generation method "{method}" not recognized') - else: - print(f'Existing MGXS library file "{mgxs_path}" will be used') - - # Convert all continuous energy materials to multigroup - self.materials.cross_sections = mgxs_path - for material in self.materials: - material.set_density('macro', 1.0) - material._nuclides = [] - material._sab = [] - material.add_macroscopic(material.name) - - self.settings.energy_mode = 'multi-group' - - # If making a set the time step size to 0.01 - if kinetic: - self.settings.kinetic_simulation = True - warnings.warn("Kinetic model. Currently, only the random ray solver" - " supports kinetic simulations. The number of time" - " steps to run and material density transient using " - " openmc.Settings.timestep_parameters['n_timesteps'] " - " and openmc.Material.set_density(), respectively.") - self.settings.timestep_parameters = { - 'dt': 0.01, 'timestep_units': 's'} - - def convert_to_random_ray(self): - """Convert a multigroup model to use random ray. - - This method determines values for the needed settings and adds them to - the settings.random_ray dictionary so as to enable random ray mode. The - settings that are populated are: - - - 'ray_source' (openmc.IndependentSource): Where random ray starting - points are sampled from. - - 'distance_inactive' (float): The "dead zone" distance at the beginning - of the ray. - - 'distance_active' (float): The "active" distance of the ray - - 'particles' (int): Number of rays to simulate - - The method will determine reasonable defaults for each of the above - variables based on analysis of the model's geometry. The function will - have no effect if the random ray dictionary is already defined in the - model settings. - """ - # If the random ray dictionary is already set, don't overwrite it - if self.settings.random_ray: - warnings.warn("Random ray conversion skipped as " - "settings.random_ray dictionary is already set.") - return - - if self.settings.energy_mode != 'multi-group': - raise ValueError( - "Random ray conversion failed: energy mode must be " - "'multi-group'. Use convert_to_multigroup() first." - ) - - # Helper function for detecting infinity - def _replace_infinity(value): - if np.isinf(value): - return 1.0 if value > 0 else -1.0 - return value - - # Get a bounding box for sampling rays. We can utilize the geometry's bounding box - # though for 2D problems we need to detect the infinities and replace them with an - # arbitrary finite value. - bounding_box = self.geometry.bounding_box - lower_left = [_replace_infinity(v) for v in bounding_box.lower_left] - upper_right = [_replace_infinity(v) for v in bounding_box.upper_right] - uniform_dist_ray = openmc.stats.Box(lower_left, upper_right) - rr_source = openmc.IndependentSource(space=uniform_dist_ray) - self.settings.random_ray['ray_source'] = rr_source - - # For the dead zone and active length, a reasonable guess is the larger of either: - # 1) The maximum chord length through the geometry (as defined by its bounding box) - # 2) 30 cm - # Then, set the active length to be 5x longer than the dead zone length, for the sake of efficiency. - chord_length = np.array(upper_right) - np.array(lower_left) - max_length = max(np.linalg.norm(chord_length), 30.0) - - self.settings.random_ray['distance_inactive'] = max_length - self.settings.random_ray['distance_active'] = 5 * max_length - - # Take a wild guess as to how many rays are needed - self.settings.particles = 2 * int(max_length) - - def keff_search( - self, - func: ModelModifier, - x0: float, - x1: float, - target: float = 1.0, - k_tol: float = 1e-4, - sigma_final: float = 3e-4, - p: float = 0.5, - q: float = 0.95, - memory: int = 4, - x_min: float | None = None, - x_max: float | None = None, - b0: int | None = None, - b_min: int = 20, - b_max: int | None = None, - maxiter: int = 50, - output: bool = False, - func_kwargs: dict[str, Any] | None = None, - run_kwargs: dict[str, Any] | None = None, - ) -> SearchResult: - r"""Perform a keff search on a model parametrized by a single variable. - - This method uses the GRsecant method described in a paper by `Price and - Roskoff `_. The GRsecant - method is a modification of the secant method that accounts for - uncertainties in the function evaluations. The method uses a weighted - linear fit of the most recent function evaluations to predict the next - point to evaluate. It also adaptively changes the number of batches to - meet the target uncertainty value at each iteration. - - The target uncertainty for iteration :math:`n+1` is determined by the - following equation (following Eq. (8) in the paper): - - .. math:: - \sigma_{i+1} = q \sigma_\text{final} \left ( \frac{ \min \left \{ - \left\lvert k_i - k_\text{target} \right\rvert : k=0,1,\dots,n - \right \} }{k_\text{tol}} \right )^p - - where :math:`q` is a multiplicative factor less than 1, given as the - ``sigma_factor`` parameter below. - - Parameters - ---------- - func : ModelModifier - Function that takes the parameter to be searched and makes a - modification to the model. - x0 : float - First guess for the parameter passed to `func` - x1 : float - Second guess for the parameter passed to `func` - target : float, optional - keff value to search for - k_tol : float, optional - Stopping criterion on the function value; the absolute value must be - within ``k_tol`` of zero to be accepted. - sigma_final : float, optional - Maximum accepted k-effective uncertainty for the stopping criterion. - p : float, optional - Exponent used in the stopping criterion. - q : float, optional - Multiplicative factor used in the stopping criterion. - memory : int, optional - Number of most-recent points used in the weighted linear fit of - ``f(x) = a + b x`` to predict the next point. - x_min : float, optional - Minimum allowed value for the parameter ``x``. - x_max : float, optional - Maximum allowed value for the parameter ``x``. - b0 : int, optional - Number of active batches to use for the initial function - evaluations. If None, uses the model's current setting. - b_min : int, optional - Minimum number of active batches to use in a function evaluation. - b_max : int, optional - Maximum number of active batches to use in a function evaluation. - maxiter : int, optional - Maximum number of iterations to perform. - output : bool, optional - Whether or not to display output showing iteration progress. - func_kwargs : dict, optional - Keyword-based arguments to pass to the `func` function. - run_kwargs : dict, optional - Keyword arguments to pass to :meth:`openmc.Model.run` or - :meth:`openmc.lib.run`. - - Returns - ------- - SearchResult - Result object containing the estimated root (parameter value) and - evaluation history (parameters, means, standard deviations, and - batches), plus convergence status and termination reason. - - """ - import openmc.lib - - check_type('model modifier', func, Callable) - check_type('target', target, Real) - if memory < 2: - raise ValueError("memory must be ≥ 2") - func_kwargs = {} if func_kwargs is None else dict(func_kwargs) - run_kwargs = {} if run_kwargs is None else dict(run_kwargs) - run_kwargs.setdefault('output', False) - - # Create lists to store the history of evaluations - xs: list[float] = [] - fs: list[float] = [] - ss: list[float] = [] - gs: list[int] = [] - count = 0 - - # Helper function to evaluate f and store results - def eval_at(x: float, batches: int) -> tuple[float, float]: - # Modify the model with the current guess - func(x, **func_kwargs) - - # Change the number of batches and run the model - batches += self.settings.inactive - if openmc.lib.is_initialized: - openmc.lib.settings.set_batches(batches) - openmc.lib.reset() - openmc.lib.run(**run_kwargs) - sp_filepath = f'statepoint.{batches}.h5' - else: - self.settings.batches = batches - sp_filepath = self.run(**run_kwargs) - - # Extract keff and its uncertainty - with openmc.StatePoint(sp_filepath) as sp: - keff = sp.keff - - if output: - nonlocal count - count += 1 - print(f'Iteration {count}: {batches=}, {x=:.6g}, {keff=:.5f}') - - xs.append(float(x)) - fs.append(float(keff.n - target)) - ss.append(float(keff.s)) - gs.append(int(batches)) - return fs[-1], ss[-1] - - # Default b0 to current model settings if not explicitly provided - if b0 is None: - b0 = self.settings.batches - self.settings.inactive - - # Perform the search (inlined GRsecant) in a temporary directory - with TemporaryDirectory() as tmpdir: - if not openmc.lib.is_initialized: - run_kwargs.setdefault('cwd', tmpdir) - - # ---- Seed with two evaluations - f0, s0 = eval_at(x0, b0) - if abs(f0) <= k_tol and s0 <= sigma_final: - return SearchResult(x0, xs, fs, ss, gs, True, "converged") - f1, s1 = eval_at(x1, b0) - if abs(f1) <= k_tol and s1 <= sigma_final: - return SearchResult(x1, xs, fs, ss, gs, True, "converged") - - for _ in range(maxiter - 2): - # ------ Step 1: propose next x via GRsecant - m = min(memory, len(xs)) - - # Perform a curve fit on f(x) = a + bx accounting for - # uncertainties. This is equivalent to minimizing the function - # in Equation (A.14) - (a, b), _ = curve_fit( - lambda x, a, b: a + b*x, - xs[-m:], fs[-m:], sigma=ss[-m:], absolute_sigma=True - ) - x_new = float(-a / b) - - # Clamp x_new to the bounds if provided - if x_min is not None: - x_new = max(x_new, x_min) - if x_max is not None: - x_new = min(x_new, x_max) - - # ------ Step 2: choose target σ for next run (Eq. 8 + clamp) - - min_abs_f = float(np.min(np.abs(fs))) - base = q * sigma_final - ratio = min_abs_f / k_tol if k_tol > 0 else 1.0 - sig = base * (ratio ** p) - sig_target = max(sig, base) - - # ------ Step 3: choose generations to hit σ_target (Appendix C) - - # Use at least two past points for regression - if len(gs) >= 2 and np.var(np.log(gs)) > 0.0: - # Perform a curve fit based on Eq. (C.3) to solve for ln(k). - # Note that unlike in the paper, we do not leave r as an - # undetermined parameter and choose r=0.5. - (ln_k,), _ = curve_fit( - lambda ln_b, ln_k: ln_k - 0.5*ln_b, - np.log(gs[-4:]), np.log(ss[-4:]), - ) - k = float(np.exp(ln_k)) - else: - k = float(ss[-1] * math.sqrt(gs[-1])) - - b_new = (k / sig_target) ** 2 - - # Clamp and round up to integer - b_new = max(b_min, math.ceil(b_new)) - if b_max is not None: - b_new = min(b_new, b_max) - - # Evaluate at proposed x with batches determined above - f_new, s_new = eval_at(x_new, b_new) - - # Termination based on both criteria (|f| and σ) - if abs(f_new) <= k_tol and s_new <= sigma_final: - return SearchResult(x_new, xs, fs, ss, gs, True, "converged") - - return SearchResult(xs[-1], xs, fs, ss, gs, False, "maxiter") - - -@dataclass -class SearchResult: - """Result of a GRsecant keff search. - - Attributes - ---------- - root : float - Estimated parameter value where f(x) = 0 at termination. - parameters : list[float] - Parameter values (x) evaluated during the search, in order. - keffs : list[float] - Estimated keff values for each evaluation. - stdevs : list[float] - One-sigma uncertainties of keff for each evaluation. - batches : list[int] - Number of active batches used for each evaluation. - converged : bool - Whether both |f| <= k_tol and sigma <= sigma_final were met. - flag : str - Reason for termination (e.g., "converged", "maxiter"). - """ - root: float - parameters: list[float] = field(repr=False) - means: list[float] = field(repr=False) - stdevs: list[float] = field(repr=False) - batches: list[int] = field(repr=False) - converged: bool - flag: str - - @property - def function_calls(self) -> int: - """Number of function evaluations performed.""" - return len(self.parameters) - - @property - def total_batches(self) -> int: - """Total number of active batches used across all evaluations.""" - return sum(self.batches) From 4de99d2132918a92f7edd2c1f55212abfbbecbd4 Mon Sep 17 00:00:00 2001 From: yardasol Date: Thu, 26 Mar 2026 14:25:12 -0500 Subject: [PATCH 59/64] fix comment --- openmc/model/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/model/model.py b/openmc/model/model.py index 9650274402c..c1eb42b3de0 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -1771,10 +1771,10 @@ def _auto_generate_mgxs_lib( mgxs_lib.mgxs_types += ['chi-prompt', 'chi-delayed', 'decay-rate', 'inverse-velocity', 'beta'] - # Specify a "cell" domain type for the cross section tally filters + # Specify a "material" domain type for the cross section tally filters mgxs_lib.domain_type = "material" - # Specify the cell domains over which to compute multi-group cross sections + # Specify the domains over which to compute multi-group cross sections mgxs_lib.domains = model.geometry.get_all_materials().values() # Do not compute cross sections on a nuclide-by-nuclide basis From b435d9fe407d08dcde146365c966f79d9818341d Mon Sep 17 00:00:00 2001 From: yardasol Date: Thu, 26 Mar 2026 14:44:35 -0500 Subject: [PATCH 60/64] model formatting fixes --- openmc/model/model.py | 156 +++++++++++++++++++++++++++++------------- 1 file changed, 108 insertions(+), 48 deletions(-) diff --git a/openmc/model/model.py b/openmc/model/model.py index c1eb42b3de0..4464aa462da 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -259,8 +259,7 @@ def add_kinetics_parameters_tallies(self, num_groups: int | None = None): beta_tally = openmc.Tally(name='IFP beta numerator') beta_tally.scores = ['ifp-beta-numerator'] if num_groups is not None: - beta_tally.filters = [openmc.DelayedGroupFilter( - list(range(1, num_groups + 1)))] + beta_tally.filters = [openmc.DelayedGroupFilter(list(range(1, num_groups + 1)))] self.tallies.append(beta_tally) if not any('ifp-denominator' in t.scores for t in self.tallies): denom_tally = openmc.Tally(name='IFP denominator') @@ -524,8 +523,7 @@ def deplete( check_value('method', method, dep.integrators.integrator_by_name.keys()) integrator_class = dep.integrators.integrator_by_name[method] - integrator = integrator_class( - depletion_operator, **integrator_kwargs) + integrator = integrator_class(depletion_operator, **integrator_kwargs) # Now perform the depletion with openmc.lib.quiet_dll(output): @@ -585,8 +583,7 @@ def export_to_xml(self, directory: PathLike = '.', remove_surfs: bool = False, # for all materials in the geometry and use that to automatically build # a collection. if self.materials: - self.materials.export_to_xml( - d, nuclides_to_ignore=nuclides_to_ignore) + self.materials.export_to_xml(d, nuclides_to_ignore=nuclides_to_ignore) else: materials = openmc.Materials(self.geometry.get_all_materials() .values()) @@ -625,8 +622,7 @@ def export_to_model_xml(self, path: PathLike = 'model.xml', remove_surfs: bool = if not xml_path.exists(): xml_path.mkdir(parents=True, exist_ok=True) elif not xml_path.is_dir(): - raise FileExistsError( - f"File exists and is not a directory: '{xml_path}'") + raise FileExistsError(f"File exists and is not a directory: '{xml_path}'") xml_path /= 'model.xml' # if this is an XML file location and the file's parent directory does # not exist, create it before continuing @@ -1638,8 +1634,7 @@ def differentiate_mats(self, diff_volume_method: str = None, depletable_only: bo Default is True, only depletable materials will be differentiated. If False, all materials will be differentiated. """ - check_value('volume differentiation method', - diff_volume_method, ("divide equally", "match cell", None)) + check_value('volume differentiation method', diff_volume_method, ("divide equally", "match cell", None)) # Count the number of instances for each cell and material self.geometry.determine_paths(instances_only=True) @@ -1687,8 +1682,7 @@ def differentiate_mats(self, diff_volume_method: str = None, depletable_only: bo # Clone materials if cell.num_instances > 1: - cell.fill = [mat.clone() - for _ in range(cell.num_instances)] + cell.fill = [mat.clone() for _ in range(cell.num_instances)] else: cell.fill = mat.clone() @@ -1844,8 +1838,7 @@ def _create_mgxs_sources( strengths.append(1.0) uniform_energy = openmc.stats.Discrete(x=midpoints, p=strengths) - uniform_distribution = openmc.IndependentSource( - spatial_dist, energy=uniform_energy, strength=0.01) + uniform_distribution = openmc.IndependentSource(spatial_dist, energy=uniform_energy, strength=0.01) sources = [uniform_distribution] # If the user provided an energy distribution, use that @@ -1961,7 +1954,13 @@ def _isothermal_infinite_media_mgxs( # Generate MGXS mgxs_lib = Model._auto_generate_mgxs_lib( - model, energy_groups, correction, directory, kinetic, num_delayed_groups) + model, + energy_groups, + correction, + directory, + kinetic, + num_delayed_groups + ) if temperature != None: return mgxs_lib.get_xsdata(domain=material, xsdata_name=name, @@ -2065,7 +2064,9 @@ def _generate_infinite_medium_mgxs( # Write the file to disk. mgxs_file = openmc.MGXSLibrary( - energy_groups=energy_groups, num_delayed_groups=num_delayed_groups) + energy_groups=energy_groups, + num_delayed_groups=num_delayed_groups + ) for mgxs_set in mgxs_sets: mgxs_file.add_xsdata(mgxs_set) mgxs_file.export_to_hdf5(mgxs_path) @@ -2092,9 +2093,14 @@ def _generate_infinite_medium_mgxs( # Unpack the isothermal XSData objects and build a single XSData object per material. mgxs_sets = [] for m in range(len(self.materials)): - mgxs_sets.append(openmc.XSdata(self.materials[m].name, energy_groups, - temperatures=temperatures, - num_delayed_groups=num_delayed_groups)) + mgxs_sets.append( + openmc.XSdata( + self.materials[m].name, + energy_groups, + temperatures=temperatures, + num_delayed_groups=num_delayed_groups + ) + ) mgxs_sets[-1].order = 0 for temperature in temperatures: mgxs_sets[-1].add_temperature_data(raw_mgxs_sets[temperature][m]) @@ -2256,8 +2262,13 @@ def _isothermal_stochastic_slab_mgxs( # Generate MGXS mgxs_lib = Model._auto_generate_mgxs_lib( - model, energy_groups, correction, directory, kinetic, - num_delayed_groups) + model, + energy_groups, + correction, + directory, + kinetic, + num_delayed_groups + ) # Fetch all of the isothermal results. if temperature != None: @@ -2371,8 +2382,10 @@ def _generate_stochastic_slab_mgxs( ).values() # Write the file to disk. - mgxs_file = openmc.MGXSLibrary(energy_groups=energy_groups, - num_delayed_groups=num_delayed_groups) + mgxs_file = openmc.MGXSLibrary( + energy_groups=energy_groups, + num_delayed_groups=num_delayed_groups + ) for mgxs_set in mgxs_sets: mgxs_file.add_xsdata(mgxs_set) mgxs_file.export_to_hdf5(mgxs_path) @@ -2396,9 +2409,14 @@ def _generate_stochastic_slab_mgxs( # Unpack the isothermal XSData objects and build a single XSData object per material. mgxs_sets = [] for mat in self.materials: - mgxs_sets.append(openmc.XSdata(mat.name, energy_groups, - temperatures=temperatures, - num_delayed_groups=num_delayed_groups)) + mgxs_sets.append( + openmc.XSdata( + mat.name, + energy_groups, + temperatures=temperatures, + num_delayed_groups=num_delayed_groups + ) + ) mgxs_sets[-1].order = 0 for temperature in temperatures: mgxs_sets[-1].add_temperature_data(raw_mgxs_sets[temperature][mat.name]) @@ -2479,7 +2497,13 @@ def _isothermal_materialwise_mgxs( # Generate MGXS mgxs_lib = Model._auto_generate_mgxs_lib( - model, energy_groups, correction, directory, kinetic, num_delayed_groups) + model, + energy_groups, + correction, + directory, + kinetic, + num_delayed_groups + ) # Fetch all of the isothermal results. if temperature != None: @@ -2561,8 +2585,10 @@ def _generate_material_wise_mgxs( ).values() # Write the file to disk. - mgxs_file = openmc.MGXSLibrary(energy_groups=energy_groups, - num_delayed_groups=num_delayed_groups) + mgxs_file = openmc.MGXSLibrary( + energy_groups=energy_groups, + num_delayed_groups=num_delayed_groups + ) for mgxs_set in mgxs_sets: mgxs_file.add_xsdata(mgxs_set) mgxs_file.export_to_hdf5(mgxs_path) @@ -2585,15 +2611,23 @@ def _generate_material_wise_mgxs( # Unpack the isothermal XSData objects and build a single XSData object per material. mgxs_sets = [] for mat in self.materials: - mgxs_sets.append(openmc.XSdata(mat.name, energy_groups, - temperatures=temperatures, - num_delayed_groups=num_delayed_groups)) + mgxs_sets.append( + openmc.XSdata( + mat.name, + energy_groups, + temperatures=temperatures, + num_delayed_groups=num_delayed_groups + ) + ) mgxs_sets[-1].order = 0 for temperature in temperatures: mgxs_sets[-1].add_temperature_data(raw_mgxs_sets[temperature][mat.name]) # Write the file to disk. - mgxs_file = openmc.MGXSLibrary(energy_groups=energy_groups) + mgxs_file = openmc.MGXSLibrary( + energy_groups=energy_groups, + num_delayed_groups=num_delayed_groups + ) for mgxs_set in mgxs_sets: mgxs_file.add_xsdata(mgxs_set) mgxs_file.export_to_hdf5(mgxs_path) @@ -2703,19 +2737,42 @@ def convert_to_multigroup( if not Path(mgxs_path).is_file() or overwrite_mgxs_library: if method == "infinite_medium": self._generate_infinite_medium_mgxs( - energy_groups, nparticles, mgxs_path, correction, tmpdir, - source_energy, temperatures, temperature_settings, - kinetic, num_delayed_groups) + energy_groups, + nparticles, + mgxs_path, + correction, + tmpdir, + source_energy, + temperatures, + temperature_settings, + kinetic, + num_delayed_groups + ) elif method == "material_wise": self._generate_material_wise_mgxs( - energy_groups, nparticles, mgxs_path, correction, - tmpdir, temperatures, temperature_settings, - kinetic, num_delayed_groups) + energy_groups, + nparticles, + mgxs_path, + correction, + tmpdir, + temperatures, + temperature_settings, + kinetic, + num_delayed_groups + ) elif method == "stochastic_slab": self._generate_stochastic_slab_mgxs( - energy_groups, nparticles, mgxs_path, correction, - tmpdir, source_energy, temperatures, temperature_settings, - kinetic, num_delayed_groups) + energy_groups, + nparticles, + mgxs_path, + correction, + tmpdir, + source_energy, + temperatures, + temperature_settings, + kinetic, + num_delayed_groups + ) else: raise ValueError( f'MGXS generation method "{method}" not recognized') @@ -2735,13 +2792,16 @@ def convert_to_multigroup( # If making a set the time step size to 0.01 if kinetic: self.settings.kinetic_simulation = True - warnings.warn("Kinetic model. Currently, only the random ray solver" - " supports kinetic simulations. The number of time" - " steps to run and material density transient using " - " openmc.Settings.timestep_parameters['n_timesteps'] " - " and openmc.Material.set_density(), respectively.") + warnings.warn( + "Kinetic model. Currently, only the random ray solver" + " supports kinetic simulations. The number of time" + " steps to run and material density transient using " + " openmc.Settings.timestep_parameters['n_timesteps'] " + " and openmc.Material.set_density(), respectively.") self.settings.timestep_parameters = { - 'dt': 0.01, 'timestep_units': 's'} + 'dt': 0.01, + 'timestep_units': 's' + } def convert_to_random_ray(self): """Convert a multigroup model to use random ray. From 774fb9b7302be4d8dfd6c9a1dca4fabcbf2db29e Mon Sep 17 00:00:00 2001 From: yardasol Date: Fri, 13 Feb 2026 09:56:50 -0600 Subject: [PATCH 61/64] fix scalar flux time derviatve scaling --- src/random_ray/flat_source_domain.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index e67ca364923..5c84038d538 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -2022,7 +2022,8 @@ void FlatSourceDomain::compute_single_phi_prime(SourceRegionHandle& srh) double scalar_flux_time_derivative = A0 * srh.scalar_flux_old(g) + srh.scalar_flux_rhs_bd(g); - srh.phi_prime(g) = scalar_flux_time_derivative * inverse_vbar / sigma_t; + srh.phi_prime(g) = + scalar_flux_time_derivative * inverse_vbar / (4 * PI * sigma_t); } } @@ -2049,7 +2050,7 @@ void FlatSourceDomain::compute_single_T1(SourceRegionHandle& srh) double scalar_flux_time_derivative_2 = B0 * srh.scalar_flux_old(g) + srh.scalar_flux_rhs_bd_2(g); - scalar_flux_time_derivative_2 *= inverse_vbar; + scalar_flux_time_derivative_2 *= inverse_vbar / (4 * PI); // Divide by sigma_t to save time during transport srh.T1(g) = From 9c1a73f38348df266750070f937fa5de6b9fc03d Mon Sep 17 00:00:00 2001 From: yardasol Date: Tue, 17 Feb 2026 16:41:15 -0600 Subject: [PATCH 62/64] update tests --- .../isotropic/results_true_1.dat | 4 +- .../isotropic/results_true_2.dat | 12 +- .../isotropic/results_true_3.dat | 12 +- .../isotropic/results_true_4.dat | 14 +- .../isotropic/results_true_5.dat | 14 +- .../propagation/results_true_1.dat | 4 +- .../propagation/results_true_2.dat | 12 +- .../propagation/results_true_3.dat | 12 +- .../propagation/results_true_4.dat | 14 +- .../propagation/results_true_5.dat | 14 +- .../isotropic/results_true_1.dat | 178 ++++----- .../isotropic/results_true_2.dat | 342 ++++++++--------- .../isotropic/results_true_3.dat | 348 ++++++++--------- .../isotropic/results_true_4.dat | 346 ++++++++--------- .../isotropic/results_true_5.dat | 360 +++++++++--------- .../propagation/results_true_1.dat | 178 ++++----- .../propagation/results_true_2.dat | 342 ++++++++--------- .../propagation/results_true_3.dat | 348 ++++++++--------- .../propagation/results_true_4.dat | 346 ++++++++--------- .../propagation/results_true_5.dat | 360 +++++++++--------- 20 files changed, 1630 insertions(+), 1630 deletions(-) diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat index a92843c016e..99af0b925e9 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat @@ -4,9 +4,9 @@ tally 1: 2.630191E+03 3.458954E+04 1.079890E+02 -5.830990E+01 +5.830991E+01 2.651432E+02 -3.515149E+02 +3.515150E+02 tally 2: 1.077582E+00 5.805916E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat index 1593f2550e3..2adcc7d60e5 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628844E+03 -3.455412E+04 -1.078946E+02 -5.820797E+01 -2.649121E+02 -3.509024E+02 +2.628846E+03 +3.455416E+04 +1.078947E+02 +5.820806E+01 +2.649123E+02 +3.509029E+02 tally 2: 1.077582E+00 5.805915E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat index b51d718be21..8c1780809f6 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.626023E+03 -3.447999E+04 -1.077395E+02 -5.804071E+01 -2.645319E+02 -3.498959E+02 +2.626025E+03 +3.448006E+04 +1.077396E+02 +5.804082E+01 +2.645322E+02 +3.498966E+02 tally 2: 1.077582E+00 5.805913E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat index 397a03896ad..c6990b4cfe5 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621898E+03 -3.437177E+04 -1.075308E+02 -5.781614E+01 -2.640203E+02 -3.485440E+02 +2.621902E+03 +3.437185E+04 +1.075310E+02 +5.781629E+01 +2.640207E+02 +3.485449E+02 tally 2: 1.077581E+00 5.805908E-03 @@ -23,4 +23,4 @@ tally 2: 2.312757E-02 2.674422E-06 3.680018E-03 -6.771265E-08 +6.771266E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat index 45797f0de66..15c1bf1d97e 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616587E+03 -3.423265E+04 -1.072735E+02 -5.753976E+01 -2.633892E+02 -3.468797E+02 +2.616591E+03 +3.423275E+04 +1.072737E+02 +5.753995E+01 +2.633897E+02 +3.468809E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -23,4 +23,4 @@ tally 2: 2.312557E-02 2.673959E-06 3.679344E-03 -6.768786E-08 +6.768788E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat index a92843c016e..99af0b925e9 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat @@ -4,9 +4,9 @@ tally 1: 2.630191E+03 3.458954E+04 1.079890E+02 -5.830990E+01 +5.830991E+01 2.651432E+02 -3.515149E+02 +3.515150E+02 tally 2: 1.077582E+00 5.805916E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat index 1593f2550e3..2adcc7d60e5 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628844E+03 -3.455412E+04 -1.078946E+02 -5.820797E+01 -2.649121E+02 -3.509024E+02 +2.628846E+03 +3.455416E+04 +1.078947E+02 +5.820806E+01 +2.649123E+02 +3.509029E+02 tally 2: 1.077582E+00 5.805915E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat index b51d718be21..8c1780809f6 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.626023E+03 -3.447999E+04 -1.077395E+02 -5.804071E+01 -2.645319E+02 -3.498959E+02 +2.626025E+03 +3.448006E+04 +1.077396E+02 +5.804082E+01 +2.645322E+02 +3.498966E+02 tally 2: 1.077582E+00 5.805913E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat index 397a03896ad..c6990b4cfe5 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621898E+03 -3.437177E+04 -1.075308E+02 -5.781614E+01 -2.640203E+02 -3.485440E+02 +2.621902E+03 +3.437185E+04 +1.075310E+02 +5.781629E+01 +2.640207E+02 +3.485449E+02 tally 2: 1.077581E+00 5.805908E-03 @@ -23,4 +23,4 @@ tally 2: 2.312757E-02 2.674422E-06 3.680018E-03 -6.771265E-08 +6.771266E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat index 45797f0de66..15c1bf1d97e 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616587E+03 -3.423265E+04 -1.072735E+02 -5.753976E+01 -2.633892E+02 -3.468797E+02 +2.616591E+03 +3.423275E+04 +1.072737E+02 +5.753995E+01 +2.633897E+02 +3.468809E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -23,4 +23,4 @@ tally 2: 2.312557E-02 2.673959E-06 3.679344E-03 -6.768786E-08 +6.768788E-08 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat index 3b5aea51fd9..5200ac7ec65 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835753E+01 -2.336672E+01 +6.835756E+01 +2.336674E+01 2.537239E+01 -3.219878E+00 +3.219879E+00 6.175132E+01 1.907257E+01 -4.341877E+01 -9.426414E+00 +4.341878E+01 +9.426419E+00 6.455425E+00 -2.083854E-01 +2.083855E-01 1.571121E+01 1.234347E+00 -2.955121E+01 -4.366402E+00 +2.955122E+01 +4.366403E+00 9.570792E-01 4.580066E-03 2.329339E+00 2.712948E-02 -3.767888E+01 -7.098576E+00 +3.767889E+01 +7.098579E+00 1.254652E+00 -7.871022E-03 +7.871025E-03 3.053572E+00 -4.662307E-02 -9.745115E+01 -4.748373E+01 +4.662309E-02 +9.745117E+01 +4.748374E+01 1.144254E+00 -6.546618E-03 -2.784920E+00 -3.877907E-02 +6.546620E-03 +2.784921E+00 +3.877908E-02 2.110520E+02 -2.227225E+02 -3.220667E-01 -5.186770E-04 -7.969316E-01 -3.175758E-03 -1.122226E+02 -6.298107E+01 +2.227226E+02 +3.220668E-01 +5.186772E-04 +7.969317E-01 +3.175759E-03 +1.122227E+02 +6.298109E+01 1.521758E+00 1.158468E-02 4.232692E+00 -8.962439E-02 +8.962442E-02 1.129470E+02 -6.378585E+01 +6.378591E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.346407E+01 -1.429216E+01 +5.346409E+01 +1.429217E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.113247E+01 -4.846178E+00 +3.113248E+01 +4.846180E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.104801E+01 -8.424780E+00 +4.104802E+01 +8.424783E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.824005E+01 -4.825571E+01 +9.824006E+01 +4.825572E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.889103E+02 -1.784413E+02 +1.784414E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.679730E+01 -4.686267E+01 +9.679731E+01 +4.686268E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.897828E+01 -1.739342E+01 +5.897831E+01 +1.739344E+01 2.181862E+01 -2.380831E+00 -5.310215E+01 -1.410257E+01 -4.079874E+01 -8.322938E+00 -6.064469E+00 -1.839035E-01 +2.380832E+00 +5.310216E+01 +1.410258E+01 +4.079875E+01 +8.322942E+00 +6.064470E+00 +1.839036E-01 1.475971E+01 1.089331E+00 2.912006E+01 -4.239913E+00 +4.239914E+00 9.439565E-01 4.455323E-03 2.297401E+00 -2.639057E-02 +2.639058E-02 3.702869E+01 -6.855691E+00 +6.855693E+00 1.233605E+00 -7.609156E-03 +7.609159E-03 3.002348E+00 -4.507194E-02 -9.753766E+01 -4.756805E+01 +4.507196E-02 +9.753767E+01 +4.756807E+01 1.146053E+00 -6.567213E-03 -2.789298E+00 -3.890107E-02 +6.567215E-03 +2.789299E+00 +3.890108E-02 2.153332E+02 -2.318479E+02 +2.318480E+02 3.284890E-01 -5.395580E-04 -8.128230E-01 -3.303608E-03 -1.140093E+02 -6.500131E+01 +5.395582E-04 +8.128231E-01 +3.303609E-03 +1.140094E+02 +6.500133E+01 1.542171E+00 -1.189591E-02 +1.189592E-02 4.289470E+00 -9.203227E-02 -6.822486E+01 -2.327587E+01 +9.203230E-02 +6.822489E+01 +2.327589E+01 2.539951E+01 3.226691E+00 6.181733E+01 1.911292E+01 -4.337628E+01 -9.407949E+00 +4.337629E+01 +9.407953E+00 6.468668E+00 2.092395E-01 -1.574344E+01 +1.574345E+01 1.239406E+00 2.954196E+01 -4.363673E+00 -9.596121E-01 +4.363674E+00 +9.596122E-01 4.604345E-03 2.335504E+00 2.727329E-02 3.766621E+01 -7.093810E+00 -1.257977E+00 -7.912792E-03 -3.061665E+00 -4.687049E-02 -9.745956E+01 -4.749193E+01 -1.147703E+00 -6.586141E-03 +7.093812E+00 +1.257978E+00 +7.912794E-03 +3.061666E+00 +4.687051E-02 +9.745958E+01 +4.749194E+01 +1.147704E+00 +6.586143E-03 2.793315E+00 -3.901318E-02 +3.901320E-02 2.111701E+02 -2.229708E+02 -3.231290E-01 -5.220986E-04 -7.995602E-01 -3.196707E-03 +2.229709E+02 +3.231291E-01 +5.220987E-04 +7.995603E-01 +3.196708E-03 1.122514E+02 -6.301118E+01 +6.301119E+01 1.525955E+00 -1.164801E-02 +1.164802E-02 4.244367E+00 -9.011440E-02 +9.011441E-02 tally 2: 3.727210E-01 6.946049E-04 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat index db723684684..97167c4acb6 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.841005E+01 -2.340265E+01 -2.539210E+01 -3.224885E+00 -6.179930E+01 -1.910222E+01 -4.345797E+01 -9.443447E+00 -6.461267E+00 -2.087628E-01 -1.572543E+01 -1.236582E+00 -2.958150E+01 -4.375358E+00 -9.580607E-01 -4.589465E-03 -2.331728E+00 -2.718515E-02 -3.771761E+01 -7.113176E+00 -1.255942E+00 -7.887221E-03 -3.056712E+00 -4.671902E-02 -9.755568E+01 -4.758565E+01 -1.145482E+00 -6.560671E-03 -2.787908E+00 -3.886231E-02 -2.112847E+02 -2.232140E+02 -3.224203E-01 -5.198164E-04 -7.978065E-01 -3.182734E-03 -1.123399E+02 -6.311276E+01 -1.523335E+00 -1.160870E-02 -4.237078E+00 -8.981024E-02 -1.130416E+02 -6.389274E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.351357E+01 -1.431864E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.116479E+01 -4.856246E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.109114E+01 -8.442495E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.834631E+01 -4.836016E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.891193E+02 -1.788365E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.689934E+01 -4.696152E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.902249E+01 -1.741951E+01 -2.183516E+01 -2.384444E+00 -5.314242E+01 -1.412397E+01 -4.083555E+01 -8.337963E+00 -6.069956E+00 -1.842364E-01 -1.477306E+01 -1.091303E+00 -2.914981E+01 -4.248581E+00 -9.449218E-01 -4.464439E-03 -2.299750E+00 -2.644457E-02 -3.706650E+01 -6.869699E+00 -1.234866E+00 -7.624725E-03 -3.005418E+00 -4.516416E-02 -9.764194E+01 -4.766982E+01 -1.147279E+00 -6.581267E-03 -2.792281E+00 -3.898431E-02 -2.155704E+02 -2.323591E+02 -3.288491E-01 -5.407419E-04 -8.137142E-01 -3.310856E-03 -1.141284E+02 -6.513710E+01 -1.543767E+00 -1.192055E-02 -4.293910E+00 -9.222288E-02 -6.827724E+01 -2.331163E+01 -2.541923E+01 -3.231703E+00 -6.186532E+01 -1.914261E+01 -4.341544E+01 -9.424942E+00 -6.474521E+00 -2.096183E-01 -1.575769E+01 -1.241649E+00 -2.957223E+01 -4.372622E+00 -9.605961E-01 -4.613792E-03 -2.337899E+00 -2.732925E-02 -3.770491E+01 -7.108396E+00 -1.259271E+00 -7.929072E-03 -3.064813E+00 -4.696693E-02 -9.756409E+01 -4.759386E+01 -1.148934E+00 -6.600277E-03 -2.796311E+00 -3.909692E-02 -2.114030E+02 -2.234629E+02 -3.234838E-01 -5.232457E-04 -8.004381E-01 -3.203731E-03 -1.123687E+02 -6.314294E+01 -1.527537E+00 -1.167217E-02 -4.248767E+00 -9.030131E-02 +6.841014E+01 +2.340271E+01 +2.539213E+01 +3.224892E+00 +6.179937E+01 +1.910227E+01 +4.345803E+01 +9.443470E+00 +6.461275E+00 +2.087633E-01 +1.572545E+01 +1.236585E+00 +2.958154E+01 +4.375368E+00 +9.580618E-01 +4.589475E-03 +2.331731E+00 +2.718521E-02 +3.771765E+01 +7.113193E+00 +1.255944E+00 +7.887240E-03 +3.056716E+00 +4.671914E-02 +9.755580E+01 +4.758576E+01 +1.145483E+00 +6.560687E-03 +2.787911E+00 +3.886241E-02 +2.112850E+02 +2.232146E+02 +3.224207E-01 +5.198176E-04 +7.978074E-01 +3.182742E-03 +1.123400E+02 +6.311292E+01 +1.523337E+00 +1.160873E-02 +4.237083E+00 +8.981046E-02 +1.130417E+02 +6.389290E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.351363E+01 +1.431867E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116483E+01 +4.856257E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.109119E+01 +8.442515E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.834643E+01 +4.836027E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891195E+02 +1.788369E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.689946E+01 +4.696163E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.902258E+01 +1.741956E+01 +2.183519E+01 +2.384450E+00 +5.314249E+01 +1.412401E+01 +4.083560E+01 +8.337984E+00 +6.069963E+00 +1.842369E-01 +1.477308E+01 +1.091305E+00 +2.914984E+01 +4.248591E+00 +9.449228E-01 +4.464449E-03 +2.299753E+00 +2.644464E-02 +3.706654E+01 +6.869716E+00 +1.234868E+00 +7.624744E-03 +3.005421E+00 +4.516427E-02 +9.764206E+01 +4.766994E+01 +1.147280E+00 +6.581283E-03 +2.792284E+00 +3.898441E-02 +2.155707E+02 +2.323596E+02 +3.288495E-01 +5.407431E-04 +8.137152E-01 +3.310864E-03 +1.141285E+02 +6.513725E+01 +1.543769E+00 +1.192058E-02 +4.293915E+00 +9.222311E-02 +6.827732E+01 +2.331168E+01 +2.541926E+01 +3.231710E+00 +6.186540E+01 +1.914265E+01 +4.341549E+01 +9.424964E+00 +6.474528E+00 +2.096188E-01 +1.575771E+01 +1.241652E+00 +2.957227E+01 +4.372632E+00 +9.605972E-01 +4.613802E-03 +2.337901E+00 +2.732931E-02 +3.770496E+01 +7.108413E+00 +1.259272E+00 +7.929092E-03 +3.064817E+00 +4.696704E-02 +9.756421E+01 +4.759397E+01 +1.148936E+00 +6.600293E-03 +2.796314E+00 +3.909702E-02 +2.114033E+02 +2.234634E+02 +3.234842E-01 +5.232469E-04 +8.004390E-01 +3.203738E-03 +1.123688E+02 +6.314309E+01 +1.527539E+00 +1.167220E-02 +4.248772E+00 +9.030152E-02 tally 2: 3.727211E-01 6.946052E-04 @@ -185,7 +185,7 @@ tally 2: 8.000435E-03 3.200348E-07 1.273182E-03 -8.104960E-09 +8.104961E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -214,7 +214,7 @@ tally 2: 1.163444E-04 2.058001E-02 2.117684E-06 -7.142754E-03 +7.142755E-03 2.550947E-07 1.136691E-03 6.460335E-09 @@ -233,4 +233,4 @@ tally 2: 7.989016E-03 3.191219E-07 1.271365E-03 -8.081840E-09 +8.081841E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat index bac8902424a..7d455f49fdc 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.846312E+01 -2.343897E+01 -2.541202E+01 -3.229945E+00 -6.184776E+01 -1.913220E+01 -4.349759E+01 -9.460674E+00 -6.467170E+00 -2.091445E-01 -1.573980E+01 -1.238843E+00 -2.961211E+01 -4.384415E+00 -9.590524E-01 -4.598971E-03 -2.334141E+00 -2.724146E-02 -3.775673E+01 -7.127940E+00 -1.257246E+00 -7.903602E-03 -3.059885E+00 -4.681606E-02 -9.766123E+01 -4.768868E+01 -1.146721E+00 -6.574876E-03 -2.790924E+00 -3.894646E-02 -2.115196E+02 -2.237105E+02 -3.227770E-01 -5.209674E-04 -7.986892E-01 -3.189781E-03 -1.124582E+02 -6.324576E+01 -1.524926E+00 -1.163296E-02 -4.241504E+00 -8.999793E-02 -1.131371E+02 -6.400083E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.356358E+01 -1.434541E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.119744E+01 -4.866426E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.113471E+01 -8.460406E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.845360E+01 -4.846573E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.893303E+02 -1.792356E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.700227E+01 -4.706134E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.906717E+01 -1.744589E+01 -2.185188E+01 -2.388096E+00 -5.318310E+01 -1.414560E+01 -4.087275E+01 -8.353159E+00 -6.075499E+00 -1.845731E-01 -1.478655E+01 -1.093297E+00 -2.917987E+01 -4.257348E+00 -9.458970E-01 -4.473659E-03 -2.302124E+00 -2.649919E-02 -3.710470E+01 -6.883867E+00 -1.236141E+00 -7.640471E-03 -3.008519E+00 -4.525743E-02 -9.774725E+01 -4.777270E+01 -1.148516E+00 -6.595474E-03 -2.795293E+00 -3.906847E-02 -2.158098E+02 -2.328754E+02 -3.292126E-01 -5.419377E-04 -8.146135E-01 -3.318178E-03 -1.142484E+02 -6.527422E+01 -1.545377E+00 -1.194543E-02 -4.298389E+00 -9.241537E-02 -6.833016E+01 -2.334778E+01 -2.543915E+01 -3.236770E+00 -6.191381E+01 -1.917263E+01 -4.345500E+01 -9.442129E+00 -6.480434E+00 -2.100014E-01 -1.577208E+01 -1.243919E+00 -2.960282E+01 -4.381672E+00 -9.615903E-01 -4.623347E-03 -2.340318E+00 -2.738585E-02 -3.774401E+01 -7.123146E+00 -1.260578E+00 -7.945537E-03 -3.067994E+00 -4.706446E-02 -9.766964E+01 -4.769689E+01 -1.150177E+00 -6.614567E-03 -2.799336E+00 -3.918157E-02 -2.116380E+02 -2.239600E+02 -3.238418E-01 -5.244043E-04 -8.013238E-01 -3.210825E-03 -1.124870E+02 -6.327601E+01 -1.529133E+00 -1.169657E-02 -4.253205E+00 -9.049007E-02 +6.846326E+01 +2.343906E+01 +2.541206E+01 +3.229957E+00 +6.184788E+01 +1.913227E+01 +4.349768E+01 +9.460710E+00 +6.467182E+00 +2.091452E-01 +1.573983E+01 +1.238847E+00 +2.961216E+01 +4.384431E+00 +9.590541E-01 +4.598987E-03 +2.334146E+00 +2.724155E-02 +3.775680E+01 +7.127966E+00 +1.257248E+00 +7.903631E-03 +3.059891E+00 +4.681623E-02 +9.766141E+01 +4.768885E+01 +1.146723E+00 +6.574901E-03 +2.790929E+00 +3.894660E-02 +2.115200E+02 +2.237114E+02 +3.227776E-01 +5.209693E-04 +7.986907E-01 +3.189793E-03 +1.124584E+02 +6.324599E+01 +1.524929E+00 +1.163300E-02 +4.241512E+00 +8.999826E-02 +1.131374E+02 +6.400109E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.356368E+01 +1.434547E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.119750E+01 +4.866444E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.113478E+01 +8.460437E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.845378E+01 +4.846591E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.893306E+02 +1.792363E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.700245E+01 +4.706152E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.906729E+01 +1.744596E+01 +2.185192E+01 +2.388105E+00 +5.318321E+01 +1.414566E+01 +4.087282E+01 +8.353191E+00 +6.075510E+00 +1.845738E-01 +1.478658E+01 +1.093301E+00 +2.917992E+01 +4.257364E+00 +9.458987E-01 +4.473675E-03 +2.302128E+00 +2.649928E-02 +3.710477E+01 +6.883893E+00 +1.236143E+00 +7.640499E-03 +3.008525E+00 +4.525760E-02 +9.774743E+01 +4.777288E+01 +1.148518E+00 +6.595498E-03 +2.795298E+00 +3.906861E-02 +2.158102E+02 +2.328763E+02 +3.292132E-01 +5.419397E-04 +8.146150E-01 +3.318191E-03 +1.142486E+02 +6.527446E+01 +1.545380E+00 +1.194548E-02 +4.298397E+00 +9.241572E-02 +6.833030E+01 +2.334787E+01 +2.543920E+01 +3.236782E+00 +6.191392E+01 +1.917269E+01 +4.345509E+01 +9.442165E+00 +6.480446E+00 +2.100022E-01 +1.577211E+01 +1.243923E+00 +2.960287E+01 +4.381688E+00 +9.615920E-01 +4.623363E-03 +2.340322E+00 +2.738594E-02 +3.774408E+01 +7.123173E+00 +1.260580E+00 +7.945567E-03 +3.067999E+00 +4.706463E-02 +9.766982E+01 +4.769706E+01 +1.150180E+00 +6.614591E-03 +2.799341E+00 +3.918171E-02 +2.116384E+02 +2.239608E+02 +3.238424E-01 +5.244063E-04 +8.013253E-01 +3.210837E-03 +1.124872E+02 +6.327624E+01 +1.529136E+00 +1.169661E-02 +4.253213E+00 +9.049039E-02 tally 2: 3.727212E-01 6.946055E-04 @@ -185,7 +185,7 @@ tally 2: 8.000705E-03 3.200564E-07 1.273273E-03 -8.106118E-09 +8.106120E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -213,11 +213,11 @@ tally 2: 1.525423E-01 1.163458E-04 2.058029E-02 -2.117742E-06 +2.117743E-06 7.142994E-03 2.551118E-07 1.136772E-03 -6.461253E-09 +6.461254E-09 3.721892E-01 6.926241E-04 8.037371E-01 @@ -230,7 +230,7 @@ tally 2: 1.455479E-04 2.301861E-02 2.649283E-06 -7.989285E-03 +7.989286E-03 3.191434E-07 -1.271455E-03 -8.082995E-09 +1.271456E-03 +8.082996E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat index 2625ac2a347..6114b3cd064 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.851755E+01 -2.347625E+01 -2.543244E+01 -3.235138E+00 -6.189746E+01 -1.916296E+01 -4.353807E+01 -9.478290E+00 -6.473201E+00 -2.095347E-01 -1.575448E+01 -1.241154E+00 -2.964329E+01 -4.393655E+00 -9.600630E-01 -4.608668E-03 -2.336601E+00 -2.729890E-02 -3.779660E+01 -7.143001E+00 -1.258574E+00 -7.920313E-03 -3.063118E+00 -4.691505E-02 -9.776873E+01 -4.779372E+01 -1.147984E+00 -6.589359E-03 -2.793996E+00 -3.903225E-02 -2.117587E+02 -2.242166E+02 -3.231403E-01 -5.221406E-04 -7.995881E-01 -3.196965E-03 -1.125788E+02 -6.338145E+01 -1.526548E+00 -1.165771E-02 -4.246015E+00 -9.018945E-02 -1.132350E+02 -6.411155E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361464E+01 -1.437278E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123071E+01 -4.876810E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117909E+01 -8.478672E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856285E+01 -4.857335E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895450E+02 -1.796425E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710717E+01 -4.716318E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911301E+01 -1.747298E+01 -2.186903E+01 -2.391846E+00 -5.322484E+01 -1.416782E+01 -4.091074E+01 -8.368698E+00 -6.081162E+00 -1.849173E-01 -1.480033E+01 -1.095336E+00 -2.921050E+01 -4.266292E+00 -9.468909E-01 -4.483065E-03 -2.304543E+00 -2.655491E-02 -3.714364E+01 -6.898322E+00 -1.237440E+00 -7.656535E-03 -3.011680E+00 -4.535258E-02 -9.785450E+01 -4.787760E+01 -1.149777E+00 -6.609958E-03 -2.798361E+00 -3.915427E-02 -2.160535E+02 -2.334017E+02 -3.295826E-01 -5.431567E-04 -8.155291E-01 -3.325642E-03 -1.143708E+02 -6.541413E+01 -1.547019E+00 -1.197082E-02 -4.302955E+00 -9.261180E-02 -6.838444E+01 -2.338489E+01 -2.545958E+01 -3.241970E+00 -6.196352E+01 -1.920343E+01 -4.349543E+01 -9.459705E+00 -6.486476E+00 -2.103931E-01 -1.578678E+01 -1.246239E+00 -2.963399E+01 -4.390905E+00 -9.626034E-01 -4.633094E-03 -2.342784E+00 -2.744358E-02 -3.778386E+01 -7.138194E+00 -1.261909E+00 -7.962333E-03 -3.071235E+00 -4.716395E-02 -9.777713E+01 -4.780194E+01 -1.151443E+00 -6.629136E-03 -2.802417E+00 -3.926787E-02 -2.118773E+02 -2.244667E+02 -3.242063E-01 -5.255855E-04 -8.022257E-01 -3.218057E-03 -1.126076E+02 -6.341177E+01 -1.530759E+00 -1.172147E-02 -4.257730E+00 -9.068268E-02 +6.851773E+01 +2.347638E+01 +2.543250E+01 +3.235154E+00 +6.189761E+01 +1.916305E+01 +4.353818E+01 +9.478338E+00 +6.473217E+00 +2.095358E-01 +1.575452E+01 +1.241161E+00 +2.964337E+01 +4.393677E+00 +9.600653E-01 +4.608690E-03 +2.336607E+00 +2.729903E-02 +3.779670E+01 +7.143037E+00 +1.258578E+00 +7.920353E-03 +3.063126E+00 +4.691528E-02 +9.776897E+01 +4.779395E+01 +1.147986E+00 +6.589392E-03 +2.794003E+00 +3.903244E-02 +2.117592E+02 +2.242177E+02 +3.231411E-01 +5.221432E-04 +7.995900E-01 +3.196980E-03 +1.125791E+02 +6.338177E+01 +1.526551E+00 +1.165777E-02 +4.246026E+00 +9.018990E-02 +1.132353E+02 +6.411189E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361478E+01 +1.437285E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123078E+01 +4.876834E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117919E+01 +8.478714E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856309E+01 +4.857359E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895455E+02 +1.796434E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710741E+01 +4.716341E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911317E+01 +1.747308E+01 +2.186909E+01 +2.391858E+00 +5.322498E+01 +1.416789E+01 +4.091085E+01 +8.368741E+00 +6.081177E+00 +1.849182E-01 +1.480037E+01 +1.095342E+00 +2.921058E+01 +4.266313E+00 +9.468932E-01 +4.483087E-03 +2.304548E+00 +2.655503E-02 +3.714373E+01 +6.898356E+00 +1.237443E+00 +7.656573E-03 +3.011688E+00 +4.535281E-02 +9.785474E+01 +4.787783E+01 +1.149780E+00 +6.609991E-03 +2.798368E+00 +3.915446E-02 +2.160541E+02 +2.334029E+02 +3.295834E-01 +5.431594E-04 +8.155311E-01 +3.325659E-03 +1.143711E+02 +6.541445E+01 +1.547023E+00 +1.197088E-02 +4.302966E+00 +9.261227E-02 +6.838461E+01 +2.338501E+01 +2.545964E+01 +3.241986E+00 +6.196367E+01 +1.920352E+01 +4.349554E+01 +9.459752E+00 +6.486491E+00 +2.103942E-01 +1.578682E+01 +1.246245E+00 +2.963407E+01 +4.390927E+00 +9.626057E-01 +4.633116E-03 +2.342790E+00 +2.744371E-02 +3.778395E+01 +7.138229E+00 +1.261912E+00 +7.962373E-03 +3.071242E+00 +4.716418E-02 +9.777738E+01 +4.780217E+01 +1.151446E+00 +6.629169E-03 +2.802424E+00 +3.926806E-02 +2.118778E+02 +2.244678E+02 +3.242071E-01 +5.255880E-04 +8.022277E-01 +3.218073E-03 +1.126079E+02 +6.341209E+01 +1.530763E+00 +1.172153E-02 +4.257740E+00 +9.068312E-02 tally 2: 3.727213E-01 6.946060E-04 @@ -182,10 +182,10 @@ tally 2: 1.459668E-04 2.305197E-02 2.656966E-06 -8.001084E-03 +8.001085E-03 3.200868E-07 1.273400E-03 -8.107736E-09 +8.107739E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -217,7 +217,7 @@ tally 2: 7.143331E-03 2.551359E-07 1.136885E-03 -6.462535E-09 +6.462537E-09 3.721894E-01 6.926247E-04 8.037378E-01 @@ -230,7 +230,7 @@ tally 2: 1.455504E-04 2.301907E-02 2.649387E-06 -7.989664E-03 +7.989665E-03 3.191737E-07 1.271582E-03 -8.084607E-09 +8.084610E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat index 5d21c6febfc..a30dfa88059 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.857321E+01 -2.351441E+01 -2.545331E+01 -3.240452E+00 -6.194827E+01 -1.919443E+01 -4.357935E+01 -9.496270E+00 -6.479351E+00 -2.099331E-01 -1.576944E+01 -1.243514E+00 -2.967503E+01 -4.403069E+00 -9.610914E-01 -4.618547E-03 -2.339104E+00 -2.735741E-02 -3.783717E+01 -7.158344E+00 -1.259926E+00 -7.937337E-03 -3.066408E+00 -4.701588E-02 -9.787805E+01 -4.790066E+01 -1.149267E+00 -6.604105E-03 -2.797121E+00 -3.911960E-02 -2.120018E+02 -2.247317E+02 -3.235096E-01 -5.233348E-04 -8.005019E-01 -3.204276E-03 -1.127015E+02 -6.351966E+01 -1.528198E+00 -1.168293E-02 -4.250605E+00 -9.038454E-02 -1.133348E+02 -6.422471E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366670E+01 -1.440070E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126455E+01 -4.887386E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122424E+01 -8.497275E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867395E+01 -4.868292E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897633E+02 -1.800565E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721388E+01 -4.726689E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.915992E+01 -1.750072E+01 -2.188657E+01 -2.395685E+00 -5.326754E+01 -1.419056E+01 -4.094949E+01 -8.384559E+00 -6.086937E+00 -1.852687E-01 -1.481439E+01 -1.097417E+00 -2.924168E+01 -4.275405E+00 -9.479024E-01 -4.492648E-03 -2.307005E+00 -2.661167E-02 -3.718326E+01 -6.913048E+00 -1.238761E+00 -7.672900E-03 -3.014897E+00 -4.544952E-02 -9.796358E+01 -4.798440E+01 -1.151059E+00 -6.624706E-03 -2.801481E+00 -3.924163E-02 -2.163013E+02 -2.339374E+02 -3.299589E-01 -5.443975E-04 -8.164601E-01 -3.333239E-03 -1.144953E+02 -6.555663E+01 -1.548689E+00 -1.199669E-02 -4.307601E+00 -9.281190E-02 -6.843995E+01 -2.342287E+01 -2.548046E+01 -3.247292E+00 -6.201435E+01 -1.923495E+01 -4.353665E+01 -9.477643E+00 -6.492636E+00 -2.107930E-01 -1.580178E+01 -1.248607E+00 -2.966572E+01 -4.400311E+00 -9.636344E-01 -4.643024E-03 -2.345293E+00 -2.750240E-02 -3.782441E+01 -7.153523E+00 -1.263264E+00 -7.979443E-03 -3.074533E+00 -4.726529E-02 -9.788645E+01 -4.790889E+01 -1.152731E+00 -6.643969E-03 -2.805551E+00 -3.935573E-02 -2.121205E+02 -2.249823E+02 -3.245768E-01 -5.267876E-04 -8.031427E-01 -3.225417E-03 -1.127304E+02 -6.355006E+01 -1.532415E+00 -1.174683E-02 -4.262334E+00 -9.087889E-02 +6.857342E+01 +2.351456E+01 +2.545339E+01 +3.240472E+00 +6.194846E+01 +1.919455E+01 +4.357948E+01 +9.496329E+00 +6.479370E+00 +2.099343E-01 +1.576949E+01 +1.243521E+00 +2.967512E+01 +4.403095E+00 +9.610942E-01 +4.618574E-03 +2.339111E+00 +2.735758E-02 +3.783729E+01 +7.158388E+00 +1.259930E+00 +7.937385E-03 +3.066418E+00 +4.701617E-02 +9.787835E+01 +4.790095E+01 +1.149271E+00 +6.604145E-03 +2.797129E+00 +3.911983E-02 +2.120024E+02 +2.247331E+02 +3.235106E-01 +5.233379E-04 +8.005043E-01 +3.204296E-03 +1.127018E+02 +6.352005E+01 +1.528203E+00 +1.168300E-02 +4.250618E+00 +9.038510E-02 +1.133352E+02 +6.422512E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366687E+01 +1.440079E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126465E+01 +4.887416E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122436E+01 +8.497326E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867425E+01 +4.868321E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897639E+02 +1.800576E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721418E+01 +4.726718E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.916011E+01 +1.750084E+01 +2.188664E+01 +2.395700E+00 +5.326771E+01 +1.419065E+01 +4.094962E+01 +8.384611E+00 +6.086955E+00 +1.852698E-01 +1.481443E+01 +1.097424E+00 +2.924177E+01 +4.275430E+00 +9.479052E-01 +4.492675E-03 +2.307011E+00 +2.661183E-02 +3.718338E+01 +6.913090E+00 +1.238765E+00 +7.672947E-03 +3.014906E+00 +4.544980E-02 +9.796388E+01 +4.798469E+01 +1.151062E+00 +6.624747E-03 +2.801490E+00 +3.924187E-02 +2.163020E+02 +2.339388E+02 +3.299598E-01 +5.444008E-04 +8.164626E-01 +3.333259E-03 +1.144957E+02 +6.555703E+01 +1.548694E+00 +1.199676E-02 +4.307614E+00 +9.281247E-02 +6.844016E+01 +2.342301E+01 +2.548054E+01 +3.247311E+00 +6.201454E+01 +1.923506E+01 +4.353678E+01 +9.477701E+00 +6.492655E+00 +2.107942E-01 +1.580182E+01 +1.248615E+00 +2.966581E+01 +4.400337E+00 +9.636372E-01 +4.643051E-03 +2.345300E+00 +2.750256E-02 +3.782452E+01 +7.153566E+00 +1.263268E+00 +7.979492E-03 +3.074542E+00 +4.726558E-02 +9.788675E+01 +4.790918E+01 +1.152734E+00 +6.644009E-03 +2.805559E+00 +3.935597E-02 +2.121212E+02 +2.249837E+02 +3.245778E-01 +5.267908E-04 +8.031451E-01 +3.225437E-03 +1.127307E+02 +6.355044E+01 +1.532419E+00 +1.174690E-02 +4.262347E+00 +9.087943E-02 tally 2: 3.727215E-01 6.946067E-04 @@ -179,13 +179,13 @@ tally 2: 2.194480E-01 2.407872E-04 1.708625E-01 -1.459700E-04 -2.305255E-02 -2.657101E-06 -8.001573E-03 +1.459701E-04 +2.305256E-02 +2.657102E-06 +8.001574E-03 3.201259E-07 1.273562E-03 -8.109801E-09 +8.109804E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -213,11 +213,11 @@ tally 2: 1.525453E-01 1.163504E-04 2.058122E-02 -2.117932E-06 -7.143764E-03 -2.551668E-07 +2.117933E-06 +7.143765E-03 +2.551669E-07 1.137029E-03 -6.464170E-09 +6.464173E-09 3.721896E-01 6.926253E-04 8.037386E-01 @@ -230,7 +230,7 @@ tally 2: 1.455537E-04 2.301965E-02 2.649522E-06 -7.990152E-03 -3.192126E-07 +7.990153E-03 +3.192127E-07 1.271744E-03 -8.086665E-09 +8.086669E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat index 3b5aea51fd9..5200ac7ec65 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835753E+01 -2.336672E+01 +6.835756E+01 +2.336674E+01 2.537239E+01 -3.219878E+00 +3.219879E+00 6.175132E+01 1.907257E+01 -4.341877E+01 -9.426414E+00 +4.341878E+01 +9.426419E+00 6.455425E+00 -2.083854E-01 +2.083855E-01 1.571121E+01 1.234347E+00 -2.955121E+01 -4.366402E+00 +2.955122E+01 +4.366403E+00 9.570792E-01 4.580066E-03 2.329339E+00 2.712948E-02 -3.767888E+01 -7.098576E+00 +3.767889E+01 +7.098579E+00 1.254652E+00 -7.871022E-03 +7.871025E-03 3.053572E+00 -4.662307E-02 -9.745115E+01 -4.748373E+01 +4.662309E-02 +9.745117E+01 +4.748374E+01 1.144254E+00 -6.546618E-03 -2.784920E+00 -3.877907E-02 +6.546620E-03 +2.784921E+00 +3.877908E-02 2.110520E+02 -2.227225E+02 -3.220667E-01 -5.186770E-04 -7.969316E-01 -3.175758E-03 -1.122226E+02 -6.298107E+01 +2.227226E+02 +3.220668E-01 +5.186772E-04 +7.969317E-01 +3.175759E-03 +1.122227E+02 +6.298109E+01 1.521758E+00 1.158468E-02 4.232692E+00 -8.962439E-02 +8.962442E-02 1.129470E+02 -6.378585E+01 +6.378591E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.346407E+01 -1.429216E+01 +5.346409E+01 +1.429217E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.113247E+01 -4.846178E+00 +3.113248E+01 +4.846180E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.104801E+01 -8.424780E+00 +4.104802E+01 +8.424783E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.824005E+01 -4.825571E+01 +9.824006E+01 +4.825572E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.889103E+02 -1.784413E+02 +1.784414E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.679730E+01 -4.686267E+01 +9.679731E+01 +4.686268E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.897828E+01 -1.739342E+01 +5.897831E+01 +1.739344E+01 2.181862E+01 -2.380831E+00 -5.310215E+01 -1.410257E+01 -4.079874E+01 -8.322938E+00 -6.064469E+00 -1.839035E-01 +2.380832E+00 +5.310216E+01 +1.410258E+01 +4.079875E+01 +8.322942E+00 +6.064470E+00 +1.839036E-01 1.475971E+01 1.089331E+00 2.912006E+01 -4.239913E+00 +4.239914E+00 9.439565E-01 4.455323E-03 2.297401E+00 -2.639057E-02 +2.639058E-02 3.702869E+01 -6.855691E+00 +6.855693E+00 1.233605E+00 -7.609156E-03 +7.609159E-03 3.002348E+00 -4.507194E-02 -9.753766E+01 -4.756805E+01 +4.507196E-02 +9.753767E+01 +4.756807E+01 1.146053E+00 -6.567213E-03 -2.789298E+00 -3.890107E-02 +6.567215E-03 +2.789299E+00 +3.890108E-02 2.153332E+02 -2.318479E+02 +2.318480E+02 3.284890E-01 -5.395580E-04 -8.128230E-01 -3.303608E-03 -1.140093E+02 -6.500131E+01 +5.395582E-04 +8.128231E-01 +3.303609E-03 +1.140094E+02 +6.500133E+01 1.542171E+00 -1.189591E-02 +1.189592E-02 4.289470E+00 -9.203227E-02 -6.822486E+01 -2.327587E+01 +9.203230E-02 +6.822489E+01 +2.327589E+01 2.539951E+01 3.226691E+00 6.181733E+01 1.911292E+01 -4.337628E+01 -9.407949E+00 +4.337629E+01 +9.407953E+00 6.468668E+00 2.092395E-01 -1.574344E+01 +1.574345E+01 1.239406E+00 2.954196E+01 -4.363673E+00 -9.596121E-01 +4.363674E+00 +9.596122E-01 4.604345E-03 2.335504E+00 2.727329E-02 3.766621E+01 -7.093810E+00 -1.257977E+00 -7.912792E-03 -3.061665E+00 -4.687049E-02 -9.745956E+01 -4.749193E+01 -1.147703E+00 -6.586141E-03 +7.093812E+00 +1.257978E+00 +7.912794E-03 +3.061666E+00 +4.687051E-02 +9.745958E+01 +4.749194E+01 +1.147704E+00 +6.586143E-03 2.793315E+00 -3.901318E-02 +3.901320E-02 2.111701E+02 -2.229708E+02 -3.231290E-01 -5.220986E-04 -7.995602E-01 -3.196707E-03 +2.229709E+02 +3.231291E-01 +5.220987E-04 +7.995603E-01 +3.196708E-03 1.122514E+02 -6.301118E+01 +6.301119E+01 1.525955E+00 -1.164801E-02 +1.164802E-02 4.244367E+00 -9.011440E-02 +9.011441E-02 tally 2: 3.727210E-01 6.946049E-04 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat index db723684684..97167c4acb6 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.841005E+01 -2.340265E+01 -2.539210E+01 -3.224885E+00 -6.179930E+01 -1.910222E+01 -4.345797E+01 -9.443447E+00 -6.461267E+00 -2.087628E-01 -1.572543E+01 -1.236582E+00 -2.958150E+01 -4.375358E+00 -9.580607E-01 -4.589465E-03 -2.331728E+00 -2.718515E-02 -3.771761E+01 -7.113176E+00 -1.255942E+00 -7.887221E-03 -3.056712E+00 -4.671902E-02 -9.755568E+01 -4.758565E+01 -1.145482E+00 -6.560671E-03 -2.787908E+00 -3.886231E-02 -2.112847E+02 -2.232140E+02 -3.224203E-01 -5.198164E-04 -7.978065E-01 -3.182734E-03 -1.123399E+02 -6.311276E+01 -1.523335E+00 -1.160870E-02 -4.237078E+00 -8.981024E-02 -1.130416E+02 -6.389274E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.351357E+01 -1.431864E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.116479E+01 -4.856246E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.109114E+01 -8.442495E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.834631E+01 -4.836016E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.891193E+02 -1.788365E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.689934E+01 -4.696152E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.902249E+01 -1.741951E+01 -2.183516E+01 -2.384444E+00 -5.314242E+01 -1.412397E+01 -4.083555E+01 -8.337963E+00 -6.069956E+00 -1.842364E-01 -1.477306E+01 -1.091303E+00 -2.914981E+01 -4.248581E+00 -9.449218E-01 -4.464439E-03 -2.299750E+00 -2.644457E-02 -3.706650E+01 -6.869699E+00 -1.234866E+00 -7.624725E-03 -3.005418E+00 -4.516416E-02 -9.764194E+01 -4.766982E+01 -1.147279E+00 -6.581267E-03 -2.792281E+00 -3.898431E-02 -2.155704E+02 -2.323591E+02 -3.288491E-01 -5.407419E-04 -8.137142E-01 -3.310856E-03 -1.141284E+02 -6.513710E+01 -1.543767E+00 -1.192055E-02 -4.293910E+00 -9.222288E-02 -6.827724E+01 -2.331163E+01 -2.541923E+01 -3.231703E+00 -6.186532E+01 -1.914261E+01 -4.341544E+01 -9.424942E+00 -6.474521E+00 -2.096183E-01 -1.575769E+01 -1.241649E+00 -2.957223E+01 -4.372622E+00 -9.605961E-01 -4.613792E-03 -2.337899E+00 -2.732925E-02 -3.770491E+01 -7.108396E+00 -1.259271E+00 -7.929072E-03 -3.064813E+00 -4.696693E-02 -9.756409E+01 -4.759386E+01 -1.148934E+00 -6.600277E-03 -2.796311E+00 -3.909692E-02 -2.114030E+02 -2.234629E+02 -3.234838E-01 -5.232457E-04 -8.004381E-01 -3.203731E-03 -1.123687E+02 -6.314294E+01 -1.527537E+00 -1.167217E-02 -4.248767E+00 -9.030131E-02 +6.841014E+01 +2.340271E+01 +2.539213E+01 +3.224892E+00 +6.179937E+01 +1.910227E+01 +4.345803E+01 +9.443470E+00 +6.461275E+00 +2.087633E-01 +1.572545E+01 +1.236585E+00 +2.958154E+01 +4.375368E+00 +9.580618E-01 +4.589475E-03 +2.331731E+00 +2.718521E-02 +3.771765E+01 +7.113193E+00 +1.255944E+00 +7.887240E-03 +3.056716E+00 +4.671914E-02 +9.755580E+01 +4.758576E+01 +1.145483E+00 +6.560687E-03 +2.787911E+00 +3.886241E-02 +2.112850E+02 +2.232146E+02 +3.224207E-01 +5.198176E-04 +7.978074E-01 +3.182742E-03 +1.123400E+02 +6.311292E+01 +1.523337E+00 +1.160873E-02 +4.237083E+00 +8.981046E-02 +1.130417E+02 +6.389290E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.351363E+01 +1.431867E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116483E+01 +4.856257E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.109119E+01 +8.442515E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.834643E+01 +4.836027E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891195E+02 +1.788369E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.689946E+01 +4.696163E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.902258E+01 +1.741956E+01 +2.183519E+01 +2.384450E+00 +5.314249E+01 +1.412401E+01 +4.083560E+01 +8.337984E+00 +6.069963E+00 +1.842369E-01 +1.477308E+01 +1.091305E+00 +2.914984E+01 +4.248591E+00 +9.449228E-01 +4.464449E-03 +2.299753E+00 +2.644464E-02 +3.706654E+01 +6.869716E+00 +1.234868E+00 +7.624744E-03 +3.005421E+00 +4.516427E-02 +9.764206E+01 +4.766994E+01 +1.147280E+00 +6.581283E-03 +2.792284E+00 +3.898441E-02 +2.155707E+02 +2.323596E+02 +3.288495E-01 +5.407431E-04 +8.137152E-01 +3.310864E-03 +1.141285E+02 +6.513725E+01 +1.543769E+00 +1.192058E-02 +4.293915E+00 +9.222311E-02 +6.827732E+01 +2.331168E+01 +2.541926E+01 +3.231710E+00 +6.186540E+01 +1.914265E+01 +4.341549E+01 +9.424964E+00 +6.474528E+00 +2.096188E-01 +1.575771E+01 +1.241652E+00 +2.957227E+01 +4.372632E+00 +9.605972E-01 +4.613802E-03 +2.337901E+00 +2.732931E-02 +3.770496E+01 +7.108413E+00 +1.259272E+00 +7.929092E-03 +3.064817E+00 +4.696704E-02 +9.756421E+01 +4.759397E+01 +1.148936E+00 +6.600293E-03 +2.796314E+00 +3.909702E-02 +2.114033E+02 +2.234634E+02 +3.234842E-01 +5.232469E-04 +8.004390E-01 +3.203738E-03 +1.123688E+02 +6.314309E+01 +1.527539E+00 +1.167220E-02 +4.248772E+00 +9.030152E-02 tally 2: 3.727211E-01 6.946052E-04 @@ -185,7 +185,7 @@ tally 2: 8.000435E-03 3.200348E-07 1.273182E-03 -8.104960E-09 +8.104961E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -214,7 +214,7 @@ tally 2: 1.163444E-04 2.058001E-02 2.117684E-06 -7.142754E-03 +7.142755E-03 2.550947E-07 1.136691E-03 6.460335E-09 @@ -233,4 +233,4 @@ tally 2: 7.989016E-03 3.191219E-07 1.271365E-03 -8.081840E-09 +8.081841E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat index bac8902424a..7d455f49fdc 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.846312E+01 -2.343897E+01 -2.541202E+01 -3.229945E+00 -6.184776E+01 -1.913220E+01 -4.349759E+01 -9.460674E+00 -6.467170E+00 -2.091445E-01 -1.573980E+01 -1.238843E+00 -2.961211E+01 -4.384415E+00 -9.590524E-01 -4.598971E-03 -2.334141E+00 -2.724146E-02 -3.775673E+01 -7.127940E+00 -1.257246E+00 -7.903602E-03 -3.059885E+00 -4.681606E-02 -9.766123E+01 -4.768868E+01 -1.146721E+00 -6.574876E-03 -2.790924E+00 -3.894646E-02 -2.115196E+02 -2.237105E+02 -3.227770E-01 -5.209674E-04 -7.986892E-01 -3.189781E-03 -1.124582E+02 -6.324576E+01 -1.524926E+00 -1.163296E-02 -4.241504E+00 -8.999793E-02 -1.131371E+02 -6.400083E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.356358E+01 -1.434541E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.119744E+01 -4.866426E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.113471E+01 -8.460406E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.845360E+01 -4.846573E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.893303E+02 -1.792356E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.700227E+01 -4.706134E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.906717E+01 -1.744589E+01 -2.185188E+01 -2.388096E+00 -5.318310E+01 -1.414560E+01 -4.087275E+01 -8.353159E+00 -6.075499E+00 -1.845731E-01 -1.478655E+01 -1.093297E+00 -2.917987E+01 -4.257348E+00 -9.458970E-01 -4.473659E-03 -2.302124E+00 -2.649919E-02 -3.710470E+01 -6.883867E+00 -1.236141E+00 -7.640471E-03 -3.008519E+00 -4.525743E-02 -9.774725E+01 -4.777270E+01 -1.148516E+00 -6.595474E-03 -2.795293E+00 -3.906847E-02 -2.158098E+02 -2.328754E+02 -3.292126E-01 -5.419377E-04 -8.146135E-01 -3.318178E-03 -1.142484E+02 -6.527422E+01 -1.545377E+00 -1.194543E-02 -4.298389E+00 -9.241537E-02 -6.833016E+01 -2.334778E+01 -2.543915E+01 -3.236770E+00 -6.191381E+01 -1.917263E+01 -4.345500E+01 -9.442129E+00 -6.480434E+00 -2.100014E-01 -1.577208E+01 -1.243919E+00 -2.960282E+01 -4.381672E+00 -9.615903E-01 -4.623347E-03 -2.340318E+00 -2.738585E-02 -3.774401E+01 -7.123146E+00 -1.260578E+00 -7.945537E-03 -3.067994E+00 -4.706446E-02 -9.766964E+01 -4.769689E+01 -1.150177E+00 -6.614567E-03 -2.799336E+00 -3.918157E-02 -2.116380E+02 -2.239600E+02 -3.238418E-01 -5.244043E-04 -8.013238E-01 -3.210825E-03 -1.124870E+02 -6.327601E+01 -1.529133E+00 -1.169657E-02 -4.253205E+00 -9.049007E-02 +6.846326E+01 +2.343906E+01 +2.541206E+01 +3.229957E+00 +6.184788E+01 +1.913227E+01 +4.349768E+01 +9.460710E+00 +6.467182E+00 +2.091452E-01 +1.573983E+01 +1.238847E+00 +2.961216E+01 +4.384431E+00 +9.590541E-01 +4.598987E-03 +2.334146E+00 +2.724155E-02 +3.775680E+01 +7.127966E+00 +1.257248E+00 +7.903631E-03 +3.059891E+00 +4.681623E-02 +9.766141E+01 +4.768885E+01 +1.146723E+00 +6.574901E-03 +2.790929E+00 +3.894660E-02 +2.115200E+02 +2.237114E+02 +3.227776E-01 +5.209693E-04 +7.986907E-01 +3.189793E-03 +1.124584E+02 +6.324599E+01 +1.524929E+00 +1.163300E-02 +4.241512E+00 +8.999826E-02 +1.131374E+02 +6.400109E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.356368E+01 +1.434547E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.119750E+01 +4.866444E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.113478E+01 +8.460437E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.845378E+01 +4.846591E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.893306E+02 +1.792363E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.700245E+01 +4.706152E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.906729E+01 +1.744596E+01 +2.185192E+01 +2.388105E+00 +5.318321E+01 +1.414566E+01 +4.087282E+01 +8.353191E+00 +6.075510E+00 +1.845738E-01 +1.478658E+01 +1.093301E+00 +2.917992E+01 +4.257364E+00 +9.458987E-01 +4.473675E-03 +2.302128E+00 +2.649928E-02 +3.710477E+01 +6.883893E+00 +1.236143E+00 +7.640499E-03 +3.008525E+00 +4.525760E-02 +9.774743E+01 +4.777288E+01 +1.148518E+00 +6.595498E-03 +2.795298E+00 +3.906861E-02 +2.158102E+02 +2.328763E+02 +3.292132E-01 +5.419397E-04 +8.146150E-01 +3.318191E-03 +1.142486E+02 +6.527446E+01 +1.545380E+00 +1.194548E-02 +4.298397E+00 +9.241572E-02 +6.833030E+01 +2.334787E+01 +2.543920E+01 +3.236782E+00 +6.191392E+01 +1.917269E+01 +4.345509E+01 +9.442165E+00 +6.480446E+00 +2.100022E-01 +1.577211E+01 +1.243923E+00 +2.960287E+01 +4.381688E+00 +9.615920E-01 +4.623363E-03 +2.340322E+00 +2.738594E-02 +3.774408E+01 +7.123173E+00 +1.260580E+00 +7.945567E-03 +3.067999E+00 +4.706463E-02 +9.766982E+01 +4.769706E+01 +1.150180E+00 +6.614591E-03 +2.799341E+00 +3.918171E-02 +2.116384E+02 +2.239608E+02 +3.238424E-01 +5.244063E-04 +8.013253E-01 +3.210837E-03 +1.124872E+02 +6.327624E+01 +1.529136E+00 +1.169661E-02 +4.253213E+00 +9.049039E-02 tally 2: 3.727212E-01 6.946055E-04 @@ -185,7 +185,7 @@ tally 2: 8.000705E-03 3.200564E-07 1.273273E-03 -8.106118E-09 +8.106120E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -213,11 +213,11 @@ tally 2: 1.525423E-01 1.163458E-04 2.058029E-02 -2.117742E-06 +2.117743E-06 7.142994E-03 2.551118E-07 1.136772E-03 -6.461253E-09 +6.461254E-09 3.721892E-01 6.926241E-04 8.037371E-01 @@ -230,7 +230,7 @@ tally 2: 1.455479E-04 2.301861E-02 2.649283E-06 -7.989285E-03 +7.989286E-03 3.191434E-07 -1.271455E-03 -8.082995E-09 +1.271456E-03 +8.082996E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat index 2625ac2a347..6114b3cd064 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.851755E+01 -2.347625E+01 -2.543244E+01 -3.235138E+00 -6.189746E+01 -1.916296E+01 -4.353807E+01 -9.478290E+00 -6.473201E+00 -2.095347E-01 -1.575448E+01 -1.241154E+00 -2.964329E+01 -4.393655E+00 -9.600630E-01 -4.608668E-03 -2.336601E+00 -2.729890E-02 -3.779660E+01 -7.143001E+00 -1.258574E+00 -7.920313E-03 -3.063118E+00 -4.691505E-02 -9.776873E+01 -4.779372E+01 -1.147984E+00 -6.589359E-03 -2.793996E+00 -3.903225E-02 -2.117587E+02 -2.242166E+02 -3.231403E-01 -5.221406E-04 -7.995881E-01 -3.196965E-03 -1.125788E+02 -6.338145E+01 -1.526548E+00 -1.165771E-02 -4.246015E+00 -9.018945E-02 -1.132350E+02 -6.411155E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361464E+01 -1.437278E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123071E+01 -4.876810E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117909E+01 -8.478672E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856285E+01 -4.857335E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895450E+02 -1.796425E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710717E+01 -4.716318E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911301E+01 -1.747298E+01 -2.186903E+01 -2.391846E+00 -5.322484E+01 -1.416782E+01 -4.091074E+01 -8.368698E+00 -6.081162E+00 -1.849173E-01 -1.480033E+01 -1.095336E+00 -2.921050E+01 -4.266292E+00 -9.468909E-01 -4.483065E-03 -2.304543E+00 -2.655491E-02 -3.714364E+01 -6.898322E+00 -1.237440E+00 -7.656535E-03 -3.011680E+00 -4.535258E-02 -9.785450E+01 -4.787760E+01 -1.149777E+00 -6.609958E-03 -2.798361E+00 -3.915427E-02 -2.160535E+02 -2.334017E+02 -3.295826E-01 -5.431567E-04 -8.155291E-01 -3.325642E-03 -1.143708E+02 -6.541413E+01 -1.547019E+00 -1.197082E-02 -4.302955E+00 -9.261180E-02 -6.838444E+01 -2.338489E+01 -2.545958E+01 -3.241970E+00 -6.196352E+01 -1.920343E+01 -4.349543E+01 -9.459705E+00 -6.486476E+00 -2.103931E-01 -1.578678E+01 -1.246239E+00 -2.963399E+01 -4.390905E+00 -9.626034E-01 -4.633094E-03 -2.342784E+00 -2.744358E-02 -3.778386E+01 -7.138194E+00 -1.261909E+00 -7.962333E-03 -3.071235E+00 -4.716395E-02 -9.777713E+01 -4.780194E+01 -1.151443E+00 -6.629136E-03 -2.802417E+00 -3.926787E-02 -2.118773E+02 -2.244667E+02 -3.242063E-01 -5.255855E-04 -8.022257E-01 -3.218057E-03 -1.126076E+02 -6.341177E+01 -1.530759E+00 -1.172147E-02 -4.257730E+00 -9.068268E-02 +6.851773E+01 +2.347638E+01 +2.543250E+01 +3.235154E+00 +6.189761E+01 +1.916305E+01 +4.353818E+01 +9.478338E+00 +6.473217E+00 +2.095358E-01 +1.575452E+01 +1.241161E+00 +2.964337E+01 +4.393677E+00 +9.600653E-01 +4.608690E-03 +2.336607E+00 +2.729903E-02 +3.779670E+01 +7.143037E+00 +1.258578E+00 +7.920353E-03 +3.063126E+00 +4.691528E-02 +9.776897E+01 +4.779395E+01 +1.147986E+00 +6.589392E-03 +2.794003E+00 +3.903244E-02 +2.117592E+02 +2.242177E+02 +3.231411E-01 +5.221432E-04 +7.995900E-01 +3.196980E-03 +1.125791E+02 +6.338177E+01 +1.526551E+00 +1.165777E-02 +4.246026E+00 +9.018990E-02 +1.132353E+02 +6.411189E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361478E+01 +1.437285E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123078E+01 +4.876834E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117919E+01 +8.478714E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856309E+01 +4.857359E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895455E+02 +1.796434E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710741E+01 +4.716341E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911317E+01 +1.747308E+01 +2.186909E+01 +2.391858E+00 +5.322498E+01 +1.416789E+01 +4.091085E+01 +8.368741E+00 +6.081177E+00 +1.849182E-01 +1.480037E+01 +1.095342E+00 +2.921058E+01 +4.266313E+00 +9.468932E-01 +4.483087E-03 +2.304548E+00 +2.655503E-02 +3.714373E+01 +6.898356E+00 +1.237443E+00 +7.656573E-03 +3.011688E+00 +4.535281E-02 +9.785474E+01 +4.787783E+01 +1.149780E+00 +6.609991E-03 +2.798368E+00 +3.915446E-02 +2.160541E+02 +2.334029E+02 +3.295834E-01 +5.431594E-04 +8.155311E-01 +3.325659E-03 +1.143711E+02 +6.541445E+01 +1.547023E+00 +1.197088E-02 +4.302966E+00 +9.261227E-02 +6.838461E+01 +2.338501E+01 +2.545964E+01 +3.241986E+00 +6.196367E+01 +1.920352E+01 +4.349554E+01 +9.459752E+00 +6.486491E+00 +2.103942E-01 +1.578682E+01 +1.246245E+00 +2.963407E+01 +4.390927E+00 +9.626057E-01 +4.633116E-03 +2.342790E+00 +2.744371E-02 +3.778395E+01 +7.138229E+00 +1.261912E+00 +7.962373E-03 +3.071242E+00 +4.716418E-02 +9.777738E+01 +4.780217E+01 +1.151446E+00 +6.629169E-03 +2.802424E+00 +3.926806E-02 +2.118778E+02 +2.244678E+02 +3.242071E-01 +5.255880E-04 +8.022277E-01 +3.218073E-03 +1.126079E+02 +6.341209E+01 +1.530763E+00 +1.172153E-02 +4.257740E+00 +9.068312E-02 tally 2: 3.727213E-01 6.946060E-04 @@ -182,10 +182,10 @@ tally 2: 1.459668E-04 2.305197E-02 2.656966E-06 -8.001084E-03 +8.001085E-03 3.200868E-07 1.273400E-03 -8.107736E-09 +8.107739E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -217,7 +217,7 @@ tally 2: 7.143331E-03 2.551359E-07 1.136885E-03 -6.462535E-09 +6.462537E-09 3.721894E-01 6.926247E-04 8.037378E-01 @@ -230,7 +230,7 @@ tally 2: 1.455504E-04 2.301907E-02 2.649387E-06 -7.989664E-03 +7.989665E-03 3.191737E-07 1.271582E-03 -8.084607E-09 +8.084610E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat index 5d21c6febfc..a30dfa88059 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.857321E+01 -2.351441E+01 -2.545331E+01 -3.240452E+00 -6.194827E+01 -1.919443E+01 -4.357935E+01 -9.496270E+00 -6.479351E+00 -2.099331E-01 -1.576944E+01 -1.243514E+00 -2.967503E+01 -4.403069E+00 -9.610914E-01 -4.618547E-03 -2.339104E+00 -2.735741E-02 -3.783717E+01 -7.158344E+00 -1.259926E+00 -7.937337E-03 -3.066408E+00 -4.701588E-02 -9.787805E+01 -4.790066E+01 -1.149267E+00 -6.604105E-03 -2.797121E+00 -3.911960E-02 -2.120018E+02 -2.247317E+02 -3.235096E-01 -5.233348E-04 -8.005019E-01 -3.204276E-03 -1.127015E+02 -6.351966E+01 -1.528198E+00 -1.168293E-02 -4.250605E+00 -9.038454E-02 -1.133348E+02 -6.422471E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366670E+01 -1.440070E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126455E+01 -4.887386E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122424E+01 -8.497275E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867395E+01 -4.868292E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897633E+02 -1.800565E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721388E+01 -4.726689E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.915992E+01 -1.750072E+01 -2.188657E+01 -2.395685E+00 -5.326754E+01 -1.419056E+01 -4.094949E+01 -8.384559E+00 -6.086937E+00 -1.852687E-01 -1.481439E+01 -1.097417E+00 -2.924168E+01 -4.275405E+00 -9.479024E-01 -4.492648E-03 -2.307005E+00 -2.661167E-02 -3.718326E+01 -6.913048E+00 -1.238761E+00 -7.672900E-03 -3.014897E+00 -4.544952E-02 -9.796358E+01 -4.798440E+01 -1.151059E+00 -6.624706E-03 -2.801481E+00 -3.924163E-02 -2.163013E+02 -2.339374E+02 -3.299589E-01 -5.443975E-04 -8.164601E-01 -3.333239E-03 -1.144953E+02 -6.555663E+01 -1.548689E+00 -1.199669E-02 -4.307601E+00 -9.281190E-02 -6.843995E+01 -2.342287E+01 -2.548046E+01 -3.247292E+00 -6.201435E+01 -1.923495E+01 -4.353665E+01 -9.477643E+00 -6.492636E+00 -2.107930E-01 -1.580178E+01 -1.248607E+00 -2.966572E+01 -4.400311E+00 -9.636344E-01 -4.643024E-03 -2.345293E+00 -2.750240E-02 -3.782441E+01 -7.153523E+00 -1.263264E+00 -7.979443E-03 -3.074533E+00 -4.726529E-02 -9.788645E+01 -4.790889E+01 -1.152731E+00 -6.643969E-03 -2.805551E+00 -3.935573E-02 -2.121205E+02 -2.249823E+02 -3.245768E-01 -5.267876E-04 -8.031427E-01 -3.225417E-03 -1.127304E+02 -6.355006E+01 -1.532415E+00 -1.174683E-02 -4.262334E+00 -9.087889E-02 +6.857342E+01 +2.351456E+01 +2.545339E+01 +3.240472E+00 +6.194846E+01 +1.919455E+01 +4.357948E+01 +9.496329E+00 +6.479370E+00 +2.099343E-01 +1.576949E+01 +1.243521E+00 +2.967512E+01 +4.403095E+00 +9.610942E-01 +4.618574E-03 +2.339111E+00 +2.735758E-02 +3.783729E+01 +7.158388E+00 +1.259930E+00 +7.937385E-03 +3.066418E+00 +4.701617E-02 +9.787835E+01 +4.790095E+01 +1.149271E+00 +6.604145E-03 +2.797129E+00 +3.911983E-02 +2.120024E+02 +2.247331E+02 +3.235106E-01 +5.233379E-04 +8.005043E-01 +3.204296E-03 +1.127018E+02 +6.352005E+01 +1.528203E+00 +1.168300E-02 +4.250618E+00 +9.038510E-02 +1.133352E+02 +6.422512E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366687E+01 +1.440079E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126465E+01 +4.887416E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122436E+01 +8.497326E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867425E+01 +4.868321E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897639E+02 +1.800576E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721418E+01 +4.726718E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.916011E+01 +1.750084E+01 +2.188664E+01 +2.395700E+00 +5.326771E+01 +1.419065E+01 +4.094962E+01 +8.384611E+00 +6.086955E+00 +1.852698E-01 +1.481443E+01 +1.097424E+00 +2.924177E+01 +4.275430E+00 +9.479052E-01 +4.492675E-03 +2.307011E+00 +2.661183E-02 +3.718338E+01 +6.913090E+00 +1.238765E+00 +7.672947E-03 +3.014906E+00 +4.544980E-02 +9.796388E+01 +4.798469E+01 +1.151062E+00 +6.624747E-03 +2.801490E+00 +3.924187E-02 +2.163020E+02 +2.339388E+02 +3.299598E-01 +5.444008E-04 +8.164626E-01 +3.333259E-03 +1.144957E+02 +6.555703E+01 +1.548694E+00 +1.199676E-02 +4.307614E+00 +9.281247E-02 +6.844016E+01 +2.342301E+01 +2.548054E+01 +3.247311E+00 +6.201454E+01 +1.923506E+01 +4.353678E+01 +9.477701E+00 +6.492655E+00 +2.107942E-01 +1.580182E+01 +1.248615E+00 +2.966581E+01 +4.400337E+00 +9.636372E-01 +4.643051E-03 +2.345300E+00 +2.750256E-02 +3.782452E+01 +7.153566E+00 +1.263268E+00 +7.979492E-03 +3.074542E+00 +4.726558E-02 +9.788675E+01 +4.790918E+01 +1.152734E+00 +6.644009E-03 +2.805559E+00 +3.935597E-02 +2.121212E+02 +2.249837E+02 +3.245778E-01 +5.267908E-04 +8.031451E-01 +3.225437E-03 +1.127307E+02 +6.355044E+01 +1.532419E+00 +1.174690E-02 +4.262347E+00 +9.087943E-02 tally 2: 3.727215E-01 6.946067E-04 @@ -179,13 +179,13 @@ tally 2: 2.194480E-01 2.407872E-04 1.708625E-01 -1.459700E-04 -2.305255E-02 -2.657101E-06 -8.001573E-03 +1.459701E-04 +2.305256E-02 +2.657102E-06 +8.001574E-03 3.201259E-07 1.273562E-03 -8.109801E-09 +8.109804E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -213,11 +213,11 @@ tally 2: 1.525453E-01 1.163504E-04 2.058122E-02 -2.117932E-06 -7.143764E-03 -2.551668E-07 +2.117933E-06 +7.143765E-03 +2.551669E-07 1.137029E-03 -6.464170E-09 +6.464173E-09 3.721896E-01 6.926253E-04 8.037386E-01 @@ -230,7 +230,7 @@ tally 2: 1.455537E-04 2.301965E-02 2.649522E-06 -7.990152E-03 -3.192126E-07 +7.990153E-03 +3.192127E-07 1.271744E-03 -8.086665E-09 +8.086669E-09 From fd5c4cbfc8b14f2ca6c90bdfa791729b08c6eb0a Mon Sep 17 00:00:00 2001 From: yardasol Date: Thu, 9 Apr 2026 11:34:12 -0500 Subject: [PATCH 63/64] Revert "update tests" This reverts commit 9c1a73f38348df266750070f937fa5de6b9fc03d. --- .../isotropic/results_true_1.dat | 4 +- .../isotropic/results_true_2.dat | 12 +- .../isotropic/results_true_3.dat | 12 +- .../isotropic/results_true_4.dat | 14 +- .../isotropic/results_true_5.dat | 14 +- .../propagation/results_true_1.dat | 4 +- .../propagation/results_true_2.dat | 12 +- .../propagation/results_true_3.dat | 12 +- .../propagation/results_true_4.dat | 14 +- .../propagation/results_true_5.dat | 14 +- .../isotropic/results_true_1.dat | 178 ++++----- .../isotropic/results_true_2.dat | 342 ++++++++--------- .../isotropic/results_true_3.dat | 348 ++++++++--------- .../isotropic/results_true_4.dat | 346 ++++++++--------- .../isotropic/results_true_5.dat | 360 +++++++++--------- .../propagation/results_true_1.dat | 178 ++++----- .../propagation/results_true_2.dat | 342 ++++++++--------- .../propagation/results_true_3.dat | 348 ++++++++--------- .../propagation/results_true_4.dat | 346 ++++++++--------- .../propagation/results_true_5.dat | 360 +++++++++--------- 20 files changed, 1630 insertions(+), 1630 deletions(-) diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat index 99af0b925e9..a92843c016e 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_1.dat @@ -4,9 +4,9 @@ tally 1: 2.630191E+03 3.458954E+04 1.079890E+02 -5.830991E+01 +5.830990E+01 2.651432E+02 -3.515150E+02 +3.515149E+02 tally 2: 1.077582E+00 5.805916E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat index 2adcc7d60e5..1593f2550e3 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628846E+03 -3.455416E+04 -1.078947E+02 -5.820806E+01 -2.649123E+02 -3.509029E+02 +2.628844E+03 +3.455412E+04 +1.078946E+02 +5.820797E+01 +2.649121E+02 +3.509024E+02 tally 2: 1.077582E+00 5.805915E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat index 8c1780809f6..b51d718be21 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.626025E+03 -3.448006E+04 -1.077396E+02 -5.804082E+01 -2.645322E+02 -3.498966E+02 +2.626023E+03 +3.447999E+04 +1.077395E+02 +5.804071E+01 +2.645319E+02 +3.498959E+02 tally 2: 1.077582E+00 5.805913E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat index c6990b4cfe5..397a03896ad 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_4.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621902E+03 -3.437185E+04 -1.075310E+02 -5.781629E+01 -2.640207E+02 -3.485449E+02 +2.621898E+03 +3.437177E+04 +1.075308E+02 +5.781614E+01 +2.640203E+02 +3.485440E+02 tally 2: 1.077581E+00 5.805908E-03 @@ -23,4 +23,4 @@ tally 2: 2.312757E-02 2.674422E-06 3.680018E-03 -6.771266E-08 +6.771265E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat index 15c1bf1d97e..45797f0de66 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/isotropic/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616591E+03 -3.423275E+04 -1.072737E+02 -5.753995E+01 -2.633897E+02 -3.468809E+02 +2.616587E+03 +3.423265E+04 +1.072735E+02 +5.753976E+01 +2.633892E+02 +3.468797E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -23,4 +23,4 @@ tally 2: 2.312557E-02 2.673959E-06 3.679344E-03 -6.768788E-08 +6.768786E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat index 99af0b925e9..a92843c016e 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_1.dat @@ -4,9 +4,9 @@ tally 1: 2.630191E+03 3.458954E+04 1.079890E+02 -5.830991E+01 +5.830990E+01 2.651432E+02 -3.515150E+02 +3.515149E+02 tally 2: 1.077582E+00 5.805916E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat index 2adcc7d60e5..1593f2550e3 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_2.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.628846E+03 -3.455416E+04 -1.078947E+02 -5.820806E+01 -2.649123E+02 -3.509029E+02 +2.628844E+03 +3.455412E+04 +1.078946E+02 +5.820797E+01 +2.649121E+02 +3.509024E+02 tally 2: 1.077582E+00 5.805915E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat index 8c1780809f6..b51d718be21 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_3.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.626025E+03 -3.448006E+04 -1.077396E+02 -5.804082E+01 -2.645322E+02 -3.498966E+02 +2.626023E+03 +3.447999E+04 +1.077395E+02 +5.804071E+01 +2.645319E+02 +3.498959E+02 tally 2: 1.077582E+00 5.805913E-03 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat index c6990b4cfe5..397a03896ad 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_4.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.621902E+03 -3.437185E+04 -1.075310E+02 -5.781629E+01 -2.640207E+02 -3.485449E+02 +2.621898E+03 +3.437177E+04 +1.075308E+02 +5.781614E+01 +2.640203E+02 +3.485440E+02 tally 2: 1.077581E+00 5.805908E-03 @@ -23,4 +23,4 @@ tally 2: 2.312757E-02 2.674422E-06 3.680018E-03 -6.771266E-08 +6.771265E-08 diff --git a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat index 15c1bf1d97e..45797f0de66 100644 --- a/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_kinetic/propagation/results_true_5.dat @@ -1,12 +1,12 @@ k-combined: 1.325787E+00 5.102917E-04 tally 1: -2.616591E+03 -3.423275E+04 -1.072737E+02 -5.753995E+01 -2.633897E+02 -3.468809E+02 +2.616587E+03 +3.423265E+04 +1.072735E+02 +5.753976E+01 +2.633892E+02 +3.468797E+02 tally 2: 1.077581E+00 5.805900E-03 @@ -23,4 +23,4 @@ tally 2: 2.312557E-02 2.673959E-06 3.679344E-03 -6.768788E-08 +6.768786E-08 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat index 5200ac7ec65..3b5aea51fd9 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835756E+01 -2.336674E+01 +6.835753E+01 +2.336672E+01 2.537239E+01 -3.219879E+00 +3.219878E+00 6.175132E+01 1.907257E+01 -4.341878E+01 -9.426419E+00 +4.341877E+01 +9.426414E+00 6.455425E+00 -2.083855E-01 +2.083854E-01 1.571121E+01 1.234347E+00 -2.955122E+01 -4.366403E+00 +2.955121E+01 +4.366402E+00 9.570792E-01 4.580066E-03 2.329339E+00 2.712948E-02 -3.767889E+01 -7.098579E+00 +3.767888E+01 +7.098576E+00 1.254652E+00 -7.871025E-03 +7.871022E-03 3.053572E+00 -4.662309E-02 -9.745117E+01 -4.748374E+01 +4.662307E-02 +9.745115E+01 +4.748373E+01 1.144254E+00 -6.546620E-03 -2.784921E+00 -3.877908E-02 +6.546618E-03 +2.784920E+00 +3.877907E-02 2.110520E+02 -2.227226E+02 -3.220668E-01 -5.186772E-04 -7.969317E-01 -3.175759E-03 -1.122227E+02 -6.298109E+01 +2.227225E+02 +3.220667E-01 +5.186770E-04 +7.969316E-01 +3.175758E-03 +1.122226E+02 +6.298107E+01 1.521758E+00 1.158468E-02 4.232692E+00 -8.962442E-02 +8.962439E-02 1.129470E+02 -6.378591E+01 +6.378585E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.346409E+01 -1.429217E+01 +5.346407E+01 +1.429216E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.113248E+01 -4.846180E+00 +3.113247E+01 +4.846178E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.104802E+01 -8.424783E+00 +4.104801E+01 +8.424780E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.824006E+01 -4.825572E+01 +9.824005E+01 +4.825571E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.889103E+02 -1.784414E+02 +1.784413E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.679731E+01 -4.686268E+01 +9.679730E+01 +4.686267E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.897831E+01 -1.739344E+01 +5.897828E+01 +1.739342E+01 2.181862E+01 -2.380832E+00 -5.310216E+01 -1.410258E+01 -4.079875E+01 -8.322942E+00 -6.064470E+00 -1.839036E-01 +2.380831E+00 +5.310215E+01 +1.410257E+01 +4.079874E+01 +8.322938E+00 +6.064469E+00 +1.839035E-01 1.475971E+01 1.089331E+00 2.912006E+01 -4.239914E+00 +4.239913E+00 9.439565E-01 4.455323E-03 2.297401E+00 -2.639058E-02 +2.639057E-02 3.702869E+01 -6.855693E+00 +6.855691E+00 1.233605E+00 -7.609159E-03 +7.609156E-03 3.002348E+00 -4.507196E-02 -9.753767E+01 -4.756807E+01 +4.507194E-02 +9.753766E+01 +4.756805E+01 1.146053E+00 -6.567215E-03 -2.789299E+00 -3.890108E-02 +6.567213E-03 +2.789298E+00 +3.890107E-02 2.153332E+02 -2.318480E+02 +2.318479E+02 3.284890E-01 -5.395582E-04 -8.128231E-01 -3.303609E-03 -1.140094E+02 -6.500133E+01 +5.395580E-04 +8.128230E-01 +3.303608E-03 +1.140093E+02 +6.500131E+01 1.542171E+00 -1.189592E-02 +1.189591E-02 4.289470E+00 -9.203230E-02 -6.822489E+01 -2.327589E+01 +9.203227E-02 +6.822486E+01 +2.327587E+01 2.539951E+01 3.226691E+00 6.181733E+01 1.911292E+01 -4.337629E+01 -9.407953E+00 +4.337628E+01 +9.407949E+00 6.468668E+00 2.092395E-01 -1.574345E+01 +1.574344E+01 1.239406E+00 2.954196E+01 -4.363674E+00 -9.596122E-01 +4.363673E+00 +9.596121E-01 4.604345E-03 2.335504E+00 2.727329E-02 3.766621E+01 -7.093812E+00 -1.257978E+00 -7.912794E-03 -3.061666E+00 -4.687051E-02 -9.745958E+01 -4.749194E+01 -1.147704E+00 -6.586143E-03 +7.093810E+00 +1.257977E+00 +7.912792E-03 +3.061665E+00 +4.687049E-02 +9.745956E+01 +4.749193E+01 +1.147703E+00 +6.586141E-03 2.793315E+00 -3.901320E-02 +3.901318E-02 2.111701E+02 -2.229709E+02 -3.231291E-01 -5.220987E-04 -7.995603E-01 -3.196708E-03 +2.229708E+02 +3.231290E-01 +5.220986E-04 +7.995602E-01 +3.196707E-03 1.122514E+02 -6.301119E+01 +6.301118E+01 1.525955E+00 -1.164802E-02 +1.164801E-02 4.244367E+00 -9.011441E-02 +9.011440E-02 tally 2: 3.727210E-01 6.946049E-04 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat index 97167c4acb6..db723684684 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_2.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.841014E+01 -2.340271E+01 -2.539213E+01 -3.224892E+00 -6.179937E+01 -1.910227E+01 -4.345803E+01 -9.443470E+00 -6.461275E+00 -2.087633E-01 -1.572545E+01 -1.236585E+00 -2.958154E+01 -4.375368E+00 -9.580618E-01 -4.589475E-03 -2.331731E+00 -2.718521E-02 -3.771765E+01 -7.113193E+00 -1.255944E+00 -7.887240E-03 -3.056716E+00 -4.671914E-02 -9.755580E+01 -4.758576E+01 -1.145483E+00 -6.560687E-03 -2.787911E+00 -3.886241E-02 -2.112850E+02 -2.232146E+02 -3.224207E-01 -5.198176E-04 -7.978074E-01 -3.182742E-03 -1.123400E+02 -6.311292E+01 -1.523337E+00 -1.160873E-02 -4.237083E+00 -8.981046E-02 -1.130417E+02 -6.389290E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.351363E+01 -1.431867E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.116483E+01 -4.856257E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.109119E+01 -8.442515E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.834643E+01 -4.836027E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.891195E+02 -1.788369E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.689946E+01 -4.696163E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.902258E+01 -1.741956E+01 -2.183519E+01 -2.384450E+00 -5.314249E+01 -1.412401E+01 -4.083560E+01 -8.337984E+00 -6.069963E+00 -1.842369E-01 -1.477308E+01 -1.091305E+00 -2.914984E+01 -4.248591E+00 -9.449228E-01 -4.464449E-03 -2.299753E+00 -2.644464E-02 -3.706654E+01 -6.869716E+00 -1.234868E+00 -7.624744E-03 -3.005421E+00 -4.516427E-02 -9.764206E+01 -4.766994E+01 -1.147280E+00 -6.581283E-03 -2.792284E+00 -3.898441E-02 -2.155707E+02 -2.323596E+02 -3.288495E-01 -5.407431E-04 -8.137152E-01 -3.310864E-03 -1.141285E+02 -6.513725E+01 -1.543769E+00 -1.192058E-02 -4.293915E+00 -9.222311E-02 -6.827732E+01 -2.331168E+01 -2.541926E+01 -3.231710E+00 -6.186540E+01 -1.914265E+01 -4.341549E+01 -9.424964E+00 -6.474528E+00 -2.096188E-01 -1.575771E+01 -1.241652E+00 -2.957227E+01 -4.372632E+00 -9.605972E-01 -4.613802E-03 -2.337901E+00 -2.732931E-02 -3.770496E+01 -7.108413E+00 -1.259272E+00 -7.929092E-03 -3.064817E+00 -4.696704E-02 -9.756421E+01 -4.759397E+01 -1.148936E+00 -6.600293E-03 -2.796314E+00 -3.909702E-02 -2.114033E+02 -2.234634E+02 -3.234842E-01 -5.232469E-04 -8.004390E-01 -3.203738E-03 -1.123688E+02 -6.314309E+01 -1.527539E+00 -1.167220E-02 -4.248772E+00 -9.030152E-02 +6.841005E+01 +2.340265E+01 +2.539210E+01 +3.224885E+00 +6.179930E+01 +1.910222E+01 +4.345797E+01 +9.443447E+00 +6.461267E+00 +2.087628E-01 +1.572543E+01 +1.236582E+00 +2.958150E+01 +4.375358E+00 +9.580607E-01 +4.589465E-03 +2.331728E+00 +2.718515E-02 +3.771761E+01 +7.113176E+00 +1.255942E+00 +7.887221E-03 +3.056712E+00 +4.671902E-02 +9.755568E+01 +4.758565E+01 +1.145482E+00 +6.560671E-03 +2.787908E+00 +3.886231E-02 +2.112847E+02 +2.232140E+02 +3.224203E-01 +5.198164E-04 +7.978065E-01 +3.182734E-03 +1.123399E+02 +6.311276E+01 +1.523335E+00 +1.160870E-02 +4.237078E+00 +8.981024E-02 +1.130416E+02 +6.389274E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.351357E+01 +1.431864E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116479E+01 +4.856246E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.109114E+01 +8.442495E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.834631E+01 +4.836016E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891193E+02 +1.788365E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.689934E+01 +4.696152E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.902249E+01 +1.741951E+01 +2.183516E+01 +2.384444E+00 +5.314242E+01 +1.412397E+01 +4.083555E+01 +8.337963E+00 +6.069956E+00 +1.842364E-01 +1.477306E+01 +1.091303E+00 +2.914981E+01 +4.248581E+00 +9.449218E-01 +4.464439E-03 +2.299750E+00 +2.644457E-02 +3.706650E+01 +6.869699E+00 +1.234866E+00 +7.624725E-03 +3.005418E+00 +4.516416E-02 +9.764194E+01 +4.766982E+01 +1.147279E+00 +6.581267E-03 +2.792281E+00 +3.898431E-02 +2.155704E+02 +2.323591E+02 +3.288491E-01 +5.407419E-04 +8.137142E-01 +3.310856E-03 +1.141284E+02 +6.513710E+01 +1.543767E+00 +1.192055E-02 +4.293910E+00 +9.222288E-02 +6.827724E+01 +2.331163E+01 +2.541923E+01 +3.231703E+00 +6.186532E+01 +1.914261E+01 +4.341544E+01 +9.424942E+00 +6.474521E+00 +2.096183E-01 +1.575769E+01 +1.241649E+00 +2.957223E+01 +4.372622E+00 +9.605961E-01 +4.613792E-03 +2.337899E+00 +2.732925E-02 +3.770491E+01 +7.108396E+00 +1.259271E+00 +7.929072E-03 +3.064813E+00 +4.696693E-02 +9.756409E+01 +4.759386E+01 +1.148934E+00 +6.600277E-03 +2.796311E+00 +3.909692E-02 +2.114030E+02 +2.234629E+02 +3.234838E-01 +5.232457E-04 +8.004381E-01 +3.203731E-03 +1.123687E+02 +6.314294E+01 +1.527537E+00 +1.167217E-02 +4.248767E+00 +9.030131E-02 tally 2: 3.727211E-01 6.946052E-04 @@ -185,7 +185,7 @@ tally 2: 8.000435E-03 3.200348E-07 1.273182E-03 -8.104961E-09 +8.104960E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -214,7 +214,7 @@ tally 2: 1.163444E-04 2.058001E-02 2.117684E-06 -7.142755E-03 +7.142754E-03 2.550947E-07 1.136691E-03 6.460335E-09 @@ -233,4 +233,4 @@ tally 2: 7.989016E-03 3.191219E-07 1.271365E-03 -8.081841E-09 +8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat index 7d455f49fdc..bac8902424a 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_3.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.846326E+01 -2.343906E+01 -2.541206E+01 -3.229957E+00 -6.184788E+01 -1.913227E+01 -4.349768E+01 -9.460710E+00 -6.467182E+00 -2.091452E-01 -1.573983E+01 -1.238847E+00 -2.961216E+01 -4.384431E+00 -9.590541E-01 -4.598987E-03 -2.334146E+00 -2.724155E-02 -3.775680E+01 -7.127966E+00 -1.257248E+00 -7.903631E-03 -3.059891E+00 -4.681623E-02 -9.766141E+01 -4.768885E+01 -1.146723E+00 -6.574901E-03 -2.790929E+00 -3.894660E-02 -2.115200E+02 -2.237114E+02 -3.227776E-01 -5.209693E-04 -7.986907E-01 -3.189793E-03 -1.124584E+02 -6.324599E+01 -1.524929E+00 -1.163300E-02 -4.241512E+00 -8.999826E-02 -1.131374E+02 -6.400109E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.356368E+01 -1.434547E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.119750E+01 -4.866444E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.113478E+01 -8.460437E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.845378E+01 -4.846591E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.893306E+02 -1.792363E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.700245E+01 -4.706152E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.906729E+01 -1.744596E+01 -2.185192E+01 -2.388105E+00 -5.318321E+01 -1.414566E+01 -4.087282E+01 -8.353191E+00 -6.075510E+00 -1.845738E-01 -1.478658E+01 -1.093301E+00 -2.917992E+01 -4.257364E+00 -9.458987E-01 -4.473675E-03 -2.302128E+00 -2.649928E-02 -3.710477E+01 -6.883893E+00 -1.236143E+00 -7.640499E-03 -3.008525E+00 -4.525760E-02 -9.774743E+01 -4.777288E+01 -1.148518E+00 -6.595498E-03 -2.795298E+00 -3.906861E-02 -2.158102E+02 -2.328763E+02 -3.292132E-01 -5.419397E-04 -8.146150E-01 -3.318191E-03 -1.142486E+02 -6.527446E+01 -1.545380E+00 -1.194548E-02 -4.298397E+00 -9.241572E-02 -6.833030E+01 -2.334787E+01 -2.543920E+01 -3.236782E+00 -6.191392E+01 -1.917269E+01 -4.345509E+01 -9.442165E+00 -6.480446E+00 -2.100022E-01 -1.577211E+01 -1.243923E+00 -2.960287E+01 -4.381688E+00 -9.615920E-01 -4.623363E-03 -2.340322E+00 -2.738594E-02 -3.774408E+01 -7.123173E+00 -1.260580E+00 -7.945567E-03 -3.067999E+00 -4.706463E-02 -9.766982E+01 -4.769706E+01 -1.150180E+00 -6.614591E-03 -2.799341E+00 -3.918171E-02 -2.116384E+02 -2.239608E+02 -3.238424E-01 -5.244063E-04 -8.013253E-01 -3.210837E-03 -1.124872E+02 -6.327624E+01 -1.529136E+00 -1.169661E-02 -4.253213E+00 -9.049039E-02 +6.846312E+01 +2.343897E+01 +2.541202E+01 +3.229945E+00 +6.184776E+01 +1.913220E+01 +4.349759E+01 +9.460674E+00 +6.467170E+00 +2.091445E-01 +1.573980E+01 +1.238843E+00 +2.961211E+01 +4.384415E+00 +9.590524E-01 +4.598971E-03 +2.334141E+00 +2.724146E-02 +3.775673E+01 +7.127940E+00 +1.257246E+00 +7.903602E-03 +3.059885E+00 +4.681606E-02 +9.766123E+01 +4.768868E+01 +1.146721E+00 +6.574876E-03 +2.790924E+00 +3.894646E-02 +2.115196E+02 +2.237105E+02 +3.227770E-01 +5.209674E-04 +7.986892E-01 +3.189781E-03 +1.124582E+02 +6.324576E+01 +1.524926E+00 +1.163296E-02 +4.241504E+00 +8.999793E-02 +1.131371E+02 +6.400083E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.356358E+01 +1.434541E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.119744E+01 +4.866426E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.113471E+01 +8.460406E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.845360E+01 +4.846573E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.893303E+02 +1.792356E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.700227E+01 +4.706134E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.906717E+01 +1.744589E+01 +2.185188E+01 +2.388096E+00 +5.318310E+01 +1.414560E+01 +4.087275E+01 +8.353159E+00 +6.075499E+00 +1.845731E-01 +1.478655E+01 +1.093297E+00 +2.917987E+01 +4.257348E+00 +9.458970E-01 +4.473659E-03 +2.302124E+00 +2.649919E-02 +3.710470E+01 +6.883867E+00 +1.236141E+00 +7.640471E-03 +3.008519E+00 +4.525743E-02 +9.774725E+01 +4.777270E+01 +1.148516E+00 +6.595474E-03 +2.795293E+00 +3.906847E-02 +2.158098E+02 +2.328754E+02 +3.292126E-01 +5.419377E-04 +8.146135E-01 +3.318178E-03 +1.142484E+02 +6.527422E+01 +1.545377E+00 +1.194543E-02 +4.298389E+00 +9.241537E-02 +6.833016E+01 +2.334778E+01 +2.543915E+01 +3.236770E+00 +6.191381E+01 +1.917263E+01 +4.345500E+01 +9.442129E+00 +6.480434E+00 +2.100014E-01 +1.577208E+01 +1.243919E+00 +2.960282E+01 +4.381672E+00 +9.615903E-01 +4.623347E-03 +2.340318E+00 +2.738585E-02 +3.774401E+01 +7.123146E+00 +1.260578E+00 +7.945537E-03 +3.067994E+00 +4.706446E-02 +9.766964E+01 +4.769689E+01 +1.150177E+00 +6.614567E-03 +2.799336E+00 +3.918157E-02 +2.116380E+02 +2.239600E+02 +3.238418E-01 +5.244043E-04 +8.013238E-01 +3.210825E-03 +1.124870E+02 +6.327601E+01 +1.529133E+00 +1.169657E-02 +4.253205E+00 +9.049007E-02 tally 2: 3.727212E-01 6.946055E-04 @@ -185,7 +185,7 @@ tally 2: 8.000705E-03 3.200564E-07 1.273273E-03 -8.106120E-09 +8.106118E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -213,11 +213,11 @@ tally 2: 1.525423E-01 1.163458E-04 2.058029E-02 -2.117743E-06 +2.117742E-06 7.142994E-03 2.551118E-07 1.136772E-03 -6.461254E-09 +6.461253E-09 3.721892E-01 6.926241E-04 8.037371E-01 @@ -230,7 +230,7 @@ tally 2: 1.455479E-04 2.301861E-02 2.649283E-06 -7.989286E-03 +7.989285E-03 3.191434E-07 -1.271456E-03 -8.082996E-09 +1.271455E-03 +8.082995E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat index 6114b3cd064..2625ac2a347 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_4.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.851773E+01 -2.347638E+01 -2.543250E+01 -3.235154E+00 -6.189761E+01 -1.916305E+01 -4.353818E+01 -9.478338E+00 -6.473217E+00 -2.095358E-01 -1.575452E+01 -1.241161E+00 -2.964337E+01 -4.393677E+00 -9.600653E-01 -4.608690E-03 -2.336607E+00 -2.729903E-02 -3.779670E+01 -7.143037E+00 -1.258578E+00 -7.920353E-03 -3.063126E+00 -4.691528E-02 -9.776897E+01 -4.779395E+01 -1.147986E+00 -6.589392E-03 -2.794003E+00 -3.903244E-02 -2.117592E+02 -2.242177E+02 -3.231411E-01 -5.221432E-04 -7.995900E-01 -3.196980E-03 -1.125791E+02 -6.338177E+01 -1.526551E+00 -1.165777E-02 -4.246026E+00 -9.018990E-02 -1.132353E+02 -6.411189E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361478E+01 -1.437285E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123078E+01 -4.876834E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117919E+01 -8.478714E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856309E+01 -4.857359E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895455E+02 -1.796434E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710741E+01 -4.716341E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911317E+01 -1.747308E+01 -2.186909E+01 -2.391858E+00 -5.322498E+01 -1.416789E+01 -4.091085E+01 -8.368741E+00 -6.081177E+00 -1.849182E-01 -1.480037E+01 -1.095342E+00 -2.921058E+01 -4.266313E+00 -9.468932E-01 -4.483087E-03 -2.304548E+00 -2.655503E-02 -3.714373E+01 -6.898356E+00 -1.237443E+00 -7.656573E-03 -3.011688E+00 -4.535281E-02 -9.785474E+01 -4.787783E+01 -1.149780E+00 -6.609991E-03 -2.798368E+00 -3.915446E-02 -2.160541E+02 -2.334029E+02 -3.295834E-01 -5.431594E-04 -8.155311E-01 -3.325659E-03 -1.143711E+02 -6.541445E+01 -1.547023E+00 -1.197088E-02 -4.302966E+00 -9.261227E-02 -6.838461E+01 -2.338501E+01 -2.545964E+01 -3.241986E+00 -6.196367E+01 -1.920352E+01 -4.349554E+01 -9.459752E+00 -6.486491E+00 -2.103942E-01 -1.578682E+01 -1.246245E+00 -2.963407E+01 -4.390927E+00 -9.626057E-01 -4.633116E-03 -2.342790E+00 -2.744371E-02 -3.778395E+01 -7.138229E+00 -1.261912E+00 -7.962373E-03 -3.071242E+00 -4.716418E-02 -9.777738E+01 -4.780217E+01 -1.151446E+00 -6.629169E-03 -2.802424E+00 -3.926806E-02 -2.118778E+02 -2.244678E+02 -3.242071E-01 -5.255880E-04 -8.022277E-01 -3.218073E-03 -1.126079E+02 -6.341209E+01 -1.530763E+00 -1.172153E-02 -4.257740E+00 -9.068312E-02 +6.851755E+01 +2.347625E+01 +2.543244E+01 +3.235138E+00 +6.189746E+01 +1.916296E+01 +4.353807E+01 +9.478290E+00 +6.473201E+00 +2.095347E-01 +1.575448E+01 +1.241154E+00 +2.964329E+01 +4.393655E+00 +9.600630E-01 +4.608668E-03 +2.336601E+00 +2.729890E-02 +3.779660E+01 +7.143001E+00 +1.258574E+00 +7.920313E-03 +3.063118E+00 +4.691505E-02 +9.776873E+01 +4.779372E+01 +1.147984E+00 +6.589359E-03 +2.793996E+00 +3.903225E-02 +2.117587E+02 +2.242166E+02 +3.231403E-01 +5.221406E-04 +7.995881E-01 +3.196965E-03 +1.125788E+02 +6.338145E+01 +1.526548E+00 +1.165771E-02 +4.246015E+00 +9.018945E-02 +1.132350E+02 +6.411155E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361464E+01 +1.437278E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123071E+01 +4.876810E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117909E+01 +8.478672E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856285E+01 +4.857335E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895450E+02 +1.796425E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710717E+01 +4.716318E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911301E+01 +1.747298E+01 +2.186903E+01 +2.391846E+00 +5.322484E+01 +1.416782E+01 +4.091074E+01 +8.368698E+00 +6.081162E+00 +1.849173E-01 +1.480033E+01 +1.095336E+00 +2.921050E+01 +4.266292E+00 +9.468909E-01 +4.483065E-03 +2.304543E+00 +2.655491E-02 +3.714364E+01 +6.898322E+00 +1.237440E+00 +7.656535E-03 +3.011680E+00 +4.535258E-02 +9.785450E+01 +4.787760E+01 +1.149777E+00 +6.609958E-03 +2.798361E+00 +3.915427E-02 +2.160535E+02 +2.334017E+02 +3.295826E-01 +5.431567E-04 +8.155291E-01 +3.325642E-03 +1.143708E+02 +6.541413E+01 +1.547019E+00 +1.197082E-02 +4.302955E+00 +9.261180E-02 +6.838444E+01 +2.338489E+01 +2.545958E+01 +3.241970E+00 +6.196352E+01 +1.920343E+01 +4.349543E+01 +9.459705E+00 +6.486476E+00 +2.103931E-01 +1.578678E+01 +1.246239E+00 +2.963399E+01 +4.390905E+00 +9.626034E-01 +4.633094E-03 +2.342784E+00 +2.744358E-02 +3.778386E+01 +7.138194E+00 +1.261909E+00 +7.962333E-03 +3.071235E+00 +4.716395E-02 +9.777713E+01 +4.780194E+01 +1.151443E+00 +6.629136E-03 +2.802417E+00 +3.926787E-02 +2.118773E+02 +2.244667E+02 +3.242063E-01 +5.255855E-04 +8.022257E-01 +3.218057E-03 +1.126076E+02 +6.341177E+01 +1.530759E+00 +1.172147E-02 +4.257730E+00 +9.068268E-02 tally 2: 3.727213E-01 6.946060E-04 @@ -182,10 +182,10 @@ tally 2: 1.459668E-04 2.305197E-02 2.656966E-06 -8.001085E-03 +8.001084E-03 3.200868E-07 1.273400E-03 -8.107739E-09 +8.107736E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -217,7 +217,7 @@ tally 2: 7.143331E-03 2.551359E-07 1.136885E-03 -6.462537E-09 +6.462535E-09 3.721894E-01 6.926247E-04 8.037378E-01 @@ -230,7 +230,7 @@ tally 2: 1.455504E-04 2.301907E-02 2.649387E-06 -7.989665E-03 +7.989664E-03 3.191737E-07 1.271582E-03 -8.084610E-09 +8.084607E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat index a30dfa88059..5d21c6febfc 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/isotropic/results_true_5.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.857342E+01 -2.351456E+01 -2.545339E+01 -3.240472E+00 -6.194846E+01 -1.919455E+01 -4.357948E+01 -9.496329E+00 -6.479370E+00 -2.099343E-01 -1.576949E+01 -1.243521E+00 -2.967512E+01 -4.403095E+00 -9.610942E-01 -4.618574E-03 -2.339111E+00 -2.735758E-02 -3.783729E+01 -7.158388E+00 -1.259930E+00 -7.937385E-03 -3.066418E+00 -4.701617E-02 -9.787835E+01 -4.790095E+01 -1.149271E+00 -6.604145E-03 -2.797129E+00 -3.911983E-02 -2.120024E+02 -2.247331E+02 -3.235106E-01 -5.233379E-04 -8.005043E-01 -3.204296E-03 -1.127018E+02 -6.352005E+01 -1.528203E+00 -1.168300E-02 -4.250618E+00 -9.038510E-02 -1.133352E+02 -6.422512E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366687E+01 -1.440079E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126465E+01 -4.887416E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122436E+01 -8.497326E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867425E+01 -4.868321E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897639E+02 -1.800576E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721418E+01 -4.726718E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.916011E+01 -1.750084E+01 -2.188664E+01 -2.395700E+00 -5.326771E+01 -1.419065E+01 -4.094962E+01 -8.384611E+00 -6.086955E+00 -1.852698E-01 -1.481443E+01 -1.097424E+00 -2.924177E+01 -4.275430E+00 -9.479052E-01 -4.492675E-03 -2.307011E+00 -2.661183E-02 -3.718338E+01 -6.913090E+00 -1.238765E+00 -7.672947E-03 -3.014906E+00 -4.544980E-02 -9.796388E+01 -4.798469E+01 -1.151062E+00 -6.624747E-03 -2.801490E+00 -3.924187E-02 -2.163020E+02 -2.339388E+02 -3.299598E-01 -5.444008E-04 -8.164626E-01 -3.333259E-03 -1.144957E+02 -6.555703E+01 -1.548694E+00 -1.199676E-02 -4.307614E+00 -9.281247E-02 -6.844016E+01 -2.342301E+01 -2.548054E+01 -3.247311E+00 -6.201454E+01 -1.923506E+01 -4.353678E+01 -9.477701E+00 -6.492655E+00 -2.107942E-01 -1.580182E+01 -1.248615E+00 -2.966581E+01 -4.400337E+00 -9.636372E-01 -4.643051E-03 -2.345300E+00 -2.750256E-02 -3.782452E+01 -7.153566E+00 -1.263268E+00 -7.979492E-03 -3.074542E+00 -4.726558E-02 -9.788675E+01 -4.790918E+01 -1.152734E+00 -6.644009E-03 -2.805559E+00 -3.935597E-02 -2.121212E+02 -2.249837E+02 -3.245778E-01 -5.267908E-04 -8.031451E-01 -3.225437E-03 -1.127307E+02 -6.355044E+01 -1.532419E+00 -1.174690E-02 -4.262347E+00 -9.087943E-02 +6.857321E+01 +2.351441E+01 +2.545331E+01 +3.240452E+00 +6.194827E+01 +1.919443E+01 +4.357935E+01 +9.496270E+00 +6.479351E+00 +2.099331E-01 +1.576944E+01 +1.243514E+00 +2.967503E+01 +4.403069E+00 +9.610914E-01 +4.618547E-03 +2.339104E+00 +2.735741E-02 +3.783717E+01 +7.158344E+00 +1.259926E+00 +7.937337E-03 +3.066408E+00 +4.701588E-02 +9.787805E+01 +4.790066E+01 +1.149267E+00 +6.604105E-03 +2.797121E+00 +3.911960E-02 +2.120018E+02 +2.247317E+02 +3.235096E-01 +5.233348E-04 +8.005019E-01 +3.204276E-03 +1.127015E+02 +6.351966E+01 +1.528198E+00 +1.168293E-02 +4.250605E+00 +9.038454E-02 +1.133348E+02 +6.422471E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366670E+01 +1.440070E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126455E+01 +4.887386E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122424E+01 +8.497275E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867395E+01 +4.868292E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897633E+02 +1.800565E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721388E+01 +4.726689E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915992E+01 +1.750072E+01 +2.188657E+01 +2.395685E+00 +5.326754E+01 +1.419056E+01 +4.094949E+01 +8.384559E+00 +6.086937E+00 +1.852687E-01 +1.481439E+01 +1.097417E+00 +2.924168E+01 +4.275405E+00 +9.479024E-01 +4.492648E-03 +2.307005E+00 +2.661167E-02 +3.718326E+01 +6.913048E+00 +1.238761E+00 +7.672900E-03 +3.014897E+00 +4.544952E-02 +9.796358E+01 +4.798440E+01 +1.151059E+00 +6.624706E-03 +2.801481E+00 +3.924163E-02 +2.163013E+02 +2.339374E+02 +3.299589E-01 +5.443975E-04 +8.164601E-01 +3.333239E-03 +1.144953E+02 +6.555663E+01 +1.548689E+00 +1.199669E-02 +4.307601E+00 +9.281190E-02 +6.843995E+01 +2.342287E+01 +2.548046E+01 +3.247292E+00 +6.201435E+01 +1.923495E+01 +4.353665E+01 +9.477643E+00 +6.492636E+00 +2.107930E-01 +1.580178E+01 +1.248607E+00 +2.966572E+01 +4.400311E+00 +9.636344E-01 +4.643024E-03 +2.345293E+00 +2.750240E-02 +3.782441E+01 +7.153523E+00 +1.263264E+00 +7.979443E-03 +3.074533E+00 +4.726529E-02 +9.788645E+01 +4.790889E+01 +1.152731E+00 +6.643969E-03 +2.805551E+00 +3.935573E-02 +2.121205E+02 +2.249823E+02 +3.245768E-01 +5.267876E-04 +8.031427E-01 +3.225417E-03 +1.127304E+02 +6.355006E+01 +1.532415E+00 +1.174683E-02 +4.262334E+00 +9.087889E-02 tally 2: 3.727215E-01 6.946067E-04 @@ -179,13 +179,13 @@ tally 2: 2.194480E-01 2.407872E-04 1.708625E-01 -1.459701E-04 -2.305256E-02 -2.657102E-06 -8.001574E-03 +1.459700E-04 +2.305255E-02 +2.657101E-06 +8.001573E-03 3.201259E-07 1.273562E-03 -8.109804E-09 +8.109801E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -213,11 +213,11 @@ tally 2: 1.525453E-01 1.163504E-04 2.058122E-02 -2.117933E-06 -7.143765E-03 -2.551669E-07 +2.117932E-06 +7.143764E-03 +2.551668E-07 1.137029E-03 -6.464173E-09 +6.464170E-09 3.721896E-01 6.926253E-04 8.037386E-01 @@ -230,7 +230,7 @@ tally 2: 1.455537E-04 2.301965E-02 2.649522E-06 -7.990153E-03 -3.192127E-07 +7.990152E-03 +3.192126E-07 1.271744E-03 -8.086669E-09 +8.086665E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat index 5200ac7ec65..3b5aea51fd9 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_1.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.835756E+01 -2.336674E+01 +6.835753E+01 +2.336672E+01 2.537239E+01 -3.219879E+00 +3.219878E+00 6.175132E+01 1.907257E+01 -4.341878E+01 -9.426419E+00 +4.341877E+01 +9.426414E+00 6.455425E+00 -2.083855E-01 +2.083854E-01 1.571121E+01 1.234347E+00 -2.955122E+01 -4.366403E+00 +2.955121E+01 +4.366402E+00 9.570792E-01 4.580066E-03 2.329339E+00 2.712948E-02 -3.767889E+01 -7.098579E+00 +3.767888E+01 +7.098576E+00 1.254652E+00 -7.871025E-03 +7.871022E-03 3.053572E+00 -4.662309E-02 -9.745117E+01 -4.748374E+01 +4.662307E-02 +9.745115E+01 +4.748373E+01 1.144254E+00 -6.546620E-03 -2.784921E+00 -3.877908E-02 +6.546618E-03 +2.784920E+00 +3.877907E-02 2.110520E+02 -2.227226E+02 -3.220668E-01 -5.186772E-04 -7.969317E-01 -3.175759E-03 -1.122227E+02 -6.298109E+01 +2.227225E+02 +3.220667E-01 +5.186770E-04 +7.969316E-01 +3.175758E-03 +1.122226E+02 +6.298107E+01 1.521758E+00 1.158468E-02 4.232692E+00 -8.962442E-02 +8.962439E-02 1.129470E+02 -6.378591E+01 +6.378585E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.346409E+01 -1.429217E+01 +5.346407E+01 +1.429216E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -3.113248E+01 -4.846180E+00 +3.113247E+01 +4.846178E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -4.104802E+01 -8.424783E+00 +4.104801E+01 +8.424780E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.824006E+01 -4.825572E+01 +9.824005E+01 +4.825571E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 1.889103E+02 -1.784414E+02 +1.784413E+02 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -9.679731E+01 -4.686268E+01 +9.679730E+01 +4.686267E+01 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -5.897831E+01 -1.739344E+01 +5.897828E+01 +1.739342E+01 2.181862E+01 -2.380832E+00 -5.310216E+01 -1.410258E+01 -4.079875E+01 -8.322942E+00 -6.064470E+00 -1.839036E-01 +2.380831E+00 +5.310215E+01 +1.410257E+01 +4.079874E+01 +8.322938E+00 +6.064469E+00 +1.839035E-01 1.475971E+01 1.089331E+00 2.912006E+01 -4.239914E+00 +4.239913E+00 9.439565E-01 4.455323E-03 2.297401E+00 -2.639058E-02 +2.639057E-02 3.702869E+01 -6.855693E+00 +6.855691E+00 1.233605E+00 -7.609159E-03 +7.609156E-03 3.002348E+00 -4.507196E-02 -9.753767E+01 -4.756807E+01 +4.507194E-02 +9.753766E+01 +4.756805E+01 1.146053E+00 -6.567215E-03 -2.789299E+00 -3.890108E-02 +6.567213E-03 +2.789298E+00 +3.890107E-02 2.153332E+02 -2.318480E+02 +2.318479E+02 3.284890E-01 -5.395582E-04 -8.128231E-01 -3.303609E-03 -1.140094E+02 -6.500133E+01 +5.395580E-04 +8.128230E-01 +3.303608E-03 +1.140093E+02 +6.500131E+01 1.542171E+00 -1.189592E-02 +1.189591E-02 4.289470E+00 -9.203230E-02 -6.822489E+01 -2.327589E+01 +9.203227E-02 +6.822486E+01 +2.327587E+01 2.539951E+01 3.226691E+00 6.181733E+01 1.911292E+01 -4.337629E+01 -9.407953E+00 +4.337628E+01 +9.407949E+00 6.468668E+00 2.092395E-01 -1.574345E+01 +1.574344E+01 1.239406E+00 2.954196E+01 -4.363674E+00 -9.596122E-01 +4.363673E+00 +9.596121E-01 4.604345E-03 2.335504E+00 2.727329E-02 3.766621E+01 -7.093812E+00 -1.257978E+00 -7.912794E-03 -3.061666E+00 -4.687051E-02 -9.745958E+01 -4.749194E+01 -1.147704E+00 -6.586143E-03 +7.093810E+00 +1.257977E+00 +7.912792E-03 +3.061665E+00 +4.687049E-02 +9.745956E+01 +4.749193E+01 +1.147703E+00 +6.586141E-03 2.793315E+00 -3.901320E-02 +3.901318E-02 2.111701E+02 -2.229709E+02 -3.231291E-01 -5.220987E-04 -7.995603E-01 -3.196708E-03 +2.229708E+02 +3.231290E-01 +5.220986E-04 +7.995602E-01 +3.196707E-03 1.122514E+02 -6.301119E+01 +6.301118E+01 1.525955E+00 -1.164802E-02 +1.164801E-02 4.244367E+00 -9.011441E-02 +9.011440E-02 tally 2: 3.727210E-01 6.946049E-04 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat index 97167c4acb6..db723684684 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_2.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.841014E+01 -2.340271E+01 -2.539213E+01 -3.224892E+00 -6.179937E+01 -1.910227E+01 -4.345803E+01 -9.443470E+00 -6.461275E+00 -2.087633E-01 -1.572545E+01 -1.236585E+00 -2.958154E+01 -4.375368E+00 -9.580618E-01 -4.589475E-03 -2.331731E+00 -2.718521E-02 -3.771765E+01 -7.113193E+00 -1.255944E+00 -7.887240E-03 -3.056716E+00 -4.671914E-02 -9.755580E+01 -4.758576E+01 -1.145483E+00 -6.560687E-03 -2.787911E+00 -3.886241E-02 -2.112850E+02 -2.232146E+02 -3.224207E-01 -5.198176E-04 -7.978074E-01 -3.182742E-03 -1.123400E+02 -6.311292E+01 -1.523337E+00 -1.160873E-02 -4.237083E+00 -8.981046E-02 -1.130417E+02 -6.389290E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.351363E+01 -1.431867E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.116483E+01 -4.856257E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.109119E+01 -8.442515E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.834643E+01 -4.836027E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.891195E+02 -1.788369E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.689946E+01 -4.696163E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.902258E+01 -1.741956E+01 -2.183519E+01 -2.384450E+00 -5.314249E+01 -1.412401E+01 -4.083560E+01 -8.337984E+00 -6.069963E+00 -1.842369E-01 -1.477308E+01 -1.091305E+00 -2.914984E+01 -4.248591E+00 -9.449228E-01 -4.464449E-03 -2.299753E+00 -2.644464E-02 -3.706654E+01 -6.869716E+00 -1.234868E+00 -7.624744E-03 -3.005421E+00 -4.516427E-02 -9.764206E+01 -4.766994E+01 -1.147280E+00 -6.581283E-03 -2.792284E+00 -3.898441E-02 -2.155707E+02 -2.323596E+02 -3.288495E-01 -5.407431E-04 -8.137152E-01 -3.310864E-03 -1.141285E+02 -6.513725E+01 -1.543769E+00 -1.192058E-02 -4.293915E+00 -9.222311E-02 -6.827732E+01 -2.331168E+01 -2.541926E+01 -3.231710E+00 -6.186540E+01 -1.914265E+01 -4.341549E+01 -9.424964E+00 -6.474528E+00 -2.096188E-01 -1.575771E+01 -1.241652E+00 -2.957227E+01 -4.372632E+00 -9.605972E-01 -4.613802E-03 -2.337901E+00 -2.732931E-02 -3.770496E+01 -7.108413E+00 -1.259272E+00 -7.929092E-03 -3.064817E+00 -4.696704E-02 -9.756421E+01 -4.759397E+01 -1.148936E+00 -6.600293E-03 -2.796314E+00 -3.909702E-02 -2.114033E+02 -2.234634E+02 -3.234842E-01 -5.232469E-04 -8.004390E-01 -3.203738E-03 -1.123688E+02 -6.314309E+01 -1.527539E+00 -1.167220E-02 -4.248772E+00 -9.030152E-02 +6.841005E+01 +2.340265E+01 +2.539210E+01 +3.224885E+00 +6.179930E+01 +1.910222E+01 +4.345797E+01 +9.443447E+00 +6.461267E+00 +2.087628E-01 +1.572543E+01 +1.236582E+00 +2.958150E+01 +4.375358E+00 +9.580607E-01 +4.589465E-03 +2.331728E+00 +2.718515E-02 +3.771761E+01 +7.113176E+00 +1.255942E+00 +7.887221E-03 +3.056712E+00 +4.671902E-02 +9.755568E+01 +4.758565E+01 +1.145482E+00 +6.560671E-03 +2.787908E+00 +3.886231E-02 +2.112847E+02 +2.232140E+02 +3.224203E-01 +5.198164E-04 +7.978065E-01 +3.182734E-03 +1.123399E+02 +6.311276E+01 +1.523335E+00 +1.160870E-02 +4.237078E+00 +8.981024E-02 +1.130416E+02 +6.389274E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.351357E+01 +1.431864E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.116479E+01 +4.856246E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.109114E+01 +8.442495E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.834631E+01 +4.836016E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.891193E+02 +1.788365E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.689934E+01 +4.696152E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.902249E+01 +1.741951E+01 +2.183516E+01 +2.384444E+00 +5.314242E+01 +1.412397E+01 +4.083555E+01 +8.337963E+00 +6.069956E+00 +1.842364E-01 +1.477306E+01 +1.091303E+00 +2.914981E+01 +4.248581E+00 +9.449218E-01 +4.464439E-03 +2.299750E+00 +2.644457E-02 +3.706650E+01 +6.869699E+00 +1.234866E+00 +7.624725E-03 +3.005418E+00 +4.516416E-02 +9.764194E+01 +4.766982E+01 +1.147279E+00 +6.581267E-03 +2.792281E+00 +3.898431E-02 +2.155704E+02 +2.323591E+02 +3.288491E-01 +5.407419E-04 +8.137142E-01 +3.310856E-03 +1.141284E+02 +6.513710E+01 +1.543767E+00 +1.192055E-02 +4.293910E+00 +9.222288E-02 +6.827724E+01 +2.331163E+01 +2.541923E+01 +3.231703E+00 +6.186532E+01 +1.914261E+01 +4.341544E+01 +9.424942E+00 +6.474521E+00 +2.096183E-01 +1.575769E+01 +1.241649E+00 +2.957223E+01 +4.372622E+00 +9.605961E-01 +4.613792E-03 +2.337899E+00 +2.732925E-02 +3.770491E+01 +7.108396E+00 +1.259271E+00 +7.929072E-03 +3.064813E+00 +4.696693E-02 +9.756409E+01 +4.759386E+01 +1.148934E+00 +6.600277E-03 +2.796311E+00 +3.909692E-02 +2.114030E+02 +2.234629E+02 +3.234838E-01 +5.232457E-04 +8.004381E-01 +3.203731E-03 +1.123687E+02 +6.314294E+01 +1.527537E+00 +1.167217E-02 +4.248767E+00 +9.030131E-02 tally 2: 3.727211E-01 6.946052E-04 @@ -185,7 +185,7 @@ tally 2: 8.000435E-03 3.200348E-07 1.273182E-03 -8.104961E-09 +8.104960E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -214,7 +214,7 @@ tally 2: 1.163444E-04 2.058001E-02 2.117684E-06 -7.142755E-03 +7.142754E-03 2.550947E-07 1.136691E-03 6.460335E-09 @@ -233,4 +233,4 @@ tally 2: 7.989016E-03 3.191219E-07 1.271365E-03 -8.081841E-09 +8.081840E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat index 7d455f49fdc..bac8902424a 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_3.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.846326E+01 -2.343906E+01 -2.541206E+01 -3.229957E+00 -6.184788E+01 -1.913227E+01 -4.349768E+01 -9.460710E+00 -6.467182E+00 -2.091452E-01 -1.573983E+01 -1.238847E+00 -2.961216E+01 -4.384431E+00 -9.590541E-01 -4.598987E-03 -2.334146E+00 -2.724155E-02 -3.775680E+01 -7.127966E+00 -1.257248E+00 -7.903631E-03 -3.059891E+00 -4.681623E-02 -9.766141E+01 -4.768885E+01 -1.146723E+00 -6.574901E-03 -2.790929E+00 -3.894660E-02 -2.115200E+02 -2.237114E+02 -3.227776E-01 -5.209693E-04 -7.986907E-01 -3.189793E-03 -1.124584E+02 -6.324599E+01 -1.524929E+00 -1.163300E-02 -4.241512E+00 -8.999826E-02 -1.131374E+02 -6.400109E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.356368E+01 -1.434547E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.119750E+01 -4.866444E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.113478E+01 -8.460437E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.845378E+01 -4.846591E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.893306E+02 -1.792363E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.700245E+01 -4.706152E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.906729E+01 -1.744596E+01 -2.185192E+01 -2.388105E+00 -5.318321E+01 -1.414566E+01 -4.087282E+01 -8.353191E+00 -6.075510E+00 -1.845738E-01 -1.478658E+01 -1.093301E+00 -2.917992E+01 -4.257364E+00 -9.458987E-01 -4.473675E-03 -2.302128E+00 -2.649928E-02 -3.710477E+01 -6.883893E+00 -1.236143E+00 -7.640499E-03 -3.008525E+00 -4.525760E-02 -9.774743E+01 -4.777288E+01 -1.148518E+00 -6.595498E-03 -2.795298E+00 -3.906861E-02 -2.158102E+02 -2.328763E+02 -3.292132E-01 -5.419397E-04 -8.146150E-01 -3.318191E-03 -1.142486E+02 -6.527446E+01 -1.545380E+00 -1.194548E-02 -4.298397E+00 -9.241572E-02 -6.833030E+01 -2.334787E+01 -2.543920E+01 -3.236782E+00 -6.191392E+01 -1.917269E+01 -4.345509E+01 -9.442165E+00 -6.480446E+00 -2.100022E-01 -1.577211E+01 -1.243923E+00 -2.960287E+01 -4.381688E+00 -9.615920E-01 -4.623363E-03 -2.340322E+00 -2.738594E-02 -3.774408E+01 -7.123173E+00 -1.260580E+00 -7.945567E-03 -3.067999E+00 -4.706463E-02 -9.766982E+01 -4.769706E+01 -1.150180E+00 -6.614591E-03 -2.799341E+00 -3.918171E-02 -2.116384E+02 -2.239608E+02 -3.238424E-01 -5.244063E-04 -8.013253E-01 -3.210837E-03 -1.124872E+02 -6.327624E+01 -1.529136E+00 -1.169661E-02 -4.253213E+00 -9.049039E-02 +6.846312E+01 +2.343897E+01 +2.541202E+01 +3.229945E+00 +6.184776E+01 +1.913220E+01 +4.349759E+01 +9.460674E+00 +6.467170E+00 +2.091445E-01 +1.573980E+01 +1.238843E+00 +2.961211E+01 +4.384415E+00 +9.590524E-01 +4.598971E-03 +2.334141E+00 +2.724146E-02 +3.775673E+01 +7.127940E+00 +1.257246E+00 +7.903602E-03 +3.059885E+00 +4.681606E-02 +9.766123E+01 +4.768868E+01 +1.146721E+00 +6.574876E-03 +2.790924E+00 +3.894646E-02 +2.115196E+02 +2.237105E+02 +3.227770E-01 +5.209674E-04 +7.986892E-01 +3.189781E-03 +1.124582E+02 +6.324576E+01 +1.524926E+00 +1.163296E-02 +4.241504E+00 +8.999793E-02 +1.131371E+02 +6.400083E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.356358E+01 +1.434541E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.119744E+01 +4.866426E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.113471E+01 +8.460406E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.845360E+01 +4.846573E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.893303E+02 +1.792356E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.700227E+01 +4.706134E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.906717E+01 +1.744589E+01 +2.185188E+01 +2.388096E+00 +5.318310E+01 +1.414560E+01 +4.087275E+01 +8.353159E+00 +6.075499E+00 +1.845731E-01 +1.478655E+01 +1.093297E+00 +2.917987E+01 +4.257348E+00 +9.458970E-01 +4.473659E-03 +2.302124E+00 +2.649919E-02 +3.710470E+01 +6.883867E+00 +1.236141E+00 +7.640471E-03 +3.008519E+00 +4.525743E-02 +9.774725E+01 +4.777270E+01 +1.148516E+00 +6.595474E-03 +2.795293E+00 +3.906847E-02 +2.158098E+02 +2.328754E+02 +3.292126E-01 +5.419377E-04 +8.146135E-01 +3.318178E-03 +1.142484E+02 +6.527422E+01 +1.545377E+00 +1.194543E-02 +4.298389E+00 +9.241537E-02 +6.833016E+01 +2.334778E+01 +2.543915E+01 +3.236770E+00 +6.191381E+01 +1.917263E+01 +4.345500E+01 +9.442129E+00 +6.480434E+00 +2.100014E-01 +1.577208E+01 +1.243919E+00 +2.960282E+01 +4.381672E+00 +9.615903E-01 +4.623347E-03 +2.340318E+00 +2.738585E-02 +3.774401E+01 +7.123146E+00 +1.260578E+00 +7.945537E-03 +3.067994E+00 +4.706446E-02 +9.766964E+01 +4.769689E+01 +1.150177E+00 +6.614567E-03 +2.799336E+00 +3.918157E-02 +2.116380E+02 +2.239600E+02 +3.238418E-01 +5.244043E-04 +8.013238E-01 +3.210825E-03 +1.124870E+02 +6.327601E+01 +1.529133E+00 +1.169657E-02 +4.253205E+00 +9.049007E-02 tally 2: 3.727212E-01 6.946055E-04 @@ -185,7 +185,7 @@ tally 2: 8.000705E-03 3.200564E-07 1.273273E-03 -8.106120E-09 +8.106118E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -213,11 +213,11 @@ tally 2: 1.525423E-01 1.163458E-04 2.058029E-02 -2.117743E-06 +2.117742E-06 7.142994E-03 2.551118E-07 1.136772E-03 -6.461254E-09 +6.461253E-09 3.721892E-01 6.926241E-04 8.037371E-01 @@ -230,7 +230,7 @@ tally 2: 1.455479E-04 2.301861E-02 2.649283E-06 -7.989286E-03 +7.989285E-03 3.191434E-07 -1.271456E-03 -8.082996E-09 +1.271455E-03 +8.082995E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat index 6114b3cd064..2625ac2a347 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_4.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.851773E+01 -2.347638E+01 -2.543250E+01 -3.235154E+00 -6.189761E+01 -1.916305E+01 -4.353818E+01 -9.478338E+00 -6.473217E+00 -2.095358E-01 -1.575452E+01 -1.241161E+00 -2.964337E+01 -4.393677E+00 -9.600653E-01 -4.608690E-03 -2.336607E+00 -2.729903E-02 -3.779670E+01 -7.143037E+00 -1.258578E+00 -7.920353E-03 -3.063126E+00 -4.691528E-02 -9.776897E+01 -4.779395E+01 -1.147986E+00 -6.589392E-03 -2.794003E+00 -3.903244E-02 -2.117592E+02 -2.242177E+02 -3.231411E-01 -5.221432E-04 -7.995900E-01 -3.196980E-03 -1.125791E+02 -6.338177E+01 -1.526551E+00 -1.165777E-02 -4.246026E+00 -9.018990E-02 -1.132353E+02 -6.411189E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.361478E+01 -1.437285E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.123078E+01 -4.876834E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.117919E+01 -8.478714E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.856309E+01 -4.857359E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.895455E+02 -1.796434E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.710741E+01 -4.716341E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.911317E+01 -1.747308E+01 -2.186909E+01 -2.391858E+00 -5.322498E+01 -1.416789E+01 -4.091085E+01 -8.368741E+00 -6.081177E+00 -1.849182E-01 -1.480037E+01 -1.095342E+00 -2.921058E+01 -4.266313E+00 -9.468932E-01 -4.483087E-03 -2.304548E+00 -2.655503E-02 -3.714373E+01 -6.898356E+00 -1.237443E+00 -7.656573E-03 -3.011688E+00 -4.535281E-02 -9.785474E+01 -4.787783E+01 -1.149780E+00 -6.609991E-03 -2.798368E+00 -3.915446E-02 -2.160541E+02 -2.334029E+02 -3.295834E-01 -5.431594E-04 -8.155311E-01 -3.325659E-03 -1.143711E+02 -6.541445E+01 -1.547023E+00 -1.197088E-02 -4.302966E+00 -9.261227E-02 -6.838461E+01 -2.338501E+01 -2.545964E+01 -3.241986E+00 -6.196367E+01 -1.920352E+01 -4.349554E+01 -9.459752E+00 -6.486491E+00 -2.103942E-01 -1.578682E+01 -1.246245E+00 -2.963407E+01 -4.390927E+00 -9.626057E-01 -4.633116E-03 -2.342790E+00 -2.744371E-02 -3.778395E+01 -7.138229E+00 -1.261912E+00 -7.962373E-03 -3.071242E+00 -4.716418E-02 -9.777738E+01 -4.780217E+01 -1.151446E+00 -6.629169E-03 -2.802424E+00 -3.926806E-02 -2.118778E+02 -2.244678E+02 -3.242071E-01 -5.255880E-04 -8.022277E-01 -3.218073E-03 -1.126079E+02 -6.341209E+01 -1.530763E+00 -1.172153E-02 -4.257740E+00 -9.068312E-02 +6.851755E+01 +2.347625E+01 +2.543244E+01 +3.235138E+00 +6.189746E+01 +1.916296E+01 +4.353807E+01 +9.478290E+00 +6.473201E+00 +2.095347E-01 +1.575448E+01 +1.241154E+00 +2.964329E+01 +4.393655E+00 +9.600630E-01 +4.608668E-03 +2.336601E+00 +2.729890E-02 +3.779660E+01 +7.143001E+00 +1.258574E+00 +7.920313E-03 +3.063118E+00 +4.691505E-02 +9.776873E+01 +4.779372E+01 +1.147984E+00 +6.589359E-03 +2.793996E+00 +3.903225E-02 +2.117587E+02 +2.242166E+02 +3.231403E-01 +5.221406E-04 +7.995881E-01 +3.196965E-03 +1.125788E+02 +6.338145E+01 +1.526548E+00 +1.165771E-02 +4.246015E+00 +9.018945E-02 +1.132350E+02 +6.411155E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.361464E+01 +1.437278E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.123071E+01 +4.876810E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.117909E+01 +8.478672E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.856285E+01 +4.857335E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.895450E+02 +1.796425E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.710717E+01 +4.716318E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.911301E+01 +1.747298E+01 +2.186903E+01 +2.391846E+00 +5.322484E+01 +1.416782E+01 +4.091074E+01 +8.368698E+00 +6.081162E+00 +1.849173E-01 +1.480033E+01 +1.095336E+00 +2.921050E+01 +4.266292E+00 +9.468909E-01 +4.483065E-03 +2.304543E+00 +2.655491E-02 +3.714364E+01 +6.898322E+00 +1.237440E+00 +7.656535E-03 +3.011680E+00 +4.535258E-02 +9.785450E+01 +4.787760E+01 +1.149777E+00 +6.609958E-03 +2.798361E+00 +3.915427E-02 +2.160535E+02 +2.334017E+02 +3.295826E-01 +5.431567E-04 +8.155291E-01 +3.325642E-03 +1.143708E+02 +6.541413E+01 +1.547019E+00 +1.197082E-02 +4.302955E+00 +9.261180E-02 +6.838444E+01 +2.338489E+01 +2.545958E+01 +3.241970E+00 +6.196352E+01 +1.920343E+01 +4.349543E+01 +9.459705E+00 +6.486476E+00 +2.103931E-01 +1.578678E+01 +1.246239E+00 +2.963399E+01 +4.390905E+00 +9.626034E-01 +4.633094E-03 +2.342784E+00 +2.744358E-02 +3.778386E+01 +7.138194E+00 +1.261909E+00 +7.962333E-03 +3.071235E+00 +4.716395E-02 +9.777713E+01 +4.780194E+01 +1.151443E+00 +6.629136E-03 +2.802417E+00 +3.926787E-02 +2.118773E+02 +2.244667E+02 +3.242063E-01 +5.255855E-04 +8.022257E-01 +3.218057E-03 +1.126076E+02 +6.341177E+01 +1.530759E+00 +1.172147E-02 +4.257730E+00 +9.068268E-02 tally 2: 3.727213E-01 6.946060E-04 @@ -182,10 +182,10 @@ tally 2: 1.459668E-04 2.305197E-02 2.656966E-06 -8.001085E-03 +8.001084E-03 3.200868E-07 1.273400E-03 -8.107739E-09 +8.107736E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -217,7 +217,7 @@ tally 2: 7.143331E-03 2.551359E-07 1.136885E-03 -6.462537E-09 +6.462535E-09 3.721894E-01 6.926247E-04 8.037378E-01 @@ -230,7 +230,7 @@ tally 2: 1.455504E-04 2.301907E-02 2.649387E-06 -7.989665E-03 +7.989664E-03 3.191737E-07 1.271582E-03 -8.084610E-09 +8.084607E-09 diff --git a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat index a30dfa88059..5d21c6febfc 100644 --- a/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat +++ b/tests/regression_tests/random_ray_k_eff_mesh_kinetic/propagation/results_true_5.dat @@ -1,174 +1,174 @@ k-combined: 1.311387E+00 6.434473E-04 tally 1: -6.857342E+01 -2.351456E+01 -2.545339E+01 -3.240472E+00 -6.194846E+01 -1.919455E+01 -4.357948E+01 -9.496329E+00 -6.479370E+00 -2.099343E-01 -1.576949E+01 -1.243521E+00 -2.967512E+01 -4.403095E+00 -9.610942E-01 -4.618574E-03 -2.339111E+00 -2.735758E-02 -3.783729E+01 -7.158388E+00 -1.259930E+00 -7.937385E-03 -3.066418E+00 -4.701617E-02 -9.787835E+01 -4.790095E+01 -1.149271E+00 -6.604145E-03 -2.797129E+00 -3.911983E-02 -2.120024E+02 -2.247331E+02 -3.235106E-01 -5.233379E-04 -8.005043E-01 -3.204296E-03 -1.127018E+02 -6.352005E+01 -1.528203E+00 -1.168300E-02 -4.250618E+00 -9.038510E-02 -1.133352E+02 -6.422512E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.366687E+01 -1.440079E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -3.126465E+01 -4.887416E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -4.122436E+01 -8.497326E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.867425E+01 -4.868321E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -1.897639E+02 -1.800576E+02 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -9.721418E+01 -4.726718E+01 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -5.916011E+01 -1.750084E+01 -2.188664E+01 -2.395700E+00 -5.326771E+01 -1.419065E+01 -4.094962E+01 -8.384611E+00 -6.086955E+00 -1.852698E-01 -1.481443E+01 -1.097424E+00 -2.924177E+01 -4.275430E+00 -9.479052E-01 -4.492675E-03 -2.307011E+00 -2.661183E-02 -3.718338E+01 -6.913090E+00 -1.238765E+00 -7.672947E-03 -3.014906E+00 -4.544980E-02 -9.796388E+01 -4.798469E+01 -1.151062E+00 -6.624747E-03 -2.801490E+00 -3.924187E-02 -2.163020E+02 -2.339388E+02 -3.299598E-01 -5.444008E-04 -8.164626E-01 -3.333259E-03 -1.144957E+02 -6.555703E+01 -1.548694E+00 -1.199676E-02 -4.307614E+00 -9.281247E-02 -6.844016E+01 -2.342301E+01 -2.548054E+01 -3.247311E+00 -6.201454E+01 -1.923506E+01 -4.353678E+01 -9.477701E+00 -6.492655E+00 -2.107942E-01 -1.580182E+01 -1.248615E+00 -2.966581E+01 -4.400337E+00 -9.636372E-01 -4.643051E-03 -2.345300E+00 -2.750256E-02 -3.782452E+01 -7.153566E+00 -1.263268E+00 -7.979492E-03 -3.074542E+00 -4.726558E-02 -9.788675E+01 -4.790918E+01 -1.152734E+00 -6.644009E-03 -2.805559E+00 -3.935597E-02 -2.121212E+02 -2.249837E+02 -3.245778E-01 -5.267908E-04 -8.031451E-01 -3.225437E-03 -1.127307E+02 -6.355044E+01 -1.532419E+00 -1.174690E-02 -4.262347E+00 -9.087943E-02 +6.857321E+01 +2.351441E+01 +2.545331E+01 +3.240452E+00 +6.194827E+01 +1.919443E+01 +4.357935E+01 +9.496270E+00 +6.479351E+00 +2.099331E-01 +1.576944E+01 +1.243514E+00 +2.967503E+01 +4.403069E+00 +9.610914E-01 +4.618547E-03 +2.339104E+00 +2.735741E-02 +3.783717E+01 +7.158344E+00 +1.259926E+00 +7.937337E-03 +3.066408E+00 +4.701588E-02 +9.787805E+01 +4.790066E+01 +1.149267E+00 +6.604105E-03 +2.797121E+00 +3.911960E-02 +2.120018E+02 +2.247317E+02 +3.235096E-01 +5.233348E-04 +8.005019E-01 +3.204276E-03 +1.127015E+02 +6.351966E+01 +1.528198E+00 +1.168293E-02 +4.250605E+00 +9.038454E-02 +1.133348E+02 +6.422471E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.366670E+01 +1.440070E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +3.126455E+01 +4.887386E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +4.122424E+01 +8.497275E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.867395E+01 +4.868292E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +1.897633E+02 +1.800565E+02 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +9.721388E+01 +4.726689E+01 +0.000000E+00 +0.000000E+00 +0.000000E+00 +0.000000E+00 +5.915992E+01 +1.750072E+01 +2.188657E+01 +2.395685E+00 +5.326754E+01 +1.419056E+01 +4.094949E+01 +8.384559E+00 +6.086937E+00 +1.852687E-01 +1.481439E+01 +1.097417E+00 +2.924168E+01 +4.275405E+00 +9.479024E-01 +4.492648E-03 +2.307005E+00 +2.661167E-02 +3.718326E+01 +6.913048E+00 +1.238761E+00 +7.672900E-03 +3.014897E+00 +4.544952E-02 +9.796358E+01 +4.798440E+01 +1.151059E+00 +6.624706E-03 +2.801481E+00 +3.924163E-02 +2.163013E+02 +2.339374E+02 +3.299589E-01 +5.443975E-04 +8.164601E-01 +3.333239E-03 +1.144953E+02 +6.555663E+01 +1.548689E+00 +1.199669E-02 +4.307601E+00 +9.281190E-02 +6.843995E+01 +2.342287E+01 +2.548046E+01 +3.247292E+00 +6.201435E+01 +1.923495E+01 +4.353665E+01 +9.477643E+00 +6.492636E+00 +2.107930E-01 +1.580178E+01 +1.248607E+00 +2.966572E+01 +4.400311E+00 +9.636344E-01 +4.643024E-03 +2.345293E+00 +2.750240E-02 +3.782441E+01 +7.153523E+00 +1.263264E+00 +7.979443E-03 +3.074533E+00 +4.726529E-02 +9.788645E+01 +4.790889E+01 +1.152731E+00 +6.643969E-03 +2.805551E+00 +3.935573E-02 +2.121205E+02 +2.249823E+02 +3.245768E-01 +5.267876E-04 +8.031427E-01 +3.225417E-03 +1.127304E+02 +6.355006E+01 +1.532415E+00 +1.174683E-02 +4.262334E+00 +9.087889E-02 tally 2: 3.727215E-01 6.946067E-04 @@ -179,13 +179,13 @@ tally 2: 2.194480E-01 2.407872E-04 1.708625E-01 -1.459701E-04 -2.305256E-02 -2.657102E-06 -8.001574E-03 +1.459700E-04 +2.305255E-02 +2.657101E-06 +8.001573E-03 3.201259E-07 1.273562E-03 -8.109804E-09 +8.109801E-09 0.000000E+00 0.000000E+00 0.000000E+00 @@ -213,11 +213,11 @@ tally 2: 1.525453E-01 1.163504E-04 2.058122E-02 -2.117933E-06 -7.143765E-03 -2.551669E-07 +2.117932E-06 +7.143764E-03 +2.551668E-07 1.137029E-03 -6.464173E-09 +6.464170E-09 3.721896E-01 6.926253E-04 8.037386E-01 @@ -230,7 +230,7 @@ tally 2: 1.455537E-04 2.301965E-02 2.649522E-06 -7.990153E-03 -3.192127E-07 +7.990152E-03 +3.192126E-07 1.271744E-03 -8.086669E-09 +8.086665E-09 From 85e3d3a8bc3793e8c9ae707516fc22e07bf64a95 Mon Sep 17 00:00:00 2001 From: yardasol Date: Thu, 9 Apr 2026 11:34:14 -0500 Subject: [PATCH 64/64] Revert "fix scalar flux time derviatve scaling" This reverts commit 774fb9b7302be4d8dfd6c9a1dca4fabcbf2db29e. --- src/random_ray/flat_source_domain.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/random_ray/flat_source_domain.cpp b/src/random_ray/flat_source_domain.cpp index 5c84038d538..e67ca364923 100644 --- a/src/random_ray/flat_source_domain.cpp +++ b/src/random_ray/flat_source_domain.cpp @@ -2022,8 +2022,7 @@ void FlatSourceDomain::compute_single_phi_prime(SourceRegionHandle& srh) double scalar_flux_time_derivative = A0 * srh.scalar_flux_old(g) + srh.scalar_flux_rhs_bd(g); - srh.phi_prime(g) = - scalar_flux_time_derivative * inverse_vbar / (4 * PI * sigma_t); + srh.phi_prime(g) = scalar_flux_time_derivative * inverse_vbar / sigma_t; } } @@ -2050,7 +2049,7 @@ void FlatSourceDomain::compute_single_T1(SourceRegionHandle& srh) double scalar_flux_time_derivative_2 = B0 * srh.scalar_flux_old(g) + srh.scalar_flux_rhs_bd_2(g); - scalar_flux_time_derivative_2 *= inverse_vbar / (4 * PI); + scalar_flux_time_derivative_2 *= inverse_vbar; // Divide by sigma_t to save time during transport srh.T1(g) =