Skip to content

Reaktoro (Aqueous Electrolytes)

DWSIM Plus

Available with a DWSIM Plus (Patreon) subscription.

Aqueous electrolyte package that hands the phase and chemical equilibrium of each flash to Reaktoro (SUPCRT07 database), with the species of the flowsheet compounds in an aqueous and an ideal-gas phase.

DWSIM.Thermodynamics.ReaktoroPropertyPackage.ReaktoroPropertyPackage
Assembly DWSIM.Thermodynamics.ReaktoroPropertyPackage.dll · Object ← PropertyPackage ← ElectrolyteBasePropertyPackage ← ReaktoroPropertyPackage
Name in the flowsheet Reaktoro (Aqueous Electrolytes) · FluentAPI PropertyPackages.Plus.ReaktoroAqueous

Scope

The package hands the phase and chemical equilibrium of every flash to Reaktoro 2, called through its C interface. Each flowsheet compound maps to a species of the SUPCRT07 database (supcrt07-organics): an aqueous species, a gaseous species or both. Reaktoro then minimizes the Gibbs energy of an aqueous phase and an ideal-gas phase built from those species, so the speciation follows from the standard-state data of the database and needs no reactions in the flowsheet. Typical uses are gas solubility in water and brines (CO2, H2S, NH3, O2, N2), acid-base speciation and the pH of simple aqueous systems. The same library drives the Gibbs Reactor (Reaktoro).

Compounds. Only compounds of the package's map can be used; any other stops the flash with a message.

Kind Compounds
Ions Hydron, Hydroxide, Sodium (ion), Potassium Ion, Lithium (ion), Cesium (ion), Ammonium (ion), Chloride (ion), Bromine (ion), Iodine Ion, Nitrate (ion), Sulfate (ion), Hydrogen sulfate (ion), Bicarbonate (ion), Carbonate (ion), Bisulfide (ion), Sulfide (ion), Perchlorate (ion)
Dissolved salts (aqueous ion pairs) NaCl, KCl, LiCl, CsCl, NaBr, KBr, CsBr, NaI, KI, CsI, MgSO4, NaOH
Gases, aqueous and gaseous Water, Carbon dioxide, Carbon monoxide, Hydrogen, Hydrogen sulfide, Ammonia, Oxygen, Nitrogen, Sulfur dioxide, Helium, Xenon
Gaseous only Methane, Ethylene, Argon
Aqueous acids Hydrogen chloride, Nitric acid

Properties. The aqueous activity coefficients come from Reaktoro. Ions enter the liquid fugacity by molality times activity coefficient; water and the dissolved gases by activity coefficient times vapor pressure, or by a Henry constant above their critical temperature. The vapor is an ideal gas. The liquid enthalpy is the ideal-gas value less the heat of vaporization, plus the electrolyte term computed with the Reaktoro activity coefficients; the liquid density is the electrolyte model of DWSIM (water plus the molar volumes of the ions). The stream pH is -log10 of the activity of Hydron, which must be in the compound list.

Limitations

  • There is no mineral phase: salts do not precipitate.
  • The gaseous phase is ideal, which limits the package to low and moderate pressures.

Example

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

fs = (Flowsheet.Create("ReaktoroExample")
      .WithCompounds("Water", "Carbon dioxide", "Hydron", "Hydroxide",
                     "Bicarbonate (ion)", "Carbonate (ion)")
      .WithPropertyPackage(PropertyPackages.Plus.ReaktoroAqueous))

# 1 kg of water with 0.1 mol of CO2, more than dissolves at 1 atm: the rest stays as gas
kg_water = 1.0 / 0.018015
s = (fs.AddMaterialStream("CO2 + water").At(Q.Celsius(25.0), Q.Bar(1.01325))
     .SetCompoundMolarFlow("Water", kg_water)
     .SetCompoundMolarFlow("Carbon dioxide", 0.1))

fs.Solve()

liq, gas = s.Object.Phases[3], s.Object.Phases[2]
m = lambda name: liq.Compounds[name].MolarFlow / (liq.Compounds["Water"].MolarFlow * 0.018015)
P = s.Object.Phases[0].Properties.pressure
print(f"CO2 partial pressure  = {gas.Compounds['Carbon dioxide'].MoleFraction * P / 1e5:.3f} bar")
print(f"Dissolved CO2         = {m('Carbon dioxide'):.4f} mol/kg")
print(f"Bicarbonate           = {m('Bicarbonate (ion)'):.2e} mol/kg")
print(f"pH                    = {liq.Properties.pH:.2f}")
print(f"Liquid density        = {liq.Properties.density:.1f} kg/m3")

Output

CO2 partial pressure  = 0.982 bar
Dissolved CO2         = 0.0334 mol/kg
Bicarbonate           = 1.25e-04 mol/kg
pH                    = 3.91
Liquid density        = 996.6 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 Gas
Liquid fugacity Reaktoro Activity Coefficient + Vapor Pressure / Henry's Law (ions by molality)
Vapor enthalpy, entropy, Cp/Cv Ideal Gas
Liquid enthalpy, entropy, Cp/Cv Ideal Gas - Vaporization Enthalpy + electrolyte term with the Reaktoro activity coefficients
Vapor density Ideal Gas
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: Electrolyte.

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 equilibrates with Reaktoro 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
Settings common to every property package, as saved for the example
Element Value
Type 68 characters
ComponentName Reaktoro (Aqueous Electrolytes)
ComponentDescription 120 characters
Tag Reaktoro (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

ReaktoroPropertyPackage()
public ReaktoroPropertyPackage()
Public Sub New()

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

Properties

FlashBase: Returns the FlashAlgorithm object instance for this property package.

Returns the FlashAlgorithm object instance for this property package.

public override FlashAlgorithm FlashBase { get; }
Public Overrides ReadOnly Property FlashBase As FlashAlgorithm

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

Methods

AUX_PVAPi(string, double)
Parameter Type Description
sub1 String
T Double
public override double AUX_PVAPi(string sub1, double T)
Public Overrides Function AUX_PVAPi(sub1 As String, T As Double) As Double

AUX_Z(double[], double, double, PhaseName)
Parameter Type Description
Vx Double[]
T Double
P Double
state PhaseName
public override double AUX_Z(double[] Vx, double T, double P, PhaseName state)
Public Overrides Function AUX_Z(Vx As Double(), T As Double, P As Double, state As PhaseName) As Double

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

DW_CalcEnthalpy(Array, double, double, State): Calculates the enthalpy of a mixture.

Calculates the enthalpy of a mixture.

Parameter Type Description
Vx Array Vector of doubles containing the molar composition of the mixture.
T Double Temperature (K)
P Double Pressure (Pa)
st State State enum indicating the state of the mixture (liquid or vapor).
public override double DW_CalcEnthalpy(Array Vx, double T, double P, State st)
Public Overrides Function DW_CalcEnthalpy(Vx As Array, T As Double, P As Double, st As State) As Double

DW_CalcEnthalpyDeparture(Array, double, double, State): Calculates the enthalpy departure of a mixture.

Calculates the enthalpy departure of a mixture.

Parameter Type Description
Vx Array Vector of doubles containing the molar composition of the mixture.
T Double Temperature (K)
P Double Pressure (Pa)
st State State enum indicating the state of the mixture (liquid or vapor).
public override double DW_CalcEnthalpyDeparture(Array Vx, double T, double P, State st)
Public Overrides Function DW_CalcEnthalpyDeparture(Vx As Array, T As Double, P As Double, st As State) As Double

DW_CalcEntropy(Array, double, double, State): Calculates the entropy of a mixture.

Calculates the entropy of a mixture.

Parameter Type Description
Vx Array Vector of doubles containing the molar composition of the mixture.
T Double Temperature (K)
P Double Pressure (Pa)
st State State enum indicating the state of the mixture (liquid or vapor).
public override double DW_CalcEntropy(Array Vx, double T, double P, State st)
Public Overrides Function DW_CalcEntropy(Vx As Array, T As Double, P As Double, st As State) As Double

DW_CalcEntropyDeparture(Array, double, double, State): Calculates the entropy departure of a mixture.

Calculates the entropy departure of a mixture.

Parameter Type Description
Vx Array Vector of doubles containing the molar composition of the mixture.
T Double Temperature (K)
P Double Pressure (Pa)
st State State enum indicating the state of the mixture (liquid or vapor).
public override double DW_CalcEntropyDeparture(Array Vx, double T, double P, State st)
Public Overrides Function DW_CalcEntropyDeparture(Vx As Array, T As Double, P As Double, st As State) As Double

DW_CalcEquilibrium(FlashSpec, FlashSpec)
Parameter Type Description
spec1 FlashSpec
spec2 FlashSpec
public override void DW_CalcEquilibrium(FlashSpec spec1, FlashSpec spec2)
Public Overrides Sub DW_CalcEquilibrium(spec1 As FlashSpec, spec2 As FlashSpec)

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()

DW_CalcKvalue(double[], double[], double, double, string): Calculates K-values of components in a mixture.

Calculates K-values of components in a mixture.

Parameter Type Description
Vx Double[] Vector of doubles containing the molar composition of the liquid phase.
Vy Double[] Vector of doubles containing the molar composition of the vapor phase.
T Double Temperature of the system.
P Double Pressure of the system.
type String
public override double[] DW_CalcKvalue(double[] Vx, double[] Vy, double T, double P, string type = "LV")
Public Overrides Function DW_CalcKvalue(Vx As Double(), Vy As Double(), T As Double, P As Double, type As String = "LV") As Double()

DW_CalcPhaseProps(Phase)
Parameter Type Description
Phase Phase
public override void DW_CalcPhaseProps(Phase Phase)
Public Overrides Sub DW_CalcPhaseProps(Phase As Phase)

DW_CalcProp(string, Phase): Provides a wrapper function for CAPE-OPEN CalcProp/CalcSingleProp functions.

Provides a wrapper function for CAPE-OPEN CalcProp/CalcSingleProp functions.

Parameter Type Description
property String The property to be calculated.
phase Phase The phase where the property must be calculated for.
public override void DW_CalcProp(string property, Phase phase)
Public Overrides Sub DW_CalcProp([property] As String, phase As Phase)

DW_CalcSolidPhaseProps(): Provides a default implementation for solid phase property calculations in CAPE-OPEN mode.

Provides a default implementation for solid phase property calculations in CAPE-OPEN mode. Should be used by all derived propety packages.

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

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

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

Fields

ClassId
public const string ClassId = "c7c54cac-387d-460a-9ecc-a9e6d247a227"
Public Const ClassId As String = "c7c54cac-387d-460a-9ecc-a9e6d247a227"