mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Update test suite with 2g, ng solvers
This commit is contained in:
parent
0a43a465d4
commit
5c04eb0d3b
17 changed files with 1575 additions and 21 deletions
|
|
@ -438,7 +438,7 @@ constexpr int RUN_MODE_VOLUME {5};
|
|||
// CMFD CONSTANTS
|
||||
|
||||
// For non-accelerated regions on coarse mesh overlay
|
||||
constexpr int CMFD_NOACCEL {99999};
|
||||
constexpr int CMFD_NOACCEL {-1};
|
||||
|
||||
} // namespace openmc
|
||||
|
||||
|
|
|
|||
|
|
@ -252,6 +252,10 @@ class CMFDRun(object):
|
|||
CMFD problem
|
||||
* "math" - Create adjoint matrices mathematically as the transpose of
|
||||
loss and production CMFD matrices
|
||||
indices : numpy.ndarray
|
||||
Stores spatial and group dimensions as [nx, ny, nz, ng]
|
||||
cmfd_src : numpy.ndarray
|
||||
CMFD source distribution calculated from solving CMFD equations
|
||||
entropy : list of floats
|
||||
"Shannon entropy" from cmfd fission source, stored for each generation
|
||||
that CMFD is invoked
|
||||
|
|
@ -443,6 +447,14 @@ class CMFDRun(object):
|
|||
def gauss_seidel_tolerance(self):
|
||||
return self._gauss_seidel_tolerance
|
||||
|
||||
@property
|
||||
def indices(self):
|
||||
return self._indices
|
||||
|
||||
@property
|
||||
def cmfd_src(self):
|
||||
return self._cmfd_src
|
||||
|
||||
@property
|
||||
def dom(self):
|
||||
return self._dom
|
||||
|
|
@ -555,7 +567,7 @@ class CMFDRun(object):
|
|||
def adjoint_type(self, adjoint_type):
|
||||
check_type('CMFD adjoint type', adjoint_type, str)
|
||||
check_value('CMFD adjoint type', adjoint_type,
|
||||
['math', 'phyical'])
|
||||
['math', 'physical'])
|
||||
self._adjoint_type = adjoint_type
|
||||
|
||||
@power_monitor.setter
|
||||
|
|
@ -1005,7 +1017,7 @@ class CMFDRun(object):
|
|||
# Get all data entries for particular row in matrix
|
||||
data = matrix.data[matrix.indptr[row]:matrix.indptr[row+1]]
|
||||
for i in range(len(cols)):
|
||||
fh.write('({:3d}, {:3d}): {:0.8f}\n'.format(
|
||||
fh.write('{:3d}, {:3d}, {:0.8f}\n'.format(
|
||||
row, cols[i], data[i]))
|
||||
|
||||
# Save matrix in scipy format
|
||||
|
|
@ -1572,8 +1584,9 @@ class CMFDRun(object):
|
|||
kerr = abs(k_o - k_n) / k_n
|
||||
|
||||
# Calculate max error in source
|
||||
serr = np.sqrt(np.sum(np.where(s_n > 0, ((s_n-s_o) / s_n)**2, 0))
|
||||
/ len(s_n))
|
||||
with np.errstate(divide='ignore', invalid='ignore'):
|
||||
serr = np.sqrt(np.sum(np.where(s_n > 0, ((s_n-s_o) / s_n)**2, 0))
|
||||
/ len(s_n))
|
||||
|
||||
# Check for convergence
|
||||
iconv = kerr < self._cmfd_ktol and serr < self._stol
|
||||
|
|
|
|||
|
|
@ -1,8 +1,17 @@
|
|||
from tests.testing_harness import CMFDTestHarness
|
||||
import openmc
|
||||
import numpy as np
|
||||
import scipy.sparse
|
||||
|
||||
def test_cmfd_feed():
|
||||
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 = openmc.CMFDMesh()
|
||||
cmfd_mesh.lower_left = -10.0, -1.0, -1.0
|
||||
|
|
@ -12,10 +21,111 @@ def test_cmfd_feed():
|
|||
|
||||
# Initialize and run CMFDRun object
|
||||
cmfd_run = openmc.CMFDRun()
|
||||
cmfd_run.cmfd_mesh = cmfd_mesh
|
||||
cmfd_run.cmfd_begin = 5
|
||||
cmfd_run.cmfd_display = 'dominance'
|
||||
cmfd_run.cmfd_feedback = True
|
||||
cmfd_run.mesh = cmfd_mesh
|
||||
cmfd_run.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 = openmc.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 = openmc.CMFDRun()
|
||||
cmfd_run.mesh = cmfd_mesh
|
||||
cmfd_run.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 = openmc.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 = openmc.CMFDRun()
|
||||
cmfd_run.mesh = cmfd_mesh
|
||||
cmfd_run.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 = openmc.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 = openmc.CMFDRun()
|
||||
cmfd_run.mesh = cmfd_mesh
|
||||
cmfd_run.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()
|
||||
|
||||
|
|
|
|||
31
tests/regression_tests/cmfd_feed_2g/geometry.xml
Normal file
31
tests/regression_tests/cmfd_feed_2g/geometry.xml
Normal 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>
|
||||
59
tests/regression_tests/cmfd_feed_2g/materials.xml
Normal file
59
tests/regression_tests/cmfd_feed_2g/materials.xml
Normal 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>
|
||||
434
tests/regression_tests/cmfd_feed_2g/results_true.dat
Normal file
434
tests/regression_tests/cmfd_feed_2g/results_true.dat
Normal file
|
|
@ -0,0 +1,434 @@
|
|||
k-combined:
|
||||
1.038883E+00 1.017026E-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.296338E+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.666151E-02
|
||||
6.192881E+01
|
||||
1.924016E+02
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
1.796382E-02
|
||||
3.190854E-05
|
||||
4.343238E+00
|
||||
9.514039E-01
|
||||
3.504683E+00
|
||||
6.157615E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
9.818871E+01
|
||||
4.822799E+02
|
||||
8.401346E-01
|
||||
3.664037E-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.670951E-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.993043E-04
|
||||
4.168558E-04
|
||||
6.384693E-04
|
||||
3.928217E-04
|
||||
3.789833E-04
|
||||
2.684860E-04
|
||||
4.849910E-04
|
||||
1.084019E-03
|
||||
1.091775E-03
|
||||
5.459767E-04
|
||||
4.455545E-04
|
||||
4.011468E-04
|
||||
3.710248E-04
|
||||
3.577152E-04
|
||||
3.845993E-04
|
||||
3.900672E-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.839162E-05
|
||||
1.407962E-05
|
||||
6.718148E-06
|
||||
9.164193E-06
|
||||
1.382539E-05
|
||||
2.871606E-05
|
||||
4.192300E-05
|
||||
5.327516E-05
|
||||
6.566500E-05
|
||||
6.655541E-05
|
||||
6.034977E-05
|
||||
6.004677E-05
|
||||
5.711623E-05
|
||||
6.271264E-05
|
||||
6.425363E-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
|
||||
25
tests/regression_tests/cmfd_feed_2g/settings.xml
Normal file
25
tests/regression_tests/cmfd_feed_2g/settings.xml
Normal 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>
|
||||
21
tests/regression_tests/cmfd_feed_2g/tallies.xml
Normal file
21
tests/regression_tests/cmfd_feed_2g/tallies.xml
Normal 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>
|
||||
46
tests/regression_tests/cmfd_feed_2g/test.py
Normal file
46
tests/regression_tests/cmfd_feed_2g/test.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
from tests.testing_harness import CMFDTestHarness
|
||||
import openmc
|
||||
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 = openmc.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 = openmc.CMFDRun()
|
||||
cmfd_run.mesh = cmfd_mesh
|
||||
cmfd_run.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()
|
||||
|
||||
# Create output string of all CMFD results to pass into testing harness
|
||||
outstr = 'cmfd indices\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._indices])
|
||||
outstr += '\nk cmfd\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._k_cmfd])
|
||||
outstr += '\ncmfd entropy\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._entropy])
|
||||
outstr += '\ncmfd balance\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._balance])
|
||||
outstr += '\ncmfd dominance ratio\n'
|
||||
outstr += '\n'.join(['{0:10.3E}'.format(x) for x in cmfd_run._dom])
|
||||
outstr += '\ncmfd openmc source comparison\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._src_cmp])
|
||||
outstr += '\ncmfd source\n'
|
||||
cmfdsrc = np.reshape(cmfd_run._cmfd_src, np.product(cmfd_run._indices),
|
||||
order='F')
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfdsrc])
|
||||
outstr += '\n'
|
||||
|
||||
# Initialize and run CMFD test harness
|
||||
harness = CMFDTestHarness('statepoint.20.h5', cmfd_results=outstr)
|
||||
harness.main()
|
||||
31
tests/regression_tests/cmfd_feed_ng/geometry.xml
Normal file
31
tests/regression_tests/cmfd_feed_ng/geometry.xml
Normal 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>
|
||||
59
tests/regression_tests/cmfd_feed_ng/materials.xml
Normal file
59
tests/regression_tests/cmfd_feed_ng/materials.xml
Normal 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>
|
||||
621
tests/regression_tests/cmfd_feed_ng/results_true.dat
Normal file
621
tests/regression_tests/cmfd_feed_ng/results_true.dat
Normal file
|
|
@ -0,0 +1,621 @@
|
|||
k-combined:
|
||||
1.030507E+00 9.667655E-03
|
||||
tally 1:
|
||||
1.159445E+02
|
||||
1.344573E+03
|
||||
1.159285E+02
|
||||
1.344429E+03
|
||||
1.161340E+02
|
||||
1.349209E+03
|
||||
1.160434E+02
|
||||
1.347427E+03
|
||||
tally 2:
|
||||
3.482032E+01
|
||||
7.610041E+01
|
||||
5.123532E+01
|
||||
1.648226E+02
|
||||
1.063498E+01
|
||||
7.110316E+00
|
||||
9.001212E+00
|
||||
5.085589E+00
|
||||
1.435947E+02
|
||||
1.322778E+03
|
||||
7.400822E+01
|
||||
3.425876E+02
|
||||
3.415144E+01
|
||||
7.318850E+01
|
||||
5.046314E+01
|
||||
1.597317E+02
|
||||
1.028893E+01
|
||||
6.661534E+00
|
||||
8.653997E+00
|
||||
4.698660E+00
|
||||
1.442064E+02
|
||||
1.338979E+03
|
||||
7.405073E+01
|
||||
3.428774E+02
|
||||
3.431740E+01
|
||||
7.390622E+01
|
||||
5.109288E+01
|
||||
1.639090E+02
|
||||
1.034894E+01
|
||||
6.746021E+00
|
||||
8.657005E+00
|
||||
4.712481E+00
|
||||
1.383790E+02
|
||||
1.200016E+03
|
||||
7.320761E+01
|
||||
3.351661E+02
|
||||
3.426169E+01
|
||||
7.373156E+01
|
||||
5.042174E+01
|
||||
1.596859E+02
|
||||
1.041331E+01
|
||||
6.828453E+00
|
||||
8.729287E+00
|
||||
4.779221E+00
|
||||
1.374766E+02
|
||||
1.182015E+03
|
||||
7.390660E+01
|
||||
3.416196E+02
|
||||
tally 3:
|
||||
4.842028E+01
|
||||
1.472522E+02
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
1.766768E-02
|
||||
3.669087E-05
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
3.489090E+00
|
||||
7.670426E-01
|
||||
2.522457E+00
|
||||
3.988419E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
6.323118E+00
|
||||
2.515554E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
1.000000E-03
|
||||
1.000000E-06
|
||||
9.772798E-02
|
||||
7.833336E-04
|
||||
3.020916E-01
|
||||
5.962947E-03
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
2.669802E+00
|
||||
4.494602E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
6.995726E+01
|
||||
3.061105E+02
|
||||
6.245439E-01
|
||||
2.516241E-02
|
||||
4.767259E+01
|
||||
1.425559E+02
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
1.511055E-02
|
||||
2.706989E-05
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
3.359388E+00
|
||||
7.162206E-01
|
||||
2.420435E+00
|
||||
3.693966E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
6.097921E+00
|
||||
2.335376E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
2.973834E-03
|
||||
2.952905E-06
|
||||
9.585516E-02
|
||||
7.950754E-04
|
||||
3.306195E-01
|
||||
7.226156E-03
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
2.606740E+00
|
||||
4.273433E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
7.004531E+01
|
||||
3.068103E+02
|
||||
5.609353E-01
|
||||
2.054700E-02
|
||||
4.844434E+01
|
||||
1.474236E+02
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
6.909228E-03
|
||||
6.822381E-06
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
3.337728E+00
|
||||
7.036827E-01
|
||||
2.418767E+00
|
||||
3.680337E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
6.114057E+00
|
||||
2.352184E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
1.000000E-03
|
||||
1.000000E-06
|
||||
1.057559E-01
|
||||
8.659764E-04
|
||||
3.268970E-01
|
||||
6.949165E-03
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
2.538042E+00
|
||||
4.047397E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
6.922289E+01
|
||||
2.996756E+02
|
||||
6.190458E-01
|
||||
2.456695E-02
|
||||
4.757150E+01
|
||||
1.421640E+02
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
8.765775E-03
|
||||
1.054666E-05
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
3.436793E+00
|
||||
7.430145E-01
|
||||
2.473841E+00
|
||||
3.843375E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
6.104077E+00
|
||||
2.339598E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
1.061129E-01
|
||||
8.936114E-04
|
||||
3.092546E-01
|
||||
6.384841E-03
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
2.539292E+00
|
||||
4.045561E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
6.994273E+01
|
||||
3.059846E+02
|
||||
5.887450E-01
|
||||
2.235244E-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.109363E+00
|
||||
3.174618E+00
|
||||
2.099346E+00
|
||||
2.784777E-01
|
||||
2.785196E+01
|
||||
4.850659E+01
|
||||
7.069021E+00
|
||||
3.132588E+00
|
||||
2.149589E+00
|
||||
2.900131E-01
|
||||
2.768129E+01
|
||||
4.790811E+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.175941E+00
|
||||
3.224156E+00
|
||||
2.135542E+00
|
||||
2.863424E-01
|
||||
2.728334E+01
|
||||
4.655111E+01
|
||||
7.206774E+00
|
||||
3.256252E+00
|
||||
2.075924E+00
|
||||
2.712640E-01
|
||||
2.747967E+01
|
||||
4.722188E+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.069021E+00
|
||||
3.132588E+00
|
||||
2.149589E+00
|
||||
2.900131E-01
|
||||
2.768129E+01
|
||||
4.790811E+01
|
||||
7.109363E+00
|
||||
3.174618E+00
|
||||
2.099346E+00
|
||||
2.784777E-01
|
||||
2.785196E+01
|
||||
4.850659E+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.108601E+00
|
||||
3.175833E+00
|
||||
2.103259E+00
|
||||
2.783890E-01
|
||||
2.784173E+01
|
||||
4.846581E+01
|
||||
7.107753E+00
|
||||
3.173064E+00
|
||||
2.087728E+00
|
||||
2.737368E-01
|
||||
2.779197E+01
|
||||
4.828855E+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.148041E+00
|
||||
3.216417E+00
|
||||
2.124230E+00
|
||||
2.831606E-01
|
||||
2.743879E+01
|
||||
4.708424E+01
|
||||
7.081749E+00
|
||||
3.151711E+00
|
||||
2.062609E+00
|
||||
2.682691E-01
|
||||
2.761154E+01
|
||||
4.768316E+01
|
||||
7.206774E+00
|
||||
3.256252E+00
|
||||
2.075924E+00
|
||||
2.712640E-01
|
||||
2.747967E+01
|
||||
4.722188E+01
|
||||
7.175941E+00
|
||||
3.224156E+00
|
||||
2.135542E+00
|
||||
2.863424E-01
|
||||
2.728334E+01
|
||||
4.655111E+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.081749E+00
|
||||
3.151711E+00
|
||||
2.062609E+00
|
||||
2.682691E-01
|
||||
2.761154E+01
|
||||
4.768316E+01
|
||||
7.148041E+00
|
||||
3.216417E+00
|
||||
2.124230E+00
|
||||
2.831606E-01
|
||||
2.743879E+01
|
||||
4.708424E+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.107753E+00
|
||||
3.173064E+00
|
||||
2.087728E+00
|
||||
2.737368E-01
|
||||
2.779197E+01
|
||||
4.828855E+01
|
||||
7.108601E+00
|
||||
3.175833E+00
|
||||
2.103259E+00
|
||||
2.783890E-01
|
||||
2.784173E+01
|
||||
4.846581E+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.843795E+01
|
||||
1.473599E+02
|
||||
8.846575E+00
|
||||
4.912671E+00
|
||||
7.292412E+01
|
||||
3.326224E+02
|
||||
1.096673E+01
|
||||
7.549697E+00
|
||||
4.119614E+00
|
||||
1.064248E+00
|
||||
3.323487E+01
|
||||
6.913295E+01
|
||||
4.768770E+01
|
||||
1.426471E+02
|
||||
8.521329E+00
|
||||
4.554207E+00
|
||||
7.297983E+01
|
||||
3.330439E+02
|
||||
1.083867E+01
|
||||
7.393362E+00
|
||||
3.955093E+00
|
||||
9.810363E-01
|
||||
3.309790E+01
|
||||
6.852254E+01
|
||||
4.845125E+01
|
||||
1.474656E+02
|
||||
8.533824E+00
|
||||
4.579629E+00
|
||||
7.208076E+01
|
||||
3.249387E+02
|
||||
1.100395E+01
|
||||
7.627044E+00
|
||||
3.908798E+00
|
||||
9.610162E-01
|
||||
3.287630E+01
|
||||
6.763801E+01
|
||||
4.758027E+01
|
||||
1.422161E+02
|
||||
8.577918E+00
|
||||
4.614174E+00
|
||||
7.278634E+01
|
||||
3.313433E+02
|
||||
1.072190E+01
|
||||
7.216342E+00
|
||||
3.922303E+00
|
||||
9.640585E-01
|
||||
3.334768E+01
|
||||
6.955922E+01
|
||||
cmfd indices
|
||||
2.000000E+00
|
||||
2.000000E+00
|
||||
1.000000E+00
|
||||
3.000000E+00
|
||||
k cmfd
|
||||
1.024488E+00
|
||||
1.022339E+00
|
||||
1.024720E+00
|
||||
1.025459E+00
|
||||
1.029180E+00
|
||||
1.022688E+00
|
||||
1.019305E+00
|
||||
1.020356E+00
|
||||
1.023384E+00
|
||||
1.023519E+00
|
||||
1.026360E+00
|
||||
cmfd entropy
|
||||
1.999710E+00
|
||||
1.999709E+00
|
||||
1.999704E+00
|
||||
1.999747E+00
|
||||
1.999885E+00
|
||||
1.999911E+00
|
||||
1.999905E+00
|
||||
1.999936E+00
|
||||
1.999873E+00
|
||||
1.999826E+00
|
||||
1.999768E+00
|
||||
cmfd balance
|
||||
3.179889E-04
|
||||
4.166064E-04
|
||||
2.746180E-04
|
||||
3.345930E-04
|
||||
5.129605E-04
|
||||
4.008511E-04
|
||||
3.628451E-04
|
||||
3.401727E-04
|
||||
3.166255E-04
|
||||
2.642675E-04
|
||||
2.482640E-04
|
||||
cmfd dominance ratio
|
||||
3.737E-03
|
||||
3.786E-03
|
||||
3.798E-03
|
||||
3.789E-03
|
||||
3.741E-03
|
||||
3.772E-03
|
||||
3.793E-03
|
||||
3.684E-03
|
||||
3.740E-03
|
||||
3.764E-03
|
||||
3.798E-03
|
||||
cmfd openmc source comparison
|
||||
3.559244E-05
|
||||
4.429506E-05
|
||||
2.739679E-05
|
||||
2.715448E-05
|
||||
5.105340E-05
|
||||
4.069206E-05
|
||||
4.033877E-05
|
||||
3.669734E-05
|
||||
3.540373E-05
|
||||
2.907247E-05
|
||||
2.734478E-05
|
||||
cmfd source
|
||||
2.564687E-01
|
||||
2.445733E-01
|
||||
2.473769E-01
|
||||
2.515811E-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
|
||||
25
tests/regression_tests/cmfd_feed_ng/settings.xml
Normal file
25
tests/regression_tests/cmfd_feed_ng/settings.xml
Normal 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>
|
||||
21
tests/regression_tests/cmfd_feed_ng/tallies.xml
Normal file
21
tests/regression_tests/cmfd_feed_ng/tallies.xml
Normal 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>
|
||||
47
tests/regression_tests/cmfd_feed_ng/test.py
Normal file
47
tests/regression_tests/cmfd_feed_ng/test.py
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
from tests.testing_harness import CMFDTestHarness
|
||||
import openmc
|
||||
import numpy as np
|
||||
|
||||
def test_cmfd_feed_ng():
|
||||
""" Test n group CMFD solver with CMFD feedback"""
|
||||
# Initialize and set CMFD mesh
|
||||
cmfd_mesh = openmc.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 = openmc.CMFDRun()
|
||||
cmfd_run.mesh = cmfd_mesh
|
||||
cmfd_run.reset = [5]
|
||||
cmfd_run.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()
|
||||
|
||||
# Create output string of all CMFD results to pass into testing harness
|
||||
outstr = 'cmfd indices\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._indices])
|
||||
outstr += '\nk cmfd\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._k_cmfd])
|
||||
outstr += '\ncmfd entropy\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._entropy])
|
||||
outstr += '\ncmfd balance\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._balance])
|
||||
outstr += '\ncmfd dominance ratio\n'
|
||||
outstr += '\n'.join(['{0:10.3E}'.format(x) for x in cmfd_run._dom])
|
||||
outstr += '\ncmfd openmc source comparison\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._src_cmp])
|
||||
outstr += '\ncmfd source\n'
|
||||
cmfdsrc = np.reshape(cmfd_run._cmfd_src, np.product(cmfd_run._indices),
|
||||
order='F')
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfdsrc])
|
||||
outstr += '\n'
|
||||
|
||||
# Initialize and run CMFD test harness
|
||||
harness = CMFDTestHarness('statepoint.20.h5', cmfd_results=outstr)
|
||||
harness.main()
|
||||
|
|
@ -2,7 +2,9 @@ from tests.testing_harness import CMFDTestHarness
|
|||
import openmc
|
||||
import numpy as np
|
||||
|
||||
|
||||
def test_cmfd_nofeed():
|
||||
""" Test 1 group CMFD solver without CMFD feedback"""
|
||||
# Initialize and set CMFD mesh
|
||||
cmfd_mesh = openmc.CMFDMesh()
|
||||
cmfd_mesh.lower_left = -10.0, -1.0, -1.0
|
||||
|
|
@ -12,28 +14,28 @@ def test_cmfd_nofeed():
|
|||
|
||||
# Initialize and run CMFDRun object
|
||||
cmfd_run = openmc.CMFDRun()
|
||||
cmfd_run.cmfd_mesh = cmfd_mesh
|
||||
cmfd_run.cmfd_begin = 5
|
||||
cmfd_run.cmfd_display = 'dominance'
|
||||
cmfd_run.cmfd_feedback = False
|
||||
cmfd_run.mesh = cmfd_mesh
|
||||
cmfd_run.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()
|
||||
|
||||
# Create output string of all CMFD results to pass into testing harness
|
||||
outstr = 'cmfd indices\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._indices])
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run.indices])
|
||||
outstr += '\nk cmfd\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._k_cmfd])
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run.k_cmfd])
|
||||
outstr += '\ncmfd entropy\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._entropy])
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run.entropy])
|
||||
outstr += '\ncmfd balance\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._balance])
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run.balance])
|
||||
outstr += '\ncmfd dominance ratio\n'
|
||||
outstr += '\n'.join(['{0:10.3E}'.format(x) for x in cmfd_run._dom])
|
||||
outstr += '\n'.join(['{0:10.3E}'.format(x) for x in cmfd_run.dom])
|
||||
outstr += '\ncmfd openmc source comparison\n'
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run._src_cmp])
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfd_run.src_cmp])
|
||||
outstr += '\ncmfd source\n'
|
||||
cmfdsrc = np.reshape(cmfd_run._cmfd_src, np.product(cmfd_run._indices),
|
||||
cmfdsrc = np.reshape(cmfd_run.cmfd_src, np.product(cmfd_run.indices),
|
||||
order='F')
|
||||
outstr += '\n'.join(['{0:12.6E}'.format(x) for x in cmfdsrc])
|
||||
outstr += '\n'
|
||||
|
|
|
|||
|
|
@ -165,6 +165,15 @@ class CMFDTestHarness(TestHarness):
|
|||
finally:
|
||||
self._cleanup()
|
||||
|
||||
def _cleanup(self):
|
||||
"""Delete output files for numpy matrices and flux vectors."""
|
||||
super()._cleanup()
|
||||
output = ['loss.npz', 'loss.dat', 'prod.npz', 'prod.dat',
|
||||
'fluxvec.npy', 'fluxvec.dat']
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
|
||||
|
||||
class ParticleRestartTestHarness(TestHarness):
|
||||
"""Specialized TestHarness for running OpenMC particle restart tests."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue