Class NetworkLoop

java.lang.Object
neqsim.process.equipment.network.NetworkLoop
All Implemented Interfaces:
Serializable

public class NetworkLoop extends Object implements Serializable
Represents an independent loop in a pipeline network.

A loop consists of a set of pipelines that form a closed path in the network. Each pipeline in the loop has a direction (+1 or -1) indicating whether its positive flow direction aligns with the loop traversal direction.

This class is used by the Hardy Cross method to balance head losses around each independent loop in a looped network topology.

Hardy Cross Method

For each loop, the method:

  1. Calculates the algebraic sum of head losses around the loop
  2. Calculates a flow correction using: ΔQ = -∑H / (2 · ∑|H/Q|)
  3. Applies the correction to all pipes in the loop

References

  • Cross, H. (1936). "Analysis of Flow in Networks of Conduits or Conductors."
  • Todini, E. and Pilati, S. (1988). "A gradient algorithm for the analysis of pipe networks."
Version:
1.0
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • loopId

      private final String loopId
      Unique identifier for this loop.
    • members

      private final List<NetworkLoop.LoopMember> members
      Pipes in this loop with their directions.
    • lastHeadLossImbalance

      private double lastHeadLossImbalance
      Last calculated head loss imbalance (Pa).
    • lastFlowCorrection

      private double lastFlowCorrection
      Last calculated flow correction (kg/s).
    • tolerance

      private double tolerance
      Convergence tolerance for head loss balance (Pa).
  • Constructor Details

    • NetworkLoop

      public NetworkLoop(String loopId)
      Create a new network loop.
      Parameters:
      loopId - unique identifier
  • Method Details

    • addMember

      public void addMember(String pipeName, int direction)
      Add a pipeline to this loop.
      Parameters:
      pipeName - the pipeline name
      direction - +1 if flow direction aligns with loop traversal, -1 otherwise
    • getLoopId

      public String getLoopId()
      Get the loop identifier.
      Returns:
      loop ID
    • getMembers

      public List<NetworkLoop.LoopMember> getMembers()
      Get all members of this loop.
      Returns:
      unmodifiable list of loop members
    • size

      public int size()
      Get the number of pipes in this loop.
      Returns:
      number of pipes
    • isBalanced

      public boolean isBalanced(double imbalance)
      Check if the loop is balanced within tolerance.
      Parameters:
      imbalance - current head loss imbalance in Pa
      Returns:
      true if |head loss imbalance| is less than tolerance
    • getLastHeadLossImbalance

      public double getLastHeadLossImbalance()
      Get the last calculated head loss imbalance.
      Returns:
      head loss imbalance in Pa
    • setLastHeadLossImbalance

      public void setLastHeadLossImbalance(double imbalance)
      Set the last head loss imbalance.
      Parameters:
      imbalance - head loss imbalance in Pa
    • getLastFlowCorrection

      public double getLastFlowCorrection()
      Get the last calculated flow correction.
      Returns:
      flow correction in kg/s
    • setLastFlowCorrection

      public void setLastFlowCorrection(double correction)
      Set the last flow correction.
      Parameters:
      correction - flow correction in kg/s
    • setTolerance

      public void setTolerance(double tolerance)
      Set the convergence tolerance for head loss balance.
      Parameters:
      tolerance - tolerance in Pa
    • getTolerance

      public double getTolerance()
      Get the convergence tolerance.
      Returns:
      tolerance in Pa
    • toString

      public String toString()
      Get a string representation of the loop for debugging.
      Overrides:
      toString in class Object
      Returns:
      string describing the loop