mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
volume not needed when finding specific activity
This commit is contained in:
parent
064426a05f
commit
98c287b83a
2 changed files with 10 additions and 15 deletions
|
|
@ -945,9 +945,9 @@ class Material(IDManagerMixin):
|
|||
activity in [Bq/g].
|
||||
"""
|
||||
activity = {}
|
||||
for nuclide, atoms in self.get_nuclide_atoms().items():
|
||||
for nuclide, atoms in self.get_nuclide_atom_densities().items():
|
||||
inv_seconds = openmc.data.decay_constant(nuclide)
|
||||
activity[nuclide] = (inv_seconds * atoms) / self.get_mass()
|
||||
activity[nuclide] = (inv_seconds * atoms * 1.0e24) / self.density
|
||||
return activity
|
||||
|
||||
def get_nuclide_atoms(self):
|
||||
|
|
|
|||
|
|
@ -481,12 +481,16 @@ def test_activity_of_stable():
|
|||
|
||||
|
||||
def test_activity_of_tritium():
|
||||
"""Checks that 1g of tritium has the correct activity"""
|
||||
"""Checks that 1g of tritium has the correct activity activity scaling"""
|
||||
m1 = openmc.Material()
|
||||
m1.add_nuclide("H3", 1)
|
||||
m1.set_density('g/cm3', 1)
|
||||
m1.volume = 1
|
||||
assert pytest.approx(m1.activity) == 3.559778e14
|
||||
m1.set_density('g/cm3', 2)
|
||||
assert pytest.approx(m1.activity) == 3.559778e14*2
|
||||
m1.volume = 3
|
||||
assert pytest.approx(m1.activity) == 3.559778e14*2*3
|
||||
|
||||
|
||||
def test_activity_of_metastable():
|
||||
|
|
@ -499,18 +503,9 @@ def test_activity_of_metastable():
|
|||
|
||||
|
||||
def test_specific_activity_of_tritium():
|
||||
"""Checks that specific activity stays the same for all volumes and
|
||||
densities while activity changes proportionally to mass"""
|
||||
"""Checks that specific activity of tritium is correct"""
|
||||
m1 = openmc.Material()
|
||||
m1.add_nuclide("H3", 1)
|
||||
m1.set_density('g/cm3', 1)
|
||||
m1.volume = 1
|
||||
# activity and specific_activity are initially the same as we have 1g
|
||||
assert pytest.approx(m1.specific_activity) == 3.559778e14
|
||||
assert pytest.approx(m1.activity) == 3.559778e14
|
||||
m1.set_density('g/cm3', 2)
|
||||
assert pytest.approx(m1.specific_activity) == 3.559778e14
|
||||
assert pytest.approx(m1.activity) == 3.559778e14*2
|
||||
m1.volume = 3
|
||||
assert pytest.approx(m1.specific_activity) == 3.559778e14
|
||||
assert pytest.approx(m1.activity) == 3.559778e14*2*3
|
||||
assert m1.specific_activity == 355978108155965.9
|
||||
assert m1.get_nuclide_specific_activity() == {"H3": 355978108155965.9}
|
||||
Loading…
Add table
Add a link
Reference in a new issue