mpet.config package

Submodules

mpet.config.configuration module

mpet.config.constants module

mpet.config.constants.T_ref = 298.0

Reference temperature, K

mpet.config.constants.k = 1.381e-23

Boltzmann constant, J/(K particle)

mpet.config.constants.e = 1.602e-19

Electron charge, C

mpet.config.constants.N_A = 6.022e+23

Avogadro constant, particle / mol

mpet.config.constants.F = 96472.44

Reference flux, C/mol

mpet.config.constants.two_var_types = ['diffn2', 'CHR2', 'homog2', 'homog2_sdn', 'ACR2']

General particle classification (1 var)

mpet.config.constants.one_var_types = ['ACR', 'ACR_Diff', 'diffn', 'CHR', 'homog', 'homog_sdn']

General particle classification (2 var)

mpet.config.constants.c_ref = 1000.0

Reference concentration, mol/m^3 = 1M

mpet.config.constants.reactions_epsilon = 1e-12

Reaction rate epsilon for values close to zero

mpet.config.constants.PARAMS_PER_TRODE = ['Nvol', 'Npart', 'mean', 'stddev', 'cs0', 'simBulkCond', 'sigma_s', 'simPartCond', 'G_mean', 'G_stddev', 'L', 'P_L', 'poros', 'BruggExp', 'specified_psd', 'specified_poros']

parameter that are defined per electrode with a _{electrode} suffix

mpet.config.constants.PARAMS_SEPARATOR = ['Nvol', 'L', 'poros', 'BruggExp', 'specified_poros']

subset of PARAMS_PER_TRODE` that is defined for the separator as well

mpet.config.constants.PARAMS_PARTICLE = {'D': <class 'float'>, 'E_A': <class 'float'>, 'E_D': <class 'float'>, 'N': <class 'int'>, 'Omega_a': <class 'float'>, 'Rfilm': <class 'float'>, 'beta_s': <class 'float'>, 'delta_L': <class 'float'>, 'gamma_con': <class 'float'>, 'k0': <class 'float'>, 'kappa': <class 'float'>}

parameters that are defined for each particle, and their type

mpet.config.derived_values module

class mpet.config.derived_values.DerivedValues[source]

Bases: object

DerivedValues holds the functions and equations required to calculate a parameter that is derived from other parameters. Results are cached, so each parameter is calculated only once. This class is meant to be used from within mpet.config.configuration.Config.

Like mpet.config.configuration.Config, the [] operator can be used to access values.

Each method of this class that does not start with an underscore is a derived value that can be calculated. If it has a trode argument, the parameter is electrode-specific and the name of the electrode should be specified (either ‘a’ or ‘c’).

A list of the available parameters is stored in self.available_values.

Where applicable, all parameters are scaled to their non-dimensional values.

__getitem__(args)[source]

Retrieve a derived parameter using the [] operator.

Parameters:

args (tuple) – Tuple with 2 or 3 items: Config object, name of parameter to retrieve, optionally electrode to retrieve parameter for (system config is selected if no electrode is provided or value is set to None)

Returns:

value of derived parameter

Example usage:

Initialize config and derived values objects: Note that DerivedValues is meant to be used from within the mpet.config.configuration.Config class. Passing the entire Config object is then achieved by passing self, instead of config to DerivedValues.

>>> config = Config('/path/to/params_system.cfg')
>>> dv = DerivedValues()

Parameter that does not need electrode, t_ref:

>>> dv[config, 't_ref', None]
7.792736808950305

Parameter that does need electrode:

>>> dv[config, 'csmax', 'c']
22904.35071404849

If a parameter that needs and electrode is accessed without electrode, or vice-versa, an error is raised:

>>> dv[config, 'csmax', None]
TypeError: csmax() missing 1 required positional argument: 'trode'
>>> dv[config, 't_ref', 'c']
TypeError: t_ref() takes 1 positional argument but 2 were given
Damb()[source]

Ambipolar diffusivity

tp()[source]

Cation transference number

t_ref()[source]

Reference time scale

curr_ref()[source]

Reference current

sigma_s_ref()[source]

Reference conductivity

currset()[source]

Total current

Rser_ref()[source]

Reference series resistance

csmax(trode)[source]

Maximum concentration for given electrode

cap(trode)[source]

Theoretical capacity of given electrode

numsegments()[source]

Number of segments in voltage/current profile

L_ref()[source]

Reference length scale

D_ref()[source]

Reference diffusivity

z()[source]

Electrode capacity ratio

limtrode()[source]

Capacity-limiting electrode

cs_ref(trode)[source]

Reference concentration

muR_ref(trode)[source]

Reference chemical potential of given electrode

phiRef(trode)[source]

Reference electrostatic potential of given electrode

power_ref()[source]

Reference power of the system

mpet.config.parameterset module

mpet.config.schemas module

Module contents