Reference state, standard state, and ideal contributions

H0S0ReferenceState

class simu.app.thermo.contributions.basic.H0S0ReferenceState

Bases: ThermoContribution

This contribution defines the reference state based on enthalpy of formation and standard entropy. It requires the following parameters:

Parameter

Description

Symbol

dh_form

Molar enthalpy of formation vector

\(\Delta_f h\)

s_0

Vector of standard entropies

\(s_0\)

T_ref

Reference temperature

\(T_\mathrm{ref}\)

p_ref

Reference pressure

\(T_\mathrm{ref}\)

Based on this, the reference state is defined in therms of entropy and chemical potentials:

Property

Description

Symbol

S

Reference state entropy of the system

\(S\)

mu

Reference state chemical potential vector

\(\mu\)

T_ref

Reference temperature (same as parameter)

\(T_\mathrm{ref}\)

p_ref

Reference pressure (same as parameter)

\(p_\mathrm{ref}\)

The contribution does not support any options.

\[\begin{split}S &= \sum_i s_{0,i}\, n_i\\ \mu_i &= \Delta_f h_i - T\,s_{0,i}\end{split}\]

LinearHeatCapacity

class simu.app.thermo.contributions.basic.LinearHeatCapacity

Bases: ThermoContribution

This contribution implements a simple heat capacity, being linear in temperature. It normally builds on a reference state and yields the standard state model. It requires the following parameters:

Parameter

Description

Symbol

cp_a

Molar heat capacity coefficient vector

\(c_{p,a}\)

cp_b

Molar heat capacity coefficient vector

\(c_{p,b}\)

Heat capacity is here defined as

\[\begin{split}\Delta T := T-T_\mathrm{ref}\\ c_{p,i} = c_{p,a,i} + \Delta T\,c_{p,b,i}\end{split}\]

The contribution does not define new properties, but builds on entropy S (\(S\)) and chemical potential mu (\(\mu\)). With the following definitions:

\[\begin{split}\Delta h_i &= \left (c_{p,a,i} + \frac12\Delta T\,c_{p,b,i}\right )\, \Delta T\\ \Delta s_i &= (c_{p,a,i} - c_{p,b,i}\,T_\mathrm{ref})\, \ln \frac{T}{T_\mathrm{ref}} + c_{p,b,i}\,\Delta T\\\end{split}\]

The properties are updated as

\[\begin{split}S &\leftarrow S + \sum_i \Delta s_i\,n_i\\ \mu_i &\leftarrow \mu_i + \Delta h_i - T\,\Delta s_i\end{split}\]

The contribution model domain is defined for positive temperatures only, due to a logarithmic contribution to entropy.

BarinHeatCapacity

class simu.app.thermo.contributions.basic.BarinHeatCapacity

Bases: ThermoContribution

This contribution defines the Barin heat capacity expression, slightly expanded by including a \(T^{-1}\) term. We introduce a temperature scaling parameter \(T_s\) [K] to align the physical dimension of all parameters:

\[t = \frac{T}{T_s}\quad t_\mathrm{ref} = \frac{T_\mathrm{ref}}{T_s}\]
\[\begin{split}c_{p,i}(T) = a_i + b_i\,(t - t_\mathrm{ref}) + c_i\,(t^2 - t_\mathrm{ref}^2) + d_i\,(t^3 - t_\mathrm{ref}^3) + e_i\,(t^{-1} - t_\mathrm{ref}^{-1})\\ + f_i\,(t^{-2} - t_\mathrm{ref}^{-2}) + g_i\,(t^{-3} - t_\mathrm{ref}^{-3})\end{split}\]

from here, integration yields

\[\Delta_{c_p} h_i = \int_{T_\mathrm{ref}}^{T} c_{p,i}(\tau)\,\mathrm{d}\tau\]

and

\[\Delta_{c_p} s_i = \int_{T_\mathrm{ref}}^{T} \frac{c_{p,i}(\tau)}{\tau}\, \mathrm{d}\tau\]

The expression for chemical potential is then

\[\Delta_{c_p} \mu_i= \Delta_{c_p} h_i^0 - T\,\Delta_{c_p} s_i^0\]

StandardState

class simu.app.thermo.contributions.basic.StandardState

This contribution assumes the current state to be the standard state and tags the following properties:

Property

Origin

S_std

S

p_std

p_ref

mu_std

mu

The contribution does not support any options or parameters.

IdealMix

class simu.app.thermo.contributions.basic.IdealMix

Bases: ThermoContribution

This contribution supplies the ideal mix entropy contribution, applicable for both liquid and gas phases. It does not require any parameters nor supports options.

The contribution does not define new properties, but builds on entropy S (\(S\)) and chemical potential mu (\(\mu\)). With \(\Delta s_i := -R\,\ln n_i/N\), we update

\[\begin{split}S &\leftarrow S + \sum_i \Delta s_i\,n_i\\ \mu_i &\leftarrow \mu_i - T\,\Delta s_i\end{split}\]

The contribution model domain is limited to positive quantities in order to prevent negative arguments to the logarithmic functions. One could enable also the third quadrant (all mole numbers negative), but doing so and thereby allowing the solver to jump between these two nearly disconnected domains has proven to be challenging in terms of solver robustness.

GibbsIdealGas

class simu.app.thermo.contributions.basic.GibbsIdealGas

Bases: ThermoContribution

This contribution supplements the ideal gas entropy contribution and defines the volume property in Gibbs coordinates, i.e. with volume as a function of pressure. The main use of this class is to actually represent an ideal gas model, while most non-ideal gas phase models are equations of state and formulated in Helmholtz coordinates.

Based on the previously provided reference pressure p_ref and \(\Delta s := -R\,\ln p/p_\mathrm{ref}\), the update is

\[\begin{split}S &\leftarrow S + \Delta s\,N\\ \mu_i &\leftarrow \mu_i - T\,\Delta s\end{split}\]

Volume is defined as

\[V = \frac{N\,R\,T}{p}\]

Due to the logarithmic term in entropy, the contribution model domain is limited to positive pressures.

HelmholtzIdealGas

class simu.app.thermo.contributions.basic.HelmholtzIdealGas

Bases: ThermoContribution

This contribution supplements the ideal gas entropy contribution and defines the pressure property in Helmholtz coordinates, i.e. with pressure as function of volume. This is the common base contribution for most equations of state. Based on the previously provided reference pressure p_ref and

\[\Delta s := -R\,\ln \frac{N\,R\,T}{V\,p_\mathrm{ref}}\]

the update is

\[\begin{split}S &\leftarrow S + \Delta s\,N\\ \mu_i &\leftarrow \mu_i - T\,\Delta s\end{split}\]

Pressure is defined as

\[p = \frac{N\,R\,T}{V}\]

Due to the logarithmic term in entropy, the contribution model domain is limited to positive volumes.

ConstantGibbsVolume

class simu.app.thermo.contributions.basic.ConstantGibbsVolume

Bases: ThermoContribution

This contribution defines a mixture with constant molar volumes and hence zero compressibility and thermal expansion. This is an easy and sufficient way to describe a condensed phase at moderate pressures in limited temperature ranges. Mixing volume is not considered either, but can be added via additional contributions.

The sole parameter is the molar volume for each species:

Parameter

Description

Symbol

v_n

Molar volume vector

\(v_n\)

The system volume is then calculated as

\[V = \sum_i v_{n,i}\,n_i\]

For the chemical potential, this yields, given pressure p and reference pressure p_ref:

\[\mu_i \leftarrow \mu_i + v_{n,i}\,(p - p_\mathrm{ref})\]

Note

The volume definition has a slight impact on the chemical potential, as shown in above equation. For a typical condensed phase however, say water, \(v_n = 1.8\cdot 10^{-5}\ \mathrm{m^3/mol}\), and if pressures are in the range of few bars, \(\Delta \mu < 10\ \mathrm{J/mol}\). This yields a 0.4 % change in the activity coefficient.

MolecularWeight

class simu.app.thermo.contributions.basic.MolecularWeight

Bases: ThermoContribution

This contribution defines the molecular weights as a species vector, based on the underlying simu.SpeciesDefinition definitions.

ChargeBalance

class simu.app.thermo.contributions.basic.ChargeBalance

Bases: ThermoContribution

This contribution defines a charge balance residual, if there are charged species. A ValueError is raised if only either positive or negative charged species exist.

Given the presents of opposite charged species, the residual defined, based on the molar quantities \(n_i\) is

\[\sum_i n_i \cdot c_i = 0\]

Here, the charges \(c_i\) are extracted from the species definition.

By default, the unit for the residual is e for states and e / s for flows. This can be altered by the following options:

  • The option state_unit defines the unit used for states. If flow_unit is not given, it will be defined as state_unit / s.

  • The option flow_unit defines the unit used for flows. It does not impact the state_unit value.