Class NetworkLoop
java.lang.Object
neqsim.process.equipment.network.NetworkLoop
- All Implemented Interfaces:
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:
- Calculates the algebraic sum of head losses around the loop
- Calculates a flow correction using: ΔQ = -∑H / (2 · ∑|H/Q|)
- 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a pipeline member of a loop with its traversal direction. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleLast calculated flow correction (kg/s).private doubleLast calculated head loss imbalance (Pa).private final StringUnique identifier for this loop.private final List<NetworkLoop.LoopMember> Pipes in this loop with their directions.private static final longprivate doubleConvergence tolerance for head loss balance (Pa). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a pipeline to this loop.doubleGet the last calculated flow correction.doubleGet the last calculated head loss imbalance.Get the loop identifier.Get all members of this loop.doubleGet the convergence tolerance.booleanisBalanced(double imbalance) Check if the loop is balanced within tolerance.voidsetLastFlowCorrection(double correction) Set the last flow correction.voidsetLastHeadLossImbalance(double imbalance) Set the last head loss imbalance.voidsetTolerance(double tolerance) Set the convergence tolerance for head loss balance.intsize()Get the number of pipes in this loop.toString()Get a string representation of the loop for debugging.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
loopId
Unique identifier for this loop. -
members
Pipes in this loop with their directions. -
lastHeadLossImbalance
private double lastHeadLossImbalanceLast calculated head loss imbalance (Pa). -
lastFlowCorrection
private double lastFlowCorrectionLast calculated flow correction (kg/s). -
tolerance
private double toleranceConvergence tolerance for head loss balance (Pa).
-
-
Constructor Details
-
NetworkLoop
-
-
Method Details
-
addMember
Add a pipeline to this loop.- Parameters:
pipeName- the pipeline namedirection- +1 if flow direction aligns with loop traversal, -1 otherwise
-
getLoopId
-
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
-