Class DualEosComparison

java.lang.Object
neqsim.process.util.DualEosComparison
All Implemented Interfaces:
Serializable

public class DualEosComparison extends Object implements Serializable
Compares thermodynamic property predictions between two equations of state.

Per TR1244 best practice, process design should cross-check results between SRK and PR78 equations of state to identify cases where EoS choice significantly affects separation predictions, compressor duties, phase envelopes or hydrate curves. This class runs both EoS on the same composition and conditions and flags deviations above configurable thresholds.

Usage example:


SystemInterface baseFluid = new SystemSrkEos(273.15 + 25, 60.0);
baseFluid.addComponent("methane", 0.85);
baseFluid.addComponent("ethane", 0.10);
baseFluid.addComponent("propane", 0.05);
baseFluid.setMixingRule("classic");

DualEosComparison comp = new DualEosComparison(baseFluid);
comp.addCondition(273.15 + 25, 60.0);
comp.addCondition(273.15 + 5, 30.0);
comp.run();
System.out.println(comp.toJson());

Version:
1.0
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • componentNames

      private String[] componentNames
      Component names.
    • molarComposition

      private double[] molarComposition
      Component molar compositions.
    • mixingRule

      private String mixingRule
      Mixing rule string.
    • conditions

      private List<double[]> conditions
      Conditions to evaluate: each entry is {T_kelvin, P_bara}.
    • results

      Results for each condition.
    • deviationThreshold

      private double deviationThreshold
      Deviation threshold for flagging (fraction, e.g., 0.05 = 5%).
    • primaryEosName

      private String primaryEosName
      Name of primary EoS.
    • secondaryEosName

      private String secondaryEosName
      Name of secondary EoS.
  • Constructor Details

    • DualEosComparison

      public DualEosComparison(SystemInterface baseFluid)
      Creates a DualEosComparison from a base fluid system.

      The composition is extracted from the supplied system. Both SRK and PR78 fluids will be built internally with the same composition. The base fluid's EoS type does not matter.

      Parameters:
      baseFluid - the base fluid to extract composition from
    • DualEosComparison

      public DualEosComparison(String[] componentNames, double[] molarComposition, String mixingRule)
      Creates a DualEosComparison from explicit composition.
      Parameters:
      componentNames - array of component names
      molarComposition - array of molar fractions (must sum to ~1.0)
      mixingRule - mixing rule name (e.g., "classic")
  • Method Details

    • setDeviationThreshold

      public void setDeviationThreshold(double threshold)
      Sets the deviation threshold for flagging differences.
      Parameters:
      threshold - fractional deviation threshold (e.g., 0.05 = 5%)
    • getDeviationThreshold

      public double getDeviationThreshold()
      Returns the deviation threshold.
      Returns:
      fractional deviation threshold
    • addCondition

      public void addCondition(double temperatureKelvin, double pressureBara)
      Adds a temperature-pressure condition to evaluate.
      Parameters:
      temperatureKelvin - temperature in Kelvin
      pressureBara - pressure in bara
    • addConditionCelsius

      public void addConditionCelsius(double temperatureCelsius, double pressureBara)
      Adds a temperature-pressure condition using Celsius.
      Parameters:
      temperatureCelsius - temperature in Celsius
      pressureBara - pressure in bara
    • run

      public void run()
      Runs the dual-EoS comparison at all configured conditions.
    • getResults

      Returns the comparison results.
      Returns:
      list of comparison results
    • hasSignificantDeviations

      public boolean hasSignificantDeviations()
      Returns whether any result has flagged deviations above the threshold.
      Returns:
      true if significant deviations exist
    • getAllFlags

      public List<String> getAllFlags()
      Returns a summary of all flagged deviations.
      Returns:
      list of flag strings
    • toJson

      public String toJson()
      Returns JSON representation of all results.
      Returns:
      JSON string with comparison data