core#
Core chemical potentials objects
Classes
|
Class to handle set of chemical potentials. |
Functions
Get chemical potential at a given temperature and partial pressure. |
- class Chempots(chempots_dict, ndecimals=None)[source]#
Bases:
MSONableClass to handle set of chemical potentials. Behaves like a python dictionary. The dictionary needs to be set with element symbols as keys and chemical potentials as values.
- Parameters:
chempots_dict (dict) – Dictionary of chemical potentials in the format {el:value}.
ndecimals (int) – Round the chemical potentials to this number of decimals. If None the numbers are left untouched.
- as_dict()[source]#
Json-serializable dict representation of a Chempots object.
- Returns:
d – Json-serializable dict of a Chempots object.
- Return type:
dict
- static from_dict(d)[source]#
Constructor of Chempots object from dictionary representation.
- Parameters:
d (dict)
- Returns:
chempots – Chempots object.
- Return type:
- static from_pmg_elements(d)[source]#
Construct a Chempots object from a dictionary in the format {Element:value}. Useful to interface with pymatgen which uses Element class to address elements instead of just their symbols.
- Parameters:
d (dict) – Dictionary in the format {Element:value}.
- Returns:
chempots – Chempots object.
- Return type:
- get_absolute(mu_refs)[source]#
Get Chempots object with chemical potentials converted to absolute values (mu + mu_ref).
- get_referenced(mu_refs)[source]#
Get Chempots object with chemical potentials converted to referenced values (mu - mu_ref).
- property mu#
Dictionary with chemical potentials
- chempot_ideal_gas(mu0, temperature, partial_pressure, coeff=2)[source]#
Get chemical potential at a given temperature and partial pressure. The chemical potential in standard conditions (mu0) has to be know.
- Parameters:
mu0 (float) – Value of chemical potential in standard conditions.
temperature (float) – Temperature in Kelvin.
partial_pressure (float) – Partial pressure over standard pressure (p/p0).
coeff (int) – Stochiometric coefficient. Default is 2 for oxygen.
- Returns:
chempot – Value of chemical potential at given T and p/p0.
- Return type:
float