NeqSim separates the thermodynamic state from phase-specific transport and interfacial properties. Establish equilibrium first, then initialize the physical-property calculations that depend on that state. The maintained physical-properties package guide contains complete, executable Java examples and the model tables.
Establish the thermodynamic state first
A flash calculation determines the stable phases and their compositions at the requested
conditions. After the flash, fluid.initPhysicalProperties() calculates density and transport
properties for the phases that exist.
Use this order:
- Define temperature, absolute pressure, composition, equation of state, and EOS mixing rule.
- Run the applicable flash, such as
new ThermodynamicOperations(fluid).TPflash(). - Select a
PhysicalPropertyModelset or an individual phase transport model. - Call
fluid.initPhysicalProperties(). - Read results from a named phase.
If temperature, pressure, composition, or phase-equilibrium settings change materially, run the
appropriate flash again before reinitializing physical properties. Calling
initPhysicalProperties() alone does not perform a new equilibrium calculation.
Cloning a phase retains its selected transport models and parameters. Every copied gas, oil, aqueous and solid property family belongs to the cloned phase, and each calculation method belongs to its copied family, including inactive families before the next initialization. Repeated cloning and phase-role changes therefore do not retain a growing chain of historical phase states. This ownership contract concerns transport-property objects; Huron–Vidal mixing-rule calculation-state isolation is tracked separately in issue #4575.
Enabling setMultiPhaseCheck(true) allocates an additional equilibrium-search template without
calculating its transport properties. This avoids viscosity, conductivity and density work for
an inactive trial phase during repeated flashes. The template initializes those properties on
first access; initialize the active phases after the flash as described above.
Thermodynamic and physical-property APIs are different
Thermodynamic quantities such as compressibility factor, enthalpy, heat capacity, and phase
equilibrium come from the active thermodynamic model. Transport-property initialization does not
replace init(...) or a flash calculation for those quantities.
The common phase accessors after physical-property initialization are:
| Quantity | Supported phase accessor |
|---|---|
| Mass density | fluid.getPhase("gas").getDensity("kg/m3") |
| Dynamic viscosity | fluid.getPhase("gas").getViscosity("kg/msec") |
| Thermal conductivity | fluid.getPhase("gas").getThermalConductivity("W/mK") |
| Kinematic viscosity | fluid.getPhase("gas").getPhysicalProperties().getKinematicViscosity() |
Always identify the phase by type or name and guard for its existence. Phase indexes can change when the equilibrium state changes.
Select the transport-property model explicitly
fluid.setPhysicalPropertyModel(PhysicalPropertyModel.DEFAULT) selects a coordinated model set.
Other supported sets include WATER, SALT_WATER, GLYCOL, AMINE, CO2WATER, and
BASIC. Select the set before calling initPhysicalProperties(). The aqueous phases
of GLYCOL, AMINE and CO2WATER use Filippov conductivity, including its enabled
CHEMPAK Missenard-derived pressure factor. See its
units, cutoffs and qualification limits.
An EOS mixing rule, such as fluid.setMixingRule("classic"), configures thermodynamic mixture
behavior. It is not a viscosity or conductivity model selector. For a specialized transport
correlation, select the model on the phase’s PhysicalProperties object and reinitialize that
phase. See the package overview,
viscosity guide, and
thermal-conductivity guide.
Diffusion coefficients
Diffusion coefficients are exposed by the phase’s PhysicalProperties object. After selecting a
diffusion model and reinitializing the phase, use the public accessors with component indexes or
names:
double methaneEthaneDiffusivity =
fluid.getPhase("gas").getPhysicalProperties()
.getDiffusionCoefficient("methane", "ethane");
For effective multicomponent diffusivity, call calcEffectiveDiffusionCoefficients() before
getEffectiveDiffusionCoefficient(...). The
diffusivity guide documents model keys, equations,
units, and executable access patterns.
Fuller’s maintained organic diffusion volumes use explicit published atomic sums and aromatic/heterocyclic ring corrections. Unknown-structure fallbacks remain approximate. Direct Fuller evaluation returns NaN for invalid state or mass inputs; its warning interval is not a universal accuracy range. The guide separates independent arithmetic checks from the selected CH4/He measured-fit comparisons. Gas-diffusion clones own their mutable coefficient/parameter arrays; clone the fluid or phase as well when thermodynamic states must be independent.
Surface and interfacial tension
Interfacial calculations belong to InterphasePropertiesInterface, not directly to
SystemInterface. Confirm that both phases exist, initialize physical properties, and access the
interface through the system:
double surfaceTensionNPerM =
fluid.getInterphaseProperties().getSurfaceTension(0, 1);
Phase numbers must refer to the intended pair in the current equilibrium state. The interfacial-properties guide shows named model selection, phase guards, units, and complete examples.
Engineering use
Transport and interfacial correlations have component, phase, temperature, pressure, and composition limits. Validate the selected model against measurements or traceable literature for the intended range. Reinitializing a model makes a calculation current; it does not establish that the correlation is accurate for a particular design case.