Class LiftCurveTable

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

public class LiftCurveTable extends Object implements Serializable
Represents a lift curve table for reservoir simulator integration.

This class stores flow rate vs. pressure data in a format compatible with Eclipse reservoir simulators. The table contains:

  • THP (Tubing Head Pressure / outlet pressure) values as column headers
  • Flow rates as row headers
  • BHP (Bottom Hole Pressure / inlet pressure) values in the table cells
  • NaN values for infeasible operating points

Eclipse Format Example

THP
20 40 60
1   100  120  140
10  110  130  150
20  120  140  NaN

In this format:

  • First row "THP" indicates pressure column headers
  • Second row contains THP values (20, 40, 60 bara)
  • Subsequent rows: first column is flow rate, remaining columns are BHP values
  • NaN indicates the operating point is infeasible (e.g., constraint violation)
Version:
1.0
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

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

      private double[] thpValues
      THP (outlet pressure) values - column headers.
    • flowRates

      private double[] flowRates
      Flow rate values - row headers.
    • bhpValues

      private double[][] bhpValues
      BHP (inlet pressure) matrix [flowIndex][thpIndex].
    • pressureUnit

      private String pressureUnit
      Unit for THP and BHP pressures.
    • flowRateUnit

      private String flowRateUnit
      Unit for flow rates.
    • tableName

      private String tableName
      Table name/identifier.
    • comments

      private String comments
      Optional comments/metadata.
  • Constructor Details

    • LiftCurveTable

      public LiftCurveTable()
      Creates an empty lift curve table.
    • LiftCurveTable

      public LiftCurveTable(int numFlowRates, int numThpValues)
      Creates a lift curve table with specified dimensions.
      Parameters:
      numFlowRates - number of flow rate points
      numThpValues - number of THP points
    • LiftCurveTable

      public LiftCurveTable(double[] flowRates, double[] thpValues, double[][] bhpValues)
      Creates a lift curve table with specified values.
      Parameters:
      flowRates - flow rate values (row headers)
      thpValues - THP values (column headers)
      bhpValues - BHP values [flowIndex][thpIndex]
  • Method Details

    • toEclipseFormat

      public String toEclipseFormat()
      Converts the table to Eclipse-compatible format.

      Format:

      THP
      thp1 thp2 thp3
      flow1 bhp11 bhp12 bhp13
      flow2 bhp21 bhp22 bhp23
      
      Returns:
      Eclipse format string
    • toCSV

      public String toCSV()
      Converts the table to CSV format.
      Returns:
      CSV format string
    • toJson

      public String toJson()
      Converts the table to a JSON representation.
      Returns:
      JSON string
    • getRawDataWithHeaders

      public double[][] getRawDataWithHeaders()
      Gets the raw data as a 2D array including row/column headers.

      Returns array where:

      • [0][0] = 0 (corner)
      • [0][1..n] = THP values
      • [1..m][0] = flow rates
      • [1..m][1..n] = BHP values
      Returns:
      2D array with headers and data
    • getBHP

      public double getBHP(int flowIndex, int thpIndex)
      Gets the BHP value at specified flow rate and THP indices.
      Parameters:
      flowIndex - flow rate index
      thpIndex - THP index
      Returns:
      BHP value, or NaN if infeasible
    • setBHP

      public void setBHP(int flowIndex, int thpIndex, double bhp)
      Sets the BHP value at specified indices.
      Parameters:
      flowIndex - flow rate index
      thpIndex - THP index
      bhp - BHP value (or NaN for infeasible)
    • interpolateBHP

      public double interpolateBHP(double flowRate, double thp)
      Interpolates BHP for given flow rate and THP using bilinear interpolation.
      Parameters:
      flowRate - flow rate
      thp - THP value
      Returns:
      interpolated BHP, or NaN if outside bounds or near infeasible points
    • countFeasiblePoints

      public int countFeasiblePoints()
      Counts the number of feasible (non-NaN) points in the table.
      Returns:
      number of feasible points
    • getTotalPoints

      public int getTotalPoints()
      Gets the total number of points in the table.
      Returns:
      total points
    • getFeasibilityPercent

      public double getFeasibilityPercent()
      Gets the feasibility percentage.
      Returns:
      percentage of feasible points (0-100)
    • formatNumber

      private String formatNumber(double value)
      Formats a number for output.
    • getThpValues

      public double[] getThpValues()
      Gets the THP values.
      Returns:
      THP values array
    • setThpValues

      public void setThpValues(double[] thpValues)
      Sets the THP values.
      Parameters:
      thpValues - THP values array
    • getFlowRates

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

      public void setFlowRates(double[] flowRates)
      Sets the flow rate values.
      Parameters:
      flowRates - flow rate values array
    • getBhpValues

      public double[][] getBhpValues()
      Gets the BHP values matrix.
      Returns:
      BHP values [flowIndex][thpIndex]
    • setBhpValues

      public void setBhpValues(double[][] bhpValues)
      Sets the BHP values matrix.
      Parameters:
      bhpValues - BHP values [flowIndex][thpIndex]
    • getPressureUnit

      public String getPressureUnit()
      Gets the pressure unit.
      Returns:
      pressure unit
    • setPressureUnit

      public void setPressureUnit(String pressureUnit)
      Sets the pressure unit.
      Parameters:
      pressureUnit - pressure unit
    • getFlowRateUnit

      public String getFlowRateUnit()
      Gets the flow rate unit.
      Returns:
      flow rate unit
    • setFlowRateUnit

      public void setFlowRateUnit(String flowRateUnit)
      Sets the flow rate unit.
      Parameters:
      flowRateUnit - flow rate unit
    • getTableName

      public String getTableName()
      Gets the table name.
      Returns:
      table name
    • setTableName

      public void setTableName(String tableName)
      Sets the table name.
      Parameters:
      tableName - table name
    • getComments

      public String getComments()
      Gets the comments.
      Returns:
      comments
    • setComments

      public void setComments(String comments)
      Sets the comments.
      Parameters:
      comments - comments
    • toString

      public String toString()
      Overrides:
      toString in class Object