Gibbs Excess Models

Gibbs Excess Models

Excess properties are properties of mixtures which quantify the non-ideal behavior of real mixtures. They are defined as the difference between the value of the property in a real mixture and the value that would exist in an ideal solution under the same conditions.

Gibbs excess models are defined in terms of a mathematical expression that describes the excess Gibbs energy of a mixture as a function of the composition of the components in the mixture and temperature. Then, the other excess properties can be derived from the excess Gibbs energy derivatives.

Routines and Methods

Activity coefficients are calculated from the excess Gibbs energy using the following expression:

derivatives

The derivatives of the activity coefficients with respect to the mole numbers:

The temperature derivative of the activity coefficients:

You may notice that yaeos calculates the derivatives of the . If for some reason you need the derivatives of the activity coefficients, you may find useful the following expressions:

Example

program main
use yaeos, only: pr
use yaeos, only: Groups, setup_unifac, UNIFAC

type(UNIFAC) :: model

integer, parameter :: nc = 3

type(Groups) :: molecules(nc)

real(pr) :: n(nc), T, ln_gamma(nc), dln_gamma_dT(nc)
real(pr) :: dln_gamma_dn(nc, nc)

T = 298.15_pr
n = [20.0_pr, 70.0_pr, 10.0_pr]

! ! Ethane [CH3]
molecules(1)%groups_ids = [1]
molecules(1)%number_of_groups = [2]

! ! Ethanol [CH3, CH2, OH]
molecules(2)%groups_ids = [1, 2, 14]
molecules(2)%number_of_groups = [1, 1, 1]

! ! Methylamine [CH3-NH2]
molecules(3)%groups_ids = [28]
molecules(3)%number_of_groups = [1]

! setup UNIFAC model
model = setup_unifac(molecules)

! Calculate ln_gamma and its derivatives
call model%ln_gamma(n, T, ln_gamma, dln_gamma_dT, dln_gamma_dn)

print *, "ln_gamma = ", ln_gamma
print *, "dln_gamma_dT = ", dln_gamma_dT
print *, "dln_gamma_dn = ", dln_gamma_dn
end program main

Excess enthalpy

From the Gibbs-Helmholtz equation [1]:

We can calculate the excess enthalpy from the excess Gibbs energy as:

The derivatives of the excess enthalpy can be calculated as:

Example

To simplify the example, we will use the same code as the previous example, ommited here for brevity. The following code calculates the excess enthalpy and its derivatives.

real(pr) :: H_E, dH_E_dT, dH_E_dn(nc)

! Calculate excess enthalpy and its derivatives
call model%excess_enthalpy(n, T, HE, dHE_dT, dHE_dn)

print *, "HE = ", HE
print *, "dHE_dT = ", dHE_dT
print *, "dHE_dn = ", dHE_dn

Excess entropy

Finally, excess entropy can be calculated from the excess Gibbs energy and excess enthalpy as:

Replacing :

The derivatives of the excess entropy can be calculated as:

Example

To simplify the example, we will use the same code as the previous example, ommited here for brevity. The following code calculates the excess entropy and its derivatives.

real(pr) :: SE, dSE_dT, dSE_dn(nc)

! Calculate excess entropy and its derivatives
call model%excess_entropy(n, T, SE, dSE_dT, dSE_dn)

print *, "S_E = ", SE
print *, "dSE_dT = ", dSE_dT
print *, "dSE_dn = ", dSE_dn

References

[1] https://en.wikipedia.org/wiki/Gibbs%E2%80%93Helmholtz_equation