UNIQUAC (universal quasichemical) is an excess-Gibbs model for nonideal liquid mixtures. It separates two reasons why real mixing differs from ideal dilution: molecules occupy different amounts of space, and unlike neighbors interact differently from like neighbors. Use it when you have consistent molecular size/area parameters and fitted directional interaction parameters for your components. It does not infer these from chemical names.
The first two terms below are combinatorial: they account for molecular size and shape. The final residual term describes energetic contacts. Here “residual” is a part of the excess model, not an EOS departure from an ideal gas. The complete is relative to an ideal liquid solution; it is not the total Gibbs energy of mixing. Differentiation gives , where activity is . Fugacity also needs a reference fugacity, as explained in the shared introduction.
With the usual coordination number , UNIQUAC adds the three contributions:
The mole fraction , volume fraction , and surface fraction use the same amounts but different weights:
The dimensionless molecular parameters and represent relative
volume and surface area, respectively. They are not measured volumes in L/mol
or areas in square metres. The contact factor weights how the
surface of component l interacts with component k; matrix direction matters.
Two conventions are worth stating explicitly, because both are easy to get wrong when transcribing a published table.
r_k and q_k belong to whole
molecules, and tau(l,k) couples component l to component k. The
interaction matrices are therefore (nc,nc), with nc the number of
components.tau(k,k) = 1 for a pure
component, and the excess Gibbs energy of a pure component vanishes. Off-
diagonal coefficients are directional and generally not symmetric.Use setup_uniquac(qs, rs, aij, bij, cij, dij, eij), preferably with keywords.
The first array is area (qs) and the second is volume (rs). Both have
length nc, should be positive, and must use the same component order as n.
Each optional interaction array has shape (nc,nc); omitted arrays are zero.
Coefficient in ln(tau) |
Units with T in kelvin |
|---|---|
aij |
Dimensionless |
bij/T |
bij in K |
cij*log(T) |
Dimensionless cij; logarithm uses the numerical kelvin value, equivalent to ln(T/1 K) |
dij*T |
dij in 1/K |
eij*T**2 |
eij in 1/K² |
These are coefficients of , not of . In particular,
for a constant tabulated in kelvin, pass
bij(i,j) = -Delta_U(i,j)/R; the minus sign belongs in the conversion. Normally
all diagonal coefficients are zero so . Off-diagonal coefficients
are directional and generally not symmetric; tau(l,k) enters the sum for
component k. Match your source’s definition before deciding to transpose it.
Do not reuse NRTL coefficients simply because some arguments have similar names.
The runnable example is below the optional derivative reference. For a structure-based model without molecular binary fits, see UNIFAC, which uses a related physical decomposition but different parameters.
The methods evaluate derivatives for you. The rewritten expressions below avoid
ratios such as 0/0 in when a component amount is zero, as long
as the total amount and weighted sums remain positive.
Some of the model’s terms can be simplified to reduce the complexity of the
derivatives. This also allows the model to be evaluated at mole vectors n
where some of the amounts are zero.
Being the total number of moles in the system. The expression for the Excess Gibbs free energy can be rewritten as:
:
:
derivatives are not really needed, but we also provide them.
:
:
Differentiating each term of the first compositional derivative respect to we get:
Example from: Gmehling et al. (2012) [2]
An example of a mixture of water–ethanol–benzene at 298.15 K with constant [K]:
| Water | Ethanol | Benzene |
|---|---|---|
| 0 | 526.02 | 309.64 |
| −318.06 | 0 | −91.532 |
| 1325.1 | 302.57 | 0 |
Read that table as . Because the model expects the
coefficients of , and , a constant
energy difference becomes a coefficient of , namely
bij(l,k) = -Delta_U(l,k)/R. That is exactly the minus sign in the code
below. It is the single most common transcription error: entering the table
values directly produces a model with the wrong sign of interaction.
program uniquac_activity
use yaeos, only: pr, setup_uniquac, UNIQUAC
implicit none
integer, parameter :: nc = 3
real(pr) :: rs(nc)
real(pr) :: qs(nc)
real(pr) :: b(nc, nc)
real(pr) :: n(nc)
real(pr) :: ln_gammas(nc)
real(pr) :: T
real(pr) :: Ge
type(UNIQUAC) :: model
rs = [0.92_pr, 2.1055_pr, 3.1878_pr]
qs = [1.4_pr, 1.972_pr, 2.4_pr]
T = 298.15_pr
! Calculate bij from DUij. We need -DU/R to get bij
b(1,:) = [0.0_pr, -526.02_pr, -309.64_pr]
b(2,:) = [318.06_pr, 0.0_pr, 91.532_pr]
b(3,:) = [-1325.1_pr, -302.57_pr, 0.0_pr]
model = setup_uniquac(qs=qs, rs=rs, bij=b)
n = [2.0_pr, 2.0_pr, 8.0_pr]
call model%ln_activity_coefficient(n, T, ln_gammas)
call model%excess_gibbs(n, T, Ge=Ge)
print *, "gamma: water, ethanol, benzene = ", exp(ln_gammas)
print *, "GE per mole [bar L/mol] = ", Ge/sum(n)
print *, "Composition = ", n/sum(n)
end program uniquac_activity
This is a complete program. Table rows and explicit b(i,:) assignments use the
same water–ethanol–benzene order. Explicit rows avoid the column-major ordering
trap of reshape. The amounts total 12 mol, so the composition is not the raw
n vector. Coefficients are dimensionless; they may be above or below 1, and
the output of ln_activity_coefficient must be exponentiated before interpreting
it as gamma. No claim of a stable, single liquid follows from this property
evaluation of a trial composition.
The printed coefficients show how differently the components respond: water’s
coefficient is far above 1 while ethanol’s is below 1, and benzene sits near
the middle. Comparing these numbers with the values reported for the same
system in the source reference is the most direct check that your parameter
table and sign convention were transcribed correctly. A sign error in bij
reverses this pattern, so it shows up immediately here.
The five optional matrices allow a richer temperature dependence. Passing
dij or eij adds a linear or quadratic term to , and cij adds a
logarithmic term. For example, to give one pair a temperature-dependent
interaction, add to the program above:
real(pr) :: dij(nc, nc)
real(pr) :: eij(nc, nc)
dij = 0.0_pr
eij = 0.0_pr
dij(1, 2) = 1.0e-3_pr
model = setup_uniquac(qs=qs, rs=rs, bij=b, dij=dij, eij=eij)
The units follow the table in Constructor inputs:
dij in 1/K and eij in 1/K². aij adds a constant offset to .
Use these terms only when your parameter source provides them; they are not
defaults that improve accuracy by themselves.
The most consequential mistake with UNIQUAC is a unit or sign error in the
interaction parameters, because the model still returns a plausible-looking
number. Use kelvin, never Celsius. If your energy table is in J/mol, convert
it with a matching gas constant before setting bij in kelvin, and remember the
minus sign described earlier. Do not swap qs and rs: changing molecular
geometry is not equivalent to changing binary interaction energies, and the
two errors are easy to make because the argument order is area first.
A useful sanity check is the ideal limit. Unlike NRTL, setting the
interaction matrices to zero does not generally make UNIQUAC ideal, because
the combinatorial contribution survives: different-sized molecules still
occupy different amounts of space. Identical r and q for every component
together with zero interaction coefficients does give the ideal result, and is
worth checking once when you first set up a model.
Two further checks apply to every variant. Scaling all amounts must leave the activity coefficients unchanged. At a pure composition, the present component’s coefficient approaches 1 for properly referenced parameters; coefficients of absent solutes need not approach 1, because a solute at infinite dilution has its own limiting value.
Finally, a fitted temperature dependence is not a license for extrapolation. Very large exponents can overflow, and the model has no general electrolyte or near-critical treatment and supplies no density or vapor properties.
Next, evaluate excess enthalpy and other shared properties and
compare with your parameter source. For phase splits, use
stability and equilibrium methods, not the
sign of Ge or the size of a single coefficient alone.