mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
add get_activity
This commit is contained in:
parent
e807c26436
commit
e030b74836
2 changed files with 3581 additions and 0 deletions
3565
openmc/data/data.py
3565
openmc/data/data.py
File diff suppressed because it is too large
Load diff
|
|
@ -3,6 +3,7 @@ from collections.abc import Iterable
|
|||
from copy import deepcopy
|
||||
from numbers import Real
|
||||
from pathlib import Path
|
||||
import math
|
||||
import re
|
||||
import warnings
|
||||
from xml.etree import ElementTree as ET
|
||||
|
|
@ -705,6 +706,21 @@ class Material(IDManagerMixin):
|
|||
def make_isotropic_in_lab(self):
|
||||
self.isotropic = [x.name for x in self._nuclides]
|
||||
|
||||
|
||||
def get_activity(self):
|
||||
"""Returns the total activity of the material in Becquerels."""
|
||||
|
||||
atoms_per_barn_cm2 = self.get_nuclide_atom_densities()
|
||||
total_activity = 0
|
||||
for key, value in atoms_per_barn_cm2.items():
|
||||
if key in openmc.data.HALF_LIFE.keys():
|
||||
atoms = value[1] * self.volume * 1e24
|
||||
activity = 0.693 * atoms / openmc.data.HALF_LIFE[key]
|
||||
print('activity', activity)
|
||||
total_activity += activity
|
||||
|
||||
return total_activity
|
||||
|
||||
def get_elements(self):
|
||||
"""Returns all elements in the material
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue