2.9. Thermodynamic properties

This module is used for calculating various thermodynamic properties using Helmholtz free energy.

qha.thermodynamics.pressure(vs, free_energies)[source]

Calculate the pressure as a function of temperature and volume, i.e.,

\[P = - \bigg( \frac{ \partial F(T, V) }{ \partial V } \bigg)_T.\]
Parameters
  • vs (array(float64, 1d, A)) – A vector of volumes.

  • free_energies (array(float64, 2d, A)) – A matrix, the free energy as a function of temperature and volume, i.e., \(F(T, V)\).

Return type

array(float64, 2d, A)

Returns

A matrix, the pressure as a function of temperature and volume, i.e., \(P(T,V)\).

qha.thermodynamics.entropy(temperature, free_energies)[source]

Calculate the entropy as a function of temperature and volume, i.e.,

\[S = - \bigg( \frac{ \partial F(T, V) }{ \partial T } \bigg)_V.\]
Parameters
  • temperature (array(float64, 1d, A)) – A vector of temperature.

  • free_energies (array(float64, 2d, A)) – A matrix, the free energy as a function of temperature and volume, i.e., \(F(T, V)\).

Return type

array(float64, 2d, A)

Returns

A matrix, the entropy as a function of temperature and volume, i.e., \(S(T,V)\).

qha.thermodynamics.thermodynamic_potentials(temperature, vs, free_energies, ps)[source]

Calculate the enthalpy \(H(T, V)\), the internal energy \(U(T, V)\), and the Gibbs free energy \(G\) on a \((T, V)\) grid from Helmholtz free energy \(F(T, V)\) by

\[\begin{split}U(T, V) &= F(T, V) + T S(T, V), \\ H(T, V) &= U(T, V) + P(T, V) V, \\ G(T, V) &= F(T, V) + P(T, V) V.\end{split}\]
Parameters
  • temperature (array(float64, 1d, A)) – A vector of temperature.

  • vs (array(float64, 1d, A)) – A vector of volumes.

  • free_energies (array(float64, 2d, A)) – A matrix, the free energy as a function of temperature and volume, i.e., \(F(T, V)\).

  • ps (array(float64, 2d, A)) – A matrix, the pressure as a function of temperature and volume, i.e., \(P(T, V)\).

Returns

A dictionary that contains the enthalpy \(H(T, V)\), the internal energy \(U(T, V)\), and the Gibbs free energy \(G\) on a \((T, V)\) grid. They can be retrieved by 'U', 'H', or 'G' keys, respectively.

qha.thermodynamics.volume(vs, desired_ps, ps)[source]

Convert the volumes as a function of temperature and pressure, i.e., on a \((T, P)\) grid.

Parameters
  • vs (array(float64, 1d, A)) – A vector of volumes.

  • desired_ps (array(float64, 1d, A)) – A vector of desired pressures.

  • ps (array(float64, 2d, A)) – A matrix, the pressure as a function of temperature and volume, i.e., \(P(T,V)\), in atomic unit.

Return type

array(float64, 2d, A)

Returns

A matrix, the volume as a function of temperature and pressure, i.e., \(V(T, P)\).

qha.thermodynamics.thermal_expansion_coefficient(temperature, vs)[source]

Calculate the thermal expansion coefficient by

\[\alpha = \frac{ 1 }{ V } \bigg( \frac{ \partial V }{ \partial T } \bigg)_P.\]
Parameters
  • temperature (array(float64, 1d, A)) – A vector of temperature.

  • vs (array(float64, 2d, A)) – A matrix, the volume as a function of temperature and pressure, i.e., \(V(T, P)\).

Return type

array(float64, 2d, A)

Returns

A matrix, the thermal expansion coefficient as a function of temperature and pressure, i.e., \(\alpha(T, P)\).

qha.thermodynamics.gruneisen_parameter(vs, bt, alpha, cv)[source]

Calculate the Grüneisen parameter by

\[\gamma = \frac{ \alpha B_T V }{ C_V }.\]
Parameters
  • vs (array(float64, 2d, A)) – A matrix, the volume as a function of temperature and pressure, i.e., \(V(T, P)\).

  • bt (array(float64, 2d, A)) – A matrix, the isothermal bulk modulus as a function of temperature and pressure, i.e., \(B_T(T, P)\).

  • alpha (array(float64, 2d, A)) – A matrix, the thermal expansion coefficient as a function of temperature and pressure, i.e., \(\alpha(T, P)\).

  • cv (array(float64, 2d, A)) – A matrix, the volumetric heat capacity as a function of temperature and pressure, i.e., \(C_V(T, P)\).

Return type

array(float64, 2d, A)

Returns

A matrix, the thermodynamic Grüneisen parameter as a function of temperature and pressure, i.e., \(\gamma(T, P)\).

qha.thermodynamics.isothermal_bulk_modulus(vs, ps)[source]

Calculate the isothermal bulk modulus by

\[B_T = - V \bigg( \frac{ \partial P }{ \partial V } \bigg)_T.\]
Parameters
  • vs (array(float64, 1d, A)) – A vector of volumes.

  • ps (array(float64, 2d, A)) – A matrix, the pressure as a function of temperature and volume, i.e., \(P(T, V)\).

Return type

array(float64, 2d, A)

Returns

A matrix, the isothermal bulk modulus, as a function of temperature and volume, i.e., \(B_T(T, V)\).

qha.thermodynamics.adiabatic_bulk_modulus(bt, alpha, gamma, temperature)[source]

Calculate the adiabatic bulk modulus by

\[B_S = B_T \big( 1 + \alpha \gamma T \big).\]
Parameters
  • bt (array(float64, 2d, A)) – A matrix, the isothermal bulk modulus, as a function of temperature and pressure, i.e., \(B_T(T, P)\).

  • alpha (array(float64, 2d, A)) – A matrix, the thermal expansion coefficient as a function of temperature and pressure, i.e., \(\alpha(T, P)\).

  • gamma (array(float64, 2d, A)) – A matrix, the thermodynamic Grüneisen parameter as a function of temperature and pressure, i.e., \(\gamma(T, P)\).

  • temperature (array(float64, 1d, A)) – A vector of temperature.

Return type

array(float64, 2d, A)

Returns

A matrix, the adiabatic bulk modulus, as a function of temperature and pressure, i.e., \(B_S(T,P)\).

qha.thermodynamics.bulk_modulus_derivative(ps, bt)[source]

Calculate the first-order derivative of bulk modulus with respect to pressure by

\[B_T' = \bigg( \frac{ \partial B_T }{ \partial P } \bigg).\]
Parameters
  • ps (array(float64, 1d, A)) – A vector of pressures.

  • bt (array(float64, 2d, A)) – A matrix, the isothermal bulk modulus, as a function of temperature and pressure, i.e., \(B_T(T, P)\).

Return type

array(float64, 2d, A)

Returns

A matrix, the isothermal bulk modulus, as a function of temperature and pressure, i.e., \(B_T'(T, P)\).

qha.thermodynamics.isobaric_heat_capacity(cv, alpha, gamma, temperature)[source]

Calculate the isobaric heat capacity by

\[C_P = C_V \big( 1 + \alpha \gamma T \big).\]
Parameters
  • cv (array(float64, 2d, A)) – A matrix, the volumetric heat capacity, \(C_V(T, P)\).

  • alpha (array(float64, 2d, A)) – A matrix, the thermal expansion coefficient as a function of temperature and pressure, i.e., \(\alpha(T, P)\).

  • gamma (array(float64, 2d, A)) – A matrix, the thermodynamic Grüneisen parameter as a function of temperature and pressure, i.e., \(\gamma(T, P)\).

  • temperature (array(float64, 1d, A)) – A vector of temperature.

Return type

array(float64, 2d, A)

Returns

A matrix, the isobaric specific heat capacity as a function of temperature and pressure, i.e., \(C_P(T,P)\).

qha.thermodynamics.volumetric_heat_capacity(temperature, internal_energies)[source]

Calculate the volumetric heat capacity by

\[C_V = \bigg( \frac{ \partial U }{ \partial T } \bigg).\]
Parameters
  • temperature (array(float64, 1d, A)) – A vector of temperature.

  • internal_energies (array(float64, 2d, A)) – A matrix, the internal energy as a function of temperature and volume, i.e., \(U(T, V)\).

Return type

array(float64, 2d, A)

Returns

A matrix, the volumetric heat capacity as a function of temperature and volume, i.e., \(C_V(T, V)\).