specie module¶
Author: Valmor de Almeida dealmeidav@ornl.gov; vfda
This Specie class is to be used with other classes in plant-level process modules.
- NB: Species is always used either in singular or plural cases, the class
named here reflects one species. If many species are used in an external context, the species object name can be used without conflict.
- For unit testing do at the linux command prompt:
python specie.py
- NB: The Specie() class encapsulates either the molecular or empirical chemical
formula of a compound. This is done as follows. Say MAO2 is either a molecular or empirical chemical formula of a ficticious compound denoting minor actinides dioxide. The list of atoms is given as follows:
[‘0.49*Np-237’, ‘0.42*Am-241’, ‘0.08*Am-243’, ‘0.01*Cm-244’, ‘2.0*O-16’]
note the MA forming nuclides add to 1 = 0.49 + 0.42 + 0.08 + 0.01. Therefore the number of atoms in this compound is 3. 1 MA “atom” and 2 O. Note that the total number of “atoms” is obtained by summing all multipliers: 0.49 + 0.42 + 0.08 + 0.01 + 2.0. The nuclide is indicated by the element symbol followed by a dash and the atomic mass number. Here the number of nuclide types is 5 (self._nNuclideTypes).
The numbers preceeding the nuclide symbol before the * will be referred to as multipliers. The sum of the multipliers will add to the number of “atoms” in the formula. WARNING: a multiplier could be in the format 0.00e-00. In this case a hiphen may appear twice, e.g.: 1.549e-09*U-233
Other forms can be used for common true species
[‘Np-237’, ‘2.0*O-16’] or [‘Np-237’, ‘O-16’, ‘O-16’] or [ ‘2*H’, ‘O’ ] or [ ‘H’, ‘O’, ‘H’ ] etc…
This code will calculate the molar mass of any species with a given valid atom list using a provided periodic table of chemical elements. The user can also reset the value of the molar mass with a setter method.
Sat May 9 21:40:48 EDT 2015 created; vfda
-
class
specie.
Specie
(name='null', formula_name='null', phase='null', atoms=[], molarCC=0.0, massCC=0.0, flag=None)[source]¶ Bases:
object
- todo: phase should not be here; concentrations should not be here
only molar quantities should be here see the Phase container
-
GetFormula
()[source]¶ Returns the molecular or empirical formula of the species. It is usually a list, for example, of the form [‘2*H’, ‘O’].
- Returns
formula
- Return type
-
GetFormulaName
()[source]¶ Returns the formulaic name of the compound. For example, “Dihydrogen monoxide”.
- Returns
self.__formula_name
- Return type
-
GetMassCC
()[source]¶ Returns the numerical value of the mass density of the species (mass/volume).
- Returns
massCC
- Return type
-
GetMassCCUnit
()[source]¶ Returns the unit used to measure the mass density of the species.
- Returns
massCCUnit
- Return type
-
GetMolarCC
()[source]¶ Returns the numerical value for the number (molar) density of the species (moles/volume).
- Returns
molarCC
- Return type
-
GetMolarCCUnit
()[source]¶ Returns the unit used to measure molar density of the species.
- Returns
molarCCUnit
- Return type
-
GetMolarGammaPwr
()[source]¶ Returns the amount of gamma radiation produced per mole of this species (measured in units of power).
- Returns
molarGammaPwr
- Return type
-
GetMolarGammaPwrUnit
()[source]¶ Returns the unit used to measure the amount of gamma radiation produced per mole of this species.
- Returns
molarGammaPwrUnit
- Return type
-
GetMolarHeatPwr
()[source]¶ Returns the amount of heat generated per mole of this species.
- Returns
molarHeatPwr
- Return type
-
GetMolarHeatPwrUnit
()[source]¶ Returns the unit used to measure the amount of heat generated per mole of this species.
- Returns
molarHeatPwrUnit
- Return type
-
GetMolarMass
()[source]¶ Returns the numerical value for the molar mass of the species. Units are given by molarMassUnit.
- Returns
molarMass
- Return type
-
GetMolarMassUnit
()[source]¶ Returns the unit used to measure the molar mass of the species.
- Returns
molarMassUnit
- Return type
-
GetMolarRadioactivity
()[source]¶ Returns the numerical value for molar radioactivity of the species.
- Returns
molarRadioactivity
- Return type
-
GetMolarRadioactivityFractions
()[source]¶ Returns a list of numbers that speciefies the % of molar reactivity that comes from each type of atom in the species. For example, a molarRadioactivityFraction of [0.65, 0.35] for water means that 65% of the molar radioactivity comes from the hydrogen atoms and 35% comes from the oxygen atom.
- Returns
molarRadioactivityFractions
- Return type
-
GetMolarRadioactivityUnit
()[source]¶ Returns the unit used to measure molar radioactivity.
- Returns
molarRadioactivityUnit
- Return type
-
GetNAtoms
()[source]¶ Returns the total number of atoms comprising the species. For example, water is comprised of three atoms.
- Returns
nAtoms
- Return type
-
GetNNuclideTypes
()[source]¶ Returns the number of different types of atoms comprising the species. For example, water is composed of two different types of atoms, hydrogen and oxygen.
- Returns
nNuclideTypes
- Return type
-
GetName
()[source]¶ Returns the empirical name of the species. For example, “water”.
- Returns
name
- Return type
-
SetFormula
(atoms)[source]¶ Sets the species’ formula equal to atoms. Will automatically update the molar mass of the species, and will also fail if atoms is not a list of strings.
- Parameters
atoms (list) –
-
SetMassCC
(v)[source]¶ Sets the numerical value of the mass density equal to v.
- Parameters
v (float) –
-
SetMolarCC
(v)[source]¶ Sets the numerical value for the molar density of the species to v.
- Parameters
v (float) –
-
SetMolarCCUnit
(v)[source]¶ Sets the unit used to measure the molar density of the species to v.
- Parameters
v (str) –
-
SetMolarGammaPwr
(v)[source]¶ Sets the amount of gamma radiation produced per mole of this species to v.
- Parameters
v (float) –
-
SetMolarGammaPwrUnit
(v)[source]¶ Sets the unit used to measure the amount of gamma radiation produced per mole of this species to v.
- Parameters
v (str) –
-
SetMolarHeatPwr
(v)[source]¶ Sets the amount of heat generated per mole of this species to v.
- Parameters
v (float) –
-
SetMolarHeatPwrUnit
(v)[source]¶ Sets the unit used to measure the amount of heat generated per mole of this species to v.
- Parameters
v (str) –
-
SetMolarMassUnit
(v)[source]¶ Sets the unit used to measure the molar mass of the species to v.
- Parameters
v (str) –
-
SetMolarRadioactivity
(v)[source]¶ Sets the molar radioactivity of the species equal to v.
- Parameters
v (float) –
-
SetMolarRadioactivityFractions
(fracs)[source]¶ Sets molarRadioactivityFractions equal to fracs. Fracs must be a list of floatswith the same length as there are different atoms in the species, or the function call will fail. (e.g. self._atoms and fracs must be of the same length). Take care to ensure that the elements of fracs match with the elements of self._atoms! (65% is in the same position in fracs as hydrogen is in self._atoms, following the above example).
- Parameters
fracs (list) –
-
SetMolarRadioactivityUnit
(v)[source]¶ Sets the unit used to measure molar radioactivity to v.
- Parameters
v (str) –
-
atoms
¶
-
formula
¶ Returns the molecular or empirical formula of the species. It is usually a list, for example, of the form [‘2*H’, ‘O’].
- Returns
formula
- Return type
-
formula_name
¶ Returns the formulaic name of the compound. For example, “Dihydrogen monoxide”.
- Returns
self.__formula_name
- Return type
-
massCC
¶ Returns the numerical value of the mass density of the species (mass/volume).
- Returns
massCC
- Return type
-
massCCUnit
¶ Returns the unit used to measure the mass density of the species.
- Returns
massCCUnit
- Return type
-
molarCC
¶ Returns the numerical value for the number (molar) density of the species (moles/volume).
- Returns
molarCC
- Return type
-
molarCCUnit
¶ Returns the unit used to measure molar density of the species.
- Returns
molarCCUnit
- Return type
-
molarGammaPwr
¶ Returns the amount of gamma radiation produced per mole of this species (measured in units of power).
- Returns
molarGammaPwr
- Return type
-
molarGammaPwrUnit
¶ Returns the unit used to measure the amount of gamma radiation produced per mole of this species.
- Returns
molarGammaPwrUnit
- Return type
-
molarHeatPwr
¶ Returns the amount of heat generated per mole of this species.
- Returns
molarHeatPwr
- Return type
-
molarHeatPwrUnit
¶ Returns the unit used to measure the amount of heat generated per mole of this species.
- Returns
molarHeatPwrUnit
- Return type
-
molarMass
¶ Returns the numerical value for the molar mass of the species. Units are given by molarMassUnit.
- Returns
molarMass
- Return type
-
molarMassUnit
¶ Returns the unit used to measure the molar mass of the species.
- Returns
molarMassUnit
- Return type
-
molarRadioactivity
¶ Returns the numerical value for molar radioactivity of the species.
- Returns
molarRadioactivity
- Return type
-
molarRadioactivityFractions
¶ Returns a list of numbers that speciefies the % of molar reactivity that comes from each type of atom in the species. For example, a molarRadioactivityFraction of [0.65, 0.35] for water means that 65% of the molar radioactivity comes from the hydrogen atoms and 35% comes from the oxygen atom.
- Returns
molarRadioactivityFractions
- Return type
-
molarRadioactivityUnit
¶ Returns the unit used to measure molar radioactivity.
- Returns
molarRadioactivityUnit
- Return type
-
nAtoms
¶ Returns the total number of atoms comprising the species. For example, water is comprised of three atoms.
- Returns
nAtoms
- Return type
-
nNuclideTypes
¶ Returns the number of different types of atoms comprising the species. For example, water is composed of two different types of atoms, hydrogen and oxygen.
- Returns
nNuclideTypes
- Return type
-
phase
¶ Returns the phase history of the species.
- Returns
phase
- Return type
dataFrame