adding back files to be reviewed

This commit is contained in:
Paul Romano 2019-10-28 11:55:45 -05:00
parent ae28233110
commit bc09d1ef55
1244 changed files with 301904 additions and 0 deletions

15
tests/__init__.py Normal file
View file

@ -0,0 +1,15 @@
from contextlib import contextmanager
import os
import tempfile
@contextmanager
def cdtemp():
"""Context manager to change to/return from a tmpdir."""
with tempfile.TemporaryDirectory() as tmpdir:
cwd = os.getcwd()
try:
os.chdir(tmpdir)
yield
finally:
os.chdir(cwd)

49
tests/chain_simple.xml Normal file
View file

@ -0,0 +1,49 @@
<?xml version="1.0"?>
<depletion_chain>
<nuclide name="I135" decay_modes="1" reactions="1" half_life="2.36520E+04">
<decay type="beta" target="Xe135" branching_ratio="1.0" />
<reaction type="(n,gamma)" Q="0.0" target="Xe136" /> <!-- Not precisely true, but whatever -->
</nuclide>
<nuclide name="Xe135" decay_modes="1" reactions="1" half_life="3.29040E+04">
<decay type=" beta" target="Cs135" branching_ratio="1.0" />
<reaction type="(n,gamma)" Q="0.0" target="Xe136" />
</nuclide>
<nuclide name="Xe136" decay_modes="0" reactions="0" />
<nuclide name="Cs135" decay_modes="0" reactions="0" />
<nuclide name="Gd157" decay_modes="0" reactions="1" >
<reaction type="(n,gamma)" Q="0.0" target="Nothing" />
</nuclide>
<nuclide name="Gd156" decay_modes="0" reactions="1">
<reaction type="(n,gamma)" Q="0.0" target="Gd157" />
</nuclide>
<nuclide name="U234" decay_modes="0" reactions="1">
<reaction type="fission" Q="191840000."/>
<neutron_fission_yields>
<energies>2.53000e-02</energies>
<fission_yields energy="2.53000e-02">
<products>Gd157 Gd156 I135 Xe135 Xe136 Cs135</products>
<data>1.093250e-04 2.087260e-04 2.780820e-02 6.759540e-03 2.392300e-02 4.356330e-05</data>
</fission_yields>
</neutron_fission_yields>
</nuclide>
<nuclide name="U235" decay_modes="0" reactions="1">
<reaction type="fission" Q="193410000."/>
<neutron_fission_yields>
<energies>2.53000e-02</energies>
<fission_yields energy="2.53000e-02">
<products>Gd157 Gd156 I135 Xe135 Xe136 Cs135</products>
<data>6.142710e-5 1.483250e-04 0.0292737 0.002566345 0.0219242 4.9097e-6</data>
</fission_yields>
</neutron_fission_yields>
</nuclide>
<nuclide name="U238" decay_modes="0" reactions="1">
<reaction type="fission" Q="197790000."/>
<neutron_fission_yields>
<energies>2.53000e-02</energies>
<fission_yields energy="2.53000e-02">
<products>Gd157 Gd156 I135 Xe135 Xe136 Cs135</products>
<data>4.141120e-04 7.605360e-04 0.0135457 0.00026864 0.0024432 3.7100E-07</data>
</fission_yields>
</neutron_fission_yields>
</nuclide>
</depletion_chain>

28
tests/conftest.py Normal file
View file

@ -0,0 +1,28 @@
import pytest
from tests.regression_tests import config as regression_config
def pytest_addoption(parser):
parser.addoption('--exe')
parser.addoption('--mpi', action='store_true')
parser.addoption('--mpiexec')
parser.addoption('--mpi-np')
parser.addoption('--update', action='store_true')
parser.addoption('--build-inputs', action='store_true')
def pytest_configure(config):
opts = ['exe', 'mpi', 'mpiexec', 'mpi_np', 'update', 'build_inputs']
for opt in opts:
if config.getoption(opt) is not None:
regression_config[opt] = config.getoption(opt)
@pytest.fixture
def run_in_tmpdir(tmpdir):
orig = tmpdir.chdir()
try:
yield
finally:
orig.chdir()

243
tests/dummy_operator.py Normal file
View file

@ -0,0 +1,243 @@
from collections import namedtuple
import numpy as np
import scipy.sparse as sp
from uncertainties import ufloat
from openmc.deplete.reaction_rates import ReactionRates
from openmc.deplete.abc import TransportOperator, OperatorResult
from openmc.deplete import (
CECMIntegrator, PredictorIntegrator, CELIIntegrator, LEQIIntegrator,
EPCRK4Integrator, CF4Integrator, SICELIIntegrator, SILEQIIntegrator
)
# Bundle for nicely passing test data to depletion unit tests
# solver should be a concrete subclass of openmc.deplete.abc.Integrator
# atoms_1 should be the number of atoms of type 1 through the simulation
# similar for atoms_2, but for type 2. This includes the first step
# Solutions should be the exact solution that can be obtained using
# the DummyOperator depletion matrix with two 0.75 second time steps
DepletionSolutionTuple = namedtuple(
"DepletionSolutionTuple", "solver atoms_1 atoms_2")
predictor_solution = DepletionSolutionTuple(
PredictorIntegrator, np.array([1.0, 2.46847546272295, 4.11525874568034]),
np.array([1.0, 0.986431226850467, -0.0581692232513460]))
cecm_solution = DepletionSolutionTuple(
CECMIntegrator, np.array([1.0, 1.86872629872102, 2.18097439443550]),
np.array([1.0, 1.395525772416039, 2.69429754646747]))
cf4_solution = DepletionSolutionTuple(
CF4Integrator, np.array([1.0, 2.06101629, 2.57241318]),
np.array([1.0, 1.37783588, 2.63731630]))
epc_rk4_solution = DepletionSolutionTuple(
EPCRK4Integrator, np.array([1.0, 2.01978516, 2.05246421]),
np.array([1.0, 1.42038037, 3.06177191]))
celi_solution = DepletionSolutionTuple(
CELIIntegrator, np.array([1.0, 1.82078767, 2.68441779]),
np.array([1.0, 0.97122898, 0.05125966]))
si_celi_solution = DepletionSolutionTuple(
SICELIIntegrator, np.array([1.0, 2.03325094, 2.69291933]),
np.array([1.0, 1.16826254, 0.37907772]))
leqi_solution = DepletionSolutionTuple(
LEQIIntegrator, np.array([1.0, 1.82078767, 2.74526197]),
np.array([1.0, 0.97122898, 0.23339915]))
si_leqi_solution = DepletionSolutionTuple(
SILEQIIntegrator, np.array([1.0, 2.03325094, 2.92711288]),
np.array([1.0, 1.16826254, 0.53753236]))
SCHEMES = {
"predictor": predictor_solution,
"cecm": cecm_solution,
"celi": celi_solution,
"cf4": cf4_solution,
"epc_rk4": epc_rk4_solution,
"leqi": leqi_solution,
"si_leqi": si_leqi_solution,
"si_celi": si_celi_solution,
}
class TestChain(object):
"""Empty chain to assist with unit testing depletion routines
Only really provides the form_matrix function, but acts like
a real Chain
"""
fission_yields = [None]
@staticmethod
def get_default_fission_yields():
return None
def form_matrix(self, rates, _fission_yields=None):
"""Forms the f(y) matrix in y' = f(y)y.
Nominally a depletion matrix, this is abstracted on the off chance
that the function f has nothing to do with depletion at all.
Parameters
----------
rates : numpy.ndarray
Slice of reaction rates for a single material
_fission_yields : optional
Not used
Returns
-------
scipy.sparse.csr_matrix
Sparse matrix representing f(y).
"""
y_1 = rates[0, 0]
y_2 = rates[1, 0]
a11 = np.sin(y_2)
a12 = np.cos(y_1)
a21 = -np.cos(y_2)
a22 = np.sin(y_1)
return sp.csr_matrix(np.array([[a11, a12], [a21, a22]]))
class DummyOperator(TransportOperator):
"""This is a dummy operator class with no statistical uncertainty.
y_1' = sin(y_2) y_1 + cos(y_1) y_2
y_2' = -cos(y_2) y_1 + sin(y_1) y_2
y_1(0) = 1
y_2(0) = 1
y_1(1.5) ~ 2.3197067076743316
y_2(1.5) ~ 3.1726475740397628
"""
def __init__(self, previous_results=None):
self.prev_res = previous_results
self.chain = TestChain()
self.output_dir = "."
def __call__(self, vec, power, print_out=False):
"""Evaluates F(y)
Parameters
----------
vec : list of numpy.array
Total atoms to be used in function.
power : float
Power in [W]
print_out : bool, optional, ignored
Whether or not to print out time.
Returns
-------
openmc.deplete.OperatorResult
Result of transport operator
"""
mats = ["1"]
nuclides = ["1", "2"]
reactions = ["1"]
reaction_rates = ReactionRates(mats, nuclides, reactions)
reaction_rates[0, 0, 0] = vec[0][0]
reaction_rates[0, 1, 0] = vec[0][1]
# Create a fake rates object
return OperatorResult(ufloat(0.0, 0.0), reaction_rates)
@property
def volume(self):
"""
volume : dict of str float
Volumes of material
"""
return {"1": 0.0}
@property
def nuc_list(self):
"""
nuc_list : list of str
A list of all nuclide names. Used for sorting the simulation.
"""
return ["1", "2"]
@property
def local_mats(self):
"""
local_mats : list of str
A list of all material IDs to be burned. Used for sorting the
simulation.
"""
return ["1"]
@property
def burnable_mats(self):
"""Maps cell name to index in global geometry."""
return self.local_mats
@staticmethod
def write_bos_data(_step):
"""Empty method but avoids calls to C API"""
@property
def reaction_rates(self):
"""
reaction_rates : ReactionRates
Reaction rates from the last operator step.
"""
mats = ["1"]
nuclides = ["1", "2"]
reactions = ["1"]
return ReactionRates(mats, nuclides, reactions)
def initial_condition(self):
"""Returns initial vector.
Returns
-------
list of numpy.array
Total density for initial conditions.
"""
return [np.array((1.0, 1.0))]
def get_results_info(self):
"""Returns volume list, cell lists, and nuc lists.
Returns
-------
volume : dict of str float
Volumes corresponding to materials in full_burn_dict
nuc_list : list of str
A list of all nuclide names. Used for sorting the simulation.
burn_list : list of int
A list of all cell IDs to be burned. Used for sorting the
simulation.
full_burn_list : OrderedDict of str to int
Maps cell name to index in global geometry.
"""
return self.volume, self.nuc_list, self.local_mats, self.burnable_mats

1
tests/readme.rst Normal file
View file

@ -0,0 +1 @@
See docs/source/devguide/tests.rst for information on the OpenMC test suite.

View file

@ -0,0 +1,9 @@
# Test configuration options for regression tests
config = {
'exe': 'openmc',
'mpi': False,
'mpiexec': 'mpiexec',
'mpi_np': '2',
'update': False,
'build_inputs': False
}

View file

@ -0,0 +1,227 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell fill="202" id="1" region="9 -10 11 -12 13 -14" universe="0" />
<cell id="27" material="1" region="-1" universe="3" />
<cell id="28" material="2" region="1 -2" universe="3" />
<cell id="29" material="4" region="2" universe="3" />
<cell id="30" material="4" region="-3" universe="4" />
<cell id="31" material="2" region="3 -4" universe="4" />
<cell id="32" material="4" region="4" universe="4" />
<cell id="70" material="4" region="35 -36" universe="7" />
<cell fill="101" id="80" region="35 -36" universe="8" />
<lattice id="101" name="Fuel assembly (upper half)">
<pitch>1.26 1.26</pitch>
<dimension>17 17</dimension>
<lower_left>-10.71 -10.71</lower_left>
<universes>
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3
3 3 3 4 3 3 3 3 3 3 3 3 3 4 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 4 3 3 3 3 3 3 3 3 3 4 3 3 3
3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 </universes>
</lattice>
<lattice id="202" name="3x3 Core Lattice">
<pitch>21.42 21.42</pitch>
<dimension>3 3</dimension>
<lower_left>-32.13 -32.13</lower_left>
<universes>
8 7 7
8 8 8
7 7 7 </universes>
</lattice>
<surface coeffs="0.0 0.0 0.41" id="1" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.475" id="2" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.56" id="3" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.62" id="4" type="z-cylinder" />
<surface boundary="reflective" coeffs="-32.13" id="9" type="x-plane" />
<surface boundary="reflective" coeffs="32.13" id="10" type="x-plane" />
<surface boundary="reflective" coeffs="-32.13" id="11" type="y-plane" />
<surface boundary="reflective" coeffs="32.13" id="12" type="y-plane" />
<surface boundary="reflective" coeffs="0" id="13" type="z-plane" />
<surface boundary="reflective" coeffs="32.13" id="14" type="z-plane" />
<surface coeffs="0.0" id="35" type="z-plane" />
<surface coeffs="183.0" id="36" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="1" name="UOX fuel">
<density units="g/cm3" value="10.062" />
<nuclide ao="4.9476e-06" name="U234" />
<nuclide ao="0.00048218" name="U235" />
<nuclide ao="0.021504" name="U238" />
<nuclide ao="1.0801e-08" name="Xe135" />
<nuclide ao="0.045737" name="O16" />
</material>
<material id="2" name="Zircaloy">
<density units="g/cm3" value="5.77" />
<nuclide ao="0.5145" name="Zr90" />
<nuclide ao="0.1122" name="Zr91" />
<nuclide ao="0.1715" name="Zr92" />
<nuclide ao="0.1738" name="Zr94" />
<nuclide ao="0.028" name="Zr96" />
</material>
<material id="3" name="Cold borated water">
<density units="atom/b-cm" value="0.07416" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
<nuclide ao="0.000649" name="B10" />
<nuclide ao="0.002689" name="B11" />
<sab name="c_H_in_H2O" />
</material>
<material id="4" name="Hot borated water">
<density units="atom/b-cm" value="0.06614" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
<nuclide ao="0.000649" name="B10" />
<nuclide ao="0.002689" name="B11" />
<sab name="c_H_in_H2O" />
</material>
<material id="5" name="Reactor pressure vessel steel">
<density units="g/cm3" value="7.9" />
<nuclide name="Fe54" wo="0.05437098" />
<nuclide name="Fe56" wo="0.88500663" />
<nuclide name="Fe57" wo="0.0208008" />
<nuclide name="Fe58" wo="0.00282159" />
<nuclide name="Ni58" wo="0.0067198" />
<nuclide name="Ni60" wo="0.0026776" />
<nuclide name="Mn55" wo="0.01" />
<nuclide name="Cr52" wo="0.002092475" />
<nuclide name="C0" wo="0.0025" />
<nuclide name="Cu63" wo="0.0013696" />
</material>
<material id="6" name="Lower radial reflector">
<density units="g/cm3" value="4.32" />
<nuclide name="H1" wo="0.0095661" />
<nuclide name="O16" wo="0.0759107" />
<nuclide name="B10" wo="3.08409e-05" />
<nuclide name="B11" wo="0.000140499" />
<nuclide name="Fe54" wo="0.035620772088" />
<nuclide name="Fe56" wo="0.579805982228" />
<nuclide name="Fe57" wo="0.01362750048" />
<nuclide name="Fe58" wo="0.001848545204" />
<nuclide name="Ni58" wo="0.055298376566" />
<nuclide name="Mn55" wo="0.018287" />
<nuclide name="Cr52" wo="0.145407678031" />
<sab name="c_H_in_H2O" />
</material>
<material id="7" name="Upper radial reflector / Top plate region">
<density units="g/cm3" value="4.28" />
<nuclide name="H1" wo="0.0086117" />
<nuclide name="O16" wo="0.0683369" />
<nuclide name="B10" wo="2.77638e-05" />
<nuclide name="B11" wo="0.000126481" />
<nuclide name="Fe54" wo="0.035953677186" />
<nuclide name="Fe56" wo="0.585224740891" />
<nuclide name="Fe57" wo="0.01375486056" />
<nuclide name="Fe58" wo="0.001865821363" />
<nuclide name="Ni58" wo="0.055815129186" />
<nuclide name="Mn55" wo="0.0184579" />
<nuclide name="Cr52" wo="0.146766614995" />
<sab name="c_H_in_H2O" />
</material>
<material id="8" name="Bottom plate region">
<density units="g/cm3" value="7.184" />
<nuclide name="H1" wo="0.0011505" />
<nuclide name="O16" wo="0.0091296" />
<nuclide name="B10" wo="3.70915e-06" />
<nuclide name="B11" wo="1.68974e-05" />
<nuclide name="Fe54" wo="0.03855611055" />
<nuclide name="Fe56" wo="0.627585036425" />
<nuclide name="Fe57" wo="0.014750478" />
<nuclide name="Fe58" wo="0.002000875025" />
<nuclide name="Ni58" wo="0.059855207342" />
<nuclide name="Mn55" wo="0.019794" />
<nuclide name="Cr52" wo="0.157390026871" />
<sab name="c_H_in_H2O" />
</material>
<material id="9" name="Bottom nozzle region">
<density units="g/cm3" value="2.53" />
<nuclide name="H1" wo="0.0245014" />
<nuclide name="O16" wo="0.1944274" />
<nuclide name="B10" wo="7.89917e-05" />
<nuclide name="B11" wo="0.000359854" />
<nuclide name="Fe54" wo="0.030411411144" />
<nuclide name="Fe56" wo="0.495012237964" />
<nuclide name="Fe57" wo="0.01163454624" />
<nuclide name="Fe58" wo="0.001578204652" />
<nuclide name="Ni58" wo="0.047211231662" />
<nuclide name="Mn55" wo="0.0156126" />
<nuclide name="Cr52" wo="0.124142524198" />
<sab name="c_H_in_H2O" />
</material>
<material id="10" name="Top nozzle region">
<density units="g/cm3" value="1.746" />
<nuclide name="H1" wo="0.035887" />
<nuclide name="O16" wo="0.2847761" />
<nuclide name="B10" wo="0.000115699" />
<nuclide name="B11" wo="0.000527075" />
<nuclide name="Fe54" wo="0.02644016154" />
<nuclide name="Fe56" wo="0.43037146399" />
<nuclide name="Fe57" wo="0.0101152584" />
<nuclide name="Fe58" wo="0.00137211607" />
<nuclide name="Ni58" wo="0.04104621835" />
<nuclide name="Mn55" wo="0.0135739" />
<nuclide name="Cr52" wo="0.107931450781" />
<sab name="c_H_in_H2O" />
</material>
<material id="11" name="Top of fuel assemblies">
<density units="g/cm3" value="3.044" />
<nuclide name="H1" wo="0.0162913" />
<nuclide name="O16" wo="0.1292776" />
<nuclide name="B10" wo="5.25228e-05" />
<nuclide name="B11" wo="0.000239272" />
<nuclide name="Zr90" wo="0.43313403903" />
<nuclide name="Zr91" wo="0.09549277374" />
<nuclide name="Zr92" wo="0.14759527104" />
<nuclide name="Zr94" wo="0.15280552077" />
<nuclide name="Zr96" wo="0.02511169542" />
<sab name="c_H_in_H2O" />
</material>
<material id="12" name="Bottom of fuel assemblies">
<density units="g/cm3" value="1.762" />
<nuclide name="H1" wo="0.0292856" />
<nuclide name="O16" wo="0.2323919" />
<nuclide name="B10" wo="9.44159e-05" />
<nuclide name="B11" wo="0.00043012" />
<nuclide name="Zr90" wo="0.3741373658" />
<nuclide name="Zr91" wo="0.0824858164" />
<nuclide name="Zr92" wo="0.1274914944" />
<nuclide name="Zr94" wo="0.1319920622" />
<nuclide name="Zr96" wo="0.0216912612" />
<sab name="c_H_in_H2O" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>100</particles>
<batches>10</batches>
<inactive>5</inactive>
<source strength="1.0">
<space type="fission">
<parameters>-32 -32 0 32 32 32</parameters>
</space>
</source>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<filter id="1" type="distribcell">
<bins>27</bins>
</filter>
<tally id="27" name="distribcell tally">
<filters>1</filters>
<scores>nu-fission</scores>
</tally>
</tallies>

View file

@ -0,0 +1 @@
4401f503237c94e9d9cfc9f60e0269d5ae5bb67be3225e18c5510ed08616482964e2962a06268751f66a455fac3ddd5faf91555638dfb56fcd09eee60219edff

View file

@ -0,0 +1,93 @@
import os
import glob
import hashlib
import openmc
from tests.testing_harness import PyAPITestHarness
class AsymmetricLatticeTestHarness(PyAPITestHarness):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Extract universes encapsulating fuel and water assemblies
geometry = self._model.geometry
water = geometry.get_universes_by_name('water assembly (hot)')[0]
fuel = geometry.get_universes_by_name('fuel assembly (hot)')[0]
# Construct a 3x3 lattice of fuel assemblies
core_lat = openmc.RectLattice(name='3x3 Core Lattice', lattice_id=202)
core_lat.lower_left = (-32.13, -32.13)
core_lat.pitch = (21.42, 21.42)
core_lat.universes = [[fuel, water, water],
[fuel, fuel, fuel],
[water, water, water]]
# Create bounding surfaces
min_x = openmc.XPlane(-32.13, 'reflective')
max_x = openmc.XPlane(+32.13, 'reflective')
min_y = openmc.YPlane(-32.13, 'reflective')
max_y = openmc.YPlane(+32.13, 'reflective')
min_z = openmc.ZPlane(0, 'reflective')
max_z = openmc.ZPlane(+32.13, 'reflective')
# Define root universe
root_univ = openmc.Universe(universe_id=0, name='root universe')
root_cell = openmc.Cell(cell_id=1)
root_cell.region = +min_x & -max_x & +min_y & -max_y & +min_z & -max_z
root_cell.fill = core_lat
root_univ.add_cell(root_cell)
# Over-ride geometry in the input set with this 3x3 lattice
self._model.geometry.root_universe = root_univ
# Initialize a "distribcell" filter for the fuel pin cell
distrib_filter = openmc.DistribcellFilter(27)
# Initialize the tallies
tally = openmc.Tally(name='distribcell tally', tally_id=27)
tally.filters.append(distrib_filter)
tally.scores.append('nu-fission')
# Assign the tallies file to the input set
self._model.tallies.append(tally)
# Specify summary output and correct source sampling box
self._model.settings.source = openmc.Source(space=openmc.stats.Box(
[-32, -32, 0], [32, 32, 32], only_fissionable = True))
def _get_results(self, hash_output=True):
"""Digest info in statepoint and summary and return as a string."""
# Read the statepoint file
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
sp = openmc.StatePoint(statepoint)
# Extract the tally of interest
tally = sp.get_tally(name='distribcell tally')
# Create a string of all mean, std. dev. values for both tallies
outstr = ''
outstr += '\n'.join(map('{:.8e}'.format, tally.mean.flatten())) + '\n'
outstr += '\n'.join(map('{:.8e}'.format, tally.std_dev.flatten())) + '\n'
# Extract fuel assembly lattices from the summary
cells = sp.summary.geometry.get_all_cells()
fuel_cell = cells[27]
# Append a string of lattice distribcell offsets to the string
outstr += '\n'.join(fuel_cell.paths) + '\n'
# Hash the results if necessary
if hash_output:
sha512 = hashlib.sha512()
sha512.update(outstr.encode('utf-8'))
outstr = sha512.hexdigest()
return outstr
def test_asymmetric_lattice():
harness = AsymmetricLatticeTestHarness('statepoint.10.h5')
harness.main()

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<geometry>
<!-- Definition of Cells -->
<cell id="1">
<universe>0</universe>
<region>-1 2 -3 4 -5 6</region>
<material>1</material>
</cell>
<!-- Defition of Surfaces -->
<surface id="1">
<type>x-plane</type>
<coeffs>10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="2">
<type>x-plane</type>
<coeffs>-10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="3">
<type>y-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="4">
<type>y-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="5">
<type>z-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="6">
<type>z-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
</geometry>

View file

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<materials>
<!-- Definition of materials -->
<material id="1">
<density value="19" units="g/cc" />
<nuclide name="U235" wo="0.21" />
<nuclide name="U238" wo="0.68" />
<nuclide name="O16" wo="0.11" />
</material>
</materials>

View file

@ -0,0 +1,488 @@
k-combined:
1.169891E+00 6.289489E-03
tally 1:
1.173922E+01
1.385461E+01
2.164076E+01
4.699368E+01
2.906462E+01
8.464937E+01
3.382312E+01
1.147095E+02
3.632006E+01
1.323878E+02
3.655413E+01
1.341064E+02
3.347757E+01
1.124264E+02
2.931336E+01
8.607239E+01
2.182947E+01
4.789565E+01
1.147668E+01
1.325716E+01
tally 2:
2.298190E+01
2.667071E+01
1.600292E+01
1.293670E+01
4.268506E+01
9.161216E+01
3.022909E+01
4.598915E+01
5.680399E+01
1.623879E+02
4.033805E+01
8.196263E+01
6.814742E+01
2.331778E+02
4.851618E+01
1.182330E+02
7.392923E+01
2.740255E+02
5.253586E+01
1.384152E+02
7.332860E+01
2.698608E+02
5.227405E+01
1.371810E+02
6.830172E+01
2.340687E+02
4.867159E+01
1.188724E+02
5.885634E+01
1.736180E+02
4.170434E+01
8.719622E+01
4.371848E+01
9.592893E+01
3.106403E+01
4.844308E+01
2.338413E+01
2.752467E+01
1.636713E+01
1.347770E+01
tally 3:
1.538752E+01
1.196478E+01
1.079685E+00
6.010786E-02
2.911906E+01
4.269070E+01
1.822657E+00
1.671850E-01
3.885421E+01
7.608218E+01
2.541516E+00
3.262451E-01
4.673300E+01
1.097036E+02
2.885307E+00
4.214444E-01
5.059247E+01
1.283984E+02
3.222796E+00
5.237329E-01
5.034856E+01
1.272538E+02
3.230225E+00
5.273424E-01
4.688476E+01
1.103152E+02
2.941287E+00
4.363749E-01
4.013746E+01
8.077506E+01
2.634234E+00
3.520270E-01
2.996887E+01
4.509953E+01
1.946504E+00
1.919104E-01
1.575260E+01
1.248707E+01
1.020705E+00
5.413569E-02
tally 4:
3.049469E+00
4.677325E-01
0.000000E+00
0.000000E+00
2.770358E+00
3.879191E-01
5.514939E+00
1.528899E+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
0.000000E+00
5.514939E+00
1.528899E+00
2.770358E+00
3.879191E-01
5.032131E+00
1.275040E+00
7.294002E+00
2.675589E+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
0.000000E+00
7.294002E+00
2.675589E+00
5.032131E+00
1.275040E+00
7.036008E+00
2.490718E+00
8.668860E+00
3.776102E+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
0.000000E+00
8.668860E+00
3.776102E+00
7.036008E+00
2.490718E+00
8.352414E+00
3.501945E+00
9.345868E+00
4.380719E+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
0.000000E+00
9.345868E+00
4.380719E+00
8.352414E+00
3.501945E+00
9.093766E+00
4.158282E+00
9.223771E+00
4.270120E+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
0.000000E+00
9.223771E+00
4.270120E+00
9.093766E+00
4.158282E+00
9.219150E+00
4.264346E+00
8.530966E+00
3.651778E+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
0.000000E+00
8.530966E+00
3.651778E+00
9.219150E+00
4.264346E+00
8.690373E+00
3.785262E+00
7.204424E+00
2.604203E+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
0.000000E+00
7.204424E+00
2.604203E+00
8.690373E+00
3.785262E+00
7.513640E+00
2.833028E+00
5.326721E+00
1.426975E+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
0.000000E+00
5.326721E+00
1.426975E+00
7.513640E+00
2.833028E+00
5.662215E+00
1.607757E+00
2.848381E+00
4.093396E-01
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
2.848381E+00
4.093396E-01
5.662215E+00
1.607757E+00
3.025812E+00
4.597241E-01
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
0.000000E+00
0.000000E+00
tally 5:
1.538652E+01
1.196332E+01
2.252427E+00
2.605738E-01
2.911344E+01
4.267319E+01
3.873926E+00
7.615035E-01
3.884516E+01
7.604619E+01
5.280610E+00
1.414008E+00
4.672391E+01
1.096625E+02
6.261805E+00
1.983205E+00
5.058447E+01
1.283588E+02
6.733810E+00
2.278242E+00
5.033589E+01
1.271898E+02
6.714658E+00
2.273652E+00
4.687563E+01
1.102719E+02
6.215002E+00
1.956978E+00
4.013134E+01
8.075062E+01
5.253064E+00
1.396224E+00
2.996497E+01
4.508839E+01
3.818076E+00
7.509442E-01
1.574994E+01
1.248291E+01
2.219928E+00
2.515492E-01
cmfd indices
1.000000E+01
1.000000E+00
1.000000E+00
1.000000E+00
k cmfd
1.170416E+00
1.172966E+00
1.165537E+00
1.170979E+00
1.161922E+00
1.157523E+00
1.158873E+00
1.162877E+00
1.167101E+00
1.168130E+00
1.170570E+00
1.168115E+00
1.174081E+00
1.169458E+00
1.167848E+00
1.165116E+00
cmfd entropy
3.203643E+00
3.207943E+00
3.213367E+00
3.214360E+00
3.219634E+00
3.222232E+00
3.221744E+00
3.224544E+00
3.225990E+00
3.227769E+00
3.227417E+00
3.230728E+00
3.231662E+00
3.233316E+00
3.233193E+00
3.232564E+00
cmfd balance
4.00906E-03
4.43177E-03
3.15267E-03
3.51038E-03
2.05209E-03
2.06865E-03
1.50243E-03
1.58983E-03
1.56602E-03
1.17001E-03
9.50759E-04
9.07259E-04
1.00900E-03
1.06470E-03
1.16361E-03
9.75631E-04
cmfd dominance ratio
5.397E-01
5.425E-01
5.481E-01
5.473E-01
5.503E-01
5.502E-01
5.483E-01
5.520E-01
5.505E-01
3.216E-01
5.373E-01
5.517E-01
5.508E-01
5.524E-01
5.524E-01
5.523E-01
cmfd openmc source comparison
6.959834E-03
5.655657E-03
3.886186E-03
4.035116E-03
3.043277E-03
5.455474E-03
4.515310E-03
2.439840E-03
2.114032E-03
2.673132E-03
2.431749E-03
4.330928E-03
3.404647E-03
3.680298E-03
3.309620E-03
3.705541E-03
cmfd source
4.697085E-02
7.920706E-02
1.107968E-01
1.250932E-01
1.383930E-01
1.380648E-01
1.246874E-01
1.113705E-01
8.203754E-02
4.337882E-02

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!-- Parameters for criticality calculation -->
<run_mode>eigenvalue</run_mode>
<batches>20</batches>
<inactive>10</inactive>
<particles>1000</particles>
<!-- Starting source -->
<source>
<space>
<type>box</type>
<parameters>-10 -1 -1 10 1 1</parameters>
</space>
</source>
<!-- Shannon Entropy -->
<mesh id="10">
<dimension> 10 1 1 </dimension>
<lower_left> -10.0 -1.0 -1.0 </lower_left>
<upper_right> 10.0 1.0 1.0 </upper_right>
</mesh>
<entropy_mesh>10</entropy_mesh>
</settings>

View file

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<tallies>
<mesh id="1">
<type>regular</type>
<lower_left>-10 -1 -1 </lower_left>
<upper_right>10 1 1</upper_right>
<dimension>10 1 1</dimension>
</mesh>
<filter id="1">
<type>mesh</type>
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>flux</scores>
</tally>
</tallies>

View file

@ -0,0 +1,142 @@
from tests.testing_harness import CMFDTestHarness
from openmc import cmfd
import numpy as np
import scipy.sparse
def test_cmfd_physical_adjoint():
"""Test physical adjoint functionality of CMFD
This test runs CMFD with a physical adjoint calculation and asserts that
the adjoint k-effective and flux vector are equal to the non-adjoint
k-effective and flux vector at the last batch (equivalent for 1 group
problems).
"""
# Initialize and set CMFD mesh
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-10.0, -1.0, -1.0)
cmfd_mesh.upper_right = (10.0, 1.0, 1.0)
cmfd_mesh.dimension = (10, 1, 1)
cmfd_mesh.albedo = (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)
# Initialize and run CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.tally_begin = 5
cmfd_run.feedback_begin = 5
cmfd_run.feedback = True
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.run_adjoint = True
cmfd_run.adjoint_type = 'physical'
cmfd_run.run()
assert(np.all(cmfd_run._phi == cmfd_run._adj_phi))
assert(cmfd_run._adj_keff == cmfd_run._keff)
def test_cmfd_math_adjoint():
"""Test mathematical adjoint functionality of CMFD
This test runs CMFD with a mathematical adjoint calculation and asserts
that the adjoint k-effective and flux vector are equal to the non-adjoint
k-effective and flux vector at the last batch (equivalent for 1 group
problems).
"""
# Initialize and set CMFD mesh
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-10.0, -1.0, -1.0)
cmfd_mesh.upper_right = (10.0, 1.0, 1.0)
cmfd_mesh.dimension = (10, 1, 1)
cmfd_mesh.albedo = (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)
# Initialize and run CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.tally_begin = 5
cmfd_run.feedback_begin = 5
cmfd_run.feedback = True
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.run_adjoint = True
cmfd_run.adjoint_type = 'math'
cmfd_run.run()
assert(np.all(cmfd_run._phi == cmfd_run._adj_phi))
assert(cmfd_run._adj_keff == cmfd_run._keff)
def test_cmfd_write_matrices():
"""Test write matrices functionality of CMFD
This test runs CMFD with feedback and loads the loss/production matrices
and flux vector that are saved to disk, and checks to make sure these
values are consistent with each other and simulation results.
"""
# Initialize and set CMFD mesh
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-10.0, -1.0, -1.0)
cmfd_mesh.upper_right = (10.0, 1.0, 1.0)
cmfd_mesh.dimension = (10, 1, 1)
cmfd_mesh.albedo = (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)
# Initialize and run CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.tally_begin = 5
cmfd_run.feedback_begin = 5
cmfd_run.display = {'dominance': True}
cmfd_run.feedback = True
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.write_matrices = True
cmfd_run.run()
# Load loss matrix from numpy output file
loss_np = scipy.sparse.load_npz('loss.npz').todense()
# Load loss matrix from data file
loss_dat = np.loadtxt("loss.dat", delimiter=',')
# Go through each element of loss_dat and compare to loss_np
for elem in loss_dat:
assert(np.isclose(loss_np[int(elem[0]), int(elem[1])], elem[2]))
# Load production matrix from numpy output file
prod_np = scipy.sparse.load_npz('prod.npz').todense()
# Load production matrix from data file
prod_dat = np.loadtxt("prod.dat", delimiter=',')
# Go through each element of prod_dat and compare to prod_np
for elem in prod_dat:
assert(np.isclose(prod_np[int(elem[0]), int(elem[1])], elem[2]))
# Load flux vector from numpy output file
flux_np = np.load('fluxvec.npy')
# Load flux from data file
flux_dat = np.loadtxt("fluxvec.dat", delimiter='\n')
# Compare flux from numpy file, .dat file, and from simulation
assert(np.all(np.isclose(flux_np, cmfd_run._phi)))
assert(np.all(np.isclose(flux_np, flux_dat)))
def test_cmfd_feed():
"""Test 1 group CMFD solver with CMFD feedback"""
# Initialize and set CMFD mesh
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-10.0, -1.0, -1.0)
cmfd_mesh.upper_right = (10.0, 1.0, 1.0)
cmfd_mesh.dimension = (10, 1, 1)
cmfd_mesh.albedo = (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)
# Initialize and run CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.tally_begin = 5
cmfd_run.feedback_begin = 5
cmfd_run.display = {'dominance': True}
cmfd_run.feedback = True
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.run()
# Initialize and run CMFD test harness
harness = CMFDTestHarness('statepoint.20.h5', cmfd_run)
harness.main()

View file

@ -0,0 +1,31 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="1" fill="5" region="151 -152 153 -154 1380 -1370" />
<cell id="52" material="9" name="Fuel rod active region - 1.6% enr radial 0: Fuel 1.6%" region="-35" universe="8" />
<cell id="53" material="5" name="Fuel rod active region - 1.6% enr radial 1: Helium" region="35 -36" universe="8" />
<cell id="54" material="7" name="Fuel rod active region - 1.6% enr radial outer: Zircaloy 4" region="36" universe="8" />
<cell fill="8" id="1253" name="Fuel cell" region="-150" universe="763" />
<cell id="1254" material="15" name="Water" region="150" universe="763" />
<lattice id="5">
<dimension>2 2</dimension>
<lower_left>-1.25984 -1.25984</lower_left>
<pitch>1.25984 1.25984</pitch>
<universes>
763 763
763 763
</universes>
</lattice>
<surface coeffs="0.0 0.0 0.39218" id="35" name="Fuel pellet OR" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.40005" id="36" name="Fuel clad IR" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.4572" id="150" name="Fuel clad OR" type="z-cylinder" />
<surface boundary="reflective" coeffs="-1.25984" id="151" name="minimum x" type="x-plane" />
<surface boundary="reflective" coeffs="1.25984" id="152" name="maximum x" type="x-plane" />
<surface boundary="reflective" coeffs="-1.25984" id="153" name="minimum y" type="y-plane" />
<surface boundary="reflective" coeffs="1.25984" id="154" name="maximum y" type="y-plane" />
<surface boundary="reflective" coeffs="1.0" id="1370" name="Highest Extent" type="z-plane" />
<surface boundary="reflective" coeffs="-1.0" id="1380" name="Lowest Extent" type="z-plane" />
</geometry>

View file

@ -0,0 +1,59 @@
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material id="5" name="Helium">
<temperature>300</temperature>
<density units="g/cc" value="0.0015981" />
<nuclide name="He3" wo="1.5070346049256974e-06" />
<nuclide name="He4" wo="0.999998492965395" />
</material>
<material id="7" name="Zircaloy 4">
<temperature>300</temperature>
<density units="g/cc" value="6.55" />
<nuclide name="O16" wo="0.0012494965182849112" />
<nuclide name="O17" wo="5.034817150887735e-07" />
<nuclide name="Cr50" wo="4.1736864731106146e-05" />
<nuclide name="Cr52" wo="0.0008369936242576807" />
<nuclide name="Cr53" wo="9.673586881507429e-05" />
<nuclide name="Cr54" wo="2.4533642196138756e-05" />
<nuclide name="Fe54" wo="0.00011855672274761877" />
<nuclide name="Fe56" wo="0.001929932104229657" />
<nuclide name="Fe57" wo="4.536774095388075e-05" />
<nuclide name="Fe58" wo="6.143432068843669e-06" />
<nuclide name="Zr90" wo="0.49750307249921255" />
<nuclide name="Zr91" wo="0.10970127796055709" />
<nuclide name="Zr92" wo="0.16952409354767467" />
<nuclide name="Zr94" wo="0.17553856942304608" />
<nuclide name="Zr96" wo="0.02888298656950975" />
<nuclide name="Sn112" wo="0.0001325869644430062" />
<nuclide name="Sn114" wo="9.182449637587617e-05" />
<nuclide name="Sn115" wo="4.771905922545867e-05" />
<nuclide name="Sn116" wo="0.002058423153629443" />
<nuclide name="Sn117" wo="0.0010966473429083066" />
<nuclide name="Sn118" wo="0.0034879812938438245" />
<nuclide name="Sn119" wo="0.001247577110245757" />
<nuclide name="Sn120" wo="0.004771539495238715" />
<nuclide name="Sn122" wo="0.0006894094798456136" />
<nuclide name="Sn124" wo="0.000876291604244001" />
</material>
<material depletable="true" id="9" name="Fuel 1.6%">
<temperature>300</temperature>
<density units="g/cc" value="10.31341" />
<nuclide ao="1.9992419999999993" name="O16" />
<nuclide ao="0.0007579999999999998" name="O17" />
<nuclide ao="0.00014571996318473284" name="U234" />
<nuclide ao="0.01630316269333107" name="U235" />
<nuclide ao="0.983476441027697" name="U238" />
<nuclide ao="7.467631578722921e-05" name="U236" />
</material>
<material id="15" name="Borated Water">
<temperature>300</temperature>
<density units="g/cc" value="0.7405820675158279" />
<nuclide ao="0.00032178659941803253" name="B10" />
<nuclide ao="0.0013017583017829388" name="B11" />
<nuclide ao="1.996441935899364" name="H1" />
<nuclide ao="0.0003109742982341739" name="H2" />
<nuclide ao="0.9979980704223166" name="O16" />
<nuclide ao="0.0003783846764824448" name="O17" />
<sab name="c_H_in_H2O" />
</material>
</materials>

View file

@ -0,0 +1,434 @@
k-combined:
1.038883E+00 1.017030E-02
tally 1:
1.167304E+02
1.362680E+03
1.157179E+02
1.339273E+03
1.167087E+02
1.362782E+03
1.164493E+02
1.356411E+03
tally 2:
4.400233E+01
9.698989E+01
6.541957E+01
2.144299E+02
1.863245E+02
1.738212E+03
1.038047E+02
5.390768E+02
4.368854E+01
9.564001E+01
6.489620E+01
2.109923E+02
1.836691E+02
1.687792E+03
1.022706E+02
5.232407E+02
4.433402E+01
9.859049E+01
6.548060E+01
2.150470E+02
1.839219E+02
1.692209E+03
1.031634E+02
5.323852E+02
4.380686E+01
9.606723E+01
6.480355E+01
2.103905E+02
1.868847E+02
1.747254E+03
1.038109E+02
5.391360E+02
tally 3:
6.192979E+01
1.921761E+02
0.000000E+00
0.000000E+00
2.033842E-02
4.375294E-05
4.296339E+00
9.280716E-01
3.493776E+00
6.157094E-01
0.000000E+00
0.000000E+00
9.876716E+01
4.880113E+02
9.043140E-01
4.156054E-02
6.138292E+01
1.887853E+02
0.000000E+00
0.000000E+00
1.591722E-02
2.328432E-05
4.296798E+00
9.289349E-01
3.584967E+00
6.444749E-01
0.000000E+00
0.000000E+00
9.717439E+01
4.724254E+02
8.435691E-01
3.666152E-02
6.192881E+01
1.924016E+02
0.000000E+00
0.000000E+00
1.796382E-02
3.190855E-05
4.343238E+00
9.514040E-01
3.504683E+00
6.157615E-01
0.000000E+00
0.000000E+00
9.818871E+01
4.822799E+02
8.401346E-01
3.664038E-02
6.130607E+01
1.882837E+02
0.000000E+00
0.000000E+00
1.220252E-02
1.711667E-05
4.245413E+00
9.056738E-01
3.468894E+00
6.033679E-01
0.000000E+00
0.000000E+00
9.885292E+01
4.888720E+02
9.509199E-01
4.670952E-02
tally 4:
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.200260E+00
4.243011E+00
3.728022E+01
6.953801E+01
9.178009E+00
4.218903E+00
3.738925E+01
6.993833E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.019225E+00
4.079528E+00
3.709185E+01
6.883085E+01
9.037478E+00
4.095846E+00
3.710303E+01
6.888447E+01
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
9.178009E+00
4.218903E+00
3.738925E+01
6.993833E+01
9.200260E+00
4.243011E+00
3.728022E+01
6.953801E+01
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
9.097360E+00
4.147125E+00
3.700603E+01
6.851110E+01
9.003417E+00
4.059372E+00
3.717266E+01
6.912709E+01
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
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.042233E+00
4.097018E+00
3.711597E+01
6.891834E+01
9.107597E+00
4.161211E+00
3.715168E+01
6.904544E+01
9.037478E+00
4.095846E+00
3.710303E+01
6.888447E+01
9.019225E+00
4.079528E+00
3.709185E+01
6.883085E+01
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
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.107597E+00
4.161211E+00
3.715168E+01
6.904544E+01
9.042233E+00
4.097018E+00
3.711597E+01
6.891834E+01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.003417E+00
4.059372E+00
3.717266E+01
6.912709E+01
9.097360E+00
4.147125E+00
3.700603E+01
6.851110E+01
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
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
tally 5:
6.195013E+01
1.923032E+02
1.022516E+02
5.230716E+02
1.418310E+01
1.011490E+01
4.677537E+01
1.094859E+02
6.139884E+01
1.888834E+02
1.007512E+02
5.078162E+02
1.403236E+01
9.884347E+00
4.598486E+01
1.058070E+02
6.194677E+01
1.925125E+02
1.016864E+02
5.172531E+02
1.407797E+01
9.971785E+00
4.623118E+01
1.069663E+02
6.131828E+01
1.883600E+02
1.023107E+02
5.236668E+02
1.375796E+01
9.501501E+00
4.638162E+01
1.076532E+02
cmfd indices
2.000000E+00
2.000000E+00
1.000000E+00
2.000000E+00
k cmfd
1.034617E+00
1.034521E+00
1.036479E+00
1.035658E+00
1.032505E+00
1.027277E+00
1.029326E+00
1.029881E+00
1.035579E+00
1.034753E+00
1.031963E+00
1.034797E+00
1.035383E+00
1.035908E+00
1.035629E+00
1.036034E+00
cmfd entropy
1.999493E+00
1.999058E+00
1.999331E+00
1.999370E+00
1.999383E+00
1.999455E+00
1.999640E+00
1.999810E+00
1.999881E+00
1.999937E+00
1.999973E+00
1.999965E+00
1.999972E+00
1.999982E+00
1.999998E+00
1.999984E+00
cmfd balance
3.99304E-04
4.16856E-04
6.38469E-04
3.92822E-04
3.78984E-04
2.68486E-04
4.84991E-04
1.08402E-03
1.09177E-03
5.45977E-04
4.45554E-04
4.01147E-04
3.71025E-04
3.57715E-04
3.84599E-04
3.90067E-04
cmfd dominance ratio
6.239E-03
6.303E-03
6.347E-03
6.388E-03
6.340E-03
6.334E-03
6.270E-03
6.173E-03
6.068E-03
6.061E-03
6.016E-03
6.108E-03
6.117E-03
6.074E-03
6.005E-03
5.996E-03
cmfd openmc source comparison
1.931386E-05
2.839161E-05
1.407963E-05
6.718156E-06
9.164199E-06
1.382540E-05
2.871606E-05
4.192300E-05
5.327515E-05
6.566500E-05
6.655540E-05
6.034977E-05
6.004677E-05
5.711622E-05
6.271263E-05
6.425362E-05
cmfd source
2.510278E-01
2.480592E-01
2.501750E-01
2.507380E-01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!-- Parameters for criticality calculation -->
<run_mode>eigenvalue</run_mode>
<batches>20</batches>
<inactive>10</inactive>
<particles>1000</particles>
<!-- Starting source -->
<source strength="1.0">
<space type="fission">
<parameters>-1.25984 -1.25984 -1 1.25984 1.25984 1</parameters>
</space>
</source>
<!-- Shannon Entropy -->
<mesh id="10">
<dimension> 2 2 1 </dimension>
<lower_left> -1.25984 -1.25984 -1.0 </lower_left>
<upper_right> 1.25984 1.25984 1.0 </upper_right>
</mesh>
<entropy_mesh>10</entropy_mesh>
</settings>

View file

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<tallies>
<mesh id="1">
<type>regular</type>
<lower_left>-1.25984 -1.25984 -1.0 </lower_left>
<upper_right>1.25984 1.25984 1.0</upper_right>
<dimension>2 2 1</dimension>
</mesh>
<filter id="1">
<type>mesh</type>
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>flux</scores>
</tally>
</tallies>

View file

@ -0,0 +1,29 @@
from tests.testing_harness import CMFDTestHarness
from openmc import cmfd
import numpy as np
def test_cmfd_feed_2g():
"""Test 2 group CMFD solver results with CMFD feedback"""
# Initialize and set CMFD mesh
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-1.25984, -1.25984, -1.0)
cmfd_mesh.upper_right = (1.25984, 1.25984, 1.0)
cmfd_mesh.dimension = (2, 2, 1)
cmfd_mesh.energy = (0.0, 0.625, 20000000)
cmfd_mesh.albedo = (1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
# Initialize and run CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.tally_begin = 5
cmfd_run.feedback_begin = 5
cmfd_run.display = {'dominance': True}
cmfd_run.feedback = True
cmfd_run.downscatter = True
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.run()
# Initialize and run CMFD test harness
harness = CMFDTestHarness('statepoint.20.h5', cmfd_run)
harness.main()

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<geometry>
<!-- Definition of Cells -->
<cell id="1">
<universe>0</universe>
<region>-1 2 -3 4 -5 6</region>
<material>1</material>
</cell>
<!-- Defition of Surfaces -->
<surface id="1">
<type>x-plane</type>
<coeffs>10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="2">
<type>x-plane</type>
<coeffs>-10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="3">
<type>y-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="4">
<type>y-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="5">
<type>z-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="6">
<type>z-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
</geometry>

View file

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<materials>
<!-- Definition of materials -->
<material id="1">
<density value="19" units="g/cc" />
<nuclide name="U235" wo="0.21" />
<nuclide name="U238" wo="0.68" />
<nuclide name="O16" wo="0.11" />
</material>
</materials>

View file

@ -0,0 +1,488 @@
k-combined:
1.165403E+00 1.129918E-02
tally 1:
1.141961E+01
1.307497E+01
2.075941E+01
4.316095E+01
2.834539E+01
8.063510E+01
3.513869E+01
1.238515E+02
3.699858E+01
1.372516E+02
3.612668E+01
1.310763E+02
3.373368E+01
1.140458E+02
2.836844E+01
8.075759E+01
2.158837E+01
4.674848E+01
1.141868E+01
1.310648E+01
tally 2:
1.126626E+00
1.269287E+00
7.749042E-01
6.004765E-01
1.991608E+00
3.966503E+00
1.411775E+00
1.993108E+00
2.978264E+00
8.870057E+00
2.130066E+00
4.537180E+00
3.708857E+00
1.375562E+01
2.698010E+00
7.279259E+00
4.233192E+00
1.791991E+01
3.023990E+00
9.144518E+00
4.062113E+00
1.650076E+01
2.910472E+00
8.470848E+00
3.506681E+00
1.229681E+01
2.497751E+00
6.238760E+00
2.974675E+00
8.848690E+00
2.121163E+00
4.499332E+00
2.329248E+00
5.425398E+00
1.658233E+00
2.749736E+00
1.158552E+00
1.342242E+00
8.282698E-01
6.860309E-01
tally 3:
7.459301E-01
5.564117E-01
4.877614E-02
2.379112E-03
1.356702E+00
1.840641E+00
8.361624E-02
6.991675E-03
2.047332E+00
4.191570E+00
1.521351E-01
2.314509E-02
2.610287E+00
6.813596E+00
1.718778E-01
2.954199E-02
2.911379E+00
8.476127E+00
1.823299E-01
3.324418E-02
2.806920E+00
7.878801E+00
2.090406E-01
4.369797E-02
2.415727E+00
5.835736E+00
1.486511E-01
2.209715E-02
2.051064E+00
4.206862E+00
1.196177E-01
1.430839E-02
1.593746E+00
2.540026E+00
1.126497E-01
1.268994E-02
7.994935E-01
6.391898E-01
5.806683E-02
3.371757E-03
tally 4:
1.341719E-01
1.800210E-02
0.000000E+00
0.000000E+00
1.420707E-01
2.018410E-02
2.633150E-01
6.933479E-02
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
2.633150E-01
6.933479E-02
1.420707E-01
2.018410E-02
2.628613E-01
6.909608E-02
3.590382E-01
1.289084E-01
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.590382E-01
1.289084E-01
2.628613E-01
6.909608E-02
3.851599E-01
1.483482E-01
4.595809E-01
2.112146E-01
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
4.595809E-01
2.112146E-01
3.851599E-01
1.483482E-01
4.679967E-01
2.190209E-01
4.970187E-01
2.470276E-01
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
4.970187E-01
2.470276E-01
4.679967E-01
2.190209E-01
4.909661E-01
2.410477E-01
4.838785E-01
2.341384E-01
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
4.838785E-01
2.341384E-01
4.909661E-01
2.410477E-01
5.152690E-01
2.655021E-01
4.788649E-01
2.293116E-01
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
4.788649E-01
2.293116E-01
5.152690E-01
2.655021E-01
4.266876E-01
1.820623E-01
3.401342E-01
1.156913E-01
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.401342E-01
1.156913E-01
4.266876E-01
1.820623E-01
3.724186E-01
1.386956E-01
2.560013E-01
6.553669E-02
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
2.560013E-01
6.553669E-02
3.724186E-01
1.386956E-01
2.892134E-01
8.364439E-02
1.556176E-01
2.421685E-02
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
1.556176E-01
2.421685E-02
2.892134E-01
8.364439E-02
1.497744E-01
2.243237E-02
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
0.000000E+00
0.000000E+00
tally 5:
7.459301E-01
5.564117E-01
1.149820E-01
1.322085E-02
1.356702E+00
1.840641E+00
1.801102E-01
3.243968E-02
2.047332E+00
4.191570E+00
2.627497E-01
6.903740E-02
2.609217E+00
6.808012E+00
3.360314E-01
1.129171E-01
2.909457E+00
8.464941E+00
4.095451E-01
1.677272E-01
2.805131E+00
7.868760E+00
3.957627E-01
1.566281E-01
2.415727E+00
5.835736E+00
3.196414E-01
1.021706E-01
2.049859E+00
4.201923E+00
3.162399E-01
1.000077E-01
1.593746E+00
2.540026E+00
2.169985E-01
4.708836E-02
7.994935E-01
6.391898E-01
1.002481E-01
1.004969E-02
cmfd indices
1.000000E+01
1.000000E+00
1.000000E+00
1.000000E+00
k cmfd
1.143597E+00
1.163387E+00
1.173384E+00
1.171035E+00
1.147196E+00
1.122260E+00
1.106380E+00
1.124693E+00
1.133192E+00
1.134435E+00
1.142380E+00
1.132168E+00
1.132560E+00
1.153781E+00
1.170308E+00
1.184540E+00
cmfd entropy
3.212002E+00
3.206393E+00
3.223984E+00
3.222764E+00
3.232123E+00
3.242083E+00
3.246067E+00
3.238869E+00
3.235585E+00
3.234611E+00
3.233575E+00
3.236922E+00
3.229545E+00
3.225232E+00
3.221485E+00
3.219108E+00
cmfd balance
8.26180E-03
4.27338E-03
2.22686E-03
1.93026E-03
1.96979E-03
2.13756E-03
2.01479E-03
1.74519E-03
2.09248E-03
1.25545E-03
1.48370E-03
1.75963E-03
1.98194E-03
1.87306E-03
1.24780E-03
1.15560E-03
cmfd dominance ratio
5.404E-01
5.406E-01
5.449E-01
5.473E-01
5.534E-01
5.623E-01
5.738E-01
5.611E-01
5.569E-01
5.556E-01
5.555E-01
5.583E-01
5.544E-01
5.486E-01
5.412E-01
5.383E-01
cmfd openmc source comparison
1.575499E-02
1.293688E-02
3.531746E-03
8.281178E-03
5.771681E-03
7.459013E-03
5.012869E-03
1.770224E-03
5.242540E-03
3.888027E-03
6.653433E-03
8.839928E-03
5.456904E-03
5.668412E-03
4.016377E-03
4.179381E-03
cmfd source
4.116210E-02
7.797480E-02
1.062822E-01
1.333719E-01
1.481091E-01
1.370422E-01
1.299765E-01
9.887040E-02
8.228753E-02
4.492330E-02

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!-- Parameters for criticality calculation -->
<run_mode>eigenvalue</run_mode>
<batches>20</batches>
<inactive>10</inactive>
<particles>1000</particles>
<!-- Starting source -->
<source>
<space>
<type>box</type>
<parameters>-10 -1 -1 10 1 1</parameters>
</space>
</source>
<!-- Shannon Entropy -->
<mesh id="10">
<dimension> 10 1 1 </dimension>
<lower_left> -10.0 -1.0 -1.0 </lower_left>
<upper_right> 10.0 1.0 1.0 </upper_right>
</mesh>
<entropy_mesh>10</entropy_mesh>
</settings>

View file

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<tallies>
<mesh id="1">
<type>regular</type>
<lower_left>-10 -1 -1 </lower_left>
<upper_right>10 1 1</upper_right>
<dimension>10 1 1</dimension>
</mesh>
<filter id="1">
<type>mesh</type>
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>flux</scores>
</tally>
</tallies>

View file

@ -0,0 +1,26 @@
from tests.testing_harness import CMFDTestHarness
from openmc import cmfd
def test_cmfd_feed_rolling_window():
"""Test 1 group CMFD solver with CMFD feedback"""
# Initialize and set CMFD mesh
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-10.0, -1.0, -1.0)
cmfd_mesh.upper_right = (10.0, 1.0, 1.0)
cmfd_mesh.dimension = (10, 1, 1)
cmfd_mesh.albedo = (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)
# Initialize and run CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.tally_begin = 5
cmfd_run.feedback_begin = 10
cmfd_run.feedback = True
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.window_type = 'expanding'
cmfd_run.run()
# Initialize and run CMFD test harness
harness = CMFDTestHarness('statepoint.20.h5', cmfd_run)
harness.main()

View file

@ -0,0 +1,31 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="1" fill="5" region="151 -152 153 -154 1380 -1370" />
<cell id="52" material="9" name="Fuel rod active region - 1.6% enr radial 0: Fuel 1.6%" region="-35" universe="8" />
<cell id="53" material="5" name="Fuel rod active region - 1.6% enr radial 1: Helium" region="35 -36" universe="8" />
<cell id="54" material="7" name="Fuel rod active region - 1.6% enr radial outer: Zircaloy 4" region="36" universe="8" />
<cell fill="8" id="1253" name="Fuel cell" region="-150" universe="763" />
<cell id="1254" material="15" name="Water" region="150" universe="763" />
<lattice id="5">
<dimension>2 2</dimension>
<lower_left>-1.25984 -1.25984</lower_left>
<pitch>1.25984 1.25984</pitch>
<universes>
763 763
763 763
</universes>
</lattice>
<surface coeffs="0.0 0.0 0.39218" id="35" name="Fuel pellet OR" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.40005" id="36" name="Fuel clad IR" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.4572" id="150" name="Fuel clad OR" type="z-cylinder" />
<surface boundary="reflective" coeffs="-1.25984" id="151" name="minimum x" type="x-plane" />
<surface boundary="reflective" coeffs="1.25984" id="152" name="maximum x" type="x-plane" />
<surface boundary="reflective" coeffs="-1.25984" id="153" name="minimum y" type="y-plane" />
<surface boundary="reflective" coeffs="1.25984" id="154" name="maximum y" type="y-plane" />
<surface boundary="reflective" coeffs="1.0" id="1370" name="Highest Extent" type="z-plane" />
<surface boundary="reflective" coeffs="-1.0" id="1380" name="Lowest Extent" type="z-plane" />
</geometry>

View file

@ -0,0 +1,59 @@
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material id="5" name="Helium">
<temperature>300</temperature>
<density units="g/cc" value="0.0015981" />
<nuclide name="He3" wo="1.5070346049256974e-06" />
<nuclide name="He4" wo="0.999998492965395" />
</material>
<material id="7" name="Zircaloy 4">
<temperature>300</temperature>
<density units="g/cc" value="6.55" />
<nuclide name="O16" wo="0.0012494965182849112" />
<nuclide name="O17" wo="5.034817150887735e-07" />
<nuclide name="Cr50" wo="4.1736864731106146e-05" />
<nuclide name="Cr52" wo="0.0008369936242576807" />
<nuclide name="Cr53" wo="9.673586881507429e-05" />
<nuclide name="Cr54" wo="2.4533642196138756e-05" />
<nuclide name="Fe54" wo="0.00011855672274761877" />
<nuclide name="Fe56" wo="0.001929932104229657" />
<nuclide name="Fe57" wo="4.536774095388075e-05" />
<nuclide name="Fe58" wo="6.143432068843669e-06" />
<nuclide name="Zr90" wo="0.49750307249921255" />
<nuclide name="Zr91" wo="0.10970127796055709" />
<nuclide name="Zr92" wo="0.16952409354767467" />
<nuclide name="Zr94" wo="0.17553856942304608" />
<nuclide name="Zr96" wo="0.02888298656950975" />
<nuclide name="Sn112" wo="0.0001325869644430062" />
<nuclide name="Sn114" wo="9.182449637587617e-05" />
<nuclide name="Sn115" wo="4.771905922545867e-05" />
<nuclide name="Sn116" wo="0.002058423153629443" />
<nuclide name="Sn117" wo="0.0010966473429083066" />
<nuclide name="Sn118" wo="0.0034879812938438245" />
<nuclide name="Sn119" wo="0.001247577110245757" />
<nuclide name="Sn120" wo="0.004771539495238715" />
<nuclide name="Sn122" wo="0.0006894094798456136" />
<nuclide name="Sn124" wo="0.000876291604244001" />
</material>
<material depletable="true" id="9" name="Fuel 1.6%">
<temperature>300</temperature>
<density units="g/cc" value="10.31341" />
<nuclide ao="1.9992419999999993" name="O16" />
<nuclide ao="0.0007579999999999998" name="O17" />
<nuclide ao="0.00014571996318473284" name="U234" />
<nuclide ao="0.01630316269333107" name="U235" />
<nuclide ao="0.983476441027697" name="U238" />
<nuclide ao="7.467631578722921e-05" name="U236" />
</material>
<material id="15" name="Borated Water">
<temperature>300</temperature>
<density units="g/cc" value="0.7405820675158279" />
<nuclide ao="0.00032178659941803253" name="B10" />
<nuclide ao="0.0013017583017829388" name="B11" />
<nuclide ao="1.996441935899364" name="H1" />
<nuclide ao="0.0003109742982341739" name="H2" />
<nuclide ao="0.9979980704223166" name="O16" />
<nuclide ao="0.0003783846764824448" name="O17" />
<sab name="c_H_in_H2O" />
</material>
</materials>

View file

@ -0,0 +1,621 @@
k-combined:
1.029540E+00 1.765357E-02
tally 1:
1.144958E+02
1.311468E+03
1.156179E+02
1.337279E+03
1.150532E+02
1.324445E+03
1.151074E+02
1.325687E+03
tally 2:
3.465741E+01
7.535177E+01
5.111161E+01
1.637703E+02
1.077835E+01
7.306380E+00
9.069631E+00
5.159419E+00
1.367406E+02
1.170393E+03
7.339832E+01
3.371470E+02
3.562570E+01
7.967278E+01
5.270792E+01
1.745991E+02
1.036807E+01
6.781874E+00
8.681747E+00
4.745685E+00
1.356820E+02
1.151355E+03
7.286142E+01
3.320255E+02
3.538463E+01
7.862285E+01
5.236063E+01
1.723667E+02
1.054863E+01
7.042669E+00
8.940285E+00
5.055491E+00
1.392130E+02
1.214087E+03
7.370365E+01
3.397160E+02
3.523551E+01
7.794325E+01
5.202347E+01
1.700797E+02
1.028117E+01
6.655678E+00
8.538920E+00
4.585368E+00
1.366887E+02
1.169157E+03
7.333804E+01
3.363693E+02
tally 3:
4.838342E+01
1.467669E+02
0.000000E+00
0.000000E+00
9.528018E-03
1.989268E-05
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
3.248228E+00
6.666986E-01
2.521640E+00
3.997992E-01
0.000000E+00
0.000000E+00
6.409424E+00
2.580559E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.132877E-01
1.324578E-03
2.859604E-01
5.376390E-03
0.000000E+00
0.000000E+00
2.639920E+00
4.380416E-01
0.000000E+00
0.000000E+00
6.939496E+01
3.014077E+02
6.294737E-01
2.532146E-02
4.991526E+01
1.566280E+02
0.000000E+00
0.000000E+00
2.046458E-02
4.809372E-05
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
3.463364E+00
7.583727E-01
2.430263E+00
3.746875E-01
0.000000E+00
0.000000E+00
6.122700E+00
2.364648E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
8.905302E-02
7.522016E-04
3.093670E-01
6.756039E-03
0.000000E+00
0.000000E+00
2.632761E+00
4.384843E-01
0.000000E+00
0.000000E+00
6.885265E+01
2.965191E+02
6.537575E-01
2.783733E-02
4.958341E+01
1.546656E+02
0.000000E+00
0.000000E+00
1.104672E-02
2.296190E-05
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
3.430503E+00
7.448601E-01
2.530174E+00
4.079173E-01
0.000000E+00
0.000000E+00
6.274274E+00
2.498200E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
9.479111E-02
8.398250E-04
3.294639E-01
7.117117E-03
0.000000E+00
0.000000E+00
2.509698E+00
3.981073E-01
0.000000E+00
0.000000E+00
6.980298E+01
3.047163E+02
5.942566E-01
2.324911E-02
4.923505E+01
1.524105E+02
0.000000E+00
0.000000E+00
8.227938E-03
1.354400E-05
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
3.469466E+00
7.613187E-01
2.362792E+00
3.532280E-01
0.000000E+00
0.000000E+00
6.039916E+00
2.302934E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
1.082199E-01
9.467140E-04
3.168219E-01
6.900253E-03
0.000000E+00
0.000000E+00
2.552623E+00
4.095459E-01
0.000000E+00
0.000000E+00
6.925085E+01
2.999309E+02
6.137602E-01
2.534680E-02
tally 4:
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
7.242831E+00
3.304033E+00
2.049900E+00
2.662637E-01
2.719284E+01
4.625227E+01
7.106615E+00
3.182962E+00
2.092906E+00
2.757959E-01
2.714938E+01
4.610188E+01
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
7.098381E+00
3.169308E+00
2.239283E+00
3.166544E-01
2.718623E+01
4.622986E+01
7.155181E+00
3.223545E+00
2.207036E+00
3.075514E-01
2.738538E+01
4.691471E+01
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
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
7.106615E+00
3.182962E+00
2.092906E+00
2.757959E-01
2.714938E+01
4.610188E+01
7.242831E+00
3.304033E+00
2.049900E+00
2.662637E-01
2.719284E+01
4.625227E+01
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
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
7.311265E+00
3.366747E+00
2.082480E+00
2.748257E-01
2.755422E+01
4.749248E+01
7.228075E+00
3.276572E+00
2.031308E+00
2.619010E-01
2.738542E+01
4.691635E+01
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
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
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
7.340922E+00
3.389303E+00
2.057125E+00
2.684644E-01
2.738205E+01
4.690167E+01
7.315301E+00
3.364365E+00
2.170144E+00
2.965160E-01
2.757366E+01
4.755684E+01
7.155181E+00
3.223545E+00
2.207036E+00
3.075514E-01
2.738538E+01
4.691471E+01
7.098381E+00
3.169308E+00
2.239283E+00
3.166544E-01
2.718623E+01
4.622986E+01
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
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
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
7.315301E+00
3.364365E+00
2.170144E+00
2.965160E-01
2.757366E+01
4.755684E+01
7.340922E+00
3.389303E+00
2.057125E+00
2.684644E-01
2.738205E+01
4.690167E+01
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
7.228075E+00
3.276572E+00
2.031308E+00
2.619010E-01
2.738542E+01
4.691635E+01
7.311265E+00
3.366747E+00
2.082480E+00
2.748257E-01
2.755422E+01
4.749248E+01
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
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
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
tally 5:
4.839295E+01
1.468255E+02
8.931064E+00
5.003633E+00
7.231756E+01
3.273024E+02
1.088865E+01
7.436517E+00
4.139343E+00
1.078084E+00
3.295902E+01
6.798023E+01
4.993572E+01
1.567557E+02
8.552963E+00
4.606265E+00
7.178811E+01
3.223267E+02
1.087522E+01
7.441404E+00
3.965469E+00
9.946937E-01
3.244312E+01
6.588480E+01
4.959446E+01
1.547357E+02
8.804447E+00
4.904770E+00
7.263395E+01
3.299329E+02
1.105711E+01
7.709583E+00
4.082202E+00
1.057954E+00
3.316528E+01
6.882214E+01
4.924327E+01
1.524623E+02
8.402708E+00
4.441938E+00
7.211875E+01
3.252784E+02
1.130536E+01
8.069378E+00
3.817575E+00
9.236385E-01
3.272602E+01
6.700774E+01
cmfd indices
2.000000E+00
2.000000E+00
1.000000E+00
3.000000E+00
k cmfd
1.029991E+00
1.037713E+00
1.038248E+00
1.035411E+00
1.039580E+00
1.031827E+00
1.026250E+00
1.026011E+00
1.026544E+00
1.031482E+00
1.031761E+00
cmfd entropy
1.998652E+00
1.999218E+00
1.999186E+00
1.999177E+00
1.999248E+00
1.999637E+00
1.999721E+00
1.999648E+00
1.999631E+00
1.999572E+00
1.999693E+00
cmfd balance
8.98944E-04
4.45874E-04
2.18562E-04
2.83412E-04
3.60924E-04
2.53288E-04
3.38843E-04
3.17072E-04
3.25867E-04
2.27001E-04
2.41723E-04
cmfd dominance ratio
3.768E-03
3.706E-03
2.572E-03
2.757E-03
3.815E-03
3.951E-03
3.826E-03
3.829E-03
3.902E-03
3.952E-03
3.885E-03
cmfd openmc source comparison
3.292759E-05
2.585546E-05
2.217204E-05
2.121913E-05
9.253928E-06
2.940947E-05
3.083596E-05
2.547491E-05
2.602691E-05
2.561169E-05
2.816825E-05
cmfd source
2.417661E-01
2.547768E-01
2.495653E-01
2.538918E-01
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!-- Parameters for criticality calculation -->
<run_mode>eigenvalue</run_mode>
<batches>20</batches>
<inactive>10</inactive>
<particles>600</particles>
<!-- Starting source -->
<source strength="1.0">
<space type="fission">
<parameters>-1.25984 -1.25984 -1 1.25984 1.25984 1</parameters>
</space>
</source>
<!-- Shannon Entropy -->
<mesh id="10">
<dimension> 2 2 1 </dimension>
<lower_left> -1.25984 -1.25984 -1.0 </lower_left>
<upper_right> 1.25984 1.25984 1.0 </upper_right>
</mesh>
<entropy_mesh>10</entropy_mesh>
</settings>

View file

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<tallies>
<mesh id="1">
<type>regular</type>
<lower_left>-1.25984 -1.25984 -1.0 </lower_left>
<upper_right>1.25984 1.25984 1.0</upper_right>
<dimension>2 2 1</dimension>
</mesh>
<filter id="1">
<type>mesh</type>
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>flux</scores>
</tally>
</tallies>

View file

@ -0,0 +1,30 @@
from tests.testing_harness import CMFDTestHarness
from openmc import cmfd
import numpy as np
def test_cmfd_feed_ng():
"""Test n group CMFD solver with CMFD feedback"""
# Initialize and set CMFD mesh
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-1.25984, -1.25984, -1.0)
cmfd_mesh.upper_right = (1.25984, 1.25984, 1.0)
cmfd_mesh.dimension = (2, 2, 1)
cmfd_mesh.energy = (0.0, 0.625, 5.53080, 20000000)
cmfd_mesh.albedo = (1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
# Initialize and run CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.reset = [5]
cmfd_run.tally_begin = 10
cmfd_run.feedback_begin = 10
cmfd_run.display = {'dominance': True}
cmfd_run.feedback = True
cmfd_run.downscatter = True
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.run()
# Initialize and run CMFD test harness
harness = CMFDTestHarness('statepoint.20.h5', cmfd_run)
harness.main()

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<geometry>
<!-- Definition of Cells -->
<cell id="1">
<universe>0</universe>
<region>-1 2 -3 4 -5 6</region>
<material>1</material>
</cell>
<!-- Defition of Surfaces -->
<surface id="1">
<type>x-plane</type>
<coeffs>10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="2">
<type>x-plane</type>
<coeffs>-10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="3">
<type>y-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="4">
<type>y-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="5">
<type>z-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="6">
<type>z-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
</geometry>

View file

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<materials>
<!-- Definition of materials -->
<material id="1">
<density value="19" units="g/cc" />
<nuclide name="U235" wo="0.21" />
<nuclide name="U238" wo="0.68" />
<nuclide name="O16" wo="0.11" />
</material>
</materials>

View file

@ -0,0 +1,488 @@
k-combined:
1.165408E+00 1.127320E-02
tally 1:
1.141009E+01
1.305436E+01
2.074878E+01
4.311543E+01
2.834824E+01
8.065180E+01
3.513901E+01
1.238542E+02
3.699846E+01
1.372507E+02
3.612638E+01
1.310741E+02
3.373329E+01
1.140431E+02
2.836806E+01
8.075546E+01
2.158796E+01
4.674672E+01
1.141841E+01
1.310586E+01
tally 2:
1.126662E+00
1.269368E+00
7.749275E-01
6.005127E-01
1.991651E+00
3.966673E+00
1.411802E+00
1.993185E+00
2.978294E+00
8.870233E+00
2.130084E+00
4.537258E+00
3.708845E+00
1.375553E+01
2.698001E+00
7.279210E+00
4.233143E+00
1.791950E+01
3.023958E+00
9.144324E+00
4.062060E+00
1.650033E+01
2.910435E+00
8.470632E+00
3.506628E+00
1.229644E+01
2.497713E+00
6.238573E+00
2.974637E+00
8.848463E+00
2.121135E+00
4.499215E+00
2.329228E+00
5.425303E+00
1.658218E+00
2.749687E+00
1.158542E+00
1.342220E+00
8.282626E-01
6.860190E-01
tally 3:
7.459525E-01
5.564451E-01
4.877161E-02
2.378670E-03
1.356729E+00
1.840713E+00
8.360848E-02
6.990377E-03
2.047350E+00
4.191641E+00
1.521210E-01
2.314079E-02
2.610278E+00
6.813552E+00
1.718619E-01
2.953650E-02
2.911348E+00
8.475950E+00
1.823129E-01
3.323800E-02
2.806884E+00
7.878600E+00
2.090212E-01
4.368986E-02
2.415690E+00
5.835559E+00
1.486373E-01
2.209304E-02
2.051037E+00
4.206752E+00
1.196066E-01
1.430573E-02
1.593732E+00
2.539980E+00
1.126392E-01
1.268759E-02
7.994865E-01
6.391786E-01
5.806144E-02
3.371131E-03
tally 4:
1.341763E-01
1.800329E-02
0.000000E+00
0.000000E+00
1.420749E-01
2.018527E-02
2.633206E-01
6.933776E-02
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
2.633206E-01
6.933776E-02
1.420749E-01
2.018527E-02
2.628684E-01
6.909981E-02
3.590428E-01
1.289117E-01
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.590428E-01
1.289117E-01
2.628684E-01
6.909981E-02
3.851638E-01
1.483512E-01
4.595776E-01
2.112116E-01
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
4.595776E-01
2.112116E-01
3.851638E-01
1.483512E-01
4.679953E-01
2.190196E-01
4.970127E-01
2.470216E-01
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
4.970127E-01
2.470216E-01
4.679953E-01
2.190196E-01
4.909606E-01
2.410423E-01
4.838733E-01
2.341333E-01
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
4.838733E-01
2.341333E-01
4.909606E-01
2.410423E-01
5.152620E-01
2.654949E-01
4.788580E-01
2.293049E-01
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
4.788580E-01
2.293049E-01
5.152620E-01
2.654949E-01
4.266812E-01
1.820568E-01
3.401298E-01
1.156883E-01
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.401298E-01
1.156883E-01
4.266812E-01
1.820568E-01
3.724142E-01
1.386923E-01
2.559996E-01
6.553579E-02
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
2.559996E-01
6.553579E-02
3.724142E-01
1.386923E-01
2.892105E-01
8.364271E-02
1.556166E-01
2.421652E-02
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
1.556166E-01
2.421652E-02
2.892105E-01
8.364271E-02
1.497731E-01
2.243198E-02
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
0.000000E+00
0.000000E+00
tally 5:
7.459525E-01
5.564451E-01
1.149859E-01
1.322177E-02
1.356729E+00
1.840713E+00
1.801152E-01
3.244149E-02
2.047350E+00
4.191641E+00
2.627538E-01
6.903954E-02
2.609208E+00
6.807967E+00
3.360312E-01
1.129170E-01
2.909427E+00
8.464765E+00
4.095398E-01
1.677229E-01
2.805095E+00
7.868559E+00
3.957580E-01
1.566244E-01
2.415690E+00
5.835559E+00
3.196366E-01
1.021676E-01
2.049833E+00
4.201813E+00
3.162366E-01
1.000056E-01
1.593732E+00
2.539980E+00
2.169968E-01
4.708761E-02
7.994865E-01
6.391786E-01
1.002479E-01
1.004964E-02
cmfd indices
1.000000E+01
1.000000E+00
1.000000E+00
1.000000E+00
k cmfd
1.143785E+00
1.163460E+00
1.173453E+00
1.171056E+00
1.147214E+00
1.122230E+00
1.106385E+00
1.124706E+00
1.133207E+00
1.134453E+00
1.142355E+00
1.132121E+00
1.132479E+00
1.153657E+00
1.170183E+00
1.184408E+00
cmfd entropy
3.211758E+00
3.206356E+00
3.223933E+00
3.222754E+00
3.232110E+00
3.242098E+00
3.246062E+00
3.238858E+00
3.235577E+00
3.234604E+00
3.233582E+00
3.236922E+00
3.229563E+00
3.225265E+00
3.221498E+00
3.219126E+00
cmfd balance
8.26180E-03
4.27338E-03
2.22686E-03
1.93026E-03
1.96979E-03
2.13756E-03
2.01521E-03
1.74538E-03
2.09240E-03
1.25495E-03
1.49542E-03
1.76968E-03
1.99174E-03
1.87753E-03
1.24170E-03
1.15645E-03
cmfd dominance ratio
5.408E-01
5.374E-01
5.420E-01
5.444E-01
5.513E-01
5.613E-01
5.722E-01
5.592E-01
5.542E-01
5.537E-01
5.541E-01
5.579E-01
5.543E-01
5.487E-01
5.413E-01
5.381E-01
cmfd openmc source comparison
1.597982E-02
1.276493E-02
3.495229E-03
8.157807E-03
5.715330E-03
7.433111E-03
5.006211E-03
1.766072E-03
5.184425E-03
3.864321E-03
6.617152E-03
8.841210E-03
5.454747E-03
5.652690E-03
4.006767E-03
4.167617E-03
cmfd source
4.116746E-02
7.798354E-02
1.062881E-01
1.333681E-01
1.481008E-01
1.370408E-01
1.299726E-01
9.886814E-02
8.228698E-02
4.492338E-02

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!-- Parameters for criticality calculation -->
<run_mode>eigenvalue</run_mode>
<batches>20</batches>
<inactive>10</inactive>
<particles>1000</particles>
<!-- Starting source -->
<source>
<space>
<type>box</type>
<parameters>-10 -1 -1 10 1 1</parameters>
</space>
</source>
<!-- Shannon Entropy -->
<mesh id="10">
<dimension> 10 1 1 </dimension>
<lower_left> -10.0 -1.0 -1.0 </lower_left>
<upper_right> 10.0 1.0 1.0 </upper_right>
</mesh>
<entropy_mesh>10</entropy_mesh>
</settings>

View file

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<tallies>
<mesh id="1">
<type>regular</type>
<lower_left>-10 -1 -1 </lower_left>
<upper_right>10 1 1</upper_right>
<dimension>10 1 1</dimension>
</mesh>
<filter id="1">
<type>mesh</type>
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>flux</scores>
</tally>
</tallies>

View file

@ -0,0 +1,27 @@
from tests.testing_harness import CMFDTestHarness
from openmc import cmfd
def test_cmfd_feed_rolling_window():
"""Test 1 group CMFD solver with CMFD feedback"""
# Initialize and set CMFD mesh
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-10.0, -1.0, -1.0)
cmfd_mesh.upper_right = (10.0, 1.0, 1.0)
cmfd_mesh.dimension = (10, 1, 1)
cmfd_mesh.albedo = (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)
# Initialize and run CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.tally_begin = 5
cmfd_run.feedback_begin = 10
cmfd_run.feedback = True
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.window_type = 'expanding'
cmfd_run.ref_d = [0.542]
cmfd_run.run()
# Initialize and run CMFD test harness
harness = CMFDTestHarness('statepoint.20.h5', cmfd_run)
harness.main()

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<geometry>
<!-- Definition of Cells -->
<cell id="1">
<universe>0</universe>
<region>-1 2 -3 4 -5 6</region>
<material>1</material>
</cell>
<!-- Defition of Surfaces -->
<surface id="1">
<type>x-plane</type>
<coeffs>10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="2">
<type>x-plane</type>
<coeffs>-10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="3">
<type>y-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="4">
<type>y-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="5">
<type>z-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="6">
<type>z-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
</geometry>

View file

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<materials>
<!-- Definition of materials -->
<material id="1">
<density value="19" units="g/cc" />
<nuclide name="U235" wo="0.21" />
<nuclide name="U238" wo="0.68" />
<nuclide name="O16" wo="0.11" />
</material>
</materials>

View file

@ -0,0 +1,488 @@
k-combined:
1.172120E+00 9.761693E-03
tally 1:
1.131066E+01
1.287315E+01
2.035268E+01
4.162146E+01
2.839961E+01
8.098764E+01
3.405187E+01
1.164951E+02
3.712390E+01
1.380899E+02
3.687780E+01
1.363090E+02
3.380903E+01
1.147695E+02
2.903657E+01
8.489183E+01
2.121421E+01
4.519765E+01
1.112628E+01
1.245629E+01
tally 2:
1.114845E+00
1.242879E+00
8.000235E-01
6.400375E-01
1.852141E+00
3.430427E+00
1.324803E+00
1.755104E+00
2.585263E+00
6.683587E+00
1.840969E+00
3.389167E+00
3.737263E+00
1.396714E+01
2.674345E+00
7.152122E+00
3.989056E+00
1.591257E+01
2.843382E+00
8.084820E+00
3.951710E+00
1.561601E+01
2.838216E+00
8.055468E+00
3.734018E+00
1.394289E+01
2.676071E+00
7.161356E+00
3.241209E+00
1.050543E+01
2.315684E+00
5.362392E+00
2.459493E+00
6.049108E+00
1.734344E+00
3.007949E+00
1.079306E+00
1.164902E+00
7.536940E-01
5.680547E-01
tally 3:
7.728275E-01
5.972624E-01
5.550061E-02
3.080318E-03
1.272034E+00
1.618070E+00
7.284456E-02
5.306329E-03
1.779821E+00
3.167762E+00
1.110012E-01
1.232127E-02
2.586020E+00
6.687502E+00
1.618768E-01
2.620410E-02
2.726552E+00
7.434084E+00
1.965647E-01
3.863767E-02
2.741747E+00
7.517178E+00
1.907834E-01
3.639829E-02
2.564084E+00
6.574527E+00
1.503142E-01
2.259435E-02
2.233122E+00
4.986832E+00
1.456891E-01
2.122532E-02
1.682929E+00
2.832250E+00
9.828234E-02
9.659418E-03
7.232788E-01
5.231322E-01
6.128193E-02
3.755475E-03
tally 4:
1.326662E-01
1.760031E-02
0.000000E+00
0.000000E+00
1.369313E-01
1.875018E-02
2.569758E-01
6.603657E-02
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
2.569758E-01
6.603657E-02
1.369313E-01
1.875018E-02
2.494513E-01
6.222596E-02
3.551002E-01
1.260962E-01
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.551002E-01
1.260962E-01
2.494513E-01
6.222596E-02
3.610027E-01
1.303230E-01
4.252566E-01
1.808432E-01
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
4.252566E-01
1.808432E-01
3.610027E-01
1.303230E-01
4.673502E-01
2.184162E-01
5.073957E-01
2.574504E-01
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
5.073957E-01
2.574504E-01
4.673502E-01
2.184162E-01
4.818855E-01
2.322136E-01
4.949753E-01
2.450006E-01
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
4.949753E-01
2.450006E-01
4.818855E-01
2.322136E-01
5.176611E-01
2.679730E-01
4.756654E-01
2.262576E-01
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
4.756654E-01
2.262576E-01
5.176611E-01
2.679730E-01
4.591191E-01
2.107904E-01
3.930251E-01
1.544688E-01
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.930251E-01
1.544688E-01
4.591191E-01
2.107904E-01
4.201532E-01
1.765287E-01
3.188250E-01
1.016494E-01
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.188250E-01
1.016494E-01
4.201532E-01
1.765287E-01
2.898817E-01
8.403142E-02
1.509185E-01
2.277639E-02
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
1.509185E-01
2.277639E-02
2.898817E-01
8.403142E-02
1.482175E-01
2.196844E-02
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
0.000000E+00
0.000000E+00
tally 5:
7.719619E-01
5.959252E-01
8.168322E-02
6.672148E-03
1.272034E+00
1.618070E+00
1.458271E-01
2.126554E-02
1.779821E+00
3.167762E+00
2.705917E-01
7.321987E-02
2.584069E+00
6.677414E+00
3.176497E-01
1.009013E-01
2.726552E+00
7.434084E+00
3.562714E-01
1.269293E-01
2.740788E+00
7.511919E+00
3.690107E-01
1.361689E-01
2.563145E+00
6.569715E+00
3.296244E-01
1.086523E-01
2.233122E+00
4.986832E+00
3.106254E-01
9.648813E-02
1.682929E+00
2.832250E+00
2.709632E-01
7.342104E-02
7.232788E-01
5.231322E-01
9.343486E-02
8.730073E-03
cmfd indices
1.000000E+01
1.000000E+00
1.000000E+00
1.000000E+00
k cmfd
1.143597E+00
1.163387E+00
1.162391E+00
1.163351E+00
1.145721E+00
1.134785E+00
1.119048E+00
1.116124E+00
1.109085E+00
1.126581E+00
1.158559E+00
1.163719E+00
1.162162E+00
1.160856E+00
1.166709E+00
1.167223E+00
cmfd entropy
3.212002E+00
3.206393E+00
3.222109E+00
3.221996E+00
3.229978E+00
3.234615E+00
3.246512E+00
3.244634E+00
3.244312E+00
3.236922E+00
3.232693E+00
3.221849E+00
3.215716E+00
3.215968E+00
3.203758E+00
3.201798E+00
cmfd balance
8.26180E-03
4.27338E-03
2.62159E-03
2.40301E-03
2.08484E-03
1.58351E-03
1.59196E-03
1.87591E-03
1.94451E-03
1.91803E-03
1.90044E-03
1.87968E-03
2.55363E-03
2.39932E-03
2.25515E-03
1.53613E-03
cmfd dominance ratio
5.404E-01
5.406E-01
5.432E-01
5.454E-01
5.507E-01
5.578E-01
5.679E-01
5.671E-01
5.690E-01
5.637E-01
5.575E-01
5.474E-01
5.480E-01
5.467E-01
5.374E-01
5.321E-01
cmfd openmc source comparison
1.575499E-02
1.293688E-02
5.920734E-03
9.746850E-03
7.183896E-03
7.693485E-03
4.158805E-03
2.962505E-03
4.415044E-03
2.304495E-03
7.921580E-03
8.609203E-03
8.945198E-03
8.054204E-03
1.164189E-02
5.945645E-03
cmfd source
4.077779E-02
6.659143E-02
1.017198E-01
1.172269E-01
1.458410E-01
1.559801E-01
1.337001E-01
1.137262E-01
8.397376E-02
4.046290E-02

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!-- Parameters for criticality calculation -->
<run_mode>eigenvalue</run_mode>
<batches>20</batches>
<inactive>10</inactive>
<particles>1000</particles>
<!-- Starting source -->
<source>
<space>
<type>box</type>
<parameters>-10 -1 -1 10 1 1</parameters>
</space>
</source>
<!-- Shannon Entropy -->
<mesh id="10">
<dimension> 10 1 1 </dimension>
<lower_left> -10.0 -1.0 -1.0 </lower_left>
<upper_right> 10.0 1.0 1.0 </upper_right>
</mesh>
<entropy_mesh>10</entropy_mesh>
</settings>

View file

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<tallies>
<mesh id="1">
<type>regular</type>
<lower_left>-10 -1 -1 </lower_left>
<upper_right>10 1 1</upper_right>
<dimension>10 1 1</dimension>
</mesh>
<filter id="1">
<type>mesh</type>
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>flux</scores>
</tally>
</tallies>

View file

@ -0,0 +1,27 @@
from tests.testing_harness import CMFDTestHarness
from openmc import cmfd
def test_cmfd_feed_rolling_window():
"""Test 1 group CMFD solver with CMFD feedback"""
# Initialize and set CMFD mesh
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-10.0, -1.0, -1.0)
cmfd_mesh.upper_right = (10.0, 1.0, 1.0)
cmfd_mesh.dimension = (10, 1, 1)
cmfd_mesh.albedo = (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)
# Initialize and run CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.tally_begin = 5
cmfd_run.feedback_begin = 10
cmfd_run.feedback = True
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.window_type = 'rolling'
cmfd_run.window_size = 5
cmfd_run.run()
# Initialize and run CMFD test harness
harness = CMFDTestHarness('statepoint.20.h5', cmfd_run)
harness.main()

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<geometry>
<!-- Definition of Cells -->
<cell id="1">
<universe>0</universe>
<region>-1 2 -3 4 -5 6</region>
<material>1</material>
</cell>
<!-- Defition of Surfaces -->
<surface id="1">
<type>x-plane</type>
<coeffs>10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="2">
<type>x-plane</type>
<coeffs>-10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="3">
<type>y-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="4">
<type>y-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="5">
<type>z-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="6">
<type>z-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
</geometry>

View file

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<materials>
<!-- Definition of materials -->
<material id="1">
<density value="19" units="g/cc" />
<nuclide name="U235" wo="0.21" />
<nuclide name="U238" wo="0.68" />
<nuclide name="O16" wo="0.11" />
</material>
</materials>

View file

@ -0,0 +1,488 @@
k-combined:
1.167381E+00 9.433835E-03
tally 1:
1.196137E+01
1.442469E+01
2.133858E+01
4.600709E+01
2.874353E+01
8.287541E+01
3.400779E+01
1.158949E+02
3.736442E+01
1.398466E+02
3.705095E+01
1.376767E+02
3.486173E+01
1.220362E+02
2.910935E+01
8.507178E+01
2.034762E+01
4.156717E+01
1.074969E+01
1.160731E+01
tally 2:
2.321994E+01
2.726751E+01
1.624000E+01
1.334217E+01
4.184801E+01
8.813954E+01
2.955600E+01
4.401685E+01
5.620224E+01
1.589242E+02
3.981400E+01
7.983679E+01
6.834724E+01
2.342245E+02
4.869600E+01
1.189597E+02
7.481522E+01
2.802998E+02
5.346500E+01
1.431835E+02
7.381412E+01
2.733775E+02
5.269700E+01
1.393729E+02
6.907776E+01
2.396752E+02
4.918500E+01
1.215909E+02
5.783261E+01
1.680814E+02
4.107800E+01
8.480751E+01
4.120212E+01
8.516647E+01
2.930300E+01
4.310295E+01
2.228419E+01
2.504034E+01
1.554100E+01
1.217931E+01
tally 3:
1.561100E+01
1.233967E+01
1.095984E+00
6.181385E-02
2.847800E+01
4.088161E+01
1.815209E+00
1.669969E-01
3.834200E+01
7.408022E+01
2.446116E+00
3.017833E-01
4.687600E+01
1.102381E+02
2.954924E+00
4.412808E-01
5.155100E+01
1.331461E+02
3.204713E+00
5.178543E-01
5.067700E+01
1.289238E+02
3.246709E+00
5.326372E-01
4.738600E+01
1.128834E+02
3.035962E+00
4.640209E-01
3.953600E+01
7.858196E+01
2.507574E+00
3.186455E-01
2.819300E+01
3.991455E+01
1.846612E+00
1.725570E-01
1.497500E+01
1.131312E+01
9.213727E-01
4.422000E-02
tally 4:
3.090000E+00
4.810640E-01
0.000000E+00
0.000000E+00
2.833000E+00
4.078910E-01
5.555000E+00
1.551579E+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
0.000000E+00
5.555000E+00
1.551579E+00
2.833000E+00
4.078910E-01
5.095000E+00
1.310819E+00
7.271000E+00
2.659755E+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
0.000000E+00
7.271000E+00
2.659755E+00
5.095000E+00
1.310819E+00
7.026000E+00
2.486552E+00
8.577000E+00
3.703215E+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
0.000000E+00
8.577000E+00
3.703215E+00
7.026000E+00
2.486552E+00
8.572000E+00
3.680852E+00
9.393000E+00
4.422429E+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
0.000000E+00
9.393000E+00
4.422429E+00
8.572000E+00
3.680852E+00
9.261000E+00
4.304411E+00
9.265000E+00
4.305625E+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
0.000000E+00
9.265000E+00
4.305625E+00
9.261000E+00
4.304411E+00
9.303000E+00
4.350791E+00
8.535000E+00
3.659395E+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
0.000000E+00
8.535000E+00
3.659395E+00
9.303000E+00
4.350791E+00
8.693000E+00
3.799545E+00
7.104000E+00
2.544182E+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
0.000000E+00
7.104000E+00
2.544182E+00
8.693000E+00
3.799545E+00
7.334000E+00
2.700052E+00
5.168000E+00
1.344390E+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
0.000000E+00
5.168000E+00
1.344390E+00
7.334000E+00
2.700052E+00
5.416000E+00
1.471086E+00
2.724000E+00
3.745680E-01
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
2.724000E+00
3.745680E-01
5.416000E+00
1.471086E+00
2.960000E+00
4.397840E-01
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
0.000000E+00
0.000000E+00
tally 5:
1.560800E+01
1.233482E+01
2.239367E+00
2.607315E-01
2.847600E+01
4.087518E+01
3.937924E+00
7.877545E-01
3.833600E+01
7.405661E+01
5.183337E+00
1.367303E+00
4.686600E+01
1.101919E+02
6.288549E+00
1.997858E+00
5.154500E+01
1.331141E+02
6.691123E+00
2.252645E+00
5.067000E+01
1.288871E+02
6.846095E+00
2.360683E+00
4.737700E+01
1.128379E+02
6.400076E+00
2.073871E+00
3.952800E+01
7.854943E+01
5.269220E+00
1.404986E+00
2.818600E+01
3.989536E+01
3.730803E+00
7.015777E-01
1.497300E+01
1.131008E+01
2.126451E+00
2.315275E-01
cmfd indices
1.000000E+01
1.000000E+00
1.000000E+00
1.000000E+00
k cmfd
1.170416E+00
1.172572E+00
1.171159E+00
1.170281E+00
1.159698E+00
1.151967E+00
1.146706E+00
1.147136E+00
1.152154E+00
1.156980E+00
1.156370E+00
1.155974E+00
1.155295E+00
1.154881E+00
1.153714E+00
1.159485E+00
cmfd entropy
3.203643E+00
3.204555E+00
3.210935E+00
3.213980E+00
3.219204E+00
3.222234E+00
3.226210E+00
3.226808E+00
3.224445E+00
3.222460E+00
3.222458E+00
3.222447E+00
3.220832E+00
3.220841E+00
3.221580E+00
3.220523E+00
cmfd balance
4.00906E-03
4.86966E-03
2.99729E-03
2.71119E-03
1.68833E-03
1.85540E-03
1.40398E-03
1.39843E-03
1.81840E-03
1.45825E-03
1.43788E-03
1.27684E-03
1.28904E-03
1.33030E-03
1.14000E-03
1.23365E-03
cmfd dominance ratio
5.397E-01
5.405E-01
5.412E-01
5.428E-01
5.460E-01
4.530E-01
5.528E-01
5.531E-01
5.493E-01
5.468E-01
5.482E-01
5.487E-01
5.471E-01
5.465E-01
5.461E-01
5.443E-01
cmfd openmc source comparison
6.959834E-03
5.494667E-03
4.076255E-03
4.451119E-03
3.035588E-03
3.391772E-03
1.907994E-03
2.482495E-03
2.994916E-03
3.104682E-03
2.309343E-03
2.151358E-03
2.348849E-03
1.976731E-03
2.080638E-03
2.301327E-03
cmfd source
4.638920E-02
7.751172E-02
1.056089E-01
1.282509E-01
1.396713E-01
1.415740E-01
1.323405E-01
1.092839E-01
7.981779E-02
3.955174E-02

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!-- Parameters for criticality calculation -->
<run_mode>eigenvalue</run_mode>
<batches>20</batches>
<inactive>10</inactive>
<particles>1000</particles>
<!-- Starting source -->
<source>
<space>
<type>box</type>
<parameters>-10 -1 -1 10 1 1</parameters>
</space>
</source>
<!-- Shannon Entropy -->
<mesh id="10">
<dimension> 10 1 1 </dimension>
<lower_left> -10.0 -1.0 -1.0 </lower_left>
<upper_right> 10.0 1.0 1.0 </upper_right>
</mesh>
<entropy_mesh>10</entropy_mesh>
</settings>

View file

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<tallies>
<mesh id="1">
<type>regular</type>
<lower_left>-10 -1 -1 </lower_left>
<upper_right>10 1 1</upper_right>
<dimension>10 1 1</dimension>
</mesh>
<filter id="1">
<type>mesh</type>
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>flux</scores>
</tally>
</tallies>

View file

@ -0,0 +1,26 @@
from tests.testing_harness import CMFDTestHarness
from openmc import cmfd
import numpy as np
def test_cmfd_nofeed():
"""Test 1 group CMFD solver without CMFD feedback"""
# Initialize and set CMFD mesh
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-10.0, -1.0, -1.0)
cmfd_mesh.upper_right = (10.0, 1.0, 1.0)
cmfd_mesh.dimension = (10, 1, 1)
cmfd_mesh.albedo = (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)
# Initialize and run CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.tally_begin = 5
cmfd_run.display = {'dominance': True}
cmfd_run.feedback = False
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.run()
# Initialize and run CMFD test harness
harness = CMFDTestHarness('statepoint.20.h5', cmfd_run)
harness.main()

View file

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<geometry>
<!-- Definition of Cells -->
<cell id="1">
<universe>0</universe>
<region>-1 2 -3 4 -5 6</region>
<material>1</material>
</cell>
<!-- Defition of Surfaces -->
<surface id="1">
<type>x-plane</type>
<coeffs>10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="2">
<type>x-plane</type>
<coeffs>-10</coeffs>
<boundary> vacuum </boundary>
</surface>
<surface id="3">
<type>y-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="4">
<type>y-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="5">
<type>z-plane</type>
<coeffs>1</coeffs>
<boundary>reflective</boundary>
</surface>
<surface id="6">
<type>z-plane</type>
<coeffs>-1</coeffs>
<boundary>reflective</boundary>
</surface>
</geometry>

View file

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<materials>
<!-- Definition of materials -->
<material id="1">
<density value="19" units="g/cc" />
<nuclide name="U235" wo="0.21" />
<nuclide name="U238" wo="0.68" />
<nuclide name="O16" wo="0.11" />
</material>
</materials>

View file

@ -0,0 +1,488 @@
k-combined:
1.169891E+00 6.289489E-03
tally 1:
1.173922E+01
1.385461E+01
2.164076E+01
4.699368E+01
2.906462E+01
8.464937E+01
3.382312E+01
1.147095E+02
3.632006E+01
1.323878E+02
3.655413E+01
1.341064E+02
3.347757E+01
1.124264E+02
2.931336E+01
8.607239E+01
2.182947E+01
4.789565E+01
1.147668E+01
1.325716E+01
tally 2:
2.298190E+01
2.667071E+01
1.600292E+01
1.293670E+01
4.268506E+01
9.161216E+01
3.022909E+01
4.598915E+01
5.680399E+01
1.623879E+02
4.033805E+01
8.196263E+01
6.814742E+01
2.331778E+02
4.851618E+01
1.182330E+02
7.392923E+01
2.740255E+02
5.253586E+01
1.384152E+02
7.332860E+01
2.698608E+02
5.227405E+01
1.371810E+02
6.830172E+01
2.340687E+02
4.867159E+01
1.188724E+02
5.885634E+01
1.736180E+02
4.170434E+01
8.719622E+01
4.371848E+01
9.592893E+01
3.106403E+01
4.844308E+01
2.338413E+01
2.752467E+01
1.636713E+01
1.347770E+01
tally 3:
1.538752E+01
1.196478E+01
1.079685E+00
6.010786E-02
2.911906E+01
4.269070E+01
1.822657E+00
1.671850E-01
3.885421E+01
7.608218E+01
2.541516E+00
3.262451E-01
4.673300E+01
1.097036E+02
2.885307E+00
4.214444E-01
5.059247E+01
1.283984E+02
3.222796E+00
5.237329E-01
5.034856E+01
1.272538E+02
3.230225E+00
5.273424E-01
4.688476E+01
1.103152E+02
2.941287E+00
4.363749E-01
4.013746E+01
8.077506E+01
2.634234E+00
3.520270E-01
2.996887E+01
4.509953E+01
1.946504E+00
1.919104E-01
1.575260E+01
1.248707E+01
1.020705E+00
5.413569E-02
tally 4:
3.049469E+00
4.677325E-01
0.000000E+00
0.000000E+00
2.770358E+00
3.879191E-01
5.514939E+00
1.528899E+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
0.000000E+00
5.514939E+00
1.528899E+00
2.770358E+00
3.879191E-01
5.032131E+00
1.275040E+00
7.294002E+00
2.675589E+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
0.000000E+00
7.294002E+00
2.675589E+00
5.032131E+00
1.275040E+00
7.036008E+00
2.490718E+00
8.668860E+00
3.776102E+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
0.000000E+00
8.668860E+00
3.776102E+00
7.036008E+00
2.490718E+00
8.352414E+00
3.501945E+00
9.345868E+00
4.380719E+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
0.000000E+00
9.345868E+00
4.380719E+00
8.352414E+00
3.501945E+00
9.093766E+00
4.158282E+00
9.223771E+00
4.270120E+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
0.000000E+00
9.223771E+00
4.270120E+00
9.093766E+00
4.158282E+00
9.219150E+00
4.264346E+00
8.530966E+00
3.651778E+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
0.000000E+00
8.530966E+00
3.651778E+00
9.219150E+00
4.264346E+00
8.690373E+00
3.785262E+00
7.204424E+00
2.604203E+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
0.000000E+00
7.204424E+00
2.604203E+00
8.690373E+00
3.785262E+00
7.513640E+00
2.833028E+00
5.326721E+00
1.426975E+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
0.000000E+00
5.326721E+00
1.426975E+00
7.513640E+00
2.833028E+00
5.662215E+00
1.607757E+00
2.848381E+00
4.093396E-01
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
2.848381E+00
4.093396E-01
5.662215E+00
1.607757E+00
3.025812E+00
4.597241E-01
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
0.000000E+00
0.000000E+00
tally 5:
1.538652E+01
1.196332E+01
2.252427E+00
2.605738E-01
2.911344E+01
4.267319E+01
3.873926E+00
7.615035E-01
3.884516E+01
7.604619E+01
5.280610E+00
1.414008E+00
4.672391E+01
1.096625E+02
6.261805E+00
1.983205E+00
5.058447E+01
1.283588E+02
6.733810E+00
2.278242E+00
5.033589E+01
1.271898E+02
6.714658E+00
2.273652E+00
4.687563E+01
1.102719E+02
6.215002E+00
1.956978E+00
4.013134E+01
8.075062E+01
5.253064E+00
1.396224E+00
2.996497E+01
4.508839E+01
3.818076E+00
7.509442E-01
1.574994E+01
1.248291E+01
2.219928E+00
2.515492E-01
cmfd indices
1.000000E+01
1.000000E+00
1.000000E+00
1.000000E+00
k cmfd
1.170416E+00
1.172966E+00
1.165537E+00
1.170979E+00
1.161922E+00
1.157523E+00
1.158873E+00
1.162877E+00
1.167101E+00
1.168130E+00
1.170570E+00
1.168115E+00
1.174081E+00
1.169458E+00
1.167848E+00
1.165116E+00
cmfd entropy
3.203643E+00
3.207943E+00
3.213367E+00
3.214360E+00
3.219634E+00
3.222232E+00
3.221744E+00
3.224544E+00
3.225990E+00
3.227769E+00
3.227417E+00
3.230728E+00
3.231662E+00
3.233316E+00
3.233193E+00
3.232564E+00
cmfd balance
4.00906E-03
4.43177E-03
3.15267E-03
3.51038E-03
2.05209E-03
2.06865E-03
1.50243E-03
1.58983E-03
1.56602E-03
1.17001E-03
9.50759E-04
9.07259E-04
1.00900E-03
1.06470E-03
1.16361E-03
9.75631E-04
cmfd dominance ratio
5.397E-01
5.425E-01
5.481E-01
5.473E-01
5.503E-01
5.502E-01
5.483E-01
5.520E-01
5.505E-01
3.216E-01
5.373E-01
5.517E-01
5.508E-01
5.524E-01
5.524E-01
5.523E-01
cmfd openmc source comparison
6.959834E-03
5.655657E-03
3.886186E-03
4.035116E-03
3.043277E-03
5.455474E-03
4.515310E-03
2.439840E-03
2.114032E-03
2.673132E-03
2.431749E-03
4.330928E-03
3.404647E-03
3.680298E-03
3.309620E-03
3.705541E-03
cmfd source
4.697085E-02
7.920706E-02
1.107968E-01
1.250932E-01
1.383930E-01
1.380648E-01
1.246874E-01
1.113705E-01
8.203754E-02
4.337882E-02

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<!-- Parameters for criticality calculation -->
<run_mode>eigenvalue</run_mode>
<batches>20</batches>
<inactive>10</inactive>
<particles>1000</particles>
<!-- Starting source -->
<source>
<space>
<type>box</type>
<parameters>-10 -1 -1 10 1 1</parameters>
</space>
</source>
<!-- Shannon Entropy -->
<mesh id="10">
<dimension> 10 1 1 </dimension>
<lower_left> -10.0 -1.0 -1.0 </lower_left>
<upper_right> 10.0 1.0 1.0 </upper_right>
</mesh>
<entropy_mesh>10</entropy_mesh>
<state_point batches="15 20" />
</settings>

View file

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<tallies>
<mesh id="1">
<type>regular</type>
<lower_left>-10 -1 -1 </lower_left>
<upper_right>10 1 1</upper_right>
<dimension>10 1 1</dimension>
</mesh>
<filter id="1">
<type>mesh</type>
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>flux</scores>
</tally>
</tallies>

View file

@ -0,0 +1,72 @@
import glob
import os
import copy
from tests.testing_harness import CMFDTestHarness
from openmc import cmfd
import numpy as np
class CMFDRestartTestHarness(CMFDTestHarness):
def __init__(self, final_sp, restart_sp, cmfd_run1, cmfd_run2):
super().__init__(final_sp, cmfd_run1)
self._cmfd_restart_run = cmfd_run2
self._restart_sp = restart_sp
def execute_test(self):
try:
# Compare results from first CMFD run
self._test_output_created()
results = self._get_results()
results += self._cmfdrun_results
self._write_results(results)
self._compare_results()
# Run CMFD from restart file
statepoint = glob.glob(os.path.join(os.getcwd(), self._restart_sp))
assert len(statepoint) == 1
statepoint = statepoint[0]
self._cmfd_restart_run.run(args=['-r', statepoint])
# Compare results from second CMFD run
self._test_output_created()
self._create_cmfd_result_str(self._cmfd_restart_run)
results = self._get_results()
results += self._cmfdrun_results
self._write_results(results)
self._compare_results()
finally:
self._cleanup()
def test_cmfd_restart():
"""Test 1 group CMFD solver with restart run"""
# Initialize and set CMFD mesh, create a copy for second run
cmfd_mesh = cmfd.CMFDMesh()
cmfd_mesh.lower_left = (-10.0, -1.0, -1.0)
cmfd_mesh.upper_right = (10.0, 1.0, 1.0)
cmfd_mesh.dimension = (10, 1, 1)
cmfd_mesh.albedo = (0.0, 0.0, 1.0, 1.0, 1.0, 1.0)
cmfd_mesh2 = copy.deepcopy(cmfd_mesh)
# Initialize and run first CMFDRun object
cmfd_run = cmfd.CMFDRun()
cmfd_run.mesh = cmfd_mesh
cmfd_run.tally_begin = 5
cmfd_run.feedback_begin = 5
cmfd_run.feedback = True
cmfd_run.gauss_seidel_tolerance = [1.e-15, 1.e-20]
cmfd_run.run()
# Initialize second CMFDRun object which will be run from restart file
cmfd_run2 = cmfd.CMFDRun()
cmfd_run2.mesh = cmfd_mesh2
cmfd_run2.tally_begin = 5
cmfd_run2.feedback_begin = 5
cmfd_run2.feedback = True
cmfd_run2.gauss_seidel_tolerance = [1.e-15, 1.e-20]
# Initialize and run CMFD restart test harness
harness = CMFDRestartTestHarness('statepoint.20.h5', 'statepoint.15.h5',
cmfd_run, cmfd_run2)
harness.main()

View file

@ -0,0 +1,25 @@
<?xml version="1.0"?>
<geometry>
<surface id="1" type="x-plane" coeffs="-10" boundary="vacuum" />
<surface id="2" type="x-plane" coeffs="-7" />
<surface id="3" type="x-plane" coeffs="-4" />
<surface id="4" type="x-plane" coeffs="4" />
<surface id="5" type="x-plane" coeffs="7" />
<surface id="6" type="x-plane" coeffs="10" boundary="vacuum" />
<surface id="7" type="x-plane" coeffs="0" />
<surface id="11" type="y-plane" coeffs="-10" boundary="vacuum" />
<surface id="12" type="y-plane" coeffs="-7" />
<surface id="13" type="y-plane" coeffs="-4" />
<surface id="14" type="y-plane" coeffs="4" />
<surface id="15" type="y-plane" coeffs="7" />
<surface id="16" type="y-plane" coeffs="10" boundary="vacuum" />
<surface id="17" type="y-plane" coeffs="0" />
<cell id="1" material="1" region="3 -4 13 -14" />
<cell id="2" material="2" region="2 -5 12 -15 ~(3 -4 13 -14)" />
<cell id="3" material="3" region="((1 -7 17 -16) | (7 -6 11 -17)) (-2 | 5 | -12 | 15)" />
<cell id="4" material="4" region="((1 -7 11 -17) | (7 -6 17 -16)) ~(2 -5 12 -15)" />
</geometry>

View file

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<materials>
<material id="1">
<density value="4.5" units="g/cc" />
<nuclide name="U235" ao="1.0" />
</material>
<material id="2">
<density value="4.5" units="g/cc" />
<nuclide name="U238" ao="1.0" />
</material>
<material id="3">
<density value="2.0" units="g/cc" />
<nuclide name="Zr90" ao="1.0" />
</material>
<material id="4">
<density value="0.1" units="g/cc" />
<nuclide name="N14" ao="1.0" />
</material>
</materials>

View file

@ -0,0 +1,11 @@
k-combined:
2.511523E-01 2.296778E-03
tally 1:
2.578905E+00
1.331155E+00
2.688693E+00
1.447929E+00
9.863773E-01
1.948548E-01
1.123802E-01
2.527537E-03

View file

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<settings>
<run_mode>eigenvalue</run_mode>
<batches>10</batches>
<inactive>5</inactive>
<particles>1000</particles>
<source>
<space type="box">
<parameters>-4 -4 -4 4 4 4</parameters>
</space>
</source>
</settings>

View file

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<tallies>
<filter id="1">
<type>cell</type>
<bins>1 2 3 4</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>total</scores>
</tally>
</tallies>

View file

@ -0,0 +1,6 @@
from tests.testing_harness import TestHarness
def test_complex_cell():
harness = TestHarness('statepoint.10.h5')
harness.main()

View file

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<geometry>
<!-- Sphere with radius 10 -->
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
<cell id="1" material="1" region="-1" />
</geometry>

View file

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<materials>
<material id="1">
<temperature>294</temperature>
<density value="4.5" units="g/cc" />
<nuclide name="U235" ao="1.0" />
</material>
</materials>

View file

@ -0,0 +1,5 @@
k-combined:
2.955487E-01 7.001017E-03
tally 1:
6.492201E+01
5.290724E+02

View file

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<settings>
<confidence_intervals>true</confidence_intervals>
<run_mode>eigenvalue</run_mode>
<batches>10</batches>
<inactive>2</inactive>
<particles>100</particles>
<source>
<space type="box">
<parameters>-4 -4 -4 4 4 4</parameters>
</space>
</source>
</settings>

View file

@ -0,0 +1,14 @@
<?xml version="1.0"?>
<tallies>
<filter id="1">
<type>cell</type>
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>flux</scores>
</tally>
</tallies>

View file

@ -0,0 +1,6 @@
from tests.testing_harness import TestHarness
def test_confidence_intervals():
harness = TestHarness('statepoint.10.h5')
harness.main()

View file

@ -0,0 +1,23 @@
import numpy as np
import openmc
from pkg_resources import parse_version
import pytest
@pytest.fixture(scope='module', autouse=True)
def numpy_version_requirement():
assert parse_version(np.__version__) >= parse_version("1.14"), \
"Regression tests require NumPy 1.14 or greater"
@pytest.fixture(scope='module', autouse=True)
def setup_regression_test(request):
# Reset autogenerated IDs assigned to OpenMC objects
openmc.reset_auto_ids()
# Change to test directory
olddir = request.fspath.dirpath().chdir()
try:
yield
finally:
olddir.chdir()

View file

@ -0,0 +1,37 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="1" material="1" name="box" region="1 -2 3 -4 5 -6" universe="0" />
<surface boundary="reflective" coeffs="-1" id="1" type="x-plane" />
<surface boundary="reflective" coeffs="1" id="2" type="x-plane" />
<surface boundary="reflective" coeffs="-1" id="3" type="y-plane" />
<surface boundary="reflective" coeffs="1" id="4" type="y-plane" />
<surface boundary="reflective" coeffs="-1" id="5" type="z-plane" />
<surface boundary="reflective" coeffs="1" id="6" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="1" name="mat">
<density units="atom/b-cm" value="0.069335" />
<nuclide ao="40.0" name="H1" />
<nuclide ao="1.0" name="U235" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>fixed source</run_mode>
<particles>100</particles>
<batches>10</batches>
<source strength="1.0">
<space type="box">
<parameters>-1 -1 -1 1 1 1</parameters>
</space>
<energy parameters="988000.0 2.249e-06" type="watt" />
</source>
<create_fission_neutrons>false</create_fission_neutrons>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<tally id="1">
<scores>flux</scores>
</tally>
</tallies>

View file

@ -0,0 +1,3 @@
tally 1:
sum = 2.056839E+02
sum_sq = 4.244628E+03

View file

@ -0,0 +1,70 @@
import openmc
from tests.testing_harness import PyAPITestHarness
class CreateFissionNeutronsTestHarness(PyAPITestHarness):
def _build_inputs(self):
# Material is composed of H-1 and U-235
mat = openmc.Material(material_id=1, name='mat')
mat.set_density('atom/b-cm', 0.069335)
mat.add_nuclide('H1', 40.0)
mat.add_nuclide('U235', 1.0)
materials_file = openmc.Materials([mat])
materials_file.export_to_xml()
# Cell is box with reflective boundary
x1 = openmc.XPlane(surface_id=1, x0=-1)
x2 = openmc.XPlane(surface_id=2, x0=1)
y1 = openmc.YPlane(surface_id=3, y0=-1)
y2 = openmc.YPlane(surface_id=4, y0=1)
z1 = openmc.ZPlane(surface_id=5, z0=-1)
z2 = openmc.ZPlane(surface_id=6, z0=1)
for surface in [x1, x2, y1, y2, z1, z2]:
surface.boundary_type = 'reflective'
box = openmc.Cell(cell_id=1, name='box')
box.region = +x1 & -x2 & +y1 & -y2 & +z1 & -z2
box.fill = mat
root = openmc.Universe(universe_id=0, name='root universe')
root.add_cell(box)
geometry = openmc.Geometry(root)
geometry.export_to_xml()
# Set the running parameters
settings_file = openmc.Settings()
settings_file.run_mode = 'fixed source'
settings_file.batches = 10
settings_file.particles = 100
settings_file.create_fission_neutrons = False
bounds = [-1, -1, -1, 1, 1, 1]
uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:])
watt_dist = openmc.stats.Watt()
settings_file.source = openmc.source.Source(space=uniform_dist,
energy=watt_dist)
settings_file.export_to_xml()
# Create tallies
tallies = openmc.Tallies()
tally = openmc.Tally(1)
tally.scores = ['flux']
tallies.append(tally)
tallies.export_to_xml()
def _get_results(self):
"""Digest info in the statepoint and return as a string."""
# Read the statepoint file.
sp = openmc.StatePoint(self._sp_name)
# Write out tally data.
outstr = ''
t = sp.get_tally()
outstr += 'tally {}:\n'.format(t.id)
outstr += 'sum = {:12.6E}\n'.format(t.sum[0, 0, 0])
outstr += 'sum_sq = {:12.6E}\n'.format(t.sum_sq[0, 0, 0])
return outstr
def test_create_fission_neutrons():
harness = CreateFissionNeutronsTestHarness('statepoint.10.h5')
harness.main()

View file

Binary file not shown.

View file

@ -0,0 +1,36 @@
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="40" name="fuel">
<density units="g/cc" value="11" />
<nuclide ao="1.0" name="U235" />
</material>
<material id="41" name="water">
<density units="g/cc" value="1.0" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
<sab name="c_H_in_H2O" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>100</particles>
<batches>5</batches>
<inactive>0</inactive>
<source strength="1.0">
<space type="box">
<parameters>-4 -4 -4 4 4 4</parameters>
</space>
</source>
<dagmc>true</dagmc>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<filter id="1" type="cell">
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>total</scores>
</tally>
</tallies>

View file

@ -0,0 +1,5 @@
k-combined:
1.028803E+00 3.340602E-02
tally 1:
8.346847E+00
1.453407E+01

View file

@ -0,0 +1,49 @@
import openmc
import openmc.lib
import pytest
from tests.testing_harness import PyAPITestHarness
pytestmark = pytest.mark.skipif(
not openmc.lib._dagmc_enabled(),
reason="DAGMC CAD geometry is not enabled.")
def test_dagmc():
model = openmc.model.Model()
# settings
model.settings.batches = 5
model.settings.inactive = 0
model.settings.particles = 100
source_box = openmc.stats.Box([-4, -4, -4],
[ 4, 4, 4])
source = openmc.Source(space=source_box)
model.settings.source = source
model.settings.dagmc = True
# tally
tally = openmc.Tally()
tally.scores = ['total']
tally.filters = [openmc.CellFilter(1)]
model.tallies = [tally]
# materials
u235 = openmc.Material(name="fuel")
u235.add_nuclide('U235', 1.0, 'ao')
u235.set_density('g/cc', 11)
u235.id = 40
water = openmc.Material(name="water")
water.add_nuclide('H1', 2.0, 'ao')
water.add_nuclide('O16', 1.0, 'ao')
water.set_density('g/cc', 1.0)
water.add_s_alpha_beta('c_H_in_H2O')
water.id = 41
mats = openmc.Materials([u235, water])
model.materials = mats
model.export_to_xml()

Binary file not shown.

View file

@ -0,0 +1,23 @@
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>100</particles>
<batches>5</batches>
<inactive>0</inactive>
<source strength="1.0">
<space type="box">
<parameters>-4 -4 -4 4 4 4</parameters>
</space>
</source>
<dagmc>true</dagmc>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<filter id="1" type="cell">
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>total</scores>
</tally>
</tallies>

View file

@ -0,0 +1,5 @@
k-combined:
2.053871E+00 7.718195E-03
tally 1:
1.171003E+01
2.864565E+01

View file

@ -0,0 +1,40 @@
import openmc
import openmc.lib
from openmc.stats import Box
import pytest
from tests.testing_harness import PyAPITestHarness
pytestmark = pytest.mark.skipif(
not openmc.lib._dagmc_enabled(),
reason="DAGMC CAD geometry is not enabled.")
class UWUWTest(PyAPITestHarness):
def _build_inputs(self):
model = openmc.model.Model()
# settings
model.settings.batches = 5
model.settings.inactive = 0
model.settings.particles = 100
source = openmc.Source(space=Box([-4, -4, -4],
[ 4, 4, 4]))
model.settings.source = source
model.settings.dagmc = True
model.settings.export_to_xml()
# tally
tally = openmc.Tally()
tally.scores = ['total']
tally.filters = [openmc.CellFilter(1)]
model.tallies = [tally]
model.tallies.export_to_xml()
def test_refl():
harness = UWUWTest('statepoint.5.h5')
harness.main()

Binary file not shown.

View file

@ -0,0 +1,23 @@
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>100</particles>
<batches>5</batches>
<inactive>0</inactive>
<source strength="1.0">
<space type="box">
<parameters>-4 -4 -4 4 4 4</parameters>
</space>
</source>
<dagmc>true</dagmc>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<filter id="1" type="cell">
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>total</scores>
</tally>
</tallies>

View file

@ -0,0 +1 @@
../legacy/results_true.dat

Some files were not shown because too many files have changed in this diff Show more