Class EclipseFluidReadWrite

java.lang.Object
neqsim.thermo.util.readwrite.EclipseFluidReadWrite

public class EclipseFluidReadWrite extends Object

EclipseFluidReadWrite class.

Version:
$Id: $Id
Author:
asmund
  • Field Details

    • logger

      static org.apache.logging.log4j.Logger logger
      Logger object for class.
    • pseudoName

      public static String pseudoName
      Constant pseudoName=""
  • Constructor Details

    • EclipseFluidReadWrite

      public EclipseFluidReadWrite()
  • Method Details

    • setComposition

      public static void setComposition(SystemInterface fluid, String inputFile, String pseudoNameIn)

      setComposition.

      Parameters:
      fluid - a SystemInterface object
      inputFile - a String object
      pseudoNameIn - a String object
    • setComposition

      public static void setComposition(SystemInterface fluid, String inputFile)

      setComposition.

      Parameters:
      fluid - a SystemInterface object
      inputFile - a String object
    • read

      public static SystemInterface read(String inputFile, String pseudoNameIn)

      read.

      Parameters:
      inputFile - a String object
      pseudoNameIn - a String object
      Returns:
      a SystemInterface object
    • read

      public static SystemInterface read(String inputFile)

      read.

      Parameters:
      inputFile - a String object
      Returns:
      a SystemInterface object
    • read

      public static SystemInterface read(String inputFile, String[] fluidNames)

      read.

      Parameters:
      inputFile - a String object representing the path to the input file
      fluidNames - an array of String objects representing the names of the fluids
      Returns:
      a SystemInterface object representing the thermodynamic system
    • readE300File

      public static SystemInterface readE300File(String inputFile)

      readE300File.

      Parameters:
      inputFile - a String object
      Returns:
      a SystemInterface object
    • write

      public static void write(SystemInterface fluid, String outputFile) throws IOException
      Write a NeqSim fluid to Eclipse E300 compositional EOS file format.

      The exported file contains all EOS parameters needed to recreate the fluid in Eclipse 300 or read it back into NeqSim, including: component names, critical properties, acentric factors, molecular weights, volume shifts, parachors, mole fractions, and binary interaction coefficients.

      Parameters:
      fluid - the fluid to export
      outputFile - path to output file (e.g., "myfluid.e300")
      Throws:
      IOException - if writing fails
    • write

      public static void write(SystemInterface fluid, String outputFile, double reservoirTempC) throws IOException
      Write a NeqSim fluid to Eclipse E300 compositional EOS file format.
      Parameters:
      fluid - the fluid to export
      outputFile - path to output file
      reservoirTempC - reservoir temperature in Celsius for RTEMP keyword
      Throws:
      IOException - if writing fails
    • write

      public static void write(SystemInterface fluid, Path outputPath, double reservoirTempC) throws IOException
      Write a NeqSim fluid to Eclipse E300 compositional EOS file format.
      Parameters:
      fluid - the fluid to export
      outputPath - output file path
      reservoirTempC - reservoir temperature in Celsius
      Throws:
      IOException - if writing fails
    • toE300String

      public static String toE300String(SystemInterface fluid)
      Convert a NeqSim fluid to Eclipse E300 format string.
      Parameters:
      fluid - the fluid to export
      Returns:
      E300 format content as string
    • toE300String

      public static String toE300String(SystemInterface fluid, double reservoirTempC)
      Convert a NeqSim fluid to Eclipse E300 format string.
      Parameters:
      fluid - the fluid to export
      reservoirTempC - reservoir temperature in Celsius
      Returns:
      E300 format content as string
    • writeToWriter

      private static void writeToWriter(SystemInterface fluid, Writer writer, double reservoirTempC) throws IOException
      Internal method to write E300 content to a Writer.
      Parameters:
      fluid - the fluid to export
      writer - output writer
      reservoirTempC - reservoir temperature in Celsius
      Throws:
      IOException - if writing fails
    • isPFCTViscosityModelActive

      private static boolean isPFCTViscosityModelActive(SystemInterface fluid)
      Check if PFCT (Pedersen) viscosity model is active on any phase.
      Parameters:
      fluid - the fluid
      Returns:
      true if PFCT viscosity model is active
    • getEOSType

      private static String getEOSType(SystemInterface fluid)
      Determines the EOS type string for the fluid.
      Parameters:
      fluid - the fluid
      Returns:
      EOS type string (SRK, PR, etc.)
    • shortenComponentName

      private static String shortenComponentName(String name)
      Shortens component names to E300 compatible format.
      Parameters:
      name - original component name
      Returns:
      shortened name
    • getBinaryInteractionParameters

      private static double[][] getBinaryInteractionParameters(SystemInterface fluid)
      Gets binary interaction parameters from fluid.
      Parameters:
      fluid - the fluid
      Returns:
      2D array of kij values
    • applyLBCViscosityModel

      private static void applyLBCViscosityModel(SystemInterface fluid, double[] lbcParams)
      Apply LBC viscosity model with custom parameters to fluid.
      Parameters:
      fluid - the fluid to configure
      lbcParams - array of 5 LBC dense contribution parameters
    • applyPFCTViscosityModel

      private static void applyPFCTViscosityModel(SystemInterface fluid)
      Apply PFCT (Pedersen) viscosity model to all phases.
      Parameters:
      fluid - the fluid to configure
    • getLBCParametersFromFluid

      private static double[] getLBCParametersFromFluid(SystemInterface fluid)
      Get LBC parameters from fluid if LBC viscosity model is active.
      Parameters:
      fluid - the fluid
      Returns:
      array of 5 LBC parameters, or null if not using LBC model