Skip to content

Extended UNIQUAC

DWSIM Plus

Available with a DWSIM Plus (Patreon) subscription.

Extended UNIQUAC (Thomsen) activity-coefficient package for aqueous electrolyte solutions, alcohol-water-salt mixtures and salt solubility, with the speciation solved by a chemical-equilibrium solver over the equilibrium reactions of the flowsheet.

DWSIM.Extensions.PropertyPackages.Electrolytes.PropertyPackages.ExtendedUNIQUACPropertyPackage
Assembly DWSIM.Extensions.PropertyPackages.Electrolytes.dll · Object ← PropertyPackage ← ElectrolyteBasePropertyPackage ← BaseElectrolytePropertyPackage ← ExtendedUNIQUACPropertyPackage
Name in the flowsheet Extended UNIQUAC (Aqueous Electrolytes) · FluentAPI PropertyPackages.Plus.ExtendedUNIQUAC

Scope

The package describes aqueous electrolyte solutions over wide ranges of concentration and temperature, with solid-liquid-vapor equilibrium of salts and their hydrates: fractional crystallization (Na2SO4·10H2O, K2SO4, NaHCO3), scaling of produced and geothermal waters (CaSO4, BaSO4, SrSO4, CaCO3), salt solutions in water-alcohol mixtures, and aqueous MEA and MDEA with carbamate speciation. Ions, salts and hydrates are compounds of the electrolyte database, and the speciation and the phase split are solved together by the same equilibrium solver as in the Electrolyte NRTL package, over the equilibrium reactions of the flowsheet. The option GenerateSolubilityReactions adds a dissolution equilibrium for each salt in the compound list that no reaction covers, with K from the Gibbs energies of formation, which is how the example finds the KCl solubility.

The model of Thomsen adds an extended Debye-Hückel term to UNIQUAC: ln γi = ln γicomb + ln γires + ln γiDH. The combinatorial term uses the volume and surface parameters r and q (coordination number 10), the residual term the interaction energies uij(T) = uij0 + uijT(T - 298.15), and the Debye-Hückel term has b = 1.5 (kg/mol)1/2 and A(T) = 1.131 + 1.335×10-3(T - 273.15) + 1.164×10-5(T - 273.15)2. Ions take the unsymmetric reference (the infinite dilution values of the combinatorial and residual terms are subtracted), water the symmetric one. The individual ion activity coefficients follow the convention of the parameter set; only their products, such as the mean activity coefficient, compare with measurements.

Parameters. ExtendedUNIQUAC_Parameters.json holds r and q for 31 species and about 120 binary interaction parameters: the Thomsen 1997 set (H2O, H+, Na+, K+, NH4+, Cl-, SO42-, HSO4-, NO3-, OH-, CO32-, HCO3-, S2O82-), Ca2+, Ba2+, Sr2+ and Mg2+ (García 2005, 2006), Cs+, seven alcohols (methanol, ethanol, the propanols and butanols), CO2(aq) and carbamate, and MEA, MEAH+, MEA carbamate, MDEA and MDEAH+. It also carries the pressure dependence of Ksp for BaSO4, SrSO4, CaSO4, gypsum, NaCl and CaCO3, and standard-state data for each species. The r, q and u0 values were checked line by line against the source publications (rNa+ = 1.4034, qCl- = 10.197, u0(H2O, Na+) = 733.286). Parameters can be replaced in the package editor or regressed with the Extended UNIQUAC fitting utility.

The liquid density, viscosity, thermal conductivity, osmotic coefficient, freezing point, pH and ionic strength are computed as in the Electrolyte NRTL package, with the water activity of the Extended UNIQUAC model.

Limitations

  • Recommended for 0 to 200 °C with the Thomsen set (to 250 °C for the García systems), ionic strength up to 6 mol/kg, 1 to 1000 bar.
  • Transition-metal ions (Fe, Cu, Zn, Ni, Co, Mn, Cd, Pb, Ag, Al, Cr) have no parameters in the Thomsen convention: their interaction energies default to zero and r = q = 1. Use the Electrolyte NRTL package for them.
  • The vapor is ideal unless VaporPhaseFugacityCalculationMode is set to Peng-Robinson.

Example

This code runs on every build of this site, and the output below is what it printed.

fs = (Flowsheet.Create("ExUNIQUACExample")
      .WithCompounds("Water", "Potassium Ion", "Chloride (ion)", "Potassium Chloride")
      .WithPropertyPackage(PropertyPackages.Plus.ExtendedUNIQUAC))

# Let solid KCl and its ions reach equilibrium: the dissolution reaction
# KCl(s) = K+ + Cl- is generated from the Gibbs energies of formation
pp = list(fs.Inner.PropertyPackages.Values)[0].__implementation__   # the package class
pp.GenerateSolubilityReactions = True

kg_water = 1.0 / 0.018015          # mol of water in 1 kg
# 6 mol of KCl (as its ions) per kg of water: more than dissolves at 25 C
slurry = (fs.AddMaterialStream("Slurry").At(Q.Celsius(25.0), Q.Bar(1.01325))
          .SetCompoundMolarFlow("Water", kg_water)
          .SetCompoundMolarFlow("Potassium Ion", 6.0)
          .SetCompoundMolarFlow("Chloride (ion)", 6.0))
# 2 mol/kg, below saturation
solution = (fs.AddMaterialStream("Solution").At(Q.Celsius(25.0), Q.Bar(1.01325))
            .SetCompoundMolarFlow("Water", kg_water)
            .SetCompoundMolarFlow("Potassium Ion", 2.0)
            .SetCompoundMolarFlow("Chloride (ion)", 2.0))

fs.Solve()

s = slurry.Object
print(f"KCl solubility           = {s.Phases[3].Compounds['Potassium Ion'].MolarFlow:.2f} mol/kg water")
print(f"KCl crystallized         = {s.Phases[7].Compounds['Potassium Chloride'].MolarFlow:.2f} mol/kg water")

liq = solution.Object.Phases[3]
# mean activity coefficient (molality scale) and water activity
gamma_pm = math.sqrt(liq.Compounds["Potassium Ion"].ActivityCoeff * liq.Compounds["Chloride (ion)"].ActivityCoeff)
a_w = liq.Compounds["Water"].ActivityCoeff * liq.Compounds["Water"].MoleFraction
print(f"2 mol/kg KCl: gamma(+-)  = {gamma_pm:.3f}")
print(f"2 mol/kg KCl: water act. = {a_w:.4f}")
print(f"2 mol/kg KCl: density    = {liq.Properties.density:.1f} kg/m3")

Output

KCl solubility           = 4.63 mol/kg water
KCl crystallized         = 1.37 mol/kg water
2 mol/kg KCl: gamma(+-)  = 0.571
2 mol/kg KCl: water act. = 0.9355
2 mol/kg KCl: density    = 1080.8 kg/m3

DWSIM 10.2.11.0, generated 2026-10-08.

Property methods

How the package calculates each property, as it reports it in PropertyMethodsInfo (the property package editor shows the same list).

Property Method
Vapor fugacity Ideal / Peng-Robinson EOS
Liquid fugacity Extended UNIQUAC Activity Coefficient + Henry's Law / Vapor Pressure
Vapor enthalpy, entropy, Cp/Cv Ideal Gas / Lee-Kesler
Liquid enthalpy, entropy, Cp/Cv Ideal Gas - Vaporization Enthalpy; the Extended UNIQUAC excess enthalpy is added when IncludeExcessEnthalpy is on
Vapor density Ideal Gas / Peng-Robinson EOS
Liquid density Water density correlation plus the molar volumes of the ions (with an ionic-strength term), from the electrolyte database; molecular solutes as pure liquids
Vapor viscosity Experimental / Lucas / Jossi-Stiel-Thodos
Liquid viscosity Experimental / Letsou-Stiel
Vapor thermal conductivity Experimental / Ely-Hanley
Liquid thermal conductivity Experimental / Latini
Surface tension Experimental / Brock-Bird
Solid density Experimental Data / User-Defined
Solid enthalpy, entropy, Cp/Cv Experimental Solid Cp / From Liquid Phase Enthalpy + Enthalpy of Fusion

Default flash algorithm: Nested_Loops_VLE.

Configuration saved with the flowsheet

The package writes its settings to the simulation file (SaveData) and reads them back on load (LoadData). The elements below are the ones this package adds to those of every property package, as written for the example.

Element Content in the example What it holds
ElectrolyteFlash_ReactionSetID DefaultSet Reaction set of the electrolyte flash of the base package; this package's flash takes every equilibrium reaction of the flowsheet and does not read it
ElectrolyteFlash_Tolerance 1E-07 Tolerance of the same base flash, not used by this package
ElectrolyteFlash_MaximumIterations 200 Iteration limit of the same base flash, not used by this package
IncludeExcessEnthalpy false Adds the excess enthalpy and entropy of the activity model to the liquid (off by default; the numerical temperature derivative slows PH and PS flashes)
GenerateSolubilityReactions true Gives every salt of the compound list that no flowsheet reaction covers a dissolution equilibrium with its ions, with K from the Gibbs energies of formation (off by default)
UseReactiveKvalues false When on, the rigorous column takes its K-values from the speciation (off by default; much slower than the generic activity route)
UseCustomParameters false Whether the parameter set in CustomParametersJson replaces the shipped ExtendedUNIQUAC_Parameters.json
CustomParametersJson empty The custom parameter set (r, q and uij0, uijT) as JSON, empty when the shipped database is used
Settings common to every property package, as saved for the example
Element Value
Type 94 characters
ComponentName Extended UNIQUAC (Aqueous Electrolytes)
ComponentDescription Extended UNIQUAC model
Tag Extended UNIQUAC (Aqueous Electrolytes)
UseHenryConstants true
AutoEstimateMissingNRTLUNIQUACParameters true
UseImmiscibleListForLiquid2InitialEstimates true
SingleCompoundCheckThreshold 0.99999
OverrideKvalFugCoeff false
OverrideEnthalpyCalculation false
OverrideEntropyCalculation false
LiquidDensityCalculationMode_Subcritical Rackett_and_ExpData
LiquidDensityCalculationMode_Supercritical Rackett_and_ExpData
LiquidDensity_CorrectExpDataForPressure true
LiquidDensity_UsePenelouxVolumeTranslation true
LiquidViscosityCalculationMode_Subcritical ExpData
LiquidViscosityCalculationMode_Supercritical Letsou_Stiel
LiquidViscosity_CorrectExpDataForPressure true
LiquidViscosity_MixingRule MoleAverage
VaporPhaseFugacityCalculationMode Ideal
SolidPhaseFugacityCalculationMethod FromLiquidFugacity
SolidPhaseFugacity_UseIdealLiquidPhaseFugacity false
SolidPhaseEnthalpy_UsesCp false
EnthalpyEntropyCpCvCalculationMode LeeKesler
LiquidEnthalpyEntropyCpCvCalculationMode_EOS EOS
LiquidFugacity_UsePoyntingCorrectionFactor true
ActivityCoefficientModels_IgnoreMissingInteractionParameters false
IgnoreVaporFractionLimit false
IgnoreSalinityLimit false
CalculateAdditionalMaterialStreamProperties true
FlashCalculationApproach NestedLoops
DisplayMissingCompoundPropertiesWarning false
ForcedSolids []
PropertyOverrides {}
FlashSettings 36 Setting entries

Learn more

API members

Public members declared by this class. Inherited members are documented on the base classes.

Constructors

ExtendedUNIQUACPropertyPackage()
public ExtendedUNIQUACPropertyPackage()
Public Sub New()

ExtendedUNIQUACPropertyPackage(bool)
Parameter Type Description
comode Boolean
public ExtendedUNIQUACPropertyPackage(bool comode)
Public Sub New(comode As Boolean)

Properties

CustomParametersJson: JSON-serialized ExUNIQUACDatabase with custom parameters.

JSON-serialized ExUNIQUACDatabase with custom parameters.

public string CustomParametersJson { get; set; }
Public Property CustomParametersJson As String

ImplementsCrossPlatformEditor
public override bool ImplementsCrossPlatformEditor { get; }
Public Overrides ReadOnly Property ImplementsCrossPlatformEditor As Boolean

MobileCompatible
public override bool MobileCompatible { get; }
Public Overrides ReadOnly Property MobileCompatible As Boolean

UseCustomParameters: Whether custom parameters are in effect.

Whether custom parameters are in effect.

public bool UseCustomParameters { get; set; }
Public Property UseCustomParameters As Boolean

Methods

CalculateChemicalEquilibria(double, double): Resolve o equilíbrio químico Extended UNIQUAC para a temperatura T e pressão P usando o cache pré-computado por...

Resolve o equilíbrio químico Extended UNIQUAC para a temperatura T e pressão P usando o cache pré-computado por BuildEquilibriumCache. Apenas as operações T-dependentes são executadas por chamada: · EvaluateK(T) para cada reação de equilíbrio. Tudo o mais (carga do banco, classificação de espécies, resolução de nomes, parâmetros de interação u0/uT) foi resolvido uma única vez em RunPostMaterialStreamSetRoutine. Nota: os parâmetros CoordinationNumber (Z) e Debye–Hückel (b, A0–A2) do banco são lidos mas não podem ser injetados no ExtendedUNIQUACEngine sem modificar o engine (constantes privadas Z_COORD = 10, B_DH = 1.5 com polinômio Sander 1986). Reservados para extensão futura.

Parameter Type Description
T Double Temperatura [K].
P Double Pressão [Pa].
public override EquilibriumResult CalculateChemicalEquilibria(double T, double P)
Public Overrides Function CalculateChemicalEquilibria(T As Double, P As Double) As EquilibriumResult

CalculateChemicalEquilibria(double, double, double[]): Sobrecarga de CalculateChemicalEquilibria que aceita a composição molar da mistura explicitamente, sem modificar a...

Sobrecarga de CalculateChemicalEquilibria que aceita a composição molar da mistura explicitamente, sem modificar a corrente. O vetor x deve ter o mesmo comprimento e a mesma ordem que _equilSpecies, preenchido por BuildEquilibriumCache() ao final de RunPostMaterialStreamSetRoutine. Essa ordem coincide com a de CurrentMaterialStream.Phases[0].Compounds.Values no momento em que a rotina foi chamada. O fator de escala de molalidade (base 1 kg de solvente) é recompensado a partir de x, de modo que a chamada é completamente independente da composição armazenada na corrente.

Parameter Type Description
T Double Temperatura [K].
P Double Pressão [Pa].
x Double[] Frações molares na ordem de _equilSpecies. Comprimento deve ser igual a _equilSpecies.Count.
public override EquilibriumResult CalculateChemicalEquilibria(double T, double P, double[] x)
Public Overrides Function CalculateChemicalEquilibria(T As Double, P As Double, x As Double()) As EquilibriumResult

Clone()
public override PropertyPackage Clone()
Public Overrides Function Clone() As PropertyPackage

ConvertIonsToSaltsInPlace(double[], double): Converts a solid-phase amount vector (indexed by RET_VNAMES) from ionic species to their parent salts using...

Converts a solid-phase amount vector (indexed by RET_VNAMES) from ionic species to their parent salts using precipitation reactions, least soluble first. Amounts in, amounts out, on the same basis and without renormalising: each salt formed takes its ions away, so every element is kept. Called by DryStateSolids. Default implementation is a no-op; overridden by each PP that has access to the resolved precipitation reactions.

Parameter Type Description
vs Double[]
T Double
public override void ConvertIonsToSaltsInPlace(double[] vs, double T)
Public Overrides Sub ConvertIonsToSaltsInPlace(vs As Double(), T As Double)

DisplayEditingForm()
public override void DisplayEditingForm()
Public Overrides Sub DisplayEditingForm()

DW_CalcFugCoeff(Array, double, double, State): Calculates fugacity coefficients for the specified composition at the specified conditions.

Calculates fugacity coefficients for the specified composition at the specified conditions.

Parameter Type Description
Vx Array Vector of doubles containing the molar composition of the mixture.
T Double Temperature in K
P Double Pressure in Pa
st State Mixture state (Liquid or Vapor)
public override double[] DW_CalcFugCoeff(Array Vx, double T, double P, State st)
Public Overrides Function DW_CalcFugCoeff(Vx As Array, T As Double, P As Double, st As State) As Double()

GetEditingForm(): Returns the binary interaction parameter editor of this package.

Returns the binary interaction parameter editor of this package.

public override object GetEditingForm()
Public Overrides Function GetEditingForm() As Object

LoadData(List<XElement>): Reads back what SaveParameterData writes.

Reads back what SaveParameterData writes. A file saved before these elements existed leaves the values at their defaults (built-in database).

Parameter Type Description
data List<XElement>
public override bool LoadData(List<XElement> data)
Public Overrides Function LoadData(data As List(Of XElement)) As Boolean

PopulateCrossPlatformEditor(object): The Avalonia editor; see AvaloniaPackageEditors.

The Avalonia editor; see AvaloniaPackageEditors.

Parameter Type Description
container Object
public override void PopulateCrossPlatformEditor(object container)
Public Overrides Sub PopulateCrossPlatformEditor(container As Object)

ReturnInstance(string)
Parameter Type Description
typename String
public override object ReturnInstance(string typename)
Public Overrides Function ReturnInstance(typename As String) As Object

RunPostMaterialStreamSetRoutine()
public override void RunPostMaterialStreamSetRoutine()
Public Overrides Sub RunPostMaterialStreamSetRoutine()

SaveData(): Writes IncludeExcessEnthalpy, GenerateSolubilityReactions and UseReactiveKvalues after the data the base package...

Writes IncludeExcessEnthalpy, GenerateSolubilityReactions and UseReactiveKvalues after the data the base package saves, so the three options travel with the flowsheet file and with Clone.

public override List<XElement> SaveData()
Public Overrides Function SaveData() As List(Of XElement)

Fields

ClassId
public const string ClassId = "10E3CFEE-8604-436C-99F1-A7B09141DBF8"
Public Const ClassId As String = "10E3CFEE-8604-436C-99F1-A7B09141DBF8"