Class EclipseVFPExporter

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

public class EclipseVFPExporter extends Object implements Serializable
Eclipse VFP (Vertical Flow Performance) table exporter.

Generates Eclipse E300 compatible VFP tables for:

  • VFPPROD - Production well performance tables
  • VFPINJ - Injection well performance tables
  • VFPEXP - Export pipeline/processing facility tables

VFP Table Format

VFP tables define the relationship between flowing bottom-hole pressure and production rate as a function of various parameters (GOR, water cut, artificial lift, etc.).

Example Usage

EclipseVFPExporter exporter = new EclipseVFPExporter();

// Configure table
exporter.setTableNumber(1);
exporter.setDatumDepth(2500.0);
exporter.setFlowRates(new double[] {100, 500, 1000, 2000, 5000});
exporter.setTHPs(new double[] {10, 20, 30, 50, 70, 100});
exporter.setWaterCuts(new double[] {0, 0.2, 0.5, 0.8});
exporter.setGORs(new double[] {50, 100, 200, 500});

// Generate from lift curve data
exporter.setLiftCurveData(liftCurveData);

// Export
exporter.exportVFPPROD("well1_vfp.inc");
Version:
1.0
Author:
NeqSim Development Team
See Also:
  • Field Details

    • serialVersionUID

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

      private static final org.apache.logging.log4j.Logger logger
      Logger.
    • tableNumber

      private int tableNumber
      VFP table number.
    • datumDepth

      private double datumDepth
      Datum depth in meters TVD.
    • flowRateType

      private String flowRateType
      Flow rate type (OIL, LIQ, GAS, WAT, TM).
    • waterCutType

      private String waterCutType
      Water cut type (WCT, WGR).
    • gorType

      private String gorType
      GOR type (GOR, OGR, GLR).
    • flowRates

      private double[] flowRates
      Flow rates for the table.
    • THPs

      private double[] THPs
      Tubing head pressures (THP) in bara.
    • waterCuts

      private double[] waterCuts
      Water cuts (0-1).
    • GORs

      private double[] GORs
      Gas-oil ratios (Sm3/Sm3).
    • ALQs

      private double[] ALQs
      Artificial lift quantities (for gas lift).
    • BHPTable

      private double[][][][][] BHPTable
      BHP values [flowRate][THP][waterCut][GOR][ALQ].
    • liftCurveData

      private transient ProcessOptimizationEngine.LiftCurveData liftCurveData
      Lift curve data source.
    • unitSystem

      private String unitSystem
      Unit system (METRIC, FIELD).
    • tableTitle

      private String tableTitle
      Table title/description.
  • Constructor Details

    • EclipseVFPExporter

      public EclipseVFPExporter()
      Default constructor.
    • EclipseVFPExporter

      public EclipseVFPExporter(int tableNumber)
      Constructor with table number.
      Parameters:
      tableNumber - VFP table number
  • Method Details

    • exportVFPPROD

      public void exportVFPPROD(String filename) throws IOException
      Exports a VFPPROD table to file.
      Parameters:
      filename - output filename
      Throws:
      IOException - if file cannot be written
    • exportVFPINJ

      public void exportVFPINJ(String filename) throws IOException
      Exports a VFPINJ table to file.
      Parameters:
      filename - output filename
      Throws:
      IOException - if file cannot be written
    • exportVFPEXP

      public void exportVFPEXP(String filename) throws IOException
      Exports a VFPEXP table to file for export pipelines/facilities.
      Parameters:
      filename - output filename
      Throws:
      IOException - if file cannot be written
    • getVFPPRODString

      public String getVFPPRODString()
      Gets the VFPPROD table as a string.
      Returns:
      VFPPROD table string
    • getVFPINJString

      public String getVFPINJString()
      Gets the VFPINJ table as a string.
      Returns:
      VFPINJ table string
    • writeVFPPROD

      private void writeVFPPROD(BufferedWriter writer) throws IOException
      Writes VFPPROD to a writer.
      Throws:
      IOException
    • writeVFPPRODContent

      private void writeVFPPRODContent(Appendable out) throws IOException
      Writes VFPPROD content to a StringBuilder.

      Output format follows Eclipse VFP convention:

      VFPPROD
        TableNum  DatumDepth  'FlowType'  'WGR'  'OGR'  /
        FlowRate1  FlowRate2  ... /
        THP1  THP2  ... /
        0 /
        0 /
        0 /
        1  1  1  1  BHP1  BHP2  ... /
        2  1  1  1  BHP1  BHP2  ... /
      
      Throws:
      IOException
    • writeVFPINJ

      private void writeVFPINJ(BufferedWriter writer) throws IOException
      Writes VFPINJ to a writer.
      Throws:
      IOException
    • writeVFPINJContent

      private void writeVFPINJContent(Appendable out) throws IOException
      Writes VFPINJ content.
      Parameters:
      out - the appendable to write content to
      Throws:
      IOException - if an I/O error occurs
    • writeVFPEXP

      private void writeVFPEXP(BufferedWriter writer) throws IOException
      Writes VFPEXP (export system) table.
      Parameters:
      writer - the writer to write the table to
      Throws:
      IOException - if an I/O error occurs
    • writeArray

      private void writeArray(Appendable out, double[] values) throws IOException
      Writes an array of values in Eclipse format.
      Parameters:
      out - the appendable to write values to
      values - the array of values to write
      Throws:
      IOException - if an I/O error occurs
    • writeArraySplitLines

      private void writeArraySplitLines(Appendable out, double[] values, int valuesPerLine) throws IOException
      Writes an array of values with line splitting after specified number of values.
      Parameters:
      out - output appendable
      values - array of values
      valuesPerLine - number of values per line before wrapping
      Throws:
      IOException - if an I/O error occurs
    • writeBHPTablesWithIndex

      private void writeBHPTablesWithIndex(Appendable out) throws IOException
      Writes BHP tables with row index prefix format.

      Format: rowIdx 1 1 1 BHP1 BHP2 ... /

      Missing values are filled with nearest valid value from same row.

      Parameters:
      out - the appendable to write tables to
      Throws:
      IOException - if an I/O error occurs
    • fillMissingWithNearest

      private void fillMissingWithNearest(double[] values, boolean[] hasValue)
      Fills missing values in a row with the nearest valid value.
      Parameters:
      values - array of values (modified in place)
      hasValue - boolean array indicating which values are valid
    • writeBHPTables

      private void writeBHPTables(Appendable out) throws IOException
      Writes BHP tables (5D array).
      Parameters:
      out - the appendable to write tables to
      Throws:
      IOException - if an I/O error occurs
    • writeInjectionBHPTable

      private void writeInjectionBHPTable(Appendable out) throws IOException
      Writes injection BHP table (2D).
      Parameters:
      out - the appendable to write table to
      Throws:
      IOException - if an I/O error occurs
    • getBHPValue

      private double getBHPValue(int iFlow, int iTHP, int iWC, int iGOR, int iALQ)
      Gets a BHP value from the table.
    • generateBHPFromLiftCurve

      private void generateBHPFromLiftCurve()
      Generates BHP table from lift curve data.
    • findIndex

      private int findIndex(double[] array, double value)
      Finds the closest index in an array.
    • exportCOMPDAT

      public String exportCOMPDAT(String wellName)
      Creates a COMPDAT style export for compressor data.
      Parameters:
      wellName - well/connection name
      Returns:
      COMPDAT string
    • exportMultipleScenarios

      public void exportMultipleScenarios(List<EclipseVFPExporter.VFPScenario> scenarios, String baseFilename) throws IOException
      Exports VFP tables for multiple scenarios.
      Parameters:
      scenarios - list of scenario configurations
      baseFilename - base filename for outputs
      Throws:
      IOException - if files cannot be written
    • getTableNumber

      public int getTableNumber()
      Gets the table number.
      Returns:
      table number
    • setTableNumber

      public void setTableNumber(int tableNumber)
      Sets the table number.
      Parameters:
      tableNumber - VFP table number
    • getDatumDepth

      public double getDatumDepth()
      Gets the datum depth.
      Returns:
      datum depth in meters
    • setDatumDepth

      public void setDatumDepth(double depth)
      Sets the datum depth.
      Parameters:
      depth - datum depth in meters TVD
    • getFlowRateType

      public String getFlowRateType()
      Gets the flow rate type.
      Returns:
      flow rate type
    • setFlowRateType

      public void setFlowRateType(String type)
      Sets the flow rate type.
      Parameters:
      type - flow rate type (OIL, LIQ, GAS, WAT, TM)
    • getFlowRates

      public double[] getFlowRates()
      Gets the flow rates.
      Returns:
      flow rate array
    • setFlowRates

      public void setFlowRates(double[] rates)
      Sets the flow rates.
      Parameters:
      rates - flow rate array
    • getTHPs

      public double[] getTHPs()
      Gets the THP values.
      Returns:
      THP array
    • setTHPs

      public void setTHPs(double[] thps)
      Sets the THP values.
      Parameters:
      thps - THP array in bara
    • getWaterCuts

      public double[] getWaterCuts()
      Gets the water cuts.
      Returns:
      water cut array
    • setWaterCuts

      public void setWaterCuts(double[] wcs)
      Sets the water cuts.
      Parameters:
      wcs - water cut array (0-1)
    • getGORs

      public double[] getGORs()
      Gets the GORs.
      Returns:
      GOR array
    • setGORs

      public void setGORs(double[] gors)
      Sets the GORs.
      Parameters:
      gors - GOR array in Sm3/Sm3
    • getALQs

      public double[] getALQs()
      Gets the ALQs.
      Returns:
      ALQ array
    • setALQs

      public void setALQs(double[] alqs)
      Sets the ALQs.
      Parameters:
      alqs - ALQ array (gas lift quantity)
    • getBHPTable

      public double[][][][][] getBHPTable()
      Gets the BHP table.
      Returns:
      BHP table array
    • setBHPTable

      public void setBHPTable(double[][][][][] table)
      Sets the BHP table.
      Parameters:
      table - BHP table [flow][THP][WC][GOR][ALQ]
    • getUnitSystem

      public String getUnitSystem()
      Gets the unit system.
      Returns:
      unit system
    • setUnitSystem

      public void setUnitSystem(String system)
      Sets the unit system.
      Parameters:
      system - unit system (METRIC, FIELD)
    • getTableTitle

      public String getTableTitle()
      Gets the table title.
      Returns:
      table title
    • setTableTitle

      public void setTableTitle(String title)
      Sets the table title.
      Parameters:
      title - table title/description
    • setLiftCurveData

      public void setLiftCurveData(ProcessOptimizationEngine.LiftCurveData data)
      Sets the lift curve data.
      Parameters:
      data - lift curve data