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

GetAtoms()[source]
GetFlag()[source]

Returns the flag associated with the species.

Returns

flag

Return type

str

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

list

GetFormulaName()[source]

Returns the formulaic name of the compound. For example, “Dihydrogen monoxide”.

Returns

self.__formula_name

Return type

str

GetMassCC()[source]

Returns the numerical value of the mass density of the species (mass/volume).

Returns

massCC

Return type

float

GetMassCCUnit()[source]

Returns the unit used to measure the mass density of the species.

Returns

massCCUnit

Return type

str

GetMolarCC()[source]

Returns the numerical value for the number (molar) density of the species (moles/volume).

Returns

molarCC

Return type

float

GetMolarCCUnit()[source]

Returns the unit used to measure molar density of the species.

Returns

molarCCUnit

Return type

str

GetMolarGammaPwr()[source]

Returns the amount of gamma radiation produced per mole of this species (measured in units of power).

Returns

molarGammaPwr

Return type

float

GetMolarGammaPwrUnit()[source]

Returns the unit used to measure the amount of gamma radiation produced per mole of this species.

Returns

molarGammaPwrUnit

Return type

str

GetMolarHeatPwr()[source]

Returns the amount of heat generated per mole of this species.

Returns

molarHeatPwr

Return type

float

GetMolarHeatPwrUnit()[source]

Returns the unit used to measure the amount of heat generated per mole of this species.

Returns

molarHeatPwrUnit

Return type

str

GetMolarMass()[source]

Returns the numerical value for the molar mass of the species. Units are given by molarMassUnit.

Returns

molarMass

Return type

float

GetMolarMassUnit()[source]

Returns the unit used to measure the molar mass of the species.

Returns

molarMassUnit

Return type

str

GetMolarRadioactivity()[source]

Returns the numerical value for molar radioactivity of the species.

Returns

molarRadioactivity

Return type

float

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

list

GetMolarRadioactivityUnit()[source]

Returns the unit used to measure molar radioactivity.

Returns

molarRadioactivityUnit

Return type

str

GetNAtoms()[source]

Returns the total number of atoms comprising the species. For example, water is comprised of three atoms.

Returns

nAtoms

Return type

int

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

int

GetName()[source]

Returns the empirical name of the species. For example, “water”.

Returns

name

Return type

str

GetPhase()[source]

Returns the phase history of the species.

Returns

phase

Return type

dataFrame

SetAtoms(atoms)[source]
SetFlag(f)[source]

Sets the flag associated with the species to f.

Parameters

f (str) –

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) –

SetFormulaName(f)[source]

Sets the formulaic name to f.

Returns

self.__formula_name

Return type

str

SetMassCC(v)[source]

Sets the numerical value of the mass density equal to v.

Parameters

v (float) –

SetMassCCUnit(v)[source]

Sets the units used to measure mass density to v.

Parameters

v (str) –

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) –

SetMolarMass(v)[source]

Sets the molar mass of the species equal to v.

Parameters

v (float) –

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) –

SetName(n)[source]

Sets the empirical name of the species to n.

Parameters

n (str) –

SetPhase(p)[source]

Sets the phase history to p.

Parameters

p (dataFrame) –

atoms
flag

Returns the flag associated with the species.

Returns

flag

Return type

str

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

list

formula_name

Returns the formulaic name of the compound. For example, “Dihydrogen monoxide”.

Returns

self.__formula_name

Return type

str

massCC

Returns the numerical value of the mass density of the species (mass/volume).

Returns

massCC

Return type

float

massCCUnit

Returns the unit used to measure the mass density of the species.

Returns

massCCUnit

Return type

str

molarCC

Returns the numerical value for the number (molar) density of the species (moles/volume).

Returns

molarCC

Return type

float

molarCCUnit

Returns the unit used to measure molar density of the species.

Returns

molarCCUnit

Return type

str

molarGammaPwr

Returns the amount of gamma radiation produced per mole of this species (measured in units of power).

Returns

molarGammaPwr

Return type

float

molarGammaPwrUnit

Returns the unit used to measure the amount of gamma radiation produced per mole of this species.

Returns

molarGammaPwrUnit

Return type

str

molarHeatPwr

Returns the amount of heat generated per mole of this species.

Returns

molarHeatPwr

Return type

float

molarHeatPwrUnit

Returns the unit used to measure the amount of heat generated per mole of this species.

Returns

molarHeatPwrUnit

Return type

str

molarMass

Returns the numerical value for the molar mass of the species. Units are given by molarMassUnit.

Returns

molarMass

Return type

float

molarMassUnit

Returns the unit used to measure the molar mass of the species.

Returns

molarMassUnit

Return type

str

molarRadioactivity

Returns the numerical value for molar radioactivity of the species.

Returns

molarRadioactivity

Return type

float

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

list

molarRadioactivityUnit

Returns the unit used to measure molar radioactivity.

Returns

molarRadioactivityUnit

Return type

str

nAtoms

Returns the total number of atoms comprising the species. For example, water is comprised of three atoms.

Returns

nAtoms

Return type

int

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

int

name

Returns the empirical name of the species. For example, “water”.

Returns

name

Return type

str

phase

Returns the phase history of the species.

Returns

phase

Return type

dataFrame