Thermodynamic Properties

EOS parametrization

The EOS’s

The EOS implemented are:

  • Rose-Vinet (RV)

  • Tight-binding second-moment-approximation (TB-SMA)

  • Third order Birch-Murnaghan (BM3)

  • Mie-Gruneisen (MG)

  • Murnaghan (Mu1)

  • Poirier-Tarantola (PT)

  • Fourth order Birch-Murnaghan (BM4)

  • Second order Murnaghan (Mu2)

Two description of the internal energy through inter-atomic potentials has been included as well:

  • Morse

  • EAM

The parameters can be entered by the user or fitted if there is data available.

Example

>>> import numpy as np
>>> import debyetools.potentials as potentials
>>> V_data = np.array([11.89,12.29,12.70,13.12,13.55,13.98,14.43,14.88,15.35,15.82,16.31,16.80,17.31,17.82,18.34,18.88,19.42,19.98,20.54,21.12,21.71])*(1E-30*6.02E+23)
>>> E_data = np.array([-2.97,-3.06,-3.14,-3.20,-3.26,-3.30,-3.33,-3.36,-3.37,-3.38,-3.38,-3.38,-3.37,-3.36,-3.34,-3.32,-3.30,-3.27,-3.24,-3.21,-3.17])*(1.60218E-19 * 6.02214E+23)
>>> params_initial_guess = [-3e5, 1e-5, 7e10, 4]
>>> Birch_Murnaghan = potentials.BM()
>>> Birch_Murnaghan.fitEOS(V_data, E_data, params_initial_guess)
array([-3.26551e+05,9.82096e-06,6.31727e+10,4.31057e+00])

Source code

The following is the source for the description of the third order Birch-Murnaghan EOS:

class debyetools.potentials.BM(*args, units='J/mol', parameters='')[source]

Third order Birch-Murnaghan EOS and derivatives.

E0(V: float | numpy.ndarray) float | numpy.ndarray[source]

Internal energy.

Parameters

V (float|np.ndarray) – Volume.

Returns

E0(V)

Return type

float|np.ndarray

E04min(V: float, pEOS: ndarray) float[source]

Energy for minimization.

Parameters
  • V (float) – Volume.

  • pEOS (np.ndarray) – parameters.

Returns

E0.

Return type

float

d2E0dV2_T(V: float | numpy.ndarray) float | numpy.ndarray[source]

Internal energy second volume derivative.

Parameters

V (float|np.ndarray) – Volume.

Returns

d2E0dV2_T(V)

Return type

float|np.ndarray

d3E0dV3_T(V: float | numpy.ndarray) float | numpy.ndarray[source]

Internal energy third volume derivative.

Parameters

V (float|np.ndarray) – Volume.

Returns

d3E0dV3_T(V)

Return type

float|np.ndarray

d4E0dV4_T(V: float | numpy.ndarray) float | numpy.ndarray[source]

Internal energy fourth volume derivative.

Parameters

V (float|np.ndarray) – Volume.

Returns

d4E0dV4_T(V)

Return type

float|np.ndarray

d5E0dV5_T(V: float | numpy.ndarray) float | numpy.ndarray[source]

Internal energy fifth volume derivative.

Parameters

V (float|np.ndarray) – Volume.

Returns

d5E0dV5_T(V)

Return type

float|np.ndarray

d6E0dV6_T(V: float | numpy.ndarray) float | numpy.ndarray[source]

Internal energy sixth volume derivative.

Parameters

V (float|np.ndarray) – Volume.

Returns

d6E0dV6_T(V)

Return type

float|np.ndarray

dE0dV_T(V: float | numpy.ndarray) float | numpy.ndarray[source]

Internal energy volume derivative.

Parameters

V (float|np.ndarray) – Volume.

Returns

dE0dV_T(V)

Return type

float|np.ndarray

error2min(P: ndarray, Vdata: ndarray, Edata: ndarray) ndarray[source]

Error for minimization.

Parameters
  • P (np.ndarray) – E0 parameters.

  • Vdata (np.ndarray) – Volume data.

  • Edata (np.ndarray) – Energy data.

Returns

Error.

Return type

np.ndarray

fitEOS(Vdata: ndarray, Edata: ndarray, initial_parameters: ndarray = None, fit: bool = True) None[source]

Parameters fitting.

Parameters
  • Vdata (np.ndarray) – Input volume data.

  • Edata (np.ndarray) – Target energy data.

  • initial_parameters (np.ndarray) – Initial guess.

  • fit (bool.) – True to run the fitting. False to just use the input parameters.

Returns

Optimal parameters.

Return type

np.ndarray

The other potentials are:

class debyetools.potentials.RV(*args, units='J/mol', parameters='')[source]

Rose-Vinet EOS and derivatives.

class debyetools.potentials.TB(*args, units='J/mol', parameters='')[source]

Thight-Binding second-order-approximation EOS and derivatives.

class debyetools.potentials.MG(*args, units='J/mol', parameters='')[source]

Mie-Gruneisen EOS and derivatives.

class debyetools.potentials.MU(*args, units='J/mol', parameters='')[source]

Murnaghan EOS and derivatives.

class debyetools.potentials.PT(*args, units='J/mol', parameters='')[source]

Poirier-Tarantola EOS and derivatives.

class debyetools.potentials.BM4(*args, units='J/mol', parameters='')[source]

Fourth order Birch-Murnaghan EOS and derivatives.

class debyetools.potentials.MU2(*args, units='J/mol', parameters='')[source]

Second order Murnaghan EOS and derivatives.

class debyetools.potentials.MP(*args, units='J/mol', parameters='', prec=10)[source]

Morse potential and derivatives.

Parameters
  • args (list) – formula, primitive_cell, basis_vectors, cutoff, number_of_neighbor_levels.

  • parameters (list_of_floats) – Morse potential parameters.

class debyetools.potentials.EAM(*args, units='J/mol', parameters='')[source]

EAM potential and derivatives.

Parameters
  • args (Tuple[str,np.ndarray,np.ndarray, float, int]) – formula, primitive_cell, basis_vectors, cutoff, number_of_neighbor_levels.

  • parameters (np.ndarray) – EAM potential parameters.

Poisson’s ratio

The Poisson’s ratio used in the calculation of the Debye temperature can entered manually by the user or calculated from the Elastic moduli matrix.

Example

>>> from debyetools.poisson import poisson_ratio
>>> EM = EM = load_EM(folder_name+'/OUTCAR.eps')
>>> nu = poisson_ratio(EM)

Source Code

debyetools.poisson.poisson_ratio(EM: ndarray, quiet: bool = False) Union[float, Tuple[float, float, float, float, float, float, float, float]][source]

Calculation of the Poisson’s ratio from elastic moduli matrix.

Parameters
  • EM (np.ndarray) – Elastic moduli matrix.

  • quiet (bool) – (optional) If verbose.

Returns

Poisson’s ratio.

Return type

float

debyetools.poisson.quiet_pa(EM: ndarray) Tuple[float, float, float, float, float, float, float, float][source]

Calculation of the Poisson’s ratio from elastic moduli matrix.

Parameters

EM (np.ndarray) – Elastic moduli matrix.

Returns

BR, BV, B, GR, GV, S, AU, nu

Return type

Tuple[float,float,float,float,float,float,float,float]

Thermodynamic Properties

The thermodynamic properties are calculated by first creating the instance of a nDeb object. Once the parametrization is complete and the temperature and volumes are know (this can be done using the nDeb.min_F method), there is just an evaluation of the thermodynamic properties left using nDeb.eval_tprops.

Example: Minimization of the free energy.

>>> from debyetools.ndeb import nDeb
>>> from debyetools import potentials
>>> from debyetools.aux_functions import gen_Ts,load_V_E
>>> m = 0.021971375
>>> nu = poisson_ratio (EM)
>>> p_electronic = fit_electronic(V_data, p_el_inittial, E, N, Ef)
>>> p_defects = [8.46, 1.69, 933, 0.1]
>>> p_anh, p_intanh = [0,0,0], [0, 1]
>>> V_data, E_data = load_V_E('/path/to/SUMMARY', '/path/to/CONTCAR')
>>> eos = potentials.BM()
>>> peos = eos.fitEOS(V_data, E_data, params_initial_guess)
>>> ndeb = nDeb (nu , m, p_intanh , eos , p_electronic , p_defects , p_anh )
>>> T = gen_Ts ( T_initial , T_final , 10 )
>>> T, V = ndeb.min_G (T,  1e-5, P=0)
>>> V
array([9.98852539e-06, 9.99974297e-06, 1.00578469e-05, 1.01135875e-05,
       1.01419825e-05, 1.02392921e-05, 1.03467847e-05, 1.04650048e-05,
       1.05953063e-05, 1.07396467e-05, 1.09045695e-05, 1.10973163e-05])

Example: Evaluation of the thermodynamic properties:

>>> trprops_dict=ndeb.eval_props(T,V)
>>> tprops_dict['Cp']
array([4.02097531e-05, 9.68739597e+00, 1.96115210e+01, 2.25070513e+01,
       2.34086394e+01, 2.54037595e+01, 2.68478029e+01, 2.82106379e+01,
       2.98214145e+01, 3.20143195e+01, 3.51848547e+01, 3.98791392e+01])

Source code

class debyetools.ndeb.nDeb(nu: float, m: float, p_intanh: ndarray, EOS: object, p_electronic: ndarray, p_defects: ndarray, p_anh: ndarray, *args: object, units: str = 'J/mol', mode: str = 'jjsl', xsparams=(0, 0, 0, 0, 0, 0), r=1)[source]

Instantiate an object that contains all the parameters for the evaluation of the thermodynamic properties of a certain element or compound. Also contains the method that implements an original Debye formalism for the calculation of the thermodynamic properties.

Parameters
  • nu (float) – Poisson’s ratio.

  • m (float) – mass in Kg/mol-at

  • p_intanh (np.ndarray) – Intrinsic anharmonicity parameters: a0, m0, V0.

  • EOS (object) – Equation of state instance.

  • p_electronic (np.ndarray) – Electronic contribution parameters.

  • p_defects (np.ndarray) – Mono-vacancies defects contribution parameters: Evac00,Svac00,Tm,a,P2,V0.

  • p_anh (np.ndarray) – Excess contribution parameters.

  • mode (str) – Type of approximation of the Debye temperature (see vibrational contribution).

eval_Cp(T: ndarray, V: ndarray, P=None) dict[source]

Evaluates the Heat capacity of a given compound/element at (T,V).

Parameters
  • T (np.ndarray) – The temperature in Kelvin.

  • V (np.ndarray) – The volume in “units”.

Returns

A dictionary with the following keys: ‘T’: temperature, ‘V’: volume, ‘tD’: Debye temperature, ‘g’: Gruneisen parameter, ‘Kt’: isothermal bulk modulus, ‘Ktp’: pressure derivative of the isothermal bulk modulus, ‘Ktpp’: second order pressure derivative of the isothermal bulk modulus, ‘Cv’: constant-volume heat capacity, ‘a’: thermal expansion, ‘Cp’: constant-pressure heat capacity, ‘Ks’: adiabatic bulk modulus , ‘Ksp’: pressure derivative of the adiabatic bulk modulus, ‘G’: Gibbs free energy, ‘E’: total internal energy, ‘S’: entropy, ‘E0’: ‘cold’ internal energy defined by the EOS, ‘Fvib’: vibrational free energy, ‘Evib’: vibrational internal energy, ‘Svib’: vibrational entropy, ‘Cvvib’: vibrational heat capacity, ‘Pcold’: ‘cold’ pressure, ‘dPdT_V’: (dP/dT)_V, ‘G^2’: Ktp**2-2*Kt*Ktpp, ‘dSdP_T’: (dS/dP)_T, ‘dKtdT_P’: (dKt/dT)_P, ‘dadP_T’: (da/dP)_T, ‘dCpdP_T’: (dCp/dP)_T, ‘ddSdT_PdP_T’: (d2S/dTdP).

Return type

dict

eval_props(T: ndarray, V: ndarray, P=None) dict[source]

Evaluates the thermodynamic properties of a given compound/element at (T,V).

Parameters
  • T (np.ndarray) – The temperature in Kelvin.

  • V (np.ndarray) – The volume in “units”.

Returns

A dictionary with the following keys: ‘T’: temperature, ‘V’: volume, ‘tD’: Debye temperature, ‘g’: Gruneisen parameter, ‘Kt’: isothermal bulk modulus, ‘Ktp’: pressure derivative of the isothermal bulk modulus, ‘Ktpp’: second order pressure derivative of the isothermal bulk modulus, ‘Cv’: constant-volume heat capacity, ‘a’: thermal expansion, ‘Cp’: constant-pressure heat capacity, ‘Ks’: adiabatic bulk modulus , ‘Ksp’: pressure derivative of the adiabatic bulk modulus, ‘G’: Gibbs free energy, ‘E’: total internal energy, ‘S’: entropy, ‘E0’: ‘cold’ internal energy defined by the EOS, ‘Fvib’: vibrational free energy, ‘Evib’: vibrational internal energy, ‘Svib’: vibrational entropy, ‘Cvvib’: vibrational heat capacity, ‘Pcold’: ‘cold’ pressure, ‘dPdT_V’: (dP/dT)_V, ‘G^2’: Ktp**2-2*Kt*Ktpp, ‘dSdP_T’: (dS/dP)_T, ‘dKtdT_P’: (dKt/dT)_P, ‘dadP_T’: (da/dP)_T, ‘dCpdP_T’: (dCp/dP)_T, ‘ddSdT_PdP_T’: (d2S/dTdP).

Return type

dict

f2min(T: float, V: float, P: float) float[source]

free energy for minimization.

Parameters
  • T (float) – Temperature.

  • V (float) – Volume.

  • P (float) – Pressure.

Returns

Free energy.

Return type

float

min_G(T: ndarray, initial_V: float, P: float) Tuple[ndarray, ndarray][source]

Procedure for the calculation of the volume as function of temperature.

Parameters
  • T (list_of_floats) – Temperature.

  • initial_V (float) – initial guess.

  • P (float) – Pressure.

Returns

Temperature and Volume

Return type

Tuple[np.ndarray,np.ndarray]