Class LiftCurveGenerator
java.lang.Object
neqsim.process.util.optimizer.LiftCurveGenerator
- All Implemented Interfaces:
Serializable
Generates lift curves (VLP tables) for reservoir simulator integration.
This class generates flow rate vs. pressure tables for use in Eclipse and other reservoir simulators. It sweeps through specified THP (outlet pressure) values and calculates the required BHP (inlet pressure) for each flow rate.
Modes of Operation
- BHP calculation mode - Given flow rates and THP values, calculate required BHP
- Flow calculation mode - Given BHP and THP values, calculate achievable flow rate
Example Usage
// Create process system with pipeline
ProcessSystem process = new ProcessSystem();
process.add(inlet);
process.add(pipe);
// Create generator
LiftCurveGenerator generator = new LiftCurveGenerator(process, "inlet", "pipeline");
generator.setMaxVelocity(20.0); // m/s constraint
// Define operating envelope
double[] flowRates = {1000, 5000, 10000, 20000, 30000}; // kg/hr
double[] thpValues = {20, 40, 60, 80}; // bara
// Generate table
LiftCurveTable table = generator.generateTable(flowRates, thpValues, "bara", "kg/hr");
// Export to Eclipse format
String eclipseFormat = table.toEclipseFormat();
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SystemInterfaceBase fluid for calculations.private booleanWhether to check capacity constraints.private static final org.apache.logging.log4j.LoggerLogger object for class.private doubleMaximum velocity constraint in m/s.private FlowRateOptimizerThe underlying flow rate optimizer.private ProcessModelProcessModel being analyzed (if in process model mode).private ProcessSystemProcessSystem being analyzed (if in process system mode).private static final longSerialization version UID.private StringTable name for generated tables. -
Constructor Summary
ConstructorsConstructorDescriptionLiftCurveGenerator(ProcessModel processModel, String inletStreamName, String outletStreamName) Creates a lift curve generator for a ProcessModel.LiftCurveGenerator(ProcessSystem processSystem, String inletStreamName, String outletStreamName) Creates a lift curve generator for a ProcessSystem. -
Method Summary
Modifier and TypeMethodDescriptiongenerateFlowRateTable(double[] bhpValues, double[] thpValues, String pressureUnit, String flowRateUnit) Generates a lift curve table by calculating flow rates for given BHP and THP combinations.generateTable(double[] flowRates, double[] thpValues, String pressureUnit, String flowRateUnit) Generates a lift curve table with BHP values for given flow rates and THP values.generateTableAutoRange(int numFlowPoints, int numPressurePoints, double minTHP, double maxTHP, String pressureUnit, String flowRateUnit) Generates a table with automatic range determination based on equipment limits.doubleGets the maximum velocity constraint.Gets the underlying optimizer.Gets the table name for generated tables.booleanChecks if constraints are being checked.voidsetCheckConstraints(boolean checkConstraints) Sets whether to check constraints.voidsetFlowRateLimits(double minFlowRate, double maxFlowRate) Sets flow rate limits for the optimizer.voidsetMaxVelocity(double maxVelocity) Sets the maximum velocity constraint.voidsetOptimizerParameters(int maxIterations, double tolerance) Sets optimizer parameters.voidsetTableName(String tableName) Sets the table name for generated tables.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger object for class. -
optimizer
The underlying flow rate optimizer. -
processSystem
ProcessSystem being analyzed (if in process system mode). -
processModel
ProcessModel being analyzed (if in process model mode). -
baseFluid
Base fluid for calculations. -
maxVelocity
private double maxVelocityMaximum velocity constraint in m/s. -
checkConstraints
private boolean checkConstraintsWhether to check capacity constraints. -
tableName
Table name for generated tables.
-
-
Constructor Details
-
LiftCurveGenerator
public LiftCurveGenerator(ProcessSystem processSystem, String inletStreamName, String outletStreamName) Creates a lift curve generator for a ProcessSystem.- Parameters:
processSystem- the process system to analyzeinletStreamName- name of the inlet streamoutletStreamName- name of the outlet stream
-
LiftCurveGenerator
public LiftCurveGenerator(ProcessModel processModel, String inletStreamName, String outletStreamName) Creates a lift curve generator for a ProcessModel.- Parameters:
processModel- the process model to analyzeinletStreamName- name of the inlet streamoutletStreamName- name of the outlet stream
-
-
Method Details
-
generateTable
public LiftCurveTable generateTable(double[] flowRates, double[] thpValues, String pressureUnit, String flowRateUnit) Generates a lift curve table with BHP values for given flow rates and THP values.For each combination of flow rate and THP, this method calculates the required BHP (inlet pressure) to achieve that operating point. If the point is infeasible (e.g., due to constraint violations), the BHP is set to NaN.
- Parameters:
flowRates- array of flow rates to evaluatethpValues- array of THP (outlet pressure) valuespressureUnit- unit for pressure valuesflowRateUnit- unit for flow rates- Returns:
- generated lift curve table
-
generateFlowRateTable
public LiftCurveTable generateFlowRateTable(double[] bhpValues, double[] thpValues, String pressureUnit, String flowRateUnit) Generates a lift curve table by calculating flow rates for given BHP and THP combinations.This is the inverse of
generateTable(double[], double[], String, String)- for each combination of BHP (inlet pressure) and THP (outlet pressure), it calculates the achievable flow rate.- Parameters:
bhpValues- array of BHP (inlet pressure) valuesthpValues- array of THP (outlet pressure) valuespressureUnit- unit for pressure valuesflowRateUnit- unit for output flow rates- Returns:
- generated table with flow rates instead of BHP
-
generateTableAutoRange
public LiftCurveTable generateTableAutoRange(int numFlowPoints, int numPressurePoints, double minTHP, double maxTHP, String pressureUnit, String flowRateUnit) Generates a table with automatic range determination based on equipment limits.- Parameters:
numFlowPoints- number of flow rate pointsnumPressurePoints- number of pressure pointsminTHP- minimum THP valuemaxTHP- maximum THP valuepressureUnit- pressure unitflowRateUnit- flow rate unit- Returns:
- generated table
-
getMaxVelocity
public double getMaxVelocity()Gets the maximum velocity constraint.- Returns:
- maximum velocity in m/s
-
setMaxVelocity
public void setMaxVelocity(double maxVelocity) Sets the maximum velocity constraint.- Parameters:
maxVelocity- maximum velocity in m/s
-
isCheckConstraints
public boolean isCheckConstraints()Checks if constraints are being checked.- Returns:
- true if checking constraints
-
setCheckConstraints
public void setCheckConstraints(boolean checkConstraints) Sets whether to check constraints.- Parameters:
checkConstraints- true to check constraints
-
getTableName
-
setTableName
Sets the table name for generated tables.- Parameters:
tableName- table name
-
getOptimizer
-
setOptimizerParameters
public void setOptimizerParameters(int maxIterations, double tolerance) Sets optimizer parameters.- Parameters:
maxIterations- maximum iterationstolerance- convergence tolerance
-
setFlowRateLimits
public void setFlowRateLimits(double minFlowRate, double maxFlowRate) Sets flow rate limits for the optimizer.- Parameters:
minFlowRate- minimum flow rate in kg/hrmaxFlowRate- maximum flow rate in kg/hr
-