Class PipeFlowNetwork
java.lang.Object
neqsim.util.NamedBaseClass
neqsim.process.SimulationBaseClass
neqsim.process.equipment.ProcessEquipmentBaseClass
neqsim.process.equipment.network.PipeFlowNetwork
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, SimulationInterface, NamedInterface
Network of pipelines connected through manifolds using compositional PipeFlowSystem.
<p> This class models pipeline networks where multiple pipelines converge to manifolds
(mixers) and pipelines depart from manifolds. Unlike
WellFlowlineNetwork which uses the
simpler Beggs-Brill correlation, this class uses the full OnePhasePipeLine with TDMA
solvers supporting: </p> <ul> <li>Compositional tracking through the
network</li> <li>Steady-state solutions</li> <li>Transient/dynamic
simulations</li> <li>Energy balance and heat transfer</li> </ul>
<h2>Architecture</h2> <p> The network is modeled as a directed graph where:
</p> <ul> <li>Nodes are manifolds (implemented as Mixer)</li>
<li>Edges are pipelines (implemented as OnePhasePipeLine)</li> <li>Feed
streams connect to source nodes</li> <li>The final node provides the network
outlet</li> </ul>
<h2>Example Usage</h2>
<pre>
// Create feeds
Stream feed1 = new Stream("feed1", gas1);
feed1.setFlowRate(5.0, "MSm3/day");
Stream feed2 = new Stream("feed2", gas2);
feed2.setFlowRate(3.0, "MSm3/day");
// Create network
PipeFlowNetwork network = new PipeFlowNetwork("gathering system");
// Create manifolds
String manifoldA = network.createManifold("manifold A");
String endManifold = network.createManifold("end manifold");
// Add inlet pipelines to manifold A
network.addInletPipeline("pipe1", feed1, manifoldA, 5000.0, 0.3, 50);
network.addInletPipeline("pipe2", feed2, manifoldA, 4500.0, 0.25, 45);
// Connect manifold A to end manifold with export pipeline
network.connectManifolds(manifoldA, endManifold, "export", 15000.0, 0.5, 100);
// Run steady-state
network.run();
// Access results
StreamInterface outlet = network.getOutletStream();
</pre>- Version:
- 1.0
- Author:
- Even Solbraa
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a manifold node in the network.static classRepresents a pipeline segment in the network. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AdvectionSchemeprivate final List<PipeFlowNetwork.PipelineSegment> private booleanprivate double[]private double[]private double[]private doubleprivate final List<StreamInterface> private booleanprivate final Map<String, PipeFlowNetwork.ManifoldNode> private static final longprivate doubleprivate StringFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddInletPipeline(String pipeName, StreamInterface feedStream, String toManifold, double length, double diameter, int numberOfNodes) Add an inlet pipeline from a feed stream to a manifold.private voidaddToExecutionOrder(PipeFlowNetwork.ManifoldNode node, List<PipeFlowNetwork.ManifoldNode> order, Set<String> visited) connectManifolds(String fromManifold, String toManifold, String pipeName, double length, double diameter, int numberOfNodes) Connect two manifolds with a pipeline.createManifold(String name) Create a manifold node in the network.private OnePhasePipeLinecreatePipeline(String name, StreamInterface inletStream, double length, double diameter, int numberOfNodes) Create and configure a pipeline.double[]getCompositionProfile(String pipeName, String componentName) Get the composition profile along a specific pipeline.private List<PipeFlowNetwork.ManifoldNode> Get execution order for manifolds (topological sort).Get all manifold nodes in the network.Get the outlet stream from the network.Get all pipeline segments in the network.double[]getPressureProfile(String pipeName, String unit) Get the pressure profile along a specific pipeline.doubleGet the current simulation time.double[]getTemperatureProfile(String pipeName, String unit) Get the temperature profile along a specific pipeline.Get the terminal manifold (network outlet).doublegetTotalPressureDrop(String unit) Get total network pressure drop.double[]getVelocityProfile(String pipeName) Get the velocity profile along a specific pipeline.voidReset simulation time to zero.voidRun steady-state simulation for the entire network.voidrunTransient(double dt, UUID id) Run transient simulation for the specified time step.voidsetAdvectionScheme(AdvectionScheme scheme) Set the advection scheme for compositional tracking.voidsetCompositionalTracking(boolean enable) Enable or disable compositional tracking.voidsetDefaultHeatTransferCoefficients(double outerCoeff, double wallCoeff) Set default heat transfer coefficients for new pipelines.voidsetDefaultOuterTemperature(double temperature) Set the default outer temperature for new pipelines.voidsetDefaultWallRoughness(double roughness) Set the default wall roughness for new pipelines.toJson()Serializes the Process Equipment along with its state to a JSON string.Methods inherited from class ProcessEquipmentBaseClass
copy, displayResult, equals, getConditionAnalysisMessage, getController, getEnergyStream, getEntropyProduction, getExergyChange, getMassBalance, getMassBalance, getMechanicalDesign, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, hashCode, initMechanicalDesign, isActive, isActive, isSetEnergyStream, reportResults, run_step, runConditionAnalysis, setController, setEnergyStream, setEnergyStream, setFlowValveController, setMinimumFlow, setPressure, setRegulatorOutSignal, setSpecification, setTemperature, solved, toJsonMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
getCapacityDuty, getCapacityMax, getExergyChange, getFluid, getRestCapacity, needRecalculation, validateSetupMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
manifolds
-
allPipelines
-
feedStreams
-
terminalManifoldName
-
compositionalTracking
private boolean compositionalTracking -
advectionScheme
-
simulationTime
private double simulationTime -
initialized
private boolean initialized -
defaultWallRoughness
private double defaultWallRoughness -
defaultOuterTemperature
private double[] defaultOuterTemperature -
defaultOuterHeatTransfer
private double[] defaultOuterHeatTransfer -
defaultWallHeatTransfer
private double[] defaultWallHeatTransfer
-
-
Constructor Details
-
PipeFlowNetwork
Create a new pipeline flow network.- Parameters:
name- network name
-
-
Method Details
-
createManifold
-
addInletPipeline
public PipeFlowNetwork.PipelineSegment addInletPipeline(String pipeName, StreamInterface feedStream, String toManifold, double length, double diameter, int numberOfNodes) Add an inlet pipeline from a feed stream to a manifold.- Parameters:
pipeName- pipeline namefeedStream- feed stream (source)toManifold- target manifold namelength- pipeline length in metersdiameter- pipeline diameter in metersnumberOfNodes- number of computational nodes- Returns:
- the created pipeline segment
-
connectManifolds
public PipeFlowNetwork.PipelineSegment connectManifolds(String fromManifold, String toManifold, String pipeName, double length, double diameter, int numberOfNodes) Connect two manifolds with a pipeline.- Parameters:
fromManifold- source manifold nametoManifold- target manifold namepipeName- pipeline namelength- pipeline length in metersdiameter- pipeline diameter in metersnumberOfNodes- number of computational nodes- Returns:
- the created pipeline segment
-
createPipeline
private OnePhasePipeLine createPipeline(String name, StreamInterface inletStream, double length, double diameter, int numberOfNodes) Create and configure a pipeline.- Parameters:
name- the pipeline nameinletStream- the inlet streamlength- the pipeline length in metersdiameter- the pipeline diameter in metersnumberOfNodes- the number of computational nodes- Returns:
- the configured pipeline
-
setDefaultWallRoughness
public void setDefaultWallRoughness(double roughness) Set the default wall roughness for new pipelines.- Parameters:
roughness- wall roughness in meters
-
setDefaultOuterTemperature
public void setDefaultOuterTemperature(double temperature) Set the default outer temperature for new pipelines.- Parameters:
temperature- outer temperature in Kelvin
-
setDefaultHeatTransferCoefficients
public void setDefaultHeatTransferCoefficients(double outerCoeff, double wallCoeff) Set default heat transfer coefficients for new pipelines.- Parameters:
outerCoeff- outer heat transfer coefficient (W/m2K)wallCoeff- wall heat transfer coefficient (W/m2K)
-
setCompositionalTracking
public void setCompositionalTracking(boolean enable) Enable or disable compositional tracking.- Parameters:
enable- true to enable compositional tracking
-
setAdvectionScheme
Set the advection scheme for compositional tracking.- Parameters:
scheme- advection scheme
-
getPipelines
Get all pipeline segments in the network.- Returns:
- list of pipeline segments
-
getManifolds
Get all manifold nodes in the network.- Returns:
- map of manifold names to nodes
-
getTerminalManifold
Get the terminal manifold (network outlet).- Returns:
- the terminal manifold node
-
getOutletStream
Get the outlet stream from the network.- Returns:
- the outlet stream
-
getSimulationTime
public double getSimulationTime()Get the current simulation time.- Returns:
- simulation time in seconds
-
resetSimulationTime
public void resetSimulationTime()Reset simulation time to zero. -
getExecutionOrder
Get execution order for manifolds (topological sort).- Returns:
- list of manifold nodes in execution order
-
addToExecutionOrder
private void addToExecutionOrder(PipeFlowNetwork.ManifoldNode node, List<PipeFlowNetwork.ManifoldNode> order, Set<String> visited) -
run
-
runTransient
Run transient simulation for the specified time step.- Parameters:
dt- time step in secondsid- calculation identifier
-
getPressureProfile
-
getTemperatureProfile
-
getCompositionProfile
-
getVelocityProfile
Get the velocity profile along a specific pipeline.- Parameters:
pipeName- pipeline name- Returns:
- array of velocities (m/s) at each node
-
getTotalPressureDrop
Get total network pressure drop.- Parameters:
unit- pressure unit- Returns:
- total pressure drop
-
toJson
Description copied from class:ProcessEquipmentBaseClassSerializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classProcessEquipmentBaseClass- Returns:
- json string.
-