mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
added specific_activity
This commit is contained in:
parent
8a6dc7e9f8
commit
064426a05f
2 changed files with 43 additions and 0 deletions
|
|
@ -94,6 +94,9 @@ class Material(IDManagerMixin):
|
|||
activity : float
|
||||
Activity of the material in [Bq]. Requires that the :attr:`volume`
|
||||
attribute is set.
|
||||
specific_activity : float
|
||||
Activity of the material per unit mass in [Bq/kg]. Requires that the
|
||||
:attr:`volume` and :attr:`density` attributes are set.
|
||||
|
||||
"""
|
||||
|
||||
|
|
@ -155,6 +158,11 @@ class Material(IDManagerMixin):
|
|||
"""Returns the total activity of the material in Becquerels."""
|
||||
return sum(self.get_nuclide_activity().values())
|
||||
|
||||
@property
|
||||
def specific_activity(self):
|
||||
"""Returns the total specific activity of the material in Becquerels per gram."""
|
||||
return sum(self.get_nuclide_specific_activity().values())
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._name
|
||||
|
|
@ -925,6 +933,23 @@ class Material(IDManagerMixin):
|
|||
activity[nuclide] = inv_seconds * atoms
|
||||
return activity
|
||||
|
||||
def get_nuclide_specific_activity(self):
|
||||
"""Return specific activity in [Bq/g] for each nuclide in the material
|
||||
|
||||
.. versionadded:: 0.13.1
|
||||
|
||||
Returns
|
||||
-------
|
||||
dict
|
||||
Dictionary whose keys are nuclide names and values are specific
|
||||
activity in [Bq/g].
|
||||
"""
|
||||
activity = {}
|
||||
for nuclide, atoms in self.get_nuclide_atoms().items():
|
||||
inv_seconds = openmc.data.decay_constant(nuclide)
|
||||
activity[nuclide] = (inv_seconds * atoms) / self.get_mass()
|
||||
return activity
|
||||
|
||||
def get_nuclide_atoms(self):
|
||||
"""Return number of atoms of each nuclide in the material
|
||||
|
||||
|
|
|
|||
|
|
@ -496,3 +496,21 @@ def test_activity_of_metastable():
|
|||
m1.set_density('g/cm3', 1)
|
||||
m1.volume = 98.9
|
||||
assert pytest.approx(m1.activity, rel=0.001) == 1.93e19
|
||||
|
||||
|
||||
def test_specific_activity_of_tritium():
|
||||
"""Checks that specific activity stays the same for all volumes and
|
||||
densities while activity changes proportionally to mass"""
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue