mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Expand windowed multipole unit test
This commit is contained in:
parent
d0b59a21be
commit
b71ad222d0
1 changed files with 24 additions and 2 deletions
|
|
@ -17,6 +17,13 @@ def u235():
|
|||
return openmc.data.WindowedMultipole.from_hdf5(filename)
|
||||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def u234():
|
||||
directory = os.environ['OPENMC_MULTIPOLE_LIBRARY']
|
||||
filename = os.path.join(directory, '092234.h5')
|
||||
return openmc.data.WindowedMultipole.from_hdf5(filename)
|
||||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
def fe56():
|
||||
directory = os.environ['OPENMC_MULTIPOLE_LIBRARY']
|
||||
|
|
@ -24,8 +31,8 @@ def fe56():
|
|||
return openmc.data.WindowedMultipole.from_hdf5(filename)
|
||||
|
||||
|
||||
def test_evaluate(u235):
|
||||
"""Make sure multipole object can be called."""
|
||||
def test_evaluate_rm(u235):
|
||||
"""Make sure a Reich-Moore multipole object can be called."""
|
||||
energies = [1e-3, 1.0, 10.0, 50.]
|
||||
total, absorption, fission = u235(energies, 0.0)
|
||||
assert total[1] == pytest.approx(90.64895383)
|
||||
|
|
@ -33,6 +40,15 @@ def test_evaluate(u235):
|
|||
assert total[1] == pytest.approx(91.12534964)
|
||||
|
||||
|
||||
def test_evaluate_mlbw(u234):
|
||||
"""Make sure a Multi-Level Breit-Wigner multipole object can be called."""
|
||||
energies = [1e-3, 1.0, 10.0, 50.]
|
||||
total, absorption, fission = u234(energies, 0.0)
|
||||
assert total[3] == pytest.approx(15.02827953)
|
||||
total, absorption, fission = u234(energies, 300.0)
|
||||
assert total[3] == pytest.approx(15.08269143)
|
||||
|
||||
|
||||
def test_high_l(fe56):
|
||||
"""Test a nuclide (Fe56) with a high l-value (4)."""
|
||||
energies = [1e-3, 1.0, 10.0, 1e3, 1e5]
|
||||
|
|
@ -40,3 +56,9 @@ def test_high_l(fe56):
|
|||
assert total[0] == pytest.approx(25.072619556789267)
|
||||
total, absorption, fission = fe56(energies, 300.0)
|
||||
assert total[0] == pytest.approx(27.85535792368082)
|
||||
|
||||
|
||||
def test_to_hdf5(tmpdir, u235):
|
||||
filename = str(tmpdir.join('092235.h5'))
|
||||
u235.to_hdf5(filename)
|
||||
assert os.path.exists(filename)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue