Class CMGEOSExporter

java.lang.Object
neqsim.blackoil.io.CMGEOSExporter

public final class CMGEOSExporter extends Object
CMG (Computer Modelling Group) reservoir simulator EOS/PVT exporter.

Exports NeqSim compositional fluids or Black-Oil PVT tables to CMG-compatible format for use in IMEX, GEM, and STARS simulators.

Supported CMG Keywords

  • PVTG - Gas PVT table
  • PVTO - Oil PVT table
  • PVTW - Water PVT properties
  • DENSITY - Stock tank densities
  • BWI/CW/VW - Water properties

Usage Example


SystemInterface fluid = new SystemSrkEos(373.15, 200.0);
fluid.addComponent("methane", 0.7);
fluid.addComponent("n-heptane", 0.3);
fluid.setMixingRule("classic");

CMGEOSExporter.toFile(fluid, Path.of("PVT.DAT"), CMGEOSExporter.Simulator.IMEX);

Version:
1.0
Author:
esol
See Also:
  • Constructor Details

    • CMGEOSExporter

      private CMGEOSExporter()
  • Method Details

    • toFile

      public static void toFile(SystemInterface fluid, Path outputPath) throws IOException
      Export a compositional fluid to a CMG file using default settings.
      Parameters:
      fluid - NeqSim compositional fluid
      outputPath - output file path
      Throws:
      IOException - if writing fails
    • toFile

      public static void toFile(SystemInterface fluid, Path outputPath, CMGEOSExporter.Simulator simulator) throws IOException
      Export a compositional fluid to a CMG file for a specific simulator.
      Parameters:
      fluid - NeqSim compositional fluid
      outputPath - output file path
      simulator - target CMG simulator
      Throws:
      IOException - if writing fails
    • toFile

      public static void toFile(SystemInterface fluid, Path outputPath, CMGEOSExporter.ExportConfig config) throws IOException
      Export a compositional fluid to a CMG file.
      Parameters:
      fluid - NeqSim compositional fluid
      outputPath - output file path
      config - export configuration
      Throws:
      IOException - if writing fails
    • toString

      public static String toString(SystemInterface fluid)
      Export a compositional fluid to a CMG format string.
      Parameters:
      fluid - NeqSim compositional fluid
      Returns:
      CMG format content
    • toString

      public static String toString(SystemInterface fluid, CMGEOSExporter.ExportConfig config)
      Export a compositional fluid to a CMG format string.
      Parameters:
      fluid - NeqSim compositional fluid
      config - export configuration
      Returns:
      CMG format content
    • toFile

      public static void toFile(BlackOilPVTTable pvt, double rhoOilSc, double rhoGasSc, double rhoWaterSc, Path outputPath) throws IOException
      Export a Black-Oil PVT table to a CMG file.
      Parameters:
      pvt - Black-Oil PVT table
      rhoOilSc - oil density at standard conditions (kg/m³)
      rhoGasSc - gas density at standard conditions (kg/m³)
      rhoWaterSc - water density at standard conditions (kg/m³)
      outputPath - output file path
      Throws:
      IOException - if writing fails
    • toFile

      public static void toFile(BlackOilPVTTable pvt, double rhoOilSc, double rhoGasSc, double rhoWaterSc, Path outputPath, CMGEOSExporter.ExportConfig config) throws IOException
      Export a Black-Oil PVT table to a CMG file.
      Parameters:
      pvt - Black-Oil PVT table
      rhoOilSc - oil density at standard conditions (kg/m³)
      rhoGasSc - gas density at standard conditions (kg/m³)
      rhoWaterSc - water density at standard conditions (kg/m³)
      outputPath - output file path
      config - export configuration
      Throws:
      IOException - if writing fails
    • toString

      public static String toString(BlackOilPVTTable pvt, double rhoOilSc, double rhoGasSc, double rhoWaterSc)
      Export a Black-Oil PVT table to a CMG format string.
      Parameters:
      pvt - Black-Oil PVT table
      rhoOilSc - oil density at standard conditions (kg/m³)
      rhoGasSc - gas density at standard conditions (kg/m³)
      rhoWaterSc - water density at standard conditions (kg/m³)
      Returns:
      CMG format content
    • toString

      public static String toString(BlackOilPVTTable pvt, double rhoOilSc, double rhoGasSc, double rhoWaterSc, CMGEOSExporter.ExportConfig config)
      Export a Black-Oil PVT table to a CMG format string.
      Parameters:
      pvt - Black-Oil PVT table
      rhoOilSc - oil density at standard conditions (kg/m³)
      rhoGasSc - gas density at standard conditions (kg/m³)
      rhoWaterSc - water density at standard conditions (kg/m³)
      config - export configuration
      Returns:
      CMG format content
    • toWriter

      private static void toWriter(SystemInterface fluid, Writer writer, CMGEOSExporter.ExportConfig config) throws IOException
      Throws:
      IOException
    • writePVTTable

      private static void writePVTTable(BlackOilPVTTable pvt, double rhoOilSc, double rhoGasSc, double rhoWaterSc, Writer writer, CMGEOSExporter.ExportConfig config) throws IOException
      Throws:
      IOException
    • writeIMEXFormat

      private static void writeIMEXFormat(BufferedWriter bw, BlackOilPVTTable pvt, double rhoOilSc, double rhoGasSc, double rhoWaterSc, List<Double> pressurePoints, double bubblePoint, double pFactor, double rhoFactor, double rsFactor, double viscFactor, String pUnit, String rhoUnit, String rsUnit, String viscUnit) throws IOException
      Throws:
      IOException
    • writeGEMFormat

      private static void writeGEMFormat(BufferedWriter bw, BlackOilPVTTable pvt, double rhoOilSc, double rhoGasSc, double rhoWaterSc, List<Double> pressurePoints, double bubblePoint, double pFactor, double rhoFactor, double rsFactor, double viscFactor, String pUnit, String rhoUnit, String rsUnit, String viscUnit) throws IOException
      Throws:
      IOException
    • writeSTARSFormat

      private static void writeSTARSFormat(BufferedWriter bw, BlackOilPVTTable pvt, double rhoOilSc, double rhoGasSc, double rhoWaterSc, List<Double> pressurePoints, double bubblePoint, double pFactor, double rhoFactor, double rsFactor, double viscFactor, String pUnit, String rhoUnit, String rsUnit, String viscUnit) throws IOException
      Throws:
      IOException
    • generateTablePressures

      private static List<Double> generateTablePressures(double bubblePoint, CMGEOSExporter.ExportConfig config)
    • generateDefaultPressureGrid

      private static double[] generateDefaultPressureGrid(double referencePressure)