Class EOSComparison

java.lang.Object
neqsim.integration.EOSComparison
All Implemented Interfaces:
Serializable

public class EOSComparison extends Object implements Serializable
Side-by-side comparison of thermodynamic properties across multiple EOS models.

Evaluates a fluid composition at specified conditions using multiple equations of state, computes property deviations, and reports results as JSON. Useful for model selection, sensitivity studies, and validating that EOS choice does not significantly affect results.

Usage:

EOSComparison comp = new EOSComparison();
comp.addComponent("methane", 0.85);
comp.addComponent("ethane", 0.10);
comp.addComponent("propane", 0.05);
comp.setConditions(273.15 + 25.0, 60.0);

ComparisonResult result = comp.compare();
System.out.println(result.toJson());
Version:
1.0
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

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

      private static final org.apache.logging.log4j.Logger logger
      Logger object for class.
    • components

      private final Map<String,Double> components
      Components and their mole fractions.
    • temperature

      private double temperature
      Temperature in Kelvin.
    • pressure

      private double pressure
      Pressure in bara.
    • eosTypes

      private List<EOSComparison.EOSType> eosTypes
      EOS types to compare.
    • multiPhaseCheck

      private boolean multiPhaseCheck
      Whether to include multi-phase check.
  • Constructor Details

    • EOSComparison

      public EOSComparison()
      Creates a new EOS comparison utility.
  • Method Details

    • addComponent

      public EOSComparison addComponent(String name, double moleFraction)
      Adds a component with its mole fraction.
      Parameters:
      name - component name (e.g., "methane")
      moleFraction - mole fraction (0-1)
      Returns:
      this for chaining
    • setConditions

      public EOSComparison setConditions(double temperatureK, double pressureBara)
      Sets the temperature and pressure conditions.
      Parameters:
      temperatureK - temperature in Kelvin
      pressureBara - pressure in bara
      Returns:
      this for chaining
    • setEOSTypes

      public EOSComparison setEOSTypes(EOSComparison.EOSType... types)
      Sets which EOS types to compare.
      Parameters:
      types - EOS types to include
      Returns:
      this for chaining
    • setMultiPhaseCheck

      public EOSComparison setMultiPhaseCheck(boolean enable)
      Enables multi-phase check for all models.
      Parameters:
      enable - true to enable multi-phase check
      Returns:
      this for chaining
    • compare

      Runs the comparison across all configured EOS types.
      Returns:
      comparison results for all models
    • evaluateEOS

      private EOSComparison.EOSResult evaluateEOS(EOSComparison.EOSType type) throws Exception
      Evaluates a single EOS type.
      Parameters:
      type - the EOS type to evaluate
      Returns:
      property results for this EOS
      Throws:
      Exception - if the evaluation fails
    • createSystem

      private SystemInterface createSystem(EOSComparison.EOSType type)
      Creates a SystemInterface for the specified EOS type.
      Parameters:
      type - the EOS type
      Returns:
      a new SystemInterface instance