pdom.data.Parameter

class pdom.Parameter(config_file, data_file=None, overwrites=None)

Collection of constants, parameters and helper functions.

This class loads the configuration and handles experimental data. Provide functions to convert data into pdom base units and alter settings.
Parameters:
  • config_file (str, Path) – .ini file to load
  • data_file (str, Path, optional) – .json file containing experimental data
  • overwrites (dict, optional) – overwrite settings from the config file
avogadro = 6.02214129e+23

\(N_A\) - Avogadro constant [1/mol]

static get_diffusion_constant_air(mol_volume, molar_weight, temperature=293.15, pressure=101325.0)

Diffusion constant in air depending on molar volume and weight Based on the FSG model with constants from the Handbook of chemical property estimation methods.

Source:

Fuller (1966) [Fuller1966], Tucker & Nelken (1982) [Tucker1982]

Parameters:
  • mol_volume (float) – molar volume [cm^3/mol]
  • molar_weight (float) – molar weight [g/mol]
  • temperature (float, int, optional) – temperature [K]
  • pressure (float, optional) – pressure [Pa]
Returns:

\(D\) - diffusion constant [cm^2/s]

Return type:

float

classmethod get_diffusion_constant_water(mol_volume, temperature=293.15, model='s')

Diffusion constant in water depending on molar volume. Based on models from either Stokes, Wilke-Chang, or Hayduk-Minhas.

Source:

Wilke & Chang (1955) [Wilke1955], Hayduk & Minhas (1982) [Hayduk1982]

Parameters:
  • mol_volume (float) – molar volume [cm^3/mol]
  • temperature (float, int, optional) – temperature [K]
  • model (str, optional) – model abbreviation | “s” Stokes (default), “wc” Wilke-Chang, “hm” Hayduk-Minhas
Returns:

\(D\) - diffusion constant [m^2/s]

Return type:

float

classmethod get_molecular_weight(composition)

Calculate the weight of a molecule from its chemical formula.

Parameters:composition (dict) – key - atomic symbol | value - atom count
Returns:molecular weight [u]
Return type:float
k_boltzmann = 1.3806488e-23

\(k_B\) - Boltzmann constant [Nm/K]

light_speed = 2997927458

\(c\) - light speed [m/s]

planck = 6.62606957e-34

\(h\) - Planck constant [Ws^2]

static scale_ten(value)

Decimal scaling

Parameters:value (int, float) – input value
Returns:scale factor, prefix
Return type:tuple
static scale_time(value)

Temporal scaling

Parameters:value (int, float) – input value
Returns:scale factor, prefix
Return type:tuple
standard_atomic_weight = {'Ac': 225.027, 'Ag': 107.87, 'Al': 26.982, 'Am': 241.061, 'Ar': 39.948, 'As': 74.922, 'At': 209.987, 'Au': 196.97, 'B': 10.81, 'Ba': 137.33, 'Be': 9.0122, 'Bh': 270.133, 'Bi': 208.98, 'Bk': 247.07, 'Br': 79.904, 'C': 12.011, 'Ca': 40.078, 'Cd': 112.41, 'Ce': 140.12, 'Cf': 249.075, 'Cl': 35.45, 'Cm': 243.061, 'Cn': 283.173, 'Co': 58.933, 'Cr': 51.996, 'Cs': 132.91, 'Cu': 63.546, 'Db': 268.126, 'Ds': 280.161, 'Dy': 162.5, 'Er': 167.26, 'Es': 253.085, 'Eu': 151.96, 'F': 18.998, 'Fe': 55.845, 'Fl': 287.187, 'Fm': 253.085, 'Fr': 211.996, 'Ga': 69.723, 'Gd': 157.25, 'Ge': 72.63, 'H': 1.008, 'He': 4.0026, 'Hf': 178.49, 'Hg': 200.59, 'Ho': 164.93, 'Hs': 269.134, 'I': 126.9, 'In': 114.82, 'Ir': 192.22, 'K': 39.098, 'Kr': 83.798, 'La': 138.91, 'Li': 6.94, 'Lr': 261.107, 'Lu': 174.97, 'Lv': 291.201, 'Md': 258.098, 'Mg': 24.305, 'Mn': 54.938, 'Mo': 95.95, 'Mt': 276.152, 'N': 14.007, 'Na': 22.99, 'Nb': 92.906, 'Nd': 144.24, 'Ne': 20.18, 'Ni': 58.693, 'No': 255.093, 'Np': 236.047, 'O': 15.999, 'Os': 190.23, 'P': 30.974, 'Pa': 231.04, 'Pb': 207.2, 'Pd': 106.42, 'Pm': 144.912, 'Po': 207.981, 'Pr': 140.91, 'Pt': 195.08, 'Pu': 238.05, 'Ra': 226.025, 'Rb': 85.468, 'Re': 186.21, 'Rf': 265.117, 'Rg': 281.165, 'Rh': 102.91, 'Rn': 209.989, 'Ru': 101.07, 'S': 32.06, 'Sb': 121.76, 'Sc': 44.956, 'Se': 78.971, 'Sg': 269.129, 'Si': 28.085, 'Sm': 150.36, 'Sn': 118.71, 'Sr': 87.62, 'Ta': 180.95, 'Tb': 158.93, 'Tc': 97.907, 'Te': 127.6, 'Th': 232.04, 'Ti': 47.867, 'Tl': 204.38, 'Tm': 168.93, 'U': 238.03, 'V': 50.942, 'W': 183.84, 'Xe': 131.29, 'Y': 88.906, 'Yb': 173.05, 'Zn': 65.38, 'Zr': 91.224}

Mapping element symbol to standard corresponding atomic weight.

Source:“Atomic weights of the elements 2013” (IUPAC) [IUPAC2016]
Returns:standard atomic weight [u]
Return type:dict
classmethod unit_convert(value, unit)

Convert into pdom base units

Note:

Base units are s, 1/s, m, m/s, W/m^2, K, g/m^3, m^2/g, m^3, cm^3/mol, m^2/molecule, kJ/mol

Parameters:
  • value (float, int) –
  • unit (str) –
Returns:

converted value

Return type:

float

unit_convert_concentration(value, unit, cfg=None)

Concentration to number of molecules

Note:

A simulation config can be passed, to use alternative parameters, for example to convert TOC.

Parameters:
  • value (float, int) – value
  • unit (str) – unit
  • cfg (dict, optional) – simulation config
Returns:

\(N\) - number of molecules [1]

Return type:

float

static update_multi_k(config)

Update the config for multi species models

This needs to be called after a basic setting is changed in the config, to update parameters depending on species size.

Parameters:config (dict) – simulation config
Returns:simulation config
Return type:dict
van_der_waals_radii = {'Ac': 2.0, 'Ag': 1.72, 'Al': 2.0, 'Am': 2.0, 'Ar': 1.88, 'As': 1.85, 'At': 2.0, 'Au': 1.66, 'B': 2.0, 'Ba': 2.0, 'Be': 2.0, 'Bh': 2.0, 'Bi': 2.0, 'Bk': 2.0, 'Br': 1.85, 'C': 1.7, 'Ca': 1.37, 'Cd': 1.58, 'Ce': 2.0, 'Cf': 2.0, 'Cl': 2.27, 'Cm': 2.0, 'Co': 2.0, 'Cr': 2.0, 'Cs': 2.1, 'Cu': 1.4, 'Db': 2.0, 'Ds': 2.0, 'Dy': 2.0, 'Er': 2.0, 'Es': 2.0, 'Eu': 2.0, 'F': 1.47, 'Fe': 2.0, 'Fm': 2.0, 'Fr': 2.0, 'Ga': 1.07, 'Gd': 2.0, 'Ge': 2.0, 'H': 1.2, 'He': 1.4, 'Hf': 2.0, 'Hg': 1.55, 'Ho': 2.0, 'Hs': 2.0, 'I': 1.98, 'In': 1.93, 'Ir': 2.0, 'K': 1.76, 'Kr': 2.02, 'La': 2.0, 'Li': 1.82, 'Lr': 2.0, 'Lu': 2.0, 'Md': 2.0, 'Mg': 1.18, 'Mn': 2.0, 'Mo': 2.0, 'Mt': 2.0, 'N': 1.55, 'Na': 1.36, 'Nb': 2.0, 'Nd': 2.0, 'Ne': 1.54, 'Ni': 1.63, 'No': 2.0, 'Np': 2.0, 'O': 1.52, 'Os': 2.0, 'P': 1.8, 'Pa': 2.0, 'Pb': 2.02, 'Pd': 1.63, 'Pm': 2.0, 'Po': 2.0, 'Pr': 2.0, 'Pt': 1.72, 'Pu': 2.0, 'Ra': 2.0, 'Rb': 2.0, 'Re': 2.0, 'Rf': 2.0, 'Rg': 2.0, 'Rh': 2.0, 'Rn': 2.0, 'Ru': 2.0, 'S': 1.8, 'Sb': 2.0, 'Sc': 2.0, 'Se': 1.9, 'Sg': 2.0, 'Si': 2.1, 'Sm': 2.0, 'Sn': 2.17, 'Sr': 2.0, 'Ta': 2.0, 'Tb': 2.0, 'Tc': 2.0, 'Te': 2.06, 'Th': 2.0, 'Ti': 2.0, 'Tl': 1.96, 'Tm': 2.0, 'U': 1.86, 'V': 2.0, 'W': 2.0, 'X': 1.5, 'Xe': 2.16, 'Y': 2.0, 'Yb': 2.0, 'Zn': 1.39, 'Zr': 2.0}

Mapping element symbol to corresponding Van der Waals radius.

Note:Radii that are not available in either of the sources have RvdW = 2.00.
Source:“van der Waals Volumes and Radii” by Bondi (1964) [Bondi1964], the value for H is taken from Rowland & Taylor (1996) [Rowland1996]
Returns:Van der Waals radii [Ang]
Return type:dict
viscosity_water = <scipy.interpolate.interpolate.interp1d object>

A smooth interpolation from 274 to 363 Kelvin. Viscosity is retuned in mPa*s | centipoise | (mN/m^2)*s.

Source:Wikibooks - Stoffdaten Wasser