mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Update failing photon tests
This commit is contained in:
parent
64e617ed09
commit
fd418f15b4
2 changed files with 14 additions and 21 deletions
|
|
@ -1,3 +1,3 @@
|
|||
tally 1:
|
||||
sum = 2.254985E+02
|
||||
sum_sq = 5.084955E+04
|
||||
sum = 2.275713E+02
|
||||
sum_sq = 5.178870E+04
|
||||
|
|
|
|||
|
|
@ -71,10 +71,20 @@ def test_transitions(element):
|
|||
assert sum(matrix['probability']) == pytest.approx(1.0)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('element', ['H', 'Al', 'Ag'], indirect=True)
|
||||
def test_bremsstrahlung(element):
|
||||
@pytest.mark.parametrize(
|
||||
'element, I, i_shell, ionization_energy, num_electrons', [
|
||||
('H', 19.2, 0, 13.6, 1),
|
||||
('O', 95.0, 2, 13.62, 4),
|
||||
('U', 890.0, 25, 6.033, -3)
|
||||
],
|
||||
indirect=['element']
|
||||
)
|
||||
def test_bremsstrahlung(element, I, i_shell, ionization_energy, num_electrons):
|
||||
brems = element.bremsstrahlung
|
||||
assert isinstance(brems, Mapping)
|
||||
assert brems['I'] == I
|
||||
assert brems['num_electrons'][i_shell] == num_electrons
|
||||
assert brems['ionization_energy'][i_shell] == ionization_energy
|
||||
assert np.all(np.diff(brems['electron_energy']) > 0.0)
|
||||
assert np.all(np.diff(brems['photon_energy']) > 0.0)
|
||||
assert brems['photon_energy'][0] == 0.0
|
||||
|
|
@ -114,23 +124,6 @@ def test_reactions(element, reaction):
|
|||
reactions[18]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'element, I', [
|
||||
('H', 19.2),
|
||||
('O', 95.0),
|
||||
('U', 890.0)
|
||||
],
|
||||
indirect=['element']
|
||||
)
|
||||
def test_stopping_powers(element, I):
|
||||
stopping_powers = element.stopping_powers
|
||||
assert isinstance(stopping_powers, Mapping)
|
||||
assert stopping_powers['I'] == I
|
||||
assert np.all(np.diff(stopping_powers['energy']) > 0.0)
|
||||
assert len(stopping_powers['s_collision']) == 200
|
||||
assert len(stopping_powers['s_radiative']) == 200
|
||||
|
||||
|
||||
@pytest.mark.parametrize('element', ['Pu'], indirect=True)
|
||||
def test_export_to_hdf5(tmpdir, element):
|
||||
filename = str(tmpdir.join('tmp.h5'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue