thermodynamics
Handle thermodynamic properties.
- class thermodynamics.Thermodynamics(params, comps, phase, TK, GfV, logger)[source]
Bases:
objectProvide methods to compute thermodynamic properties.
Methods that compute the Gibbs free energy and chemical potentials as a function of atom fraction array (G_funx and MU_funx) assume vacancies are at equilibrium.
Methods that compute the Gibbs free energy and chemical potentials as a function of site fraction array (G_funy and MU_funy) are initialized based on the same assumption, but the class provides a method to update these methods in the case of a non-ideal lattice (set_nonideal_lattice).
- Variables:
comps (list of str) – System components.
TK (float) – Temperature in Kelvin.
GfV (dict of list) – Vacancy formation energy in pure metals, given as [enthalpy, entropy] in J/mol and J/mol/K. See
data_io.get_vacancy_formation_energy().params (dict of floats) –
Thermodynamic parameters arranged as follows:
A: G_A for A in endmembersAB: [L0, L1] for AB in binary subsystemsideal_lattice (bool) – Whether lattice is ideal, in the sense that the vacancy fraction is maintained at equilibrium.
- G_funx(x) :
Return Gibbs free energy at composition given by atom fraction array.
- MU_funx(x) :
Return chemical potentials at composition given by atom fraction array.
- yVa_fun(x) :
Return equilibrium vacancy fraction at composition given by atom fraction array.
- G_fun(x) :
Alias of G_funx.
- MU_fun(x):
Return MU_funx as a dict.
- G_funy(y):
Return Gibbs free energy at composition given by site fraction array.
- MU_funy(y) :
Return chemical potentials at composition given by site fraction array.
- __init__(params, comps, phase, TK, GfV, logger)[source]
Class constructor.
- Parameters:
params (dict of floats) –
Thermodynamic parameters arranged as follows:
A: G_A for A in endmembersAB: [L0, L1] for AB in binary subsystemscomps (list of str) – System components.
phase (str) – Phase name.
TK (float) – Temperature in Kelvin.
vacancy_databases (dict) – Register of vacancy formation energy databases.
vacancy_db (str) – Name of database with vacancy formation energy in pure metals.
logger (
log_utils.CustomLogger) – Logger.
- extend_G_funx()[source]
Make function that computes G from site fractions.
Here the vacancy site fraction is at its equilibrium value.
- extend_MU_funx()[source]
Make function that computes MU from site fractions.
Here the vacancy site fraction is at its equilibrium value (MU_Va = 0).
- thermodynamics.make_G_fun(comps, pdict, TK)[source]
Make function to compute Gibbs free energy.
Process parameters and call
thermo_functions.G_model().- Parameters:
comps (list of str) – System constituents.
pdict (dict) – Thermodynamic parameters.
TK (float) – Temperature in Kelvin.
- Returns:
fun – Function that takes composition array (shape (n_inds, nz)) as argument, and returns Gibbs free energy evaluated on this composition grid (shape (nz,)).
- Return type:
function
- thermodynamics.make_MU_fun(comps, pdict, TK)[source]
Make function that computes chemical potentials.
Process parameters and call
thermo_functions.MU_model(). Use a Redlich-Kister polynomial with binary interactions of order 0 and 1 (seethermo_functions.MU_model()).- Parameters:
comps (list of str) – System constituents.
pdict (dict of floats) – Thermodynamic parameters.
TK (float) – Temperature in Kelvin.
- Returns:
fun – Function that takes composition array (shape (n_inds, nz)) as argument, and returns chemical potentials evaluated on this composition grid (shape (n_comps, nz)).
- Return type:
function
- thermodynamics.make_yVa_fun(comps, pdict, TK)[source]
Make function to compute equilibrium vacancy site fractions.
Process parameters and call
thermo_functions.yVa_model().- Parameters:
comps (list of str) – System constituents, including Va.
pdict (dict) – Thermodynamic parameters.
TK (float) – Temperature in Kelvin.
- Returns:
fun – Function that takes atom fractions (shape (n_inds, nz)) as argument, and returns the equilibrium vacancy fraction evaluated on this composition array (shape (nz,)).
- Return type:
function