Class EclipseVFPExporter
java.lang.Object
neqsim.process.util.optimizer.EclipseVFPExporter
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classVFP scenario configuration. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double[]Artificial lift quantities (for gas lift).private double[][][][][]BHP values [flowRate][THP][waterCut][GOR][ALQ].private doubleDatum depth in meters TVD.private double[]Flow rates for the table.private StringFlow rate type (OIL, LIQ, GAS, WAT, TM).private double[]Gas-oil ratios (Sm3/Sm3).private StringGOR type (GOR, OGR, GLR).Lift curve data source.private static final org.apache.logging.log4j.LoggerLogger.private static final longSerialization version UID.private intVFP table number.private StringTable title/description.private double[]Tubing head pressures (THP) in bara.private StringUnit system (METRIC, FIELD).private double[]Water cuts (0-1).private StringWater cut type (WCT, WGR). -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.EclipseVFPExporter(int tableNumber) Constructor with table number. -
Method Summary
Modifier and TypeMethodDescriptionexportCOMPDAT(String wellName) Creates a COMPDAT style export for compressor data.voidexportMultipleScenarios(List<EclipseVFPExporter.VFPScenario> scenarios, String baseFilename) Exports VFP tables for multiple scenarios.voidexportVFPEXP(String filename) Exports a VFPEXP table to file for export pipelines/facilities.voidexportVFPINJ(String filename) Exports a VFPINJ table to file.voidexportVFPPROD(String filename) Exports a VFPPROD table to file.private voidfillMissingWithNearest(double[] values, boolean[] hasValue) Fills missing values in a row with the nearest valid value.private intfindIndex(double[] array, double value) Finds the closest index in an array.private voidGenerates BHP table from lift curve data.double[]getALQs()Gets the ALQs.double[][][][][]Gets the BHP table.private doublegetBHPValue(int iFlow, int iTHP, int iWC, int iGOR, int iALQ) Gets a BHP value from the table.doubleGets the datum depth.double[]Gets the flow rates.Gets the flow rate type.double[]getGORs()Gets the GORs.intGets the table number.Gets the table title.double[]getTHPs()Gets the THP values.Gets the unit system.Gets the VFPINJ table as a string.Gets the VFPPROD table as a string.double[]Gets the water cuts.voidsetALQs(double[] alqs) Sets the ALQs.voidsetBHPTable(double[][][][][] table) Sets the BHP table.voidsetDatumDepth(double depth) Sets the datum depth.voidsetFlowRates(double[] rates) Sets the flow rates.voidsetFlowRateType(String type) Sets the flow rate type.voidsetGORs(double[] gors) Sets the GORs.voidSets the lift curve data.voidsetTableNumber(int tableNumber) Sets the table number.voidsetTableTitle(String title) Sets the table title.voidsetTHPs(double[] thps) Sets the THP values.voidsetUnitSystem(String system) Sets the unit system.voidsetWaterCuts(double[] wcs) Sets the water cuts.private voidwriteArray(Appendable out, double[] values) Writes an array of values in Eclipse format.private voidwriteArraySplitLines(Appendable out, double[] values, int valuesPerLine) Writes an array of values with line splitting after specified number of values.private voidwriteBHPTables(Appendable out) Writes BHP tables (5D array).private voidWrites BHP tables with row index prefix format.private voidWrites injection BHP table (2D).private voidwriteVFPEXP(BufferedWriter writer) Writes VFPEXP (export system) table.private voidwriteVFPINJ(BufferedWriter writer) Writes VFPINJ to a writer.private voidWrites VFPINJ content.private voidwriteVFPPROD(BufferedWriter writer) Writes VFPPROD to a writer.private voidWrites VFPPROD content to a StringBuilder.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger. -
tableNumber
private int tableNumberVFP table number. -
datumDepth
private double datumDepthDatum depth in meters TVD. -
flowRateType
Flow rate type (OIL, LIQ, GAS, WAT, TM). -
waterCutType
Water cut type (WCT, WGR). -
gorType
GOR type (GOR, OGR, GLR). -
flowRates
private double[] flowRatesFlow rates for the table. -
THPs
private double[] THPsTubing head pressures (THP) in bara. -
waterCuts
private double[] waterCutsWater cuts (0-1). -
GORs
private double[] GORsGas-oil ratios (Sm3/Sm3). -
ALQs
private double[] ALQsArtificial lift quantities (for gas lift). -
BHPTable
private double[][][][][] BHPTableBHP values [flowRate][THP][waterCut][GOR][ALQ]. -
liftCurveData
Lift curve data source. -
unitSystem
Unit system (METRIC, FIELD). -
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
Exports a VFPPROD table to file.- Parameters:
filename- output filename- Throws:
IOException- if file cannot be written
-
exportVFPINJ
Exports a VFPINJ table to file.- Parameters:
filename- output filename- Throws:
IOException- if file cannot be written
-
exportVFPEXP
Exports a VFPEXP table to file for export pipelines/facilities.- Parameters:
filename- output filename- Throws:
IOException- if file cannot be written
-
getVFPPRODString
-
getVFPINJString
-
writeVFPPROD
Writes VFPPROD to a writer.- Throws:
IOException
-
writeVFPPRODContent
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
Writes VFPINJ to a writer.- Throws:
IOException
-
writeVFPINJContent
Writes VFPINJ content.- Parameters:
out- the appendable to write content to- Throws:
IOException- if an I/O error occurs
-
writeVFPEXP
Writes VFPEXP (export system) table.- Parameters:
writer- the writer to write the table to- Throws:
IOException- if an I/O error occurs
-
writeArray
Writes an array of values in Eclipse format.- Parameters:
out- the appendable to write values tovalues- 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 appendablevalues- array of valuesvaluesPerLine- number of values per line before wrapping- Throws:
IOException- if an I/O error occurs
-
writeBHPTablesWithIndex
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
Writes BHP tables (5D array).- Parameters:
out- the appendable to write tables to- Throws:
IOException- if an I/O error occurs
-
writeInjectionBHPTable
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
-
exportMultipleScenarios
public void exportMultipleScenarios(List<EclipseVFPExporter.VFPScenario> scenarios, String baseFilename) throws IOException Exports VFP tables for multiple scenarios.- Parameters:
scenarios- list of scenario configurationsbaseFilename- 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
-
setFlowRateType
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
-
setUnitSystem
Sets the unit system.- Parameters:
system- unit system (METRIC, FIELD)
-
getTableTitle
-
setTableTitle
Sets the table title.- Parameters:
title- table title/description
-
setLiftCurveData
Sets the lift curve data.- Parameters:
data- lift curve data
-