Skip to content

Create a fluid and select Equation of State and Mixing Rule

Even Solbraa edited this page May 1, 2021 · 5 revisions

A fluid is created using a constructor specifying the Equation of State to be used. All fluids inherit from the SystemInterface class. A fluid using the SRK-EoS is created using the code:

SystemInterface testSystem = new SystemSrkEos(273.15+10.0, 450.0);

Components are added to the fluid using the addComponent method, eg.:

testSystem.addComponent("nitrogen", 0.616);

Examples of components in the embedded database are; methane, CO2, nitrogen, ethane, propane, i-butane, n.butane, water, methanol, etc.

The mixing rule is set using:

testSystem.setMixingRule("classic");

Classic means using temperature independent kij interaction parameters. By setting the mixing rule to "no" - all kij are set to zero. Alternatively by specifying the mixing rule number (classic with kij is number 2):

testSystem.setMixingRule(2);

Methods available after creating a fluid can be see in the fluid, phase and component interfaces

Pure component names in embedded neqsim database: https://github.com/equinor/neqsim/blob/master/src/main/resources/neqsim_component_names.txt

Thermodynamic models

NeqSim implements a number of thermodynamic models. Theese models spans from the traditional equations of state (eg. SRK, PR), but alos more advanced models such as the CPA-EoS and variants of the SAFT model. Traditional GE models such as NRTL, UNIFAC and others are also implemented. The parameters used for all these models are stored in the parameter database. All fluid packages/thermodynamic models implements the SystemInterface (in this folder).

The most used Equations of State are Modelname : Class SRK-EoS : SystemSrkEos PR-EoS: SystemPrEos CPA-EoS: SystemSrkCPAs UMR-PRU-EoS: UMRPRUMCEos

Mixing Rules

A number of mixing rules have been implemented. In general you can use any mixing rule with any model. THat means after specifying the model, the mixing rule have to be specified. If no mixing rule is specified, the default mixing rule will typical be the classic mixing rule with zero kij. Mixing rules are implemented in the the classes found here.

The most used mixing rules are: Description : name : number

  • Classic with kij=0 : 'no' : 1
  • Classic with single kij from database : 'classic' : 2
  • Huron-Vidal mixing rules : 'HV' : 4
  • Wong Sandler : 'WS' : 5
  • Classic CPA (one kij) : 'CPA-Mix' : 7
  • Classic with temperature dependent kij : 'classic-T' : 8
  • Classic with temperature dependent kij for CPA : 'classic-T-cpa : 9
  • Classic with temperature and composition dependent kij: 'classic-Tx-cpa': 10

Adding new thermdynamic models

See https://github.com/equinor/neqsim/wiki/Adding-a-thermodynamic-model-in-NeqSim

Clone this wiki locally