Class NetworkSolver

java.lang.Object
neqsim.process.fielddevelopment.network.NetworkSolver
All Implemented Interfaces:
Serializable

public class NetworkSolver extends Object implements 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:

  1. Assume manifold pressure
  2. Calculate each well's production at that backpressure
  3. Calculate flowline pressure drops
  4. Adjust manifold pressure to satisfy pressure balance
  5. 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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • name

      private String name
    • solutionMode

      private NetworkSolver.SolutionMode solutionMode
    • manifoldPressure

      private double manifoldPressure
    • maxTotalRate

      private double maxTotalRate
    • targetTotalRate

      private double targetTotalRate
    • wellNodes

      private List<NetworkSolver.WellNode> wellNodes
    • referenceFluid

      private SystemInterface 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

      public NetworkSolver(String name)
      Creates a new network solver.
      Parameters:
      name - network name
  • Method Details

    • addWell

      public NetworkSolver addWell(WellSystem well, double flowlineLengthKm)
      Adds a well to the network.
      Parameters:
      well - integrated well system
      flowlineLengthKm - flowline length in km
      Returns:
      this for chaining
    • addWell

      public NetworkSolver addWell(WellSystem well, double flowlineLengthKm, double flowlineDiameterM)
      Adds a well with flowline specifications.
      Parameters:
      well - integrated well system
      flowlineLengthKm - flowline length in km
      flowlineDiameterM - flowline inner diameter in meters
      Returns:
      this for chaining
    • setSolutionMode

      public NetworkSolver setSolutionMode(NetworkSolver.SolutionMode mode)
      Sets the solution mode.
      Parameters:
      mode - solution mode
      Returns:
      this for chaining
    • setManifoldPressure

      public NetworkSolver setManifoldPressure(double pressure, String unit)
      Sets the manifold pressure constraint.
      Parameters:
      pressure - manifold pressure
      unit - pressure unit
      Returns:
      this for chaining
    • setMaxTotalRate

      public NetworkSolver setMaxTotalRate(double rate, String unit)
      Sets the maximum total production rate constraint.
      Parameters:
      rate - maximum rate
      unit - rate unit
      Returns:
      this for chaining
    • setTargetTotalRate

      public NetworkSolver setTargetTotalRate(double rate, String unit)
      Sets the target total rate for FIXED_TOTAL_RATE mode.
      Parameters:
      rate - target rate
      unit - rate unit
      Returns:
      this for chaining
    • setReferenceFluid

      public NetworkSolver setReferenceFluid(SystemInterface fluid)
      Sets the reference fluid for pressure drop calculations.
      Parameters:
      fluid - thermodynamic system
      Returns:
      this for chaining
    • setWellEnabled

      public NetworkSolver setWellEnabled(String wellName, boolean enabled)
      Enables or disables a well.
      Parameters:
      wellName - well name
      enabled - true to enable, false to shut in
      Returns:
      this for chaining
    • setChokeOpening

      public NetworkSolver setChokeOpening(String wellName, double opening)
      Sets the choke opening for a well.
      Parameters:
      wellName - well name
      opening - choke opening (0-1)
      Returns:
      this for chaining
    • setSolverParameters

      public NetworkSolver setSolverParameters(double tolerance, int maxIter, double relaxation)
      Sets solver parameters.
      Parameters:
      tolerance - convergence tolerance (fraction)
      maxIter - maximum iterations
      relaxation - under-relaxation factor
      Returns:
      this for chaining
    • solve

      public NetworkResult 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

      private double estimateFlowlinePressureDrop(NetworkSolver.WellNode node)
      Estimates flowline pressure drop using simplified Beggs-Brill.
    • findWHPForRate

      private double findWHPForRate(NetworkSolver.WellNode node, double targetRate)
      Finds wellhead pressure required to achieve target rate.
    • buildResult

      private NetworkResult buildResult()
      Builds the result object.
    • convertRateToSm3PerDay

      private double convertRateToSm3PerDay(double rate, String unit)
    • getName

      public String getName()
      Gets the network name.
      Returns:
      network name
    • 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

      public StreamInterface getCombinedStream()
      Gets the combined outlet stream from all wells.
      Returns:
      combined stream (requires referenceFluid to be set)