Class NetworkSolver
java.lang.Object
neqsim.process.fielddevelopment.network.NetworkSolver
- All Implemented Interfaces:
Serializable
Production network solver for multi-well gathering systems.
This class solves the pressure-flow equilibrium in a gathering network connecting multiple wells to a common manifold or host facility. It supports:
- Multiple production wells with IPR+VLP models
- Flowlines from wellhead to manifold
- Common manifold pressure constraint
- Total production rate constraint (facility capacity)
- Choke/valve allocation for production optimization
Network Topology
Well-1 (IPR+VLP) ──┬─ Flowline-1 ──┐ Well-2 (IPR+VLP) ──┼─ Flowline-2 ──┼── Manifold ── Export Well-3 (IPR+VLP) ──┴─ Flowline-3 ──┘
Solution Method
The solver uses successive substitution with under-relaxation:
- Assume manifold pressure
- Calculate each well's production at that backpressure
- Calculate flowline pressure drops
- Adjust manifold pressure to satisfy pressure balance
- Repeat until convergence
Example Usage
NetworkSolver network = new NetworkSolver("Subsea Gathering");
// Add wells
network.addWell(well1, 5.0); // 5 km flowline
network.addWell(well2, 8.0); // 8 km flowline
network.addWell(well3, 3.0); // 3 km flowline
// Set constraints
network.setManifoldPressure(50.0, "bara");
network.setMaxTotalRate(15.0e6, "Sm3/day");
// Solve
NetworkResult result = network.solve();
System.out.println("Total rate: " + result.getTotalRate("MSm3/day"));
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSolution mode for the network.static classWell node in the network. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate doubleprivate doubleprivate intprivate doubleprivate Stringprivate SystemInterfaceprivate doubleprivate static final longprivate NetworkSolver.SolutionModeprivate booleanprivate doubleprivate doubleprivate List<NetworkSolver.WellNode> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddWell(WellSystem well, double flowlineLengthKm) Adds a well to the network.addWell(WellSystem well, double flowlineLengthKm, double flowlineDiameterM) Adds a well with flowline specifications.private NetworkResultBuilds the result object.private doubleconvertRateToSm3PerDay(double rate, String unit) private doubleEstimates flowline pressure drop using simplified Beggs-Brill.private doublefindWHPForRate(NetworkSolver.WellNode node, double targetRate) Finds wellhead pressure required to achieve target rate.Gets the combined outlet stream from all wells.intGets the number of enabled wells.getName()Gets the network name.intGets the number of wells.booleanisSolved()Checks if the network has been solved.setChokeOpening(String wellName, double opening) Sets the choke opening for a well.setManifoldPressure(double pressure, String unit) Sets the manifold pressure constraint.setMaxTotalRate(double rate, String unit) Sets the maximum total production rate constraint.setReferenceFluid(SystemInterface fluid) Sets the reference fluid for pressure drop calculations.Sets the solution mode.setSolverParameters(double tolerance, int maxIter, double relaxation) Sets solver parameters.setTargetTotalRate(double rate, String unit) Sets the target total rate for FIXED_TOTAL_RATE mode.setWellEnabled(String wellName, boolean enabled) Enables or disables a well.solve()Solves the network for pressure-flow equilibrium.private voidSolves with fixed manifold pressure - calculates resulting well rates.private voidSolves with fixed total rate - adjusts manifold pressure to achieve target.private voidOptimizes production allocation across wells.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
-
solutionMode
-
manifoldPressure
private double manifoldPressure -
maxTotalRate
private double maxTotalRate -
targetTotalRate
private double targetTotalRate -
wellNodes
-
referenceFluid
-
tolerance
private double tolerance -
maxIterations
private int maxIterations -
relaxationFactor
private double relaxationFactor -
solved
private boolean solved -
lastIterations
private int lastIterations -
lastResidual
private double lastResidual
-
-
Constructor Details
-
NetworkSolver
-
-
Method Details
-
addWell
Adds a well to the network.- Parameters:
well- integrated well systemflowlineLengthKm- flowline length in km- Returns:
- this for chaining
-
addWell
Adds a well with flowline specifications.- Parameters:
well- integrated well systemflowlineLengthKm- flowline length in kmflowlineDiameterM- flowline inner diameter in meters- Returns:
- this for chaining
-
setSolutionMode
Sets the solution mode.- Parameters:
mode- solution mode- Returns:
- this for chaining
-
setManifoldPressure
Sets the manifold pressure constraint.- Parameters:
pressure- manifold pressureunit- pressure unit- Returns:
- this for chaining
-
setMaxTotalRate
Sets the maximum total production rate constraint.- Parameters:
rate- maximum rateunit- rate unit- Returns:
- this for chaining
-
setTargetTotalRate
Sets the target total rate for FIXED_TOTAL_RATE mode.- Parameters:
rate- target rateunit- rate unit- Returns:
- this for chaining
-
setReferenceFluid
Sets the reference fluid for pressure drop calculations.- Parameters:
fluid- thermodynamic system- Returns:
- this for chaining
-
setWellEnabled
Enables or disables a well.- Parameters:
wellName- well nameenabled- true to enable, false to shut in- Returns:
- this for chaining
-
setChokeOpening
Sets the choke opening for a well.- Parameters:
wellName- well nameopening- choke opening (0-1)- Returns:
- this for chaining
-
setSolverParameters
Sets solver parameters.- Parameters:
tolerance- convergence tolerance (fraction)maxIter- maximum iterationsrelaxation- under-relaxation factor- Returns:
- this for chaining
-
solve
Solves the network for pressure-flow equilibrium.- Returns:
- network result
-
solveFixedManifoldPressure
private void solveFixedManifoldPressure()Solves with fixed manifold pressure - calculates resulting well rates. -
solveFixedTotalRate
private void solveFixedTotalRate()Solves with fixed total rate - adjusts manifold pressure to achieve target. -
solveOptimizeAllocation
private void solveOptimizeAllocation()Optimizes production allocation across wells. -
estimateFlowlinePressureDrop
Estimates flowline pressure drop using simplified Beggs-Brill. -
findWHPForRate
Finds wellhead pressure required to achieve target rate. -
buildResult
Builds the result object. -
convertRateToSm3PerDay
-
getName
-
getWellCount
public int getWellCount()Gets the number of wells.- Returns:
- well count
-
getEnabledWellCount
public int getEnabledWellCount()Gets the number of enabled wells.- Returns:
- enabled well count
-
isSolved
public boolean isSolved()Checks if the network has been solved.- Returns:
- true if solved
-
getCombinedStream
Gets the combined outlet stream from all wells.- Returns:
- combined stream (requires referenceFluid to be set)
-