Electrolyte models

ElectrolyteBasics

class simu.app.thermo.contributions.electrolytes.pitzer.ElectrolyteBasics

Bases: ThermoContribution

This contribution prepares some basic properties relevant for electrolyte systems.

Molality (\(b_i\)) is defined as the molar quantities per mass of solvent. Generalized, we consider all non-ionic species as solvent. With the charge vector \(c_i\), the Kronecker symbol for marking solvent components is

\[\begin{split}\delta_{si} = \begin{cases} 1\quad\text{for}\ c_i = 0\\ 0\quad\text{else} \end{cases}\end{split}\]

As such, \(m_s = \sum_i n_i\,M_i\,b_0\,\delta_{si}\) and molalities are defined as \(b_i = n_i / m_s\). Here, \(b_0 = 1\) mol/kg is a common factor used to yield dimensionless molalities.

Based on molality, ionic strength \(I\) is defined as

\[I = \frac12\,\sum_i b_i\,\left (\frac{c_i}{c_0}\right )^2\]

Again, to support the dimensionless mind of electro-chemists for empirical freedom, the charge is normalized by \(c_0 = 1\) e/mol.

To derive molality-based Gibbs excess contributions with respect to molar quantities, we pre-calculate the following derivatives:

\[\frac{\mathrm{d} m_s}{\mathrm{d} n_k} = M_k\,b_0\,\delta_{sk}\qquad \frac{\mathrm{d} I}{\mathrm{d} b_k} = \frac12 \left (\frac{c_k}{c_0} \right )^2\]

ExcessBasePitzer

class simu.app.thermo.contributions.electrolytes.pitzer.ExcessBasePitzer

Bases: ThermoContribution

The Pitzer model is formulated in terms of a reduced excess Gibbs energy contributions follows:

\[\frac{\Delta \chi G^\mathrm{ex}}{R\,T} = m_s\,\chi(T, b_i)\]

Both the long-range contribution (Pitzer-Debye-Hückel) and the short-range contribution expressed by binary and ternary parameters are expressed in terms of \(\chi(T, b_i)\).

The chemical potential is then

\[\frac{\Delta_\chi \mu_i}{R\,T} = \left [ \chi - \left . \sum_k\frac{\partial \chi}{\partial b_k}\right |_T\,\,b_k \right ]\,\frac{\mathrm{d} m_s}{\mathrm{d} n_i} + \left . \frac{\partial \chi}{\partial b_i} \right |_T\]

The entropy is

\[\Delta_\chi S = \left . -\frac{\partial \Delta \chi G^\mathrm{ex}}{\partial T} \right |_n = -R\,m_s\,\left [ \chi + T\,\left .\frac{\partial \chi}{\partial T} \right |_{n} \right ]\]

From the subclasses, the define_chi() method is to return for convenience partial derivatives with respect to molalities and ionic strength separately. The required combined derivative is then

\[\left . \frac{\partial \chi}{\partial b_i} \right |_T = \left . \frac{\partial \chi}{\partial b_i} \right |_{T, I} + \left . \frac{\partial \chi}{\partial I} \right |_{T, b}\, \frac{\mathrm{d} I}{\mathrm{d} b_k}\]
abstractmethod define_chi(
res: MutableMapping[str, Quantity],
) Mapping[str, Quantity]

Provide dimensionless residual contribution \(\chi(T, I, b_i)\) and the partial derivatives \(\chi_T\) (chi_t), \(\chi_I\) (chi_i) and \(\chi_{b}\) (chi_b).

PitzerDebyeHueckel

class simu.app.thermo.contributions.electrolytes.pitzer.PitzerDebyeHueckel

Bases: ExcessBasePitzer

The Pitzer-Debye-Hückel rule defines the long-range interaction as described in [Pit80].

A Debye-Hückel parameter is solely a function of temperature and defined as

\[A_\gamma =\sqrt{2\pi\, N_A\, m_0\,\rho_{\rm s}}\cdot \left [\frac{e^2}{4\pi\,\epsilon_0\epsilon_r\,k_B\,T} \right ]^{3/2}\]

Here, \(N_A\) is the Avogadro constant, \(e\) the electron charge, \(\epsilon_0\) the vacuum permittivity, and \(k_B\) the Boltzmann constant. Further, \(\rho_s\) the density and \(\epsilon_r\) the dielectric constant of the solvent.

One could consider the solvent properties as being temperature-dependent, but this is omitted, as the dominant impact is captured by the \(T^{-3/2}\) dependency, and the model was developed with the intention to keep the property values at 25 °C. Secondary impact of temperature is to be caught by parametrising the short-range binary and ternary interaction.

The dimensionless long-range contribution is then additionally a function of ionic strength \(I\).

\[\chi^\mathrm{PDH}(I) = -\frac43A_\gamma I^{3/2}\, \frac{\ln (1+b\sqrt{I})}{b\sqrt{I}}\]

The function \(\chi^\mathrm{PDH}(I)\) is a compatible dimensionless contribution as defined for the ExcessBasePitzer base-class.

The required derivatives are

\[\chi^\mathrm{PDH}_T = -\frac32\,\frac{\chi^\mathrm{PDH}}{T}\qquad \chi^\mathrm{PDH}_I = \frac{\chi^\mathrm{PDH}}{I} - \frac23\,A_\gamma\,\frac{\sqrt{I}}{1 + b\,\sqrt{I}}\qquad \chi^\mathrm{PDH}_b = 0\]

The contribution expects the following parameters:

Name

Symbol

Description

Unit

RHO_SOLVENT

\(\rho_s\)

Standard density of solvent

[kg/m3]

EPS_SOLVENT

\(\epsilon_r\)

Dielectric constant solvent

[-]

B

\(b\)

Ion size parameter

[-]

Generally, \(b = 1.2\) is used universally. For water, normally \(\rho_s = 998\ \mathrm{kg/m3}\) and \(\epsilon_r = 80\).

PitzerBinaryInteraction

class simu.app.thermo.contributions.electrolytes.pitzer.PitzerBinaryInteraction

Bases: ExcessBasePitzer

The binary interaction in the Pitzer model is dependent on temperature and ionic strength as:

\[\lambda_{ij}(T, I) = \beta^{(0)}_{ij}(T) + \frac{1-(1+2\sqrt{I})\,\exp(-2\sqrt{I})}{2\,I}\,\beta^{(1)}_{ij}(T)\]

with

\[\beta^{(k)}_{ij}(T) = \beta^{(k)}_{ij,1} + \beta^{(k)}_{ij,2}(T-\Theta) + \beta^{(k)}_{ij,3}\left (\frac1T-\frac1{\Theta}\right ) + \beta^{(k)}_{ij,4}\ln\frac{T}{\Theta} + \beta^{(k)}_{ij,5}\left (T^2-\Theta^2\right )\]

In other implementations, the interaction coefficients are assumed symmetric and hence accounted for twice. This is not the case in this fully sparse implementation. For each species pair \(i,j\), a contribution is defined as

\[\Delta_\lambda\chi = b_i\,b_j\,\lambda_{ij}(T, I)\]

The derivatives are coded manually with

\[\beta^{(k)}_{ij,T} = \beta^{(k)}_{ij,2} - \beta^{(k)}_{ij,3} \frac1{T^2} + \beta^{(k)}_{ij,4}\,\frac{1}{T} + 2\,\beta^{(k)}_{ij,5}\,T\]

as

\begin{align*} \Delta_\lambda\chi_T &= b_i\,b_j\,\lambda_{ij,T}(T, I)\quad\text{with}\quad \lambda_{ij,T}(T, I) = \beta^{(0)}_{ij,T} + \frac{1-(1+2\sqrt{I})\,\exp(-2\sqrt{I})}{2\,I}\,\beta^{(1)}_{ij,T}\\ \Delta_\lambda\chi_I &= b_i\,b_j\,\lambda_{ij,I}(T, I)\quad\text{with}\quad \lambda_{ij,I}(T, I) = \frac{(2\,I + 2\,\sqrt{I} + 1)\,\exp(-2\sqrt{I}) - 1}{2\,I^2}\, \beta^{(1)}_{ij}\\ \Delta_\lambda\boldsymbol{\chi}_b &= \lambda_{ij,T}(T, I)\,( b_i\,\mathbf{e}_j + b_j\,\mathbf{e}_i) \end{align*}

PitzerTernaryInteraction

class simu.app.thermo.contributions.electrolytes.pitzer.PitzerTernaryInteraction

Bases: ExcessBasePitzer

The ternary interaction in the Pitzer model is dependent only on temperature:

\[\Delta_\gamma \chi_{ijk} = \gamma_{ijk}(T)\,b_i\,b_j\,b_k\]

The interaction coefficients are parameterized as

\[\gamma_{ijk}(T) = \gamma_{ijk,1} + \gamma_{ijk,2}(T-\Theta) + \gamma_{ijk,3}\left (\frac1T-\frac1{\Theta}\right ) + \gamma_{ijk,4}\ln\frac{T}{\Theta} + \gamma_{ijk,5}\left (T^2-\Theta^2\right )\]

The derivatives are coded manually with

\[\gamma_{ijk,T} = \gamma_{ijk,2} - \gamma_{ijk,3} \frac1{T^2} + \gamma_{ijk,4}\,\frac{1}{T} + 2\,\gamma_{ijk,5}\,T\]

The required derivatives are provided analytically:

\[\Delta_{\gamma} \chi_{ijk, T} = \gamma_{ijk_T}\,b_i\,b_j\,b_k\qquad \Delta_{\gamma} \chi_{ijk, I} = 0\qquad \Delta_{\gamma} \chi_{ijk, m} = \gamma_{ijk}\,\left ( b_i\,b_j\,\mathbf{e}_k + b_i\,b_k\,\mathbf{e}_j + b_j\,b_k\,\mathbf{i}_k \right )\]