Skip to the content.

Mercury Thermodynamics in NeqSim

This page describes practical workflows for modeling elemental mercury ($Hg^0$) in hydrocarbon systems with NeqSim.

It is aligned with the PhD reference:

For mercury-containing natural gas and light hydrocarbon systems, use:

This model is the NeqSim SRK-TwuCoon variant used for mercury-focused calculations.

Minimal TPflash Example (Java)

SystemInterface fluid = new SystemSrkTwuCoonStatoilEos(273.15 - 172.0, 1.0);

fluid.addComponent("nitrogen", 2.97007999748152e-2);
fluid.addComponent("methane", 0.902244);
fluid.addComponent("ethane", 0.053167);
fluid.addComponent("propane", 0.010742);
fluid.addComponent("i-butane", 0.000902);
fluid.addComponent("n-heptane", 0.02692);
fluid.addComponent("mercury", 2.12608096955523e-10);

fluid.createDatabase(true);
fluid.setMixingRule(2);
fluid.setMultiPhaseCheck(true);

ThermodynamicOperations ops = new ThermodynamicOperations(fluid);
ops.TPflash();

// Optional post-processing examples
double pHg = fluid.getPhase(0).getComponent("mercury").getx() * fluid.getPressure();

A runnable repository example is available in:

Minimal TPflash Example (Python)

import neqsim

fluid = neqsim.thermo.system.SystemSrkTwuCoonStatoilEos(273.15 - 172.0, 1.0)
fluid.addComponent("nitrogen", 2.97007999748152e-2)
fluid.addComponent("methane", 0.902244)
fluid.addComponent("ethane", 0.053167)
fluid.addComponent("propane", 0.010742)
fluid.addComponent("i-butane", 0.000902)
fluid.addComponent("n-heptane", 0.02692)
fluid.addComponent("mercury", 2.12608096955523e-10)

fluid.createDatabase(True)
fluid.setMixingRule(2)
fluid.setMultiPhaseCheck(True)

ops = neqsim.thermodynamicoperations.ThermodynamicOperations(fluid)
ops.TPflash()

Mercury with UMR-PRU

In addition to SRK-TwuCoon, NeqSim also supports mercury calculations with UMR-PRU family models:

UMR-PRU is useful when you want a predictive UNIFAC-driven mixing-rule framework for non-ideal mixtures, while still using a cubic EOS backbone.

When to use UMR-PRU for mercury

Use UMR-PRU as a comparison or sensitivity model when:

For direct alignment with the mercury thesis workflows, SRK-TwuCoon-Statoil-EOS remains the primary baseline model.

Minimal UMR-PRU TPflash Example (Java)

SystemInterface fluid = new SystemUMRPRUEos(273.15 - 172.0, 1.0);

fluid.addComponent("nitrogen", 2.97007999748152e-2);
fluid.addComponent("methane", 0.902244);
fluid.addComponent("ethane", 0.053167);
fluid.addComponent("propane", 0.010742);
fluid.addComponent("i-butane", 0.000902);
fluid.addComponent("n-heptane", 0.02692);
fluid.addComponent("mercury", 2.12608096955523e-10);

fluid.createDatabase(true);
fluid.setMixingRule("HV", "UNIFAC_UMRPRU");
fluid.setMultiPhaseCheck(true);

ThermodynamicOperations ops = new ThermodynamicOperations(fluid);
ops.TPflash();

Minimal UMR-PRU TPflash Example (Python)

import neqsim

fluid = neqsim.thermo.system.SystemUMRPRUEos(273.15 - 172.0, 1.0)
fluid.addComponent("nitrogen", 2.97007999748152e-2)
fluid.addComponent("methane", 0.902244)
fluid.addComponent("ethane", 0.053167)
fluid.addComponent("propane", 0.010742)
fluid.addComponent("i-butane", 0.000902)
fluid.addComponent("n-heptane", 0.02692)
fluid.addComponent("mercury", 2.12608096955523e-10)

fluid.createDatabase(True)
fluid.setMixingRule("HV", "UNIFAC_UMRPRU")
fluid.setMultiPhaseCheck(True)

ops = neqsim.thermodynamicoperations.ThermodynamicOperations(fluid)
ops.TPflash()

For mercury studies, compare at least two models on the same fluid and conditions:

  1. SRK-TwuCoon-Statoil-EOS (baseline)
  2. UMR-PRU (predictive comparison)

Track differences in:

This gives a practical uncertainty band for design and interpretation.

Thesis-Derived BIP Usage in NeqSim

NeqSim uses INTER.csv as the main source of binary interaction parameters for SRK and PR family models.

For mercury-related systems, key updates can include:

When explicit rows are not available for mercury-heavy pseudo components, NeqSim can estimate $k_{ij}$ using a correlation of the form:

\[k_{ij} = A \cdot T_b + B \cdot MW + C\]

where:

Unit consistency is important: using $MW$ in kg/mol instead of g/mol changes $k_{ij}$ significantly.

Practical Validation Workflow

For a mercury thermodynamics validation study:

  1. Build one representative fluid from your process basis.
  2. Run TPflash over your operating pressure-temperature envelope.
  3. Track mercury partitioning between phases and partial pressure trends.
  4. Compare against thesis plots/tables at matching conditions.
  5. Document deviations and whether they are due to EOS limits, composition uncertainty, or BIP uncertainty.