Class Pipeline
- All Implemented Interfaces:
Serializable, Runnable, CapacityConstrainedEquipment, PipeLineInterface, ProcessEquipmentInterface, TwoPortInterface, SimulationInterface, NamedInterface
- Direct Known Subclasses:
AdiabaticPipe, AdiabaticTwoPhasePipe, MultiphasePipe, OnePhasePipeLine, PipeBeggsAndBrills, SimpleTPoutPipeline, TubingPerformance, TwoFluidPipe, TwoPhasePipeLine, WaterHammerPipe
This class provides the foundation for all pipeline models in NeqSim. It implements the
PipeLineInterface with default implementations that can be overridden by specialized
subclasses.
Subclasses
AdiabaticPipe- Single-phase adiabatic pipeAdiabaticTwoPhasePipe- Two-phase adiabatic pipePipeBeggsAndBrills- Beggs and Brill multiphase correlationOnePhasePipeLine- One-phase flow with compositional trackingTwoPhasePipeLine- Two-phase flow modelTwoFluidPipe- Two-fluid transient modelWaterHammerPipe- Water hammer transient modelTubingPerformance- Wellbore vertical lift performance
- Version:
- 2.0
- Author:
- Even Solbraa
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFlag for adiabatic operation.protected doubleAmbient temperature in Kelvin.protected doublePipe angle from horizontal in degrees.protected doubleBurial depth in meters.protected booleanFlag for buried pipe.private final Map<String, CapacityConstraint> Storage for capacity constraints.protected doubleCoating thermal conductivity in W/(m·K).protected doubleCoating thickness in meters.protected doubleCorrosion allowance in meters.protected StringDesign code (e.g., ASME_B31_8).protected doubleDesign pressure in MPa.protected doubleDesign temperature in Celsius.protected doublePipe inner diameter in meters.protected doubleElevation change from inlet to outlet in meters.(package private) boolean(package private) booleanprotected Stringprotected FittingsCollection of pipe fittings for equivalent length calculations.(package private) Stringprotected StringFlow regime string.protected doubleFriction factor.protected doubleOverall heat transfer coefficient in W/(m²·K).protected doubleInlet elevation above reference in meters.protected doubleInner (fluid-side) heat transfer coefficient in W/(m²·K).protected doubleInsulation thermal conductivity in W/(m·K).protected doubleInsulation thickness in meters.protected StringInsulation type/material.(package private) double[](package private) double[]protected doubleTotal pipe length in meters.protected doubleLiquid holdup fraction.protected double[]Liquid holdup profile along pipe.protected intLocation class per ASME B31.8.(package private) static org.apache.logging.log4j.LoggerLogger object for class.protected StringMaterial grade per API 5L.protected PipeMechanicalDesignCalculatorMechanical design calculator.protected intNumber of computational increments.(package private) int(package private) intprotected doubleOuter (external) heat transfer coefficient in W/(m²·K).(package private) double[](package private) double[]protected doubleOutlet elevation above reference in meters.protected FlowSystemInterface(package private) double[](package private) PipelineMechanicalDesignprotected StringPipe material.protected StringPipe schedule.protected doublePipe wall thermal conductivity in W/(m·K).(package private) double[]protected doubleCalculated pressure drop in bar.protected double[]Pressure profile along pipe.protected doubleReynolds number.protected doublePipe wall roughness in meters.private static final longSerialization version UID.protected doubleSoil thermal conductivity in W/(m·K).protected doubleConstant surface temperature in Kelvin.protected SystemInterfaceprotected double[]Temperature profile along pipe.(package private) double[]protected booleanFlag to enable/disable fittings in pressure drop calculations.protected doubleFlow velocity in m/s.(package private) double[]protected doublePipe wall thickness in meters.Fields inherited from class TwoPortEquipment
inStream, outStreamFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for Pipeline.Pipeline(String name, StreamInterface inStream) Constructor for Pipeline with inlet stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCapacityConstraint(CapacityConstraint constraint) Adds a new capacity constraint to this equipment.voidaddFitting(String name, double LdivD) Add a fitting with a specified L/D ratio.voidaddFittingFromDatabase(String name) Add a fitting by name, loading L/D from database.voidaddFittings(String name, double LdivD, int count) Add multiple identical fittings with specified L/D ratio.booleanaddStandardFitting(String type) Add a standard fitting type with predefined L/D value.booleanaddStandardFittings(String type, int count) Add multiple standard fittings of the same type.doubleCalculate hoop stress at operating pressure.doubleCalculate Maximum Allowable Operating Pressure (MAOP).doubleCalculate minimum required wall thickness based on design code.doubleCalculate the overall heat transfer coefficient based on pipe buildup.doubleCalculate hydrostatic test pressure.doublecalculateVonMisesStress(double deltaT) Calculate von Mises equivalent stress.voidClears all capacity constraints from this equipment.voidClear all fittings from the pipe.voiddisplayResult.Generate a mechanical design report.doubleGet the ambient temperature.doublegetAngle()Get the angle of the pipe from horizontal.Gets the constraint with the highest utilization (the bottleneck).doubleGet the burial depth.Gets all capacity constraints defined for this equipment.doublegetCapacityDuty.doublegetCapacityMax.doubleGet the coating thermal conductivity.doubleGet the coating thickness.doubleGet the corrosion allowance.Get the design code.doubleGet design pressure.doubleGet maximum design temperature.doubleGet the pipe inner diameter.doubleGet the effective pipe length for pressure drop calculations.doubleGet the elevation change from inlet to outlet.doublegetEntropyProduction(String unit) getEntropyProduction.doubleCalculate the total equivalent length from all fittings.Get the fittings collection.Get the determined flow regime.doubleGet the friction factor.doubleGet the overall heat transfer coefficient.doubleGet the inlet elevation above reference.doubleGet the inner (fluid-side) heat transfer coefficient.doubleGet the insulation thermal conductivity.doubleGet the insulation thickness.Get the insulation type/material.doubleGet the total pipe length.doubleGet the liquid holdup fraction.double[]Get the liquid holdup profile along the pipe.intGet the location class.doubleGet MAOP in specified unit.Get the pipe material grade.doubleGets the maximum utilization across all constraints.Get amechanicalDesignfor the equipment.Get the mechanical design calculator for this pipeline.intGet the number of fittings added to this pipe.intGet number of computational increments/segments.intGet number of pipe legs/segments.doubleGet the outer (external) heat transfer coefficient.doubleGet the outlet elevation above reference.doublegetOutletPressure(String unit) Get the outlet pressure.doublegetOutletTemperature(String unit) Get the outlet temperature.getPipe()Get the underlying flow system (for advanced models).Get the pipe material.Get the pipe schedule.doubleGet the pipe wall thermal conductivity.doubleGet the pipe wall roughness.doubleGet the total pressure drop across the pipeline.double[]Get the pressure profile along the pipe.doubleGet the Reynolds number for the flow.doubleGet the soil thermal conductivity.doublegetSuperficialVelocity(int phaseNumber) Get the superficial velocity for a specific phase.doublegetSuperficialVelocity(int phaseNum, int node) Get superficial velocity for a phase at a specific node.double[]Get the temperature profile along the pipe.double[]getTimes()Get the time array for transient simulations.doubleGet the total L/D ratio of all fittings.doubleGet the flow velocity in the pipe.doubleGet the pipe wall thickness.protected voidInitializes default capacity constraints for the pipeline.voidInitialize ainitMechanicalDesignfor the equipment.booleanCheck if the pipe is operating in adiabatic mode.booleanisBuried()Check if the pipe is buried.booleanChecks if any capacity constraint is violated (exceeds 100% utilization).booleanChecks if any HARD constraint limit is exceeded.booleanCheck if the mechanical design is within allowable stress limits.booleanCheck if fittings are enabled in pressure drop calculations.voidPrint a summary of all fittings to the console.booleanremoveCapacityConstraint(String constraintName) Removes a capacity constraint by name.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunTransient(double dt, UUID id) runTransientvoidsetAdiabatic(boolean adiabatic) Set whether the pipe operates in adiabatic mode.voidsetAmbientTemperature(double temperature) Set the ambient temperature.voidsetAmbientTemperatures(double[] temperatures) Set ambient/surrounding temperatures for each pipe segment.voidsetAngle(double angle) Set the angle of the pipe from horizontal.voidsetBurialDepth(double depth) Set the burial depth below ground surface.voidsetBuried(boolean buried) Set whether the pipe is buried.voidsetCoatingConductivity(double conductivity) Set the coating thermal conductivity.voidsetCoatingThickness(double thickness) Set the coating thickness.voidsetConstantSurfaceTemperature(double temperature) Set the constant surface temperature for heat transfer.voidsetCorrosionAllowance(double allowance) Set the corrosion allowance.voidsetDesignCode(String code) Set the design code for wall thickness and pressure calculations.voidsetDesignPressure(double pressure) Set design pressure for mechanical design calculations.voidsetDesignPressure(double pressure, String unit) Set design pressure with unit.voidsetDesignTemperature(double temperature) Set maximum design temperature for mechanical design.voidsetDiameter(double diameter) Set the pipe inner diameter.voidsetElevation(double elevation) Set the elevation change from inlet to outlet.voidsetEquilibriumHeatTransfer(boolean equilibriumHeatTransfer) Set equilibrium heat transfer flag.voidsetEquilibriumMassTransfer(boolean equilibriumMassTransfer) Set equilibrium mass transfer flag.voidsetHeatTransferCoefficient(double coefficient) Set the overall heat transfer coefficient.voidsetHeightProfile(double[] heights) Set the height profile along the pipe.voidsetInitialFlowPattern(String flowPattern) Set initial flow pattern for simulation initialization.voidsetInletElevation(double inletElevation) Set the inlet elevation above reference.voidsetInnerHeatTransferCoefficient(double coefficient) Set the inner (fluid-side) heat transfer coefficient.voidsetInsulationConductivity(double conductivity) Set the insulation thermal conductivity.voidsetInsulationThickness(double thickness) Set the insulation thickness.voidsetInsulationType(String insulationType) Set the insulation type/material.voidsetLegPositions(double[] positions) Set the position of each leg along the pipe.voidsetLength(double length) Set the total pipe length.voidsetLocationClass(int locationClass) Set the location class per ASME B31.8.voidsetMaterialGrade(String grade) Set the pipe material grade per API 5L.voidsetNumberOfIncrements(int numberOfIncrements) Set number of computational increments/segments.voidsetNumberOfLegs(int number) Set number of pipe legs/segments.voidsetNumberOfNodesInLeg(int number) Set number of computational nodes in each leg.voidsetOuterHeatTransferCoefficient(double coefficient) Set the outer (external) heat transfer coefficient.voidsetOuterHeatTransferCoefficients(double[] coefficients) Set outer heat transfer coefficients for each pipe segment.voidsetOuterTemperatures(double[] outerTemp) Set outer temperatures for heat transfer calculations.voidsetOutletElevation(double outletElevation) Set the outlet elevation above reference.voidsetOutletPressure(double pressure) Set outlet pressure of twoport.voidsetOutletTemperature(double temperature) Set outlet temperature of twoport.voidsetOutputFileName(String name) Set output file name for detailed results.voidsetPipeDiameters(double[] diameters) Set pipe diameters for each segment.voidsetPipeMaterial(String material) Set the pipe material.voidsetPipeOuterHeatTransferCoefficients(double[] heatCoefs) Set pipe outer heat transfer coefficients for each leg.voidsetPipeSchedule(String schedule) Set the pipe schedule.voidsetPipeSpecification(double nominalDiameter, String specification) Set pipe specification from database.voidsetPipeWallConductivity(double conductivity) Set the pipe wall thermal conductivity.voidsetPipeWallHeatTransferCoefficients(double[] heatCoefs) Set pipe wall heat transfer coefficients for each leg.voidsetPipeWallRoughness(double roughness) Set the pipe wall roughness.voidsetPipeWallRoughness(double[] rough) Set wall roughness for each segment.voidsetSoilConductivity(double conductivity) Set the soil thermal conductivity.voidsetTimeSeries(double[] times, SystemInterface[] systems, int timestepininterval) Set time series for transient simulation.voidsetUseFittings(boolean enable) Enable or disable fittings in pressure drop calculations.voidsetWallHeatTransferCoefficients(double[] coefficients) Set inner (wall) heat transfer coefficients for each pipe segment.voidsetWallThickness(double thickness) Set the pipe wall thickness.toJson()Serializes the Process Equipment along with its state to a JSON string.toJson(ReportConfig cfg) Serializes the Process Equipment with configurable level of detail.Methods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletTemperature, getMassBalance, getOutletPressure, getOutletStream, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, setOutletPressure, setOutletStream, setOutletTemperature, validateSetupMethods inherited from class ProcessEquipmentBaseClass
copy, equals, getConditionAnalysisMessage, getController, getEffectiveCapacityFactor, getEnergyStream, getExergyChange, getFailureMode, getMassBalance, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, hashCode, isActive, isActive, isCapacityAnalysisEnabled, isFailed, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solvedMethods 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 CapacityConstrainedEquipment
disableAllConstraints, enableAllConstraints, getAvailableMargin, getAvailableMarginPercent, getMaxUtilizationPercent, getUtilizationSummary, isCapacityAnalysisEnabled, isNearCapacityLimit, setCapacityAnalysisEnabledMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface PipeLineInterface
setOutPressure, setOutTemperatureMethods inherited from interface ProcessEquipmentInterface
getExergyChange, getFluid, getOperatingEnvelopeViolation, getRestCapacity, getSimulationValidationErrors, isSimulationValid, isWithinOperatingEnvelope, needRecalculationMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, run_step, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solvedMethods inherited from interface TwoPortInterface
getInletPressure, getInletStream, getInletTemperature, getInStream, getOutletPressure, getOutletStream, getOutletTemperature, getOutStream, setInletPressure, setInletStream, setInletTemperature, setOutletPressure, setOutletStream, setOutletTemperature, setOutPressure, setOutTemperature
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
fileName
-
pipe
-
system
-
length
protected double lengthTotal pipe length in meters. -
diameter
protected double diameterPipe inner diameter in meters. -
roughness
protected double roughnessPipe wall roughness in meters. -
wallThickness
protected double wallThicknessPipe wall thickness in meters. -
elevation
protected double elevationElevation change from inlet to outlet in meters. -
inletElevation
protected double inletElevationInlet elevation above reference in meters. -
outletElevation
protected double outletElevationOutlet elevation above reference in meters. -
angle
protected double anglePipe angle from horizontal in degrees. -
heatTransferCoefficient
protected double heatTransferCoefficientOverall heat transfer coefficient in W/(m²·K). -
surfaceTemperature
protected double surfaceTemperatureConstant surface temperature in Kelvin. -
adiabatic
protected boolean adiabaticFlag for adiabatic operation. -
ambientTemperature
protected double ambientTemperatureAmbient temperature in Kelvin. -
innerHeatTransferCoefficient
protected double innerHeatTransferCoefficientInner (fluid-side) heat transfer coefficient in W/(m²·K). -
outerHeatTransferCoefficient
protected double outerHeatTransferCoefficientOuter (external) heat transfer coefficient in W/(m²·K). -
pipeMaterial
Pipe material. -
pipeSchedule
Pipe schedule. -
pipeWallConductivity
protected double pipeWallConductivityPipe wall thermal conductivity in W/(m·K). -
insulationThickness
protected double insulationThicknessInsulation thickness in meters. -
insulationConductivity
protected double insulationConductivityInsulation thermal conductivity in W/(m·K). -
insulationType
Insulation type/material. -
coatingThickness
protected double coatingThicknessCoating thickness in meters. -
coatingConductivity
protected double coatingConductivityCoating thermal conductivity in W/(m·K). -
burialDepth
protected double burialDepthBurial depth in meters. -
soilConductivity
protected double soilConductivitySoil thermal conductivity in W/(m·K). -
buried
protected boolean buriedFlag for buried pipe. -
designPressure
protected double designPressureDesign pressure in MPa. -
designTemperature
protected double designTemperatureDesign temperature in Celsius. -
materialGrade
Material grade per API 5L. -
designCode
Design code (e.g., ASME_B31_8). -
locationClass
protected int locationClassLocation class per ASME B31.8. -
corrosionAllowance
protected double corrosionAllowanceCorrosion allowance in meters. -
mechanicalDesignCalculator
Mechanical design calculator. -
pressureDrop
protected double pressureDropCalculated pressure drop in bar. -
flowRegime
Flow regime string. -
liquidHoldup
protected double liquidHoldupLiquid holdup fraction. -
reynoldsNumber
protected double reynoldsNumberReynolds number. -
frictionFactor
protected double frictionFactorFriction factor. -
velocity
protected double velocityFlow velocity in m/s. -
pressureProfile
protected double[] pressureProfilePressure profile along pipe. -
temperatureProfile
protected double[] temperatureProfileTemperature profile along pipe. -
liquidHoldupProfile
protected double[] liquidHoldupProfileLiquid holdup profile along pipe. -
numberOfIncrements
protected int numberOfIncrementsNumber of computational increments. -
fittings
Collection of pipe fittings for equivalent length calculations.Fittings such as bends, valves, tees, and reducers contribute additional pressure drop beyond the straight pipe friction loss. This is accounted for using the equivalent length method, where each fitting is assigned an L/D ratio representing the length of straight pipe (in diameters) that would produce the same pressure drop.
-
useFittings
protected boolean useFittingsFlag to enable/disable fittings in pressure drop calculations.When true (default), the equivalent length from fittings is added to the physical pipe length in pressure drop calculations. Set to false to temporarily exclude fittings.
-
flowPattern
String flowPattern -
times
double[] times -
equilibriumHeatTransfer
boolean equilibriumHeatTransfer -
equilibriumMassTransfer
boolean equilibriumMassTransfer -
numberOfLegs
int numberOfLegs -
numberOfNodesInLeg
int numberOfNodesInLeg -
legHeights
double[] legHeights -
legPositions
double[] legPositions -
pipeDiameters
double[] pipeDiameters -
outerTemperature
double[] outerTemperature -
pipeWallRoughness
double[] pipeWallRoughness -
outerHeatTransferCoeffs
double[] outerHeatTransferCoeffs -
wallHeatTransferCoeffs
double[] wallHeatTransferCoeffs -
pipelineMechanicalDesign
PipelineMechanicalDesign pipelineMechanicalDesign -
capacityConstraints
Storage for capacity constraints.
-
-
Constructor Details
-
Pipeline
-
Pipeline
Constructor for Pipeline with inlet stream.- Parameters:
name- the equipment nameinStream- the inlet stream
-
-
Method Details
-
setLength
public void setLength(double length) Set the total pipe length.- Specified by:
setLengthin interfacePipeLineInterface- Parameters:
length- the pipe length in meters
-
getLength
public double getLength()Get the total pipe length.- Specified by:
getLengthin interfacePipeLineInterface- Returns:
- the pipe length in meters
-
setDiameter
public void setDiameter(double diameter) Set the pipe inner diameter.- Specified by:
setDiameterin interfacePipeLineInterface- Parameters:
diameter- the inner diameter in meters
-
getDiameter
public double getDiameter()Get the pipe inner diameter.- Specified by:
getDiameterin interfacePipeLineInterface- Returns:
- the inner diameter in meters
-
setPipeWallRoughness
public void setPipeWallRoughness(double roughness) Set the pipe wall roughness.- Specified by:
setPipeWallRoughnessin interfacePipeLineInterface- Parameters:
roughness- the wall roughness in meters
-
getPipeWallRoughness
public double getPipeWallRoughness()Get the pipe wall roughness.- Specified by:
getPipeWallRoughnessin interfacePipeLineInterface- Returns:
- the wall roughness in meters
-
setElevation
public void setElevation(double elevation) Set the elevation change from inlet to outlet.- Specified by:
setElevationin interfacePipeLineInterface- Parameters:
elevation- elevation change in meters (positive = uphill)
-
getElevation
public double getElevation()Get the elevation change from inlet to outlet.- Specified by:
getElevationin interfacePipeLineInterface- Returns:
- elevation change in meters
-
setInletElevation
public void setInletElevation(double inletElevation) Set the inlet elevation above reference.- Specified by:
setInletElevationin interfacePipeLineInterface- Parameters:
inletElevation- inlet elevation in meters
-
getInletElevation
public double getInletElevation()Get the inlet elevation above reference.- Specified by:
getInletElevationin interfacePipeLineInterface- Returns:
- inlet elevation in meters
-
setOutletElevation
public void setOutletElevation(double outletElevation) Set the outlet elevation above reference.- Specified by:
setOutletElevationin interfacePipeLineInterface- Parameters:
outletElevation- outlet elevation in meters
-
getOutletElevation
public double getOutletElevation()Get the outlet elevation above reference.- Specified by:
getOutletElevationin interfacePipeLineInterface- Returns:
- outlet elevation in meters
-
setAngle
public void setAngle(double angle) Set the angle of the pipe from horizontal.- Specified by:
setAnglein interfacePipeLineInterface- Parameters:
angle- angle in degrees (0 = horizontal, 90 = vertical upward)
-
getAngle
public double getAngle()Get the angle of the pipe from horizontal.- Specified by:
getAnglein interfacePipeLineInterface- Returns:
- angle in degrees (0 = horizontal, 90 = vertical upward)
-
setWallThickness
public void setWallThickness(double thickness) Set the pipe wall thickness.- Specified by:
setWallThicknessin interfacePipeLineInterface- Parameters:
thickness- wall thickness in meters
-
getWallThickness
public double getWallThickness()Get the pipe wall thickness.- Specified by:
getWallThicknessin interfacePipeLineInterface- Returns:
- wall thickness in meters
-
setNumberOfLegs
public void setNumberOfLegs(int number) Set number of pipe legs/segments.- Specified by:
setNumberOfLegsin interfacePipeLineInterface- Parameters:
number- number of legs
-
getNumberOfLegs
public int getNumberOfLegs()Get number of pipe legs/segments.- Specified by:
getNumberOfLegsin interfacePipeLineInterface- Returns:
- number of legs
-
setNumberOfNodesInLeg
public void setNumberOfNodesInLeg(int number) Set number of computational nodes in each leg.- Specified by:
setNumberOfNodesInLegin interfacePipeLineInterface- Parameters:
number- number of nodes per leg
-
setNumberOfIncrements
public void setNumberOfIncrements(int numberOfIncrements) Set number of computational increments/segments.- Specified by:
setNumberOfIncrementsin interfacePipeLineInterface- Parameters:
numberOfIncrements- number of increments for pressure drop calculation
-
getNumberOfIncrements
public int getNumberOfIncrements()Get number of computational increments/segments.- Specified by:
getNumberOfIncrementsin interfacePipeLineInterface- Returns:
- number of increments
-
setHeightProfile
public void setHeightProfile(double[] heights) Set the height profile along the pipe.- Specified by:
setHeightProfilein interfacePipeLineInterface- Parameters:
heights- array of heights at each leg boundary (length = numberOfLegs + 1)
-
setLegPositions
public void setLegPositions(double[] positions) Set the position of each leg along the pipe.- Specified by:
setLegPositionsin interfacePipeLineInterface- Parameters:
positions- array of positions at each leg boundary in meters
-
setPipeDiameters
public void setPipeDiameters(double[] diameters) Set pipe diameters for each segment.- Specified by:
setPipeDiametersin interfacePipeLineInterface- Parameters:
diameters- array of diameters for each leg boundary
-
setPipeWallRoughness
public void setPipeWallRoughness(double[] rough) Set wall roughness for each segment.- Specified by:
setPipeWallRoughnessin interfacePipeLineInterface- Parameters:
rough- array of roughness values for each leg
-
setOuterTemperatures
public void setOuterTemperatures(double[] outerTemp) Set outer temperatures for heat transfer calculations.- Specified by:
setOuterTemperaturesin interfacePipeLineInterface- Parameters:
outerTemp- array of outer temperatures in Kelvin for each leg
-
setOutletPressure
public void setOutletPressure(double pressure) Set outlet pressure of twoport.- Specified by:
setOutletPressurein interfacePipeLineInterface- Specified by:
setOutletPressurein interfaceTwoPortInterface- Overrides:
setOutletPressurein classTwoPortEquipment- Parameters:
pressure- value to set in unit bara
-
setOutletTemperature
public void setOutletTemperature(double temperature) Set outlet temperature of twoport.- Specified by:
setOutletTemperaturein interfacePipeLineInterface- Specified by:
setOutletTemperaturein interfaceTwoPortInterface- Overrides:
setOutletTemperaturein classTwoPortEquipment- Parameters:
temperature- value to set in kelvin
-
getPressureDrop
public double getPressureDrop()Get the total pressure drop across the pipeline.- Specified by:
getPressureDropin interfacePipeLineInterface- Returns:
- pressure drop in bar
-
getOutletPressure
Get the outlet pressure.- Specified by:
getOutletPressurein interfacePipeLineInterface- Parameters:
unit- pressure unit (e.g., "bara", "barg", "Pa", "MPa")- Returns:
- outlet pressure in specified unit
-
getOutletTemperature
Get the outlet temperature.- Specified by:
getOutletTemperaturein interfacePipeLineInterface- Parameters:
unit- temperature unit (e.g., "K", "C")- Returns:
- outlet temperature in specified unit
-
getVelocity
public double getVelocity()Get the flow velocity in the pipe.- Specified by:
getVelocityin interfacePipeLineInterface- Returns:
- velocity in m/s
-
getSuperficialVelocity
public double getSuperficialVelocity(int phaseNumber) Get the superficial velocity for a specific phase.- Specified by:
getSuperficialVelocityin interfacePipeLineInterface- Parameters:
phaseNumber- phase index (0=gas, 1=liquid)- Returns:
- superficial velocity in m/s
-
getSuperficialVelocity
public double getSuperficialVelocity(int phaseNum, int node) Get superficial velocity for a phase at a specific node.- Parameters:
phaseNum- phase index (0=gas, 1=liquid)node- node index- Returns:
- superficial velocity in m/s
-
getFlowRegime
Get the determined flow regime.- Specified by:
getFlowRegimein interfacePipeLineInterface- Returns:
- flow regime as string (e.g., "stratified", "slug", "annular", "dispersed bubble")
-
getLiquidHoldup
public double getLiquidHoldup()Get the liquid holdup fraction.- Specified by:
getLiquidHoldupin interfacePipeLineInterface- Returns:
- liquid holdup as fraction (0-1)
-
getReynoldsNumber
public double getReynoldsNumber()Get the Reynolds number for the flow.- Specified by:
getReynoldsNumberin interfacePipeLineInterface- Returns:
- Reynolds number (dimensionless)
-
getFrictionFactor
public double getFrictionFactor()Get the friction factor.- Specified by:
getFrictionFactorin interfacePipeLineInterface- Returns:
- Darcy friction factor (dimensionless)
-
getPressureProfile
public double[] getPressureProfile()Get the pressure profile along the pipe.- Specified by:
getPressureProfilein interfacePipeLineInterface- Returns:
- array of pressures in bar at each increment
-
getTemperatureProfile
public double[] getTemperatureProfile()Get the temperature profile along the pipe.- Specified by:
getTemperatureProfilein interfacePipeLineInterface- Returns:
- array of temperatures in Kelvin at each increment
-
getLiquidHoldupProfile
public double[] getLiquidHoldupProfile()Get the liquid holdup profile along the pipe.- Specified by:
getLiquidHoldupProfilein interfacePipeLineInterface- Returns:
- array of liquid holdup values at each increment
-
setHeatTransferCoefficient
public void setHeatTransferCoefficient(double coefficient) Set the overall heat transfer coefficient.- Specified by:
setHeatTransferCoefficientin interfacePipeLineInterface- Parameters:
coefficient- heat transfer coefficient in W/(m²·K)
-
getHeatTransferCoefficient
public double getHeatTransferCoefficient()Get the overall heat transfer coefficient.- Specified by:
getHeatTransferCoefficientin interfacePipeLineInterface- Returns:
- heat transfer coefficient in W/(m²·K)
-
setConstantSurfaceTemperature
public void setConstantSurfaceTemperature(double temperature) Set the constant surface temperature for heat transfer.- Specified by:
setConstantSurfaceTemperaturein interfacePipeLineInterface- Parameters:
temperature- surface temperature in Kelvin
-
isAdiabatic
public boolean isAdiabatic()Check if the pipe is operating in adiabatic mode.- Specified by:
isAdiabaticin interfacePipeLineInterface- Returns:
- true if adiabatic (no heat transfer)
-
setAdiabatic
public void setAdiabatic(boolean adiabatic) Set whether the pipe operates in adiabatic mode.- Specified by:
setAdiabaticin interfacePipeLineInterface- Parameters:
adiabatic- true for no heat transfer
-
setPipeMaterial
Set the pipe material.- Specified by:
setPipeMaterialin interfacePipeLineInterface- Parameters:
material- pipe material name (e.g., "carbon steel", "stainless steel", "duplex")
-
getPipeMaterial
Get the pipe material.- Specified by:
getPipeMaterialin interfacePipeLineInterface- Returns:
- pipe material name
-
setPipeSchedule
Set the pipe schedule.- Specified by:
setPipeSchedulein interfacePipeLineInterface- Parameters:
schedule- pipe schedule (e.g., "40", "80", "STD", "XS")
-
getPipeSchedule
Get the pipe schedule.- Specified by:
getPipeSchedulein interfacePipeLineInterface- Returns:
- pipe schedule
-
setInsulationThickness
public void setInsulationThickness(double thickness) Set the insulation thickness.- Specified by:
setInsulationThicknessin interfacePipeLineInterface- Parameters:
thickness- insulation thickness in meters
-
getInsulationThickness
public double getInsulationThickness()Get the insulation thickness.- Specified by:
getInsulationThicknessin interfacePipeLineInterface- Returns:
- insulation thickness in meters
-
setInsulationConductivity
public void setInsulationConductivity(double conductivity) Set the insulation thermal conductivity.- Specified by:
setInsulationConductivityin interfacePipeLineInterface- Parameters:
conductivity- thermal conductivity in W/(m·K)
-
getInsulationConductivity
public double getInsulationConductivity()Get the insulation thermal conductivity.- Specified by:
getInsulationConductivityin interfacePipeLineInterface- Returns:
- thermal conductivity in W/(m·K)
-
setInsulationType
Set the insulation type/material.- Specified by:
setInsulationTypein interfacePipeLineInterface- Parameters:
insulationType- insulation type (e.g., "polyurethane", "mineral wool", "aerogel")
-
getInsulationType
Get the insulation type/material.- Specified by:
getInsulationTypein interfacePipeLineInterface- Returns:
- insulation type
-
setCoatingThickness
public void setCoatingThickness(double thickness) Set the coating thickness.- Specified by:
setCoatingThicknessin interfacePipeLineInterface- Parameters:
thickness- coating thickness in meters
-
getCoatingThickness
public double getCoatingThickness()Get the coating thickness.- Specified by:
getCoatingThicknessin interfacePipeLineInterface- Returns:
- coating thickness in meters
-
setCoatingConductivity
public void setCoatingConductivity(double conductivity) Set the coating thermal conductivity.- Specified by:
setCoatingConductivityin interfacePipeLineInterface- Parameters:
conductivity- thermal conductivity in W/(m·K)
-
getCoatingConductivity
public double getCoatingConductivity()Get the coating thermal conductivity.- Specified by:
getCoatingConductivityin interfacePipeLineInterface- Returns:
- thermal conductivity in W/(m·K)
-
setPipeWallConductivity
public void setPipeWallConductivity(double conductivity) Set the pipe wall thermal conductivity.- Specified by:
setPipeWallConductivityin interfacePipeLineInterface- Parameters:
conductivity- thermal conductivity in W/(m·K)
-
getPipeWallConductivity
public double getPipeWallConductivity()Get the pipe wall thermal conductivity.- Specified by:
getPipeWallConductivityin interfacePipeLineInterface- Returns:
- thermal conductivity in W/(m·K)
-
setOuterHeatTransferCoefficient
public void setOuterHeatTransferCoefficient(double coefficient) Set the outer (external) heat transfer coefficient.This is the convective heat transfer coefficient between the pipe outer surface (or insulation outer surface if insulated) and the surrounding environment.
Typical values:
- Still air: 5-25 W/(m²·K)
- Flowing air: 10-100 W/(m²·K)
- Buried in soil: 1-5 W/(m²·K)
- Still water: 100-500 W/(m²·K)
- Flowing seawater: 500-2000 W/(m²·K)
- Specified by:
setOuterHeatTransferCoefficientin interfacePipeLineInterface- Parameters:
coefficient- outer heat transfer coefficient in W/(m²·K)
-
getOuterHeatTransferCoefficient
public double getOuterHeatTransferCoefficient()Get the outer (external) heat transfer coefficient.- Specified by:
getOuterHeatTransferCoefficientin interfacePipeLineInterface- Returns:
- outer heat transfer coefficient in W/(m²·K)
-
setInnerHeatTransferCoefficient
public void setInnerHeatTransferCoefficient(double coefficient) Set the inner (fluid-side) heat transfer coefficient.This is the convective heat transfer coefficient between the fluid and the pipe inner wall. If not set, it can be calculated automatically based on flow conditions.
- Specified by:
setInnerHeatTransferCoefficientin interfacePipeLineInterface- Parameters:
coefficient- inner heat transfer coefficient in W/(m²·K)
-
getInnerHeatTransferCoefficient
public double getInnerHeatTransferCoefficient()Get the inner (fluid-side) heat transfer coefficient.- Specified by:
getInnerHeatTransferCoefficientin interfacePipeLineInterface- Returns:
- inner heat transfer coefficient in W/(m²·K)
-
setOuterHeatTransferCoefficients
public void setOuterHeatTransferCoefficients(double[] coefficients) Set outer heat transfer coefficients for each pipe segment.- Specified by:
setOuterHeatTransferCoefficientsin interfacePipeLineInterface- Parameters:
coefficients- array of outer heat transfer coefficients in W/(m²·K)
-
setWallHeatTransferCoefficients
public void setWallHeatTransferCoefficients(double[] coefficients) Set inner (wall) heat transfer coefficients for each pipe segment.- Specified by:
setWallHeatTransferCoefficientsin interfacePipeLineInterface- Parameters:
coefficients- array of wall heat transfer coefficients in W/(m²·K)
-
setAmbientTemperatures
public void setAmbientTemperatures(double[] temperatures) Set ambient/surrounding temperatures for each pipe segment.- Specified by:
setAmbientTemperaturesin interfacePipeLineInterface- Parameters:
temperatures- array of ambient temperatures in Kelvin
-
setAmbientTemperature
public void setAmbientTemperature(double temperature) Set the ambient temperature.- Specified by:
setAmbientTemperaturein interfacePipeLineInterface- Parameters:
temperature- ambient temperature in Kelvin
-
getAmbientTemperature
public double getAmbientTemperature()Get the ambient temperature.- Specified by:
getAmbientTemperaturein interfacePipeLineInterface- Returns:
- ambient temperature in Kelvin
-
calculateOverallHeatTransferCoefficient
public double calculateOverallHeatTransferCoefficient()Calculate the overall heat transfer coefficient based on pipe buildup.This method calculates the overall U-value considering:
- Inner fluid-side convection
- Pipe wall conduction
- Coating conduction (if present)
- Insulation conduction (if present)
- Outer convection
The calculation uses the resistance analogy for cylindrical geometries.
- Specified by:
calculateOverallHeatTransferCoefficientin interfacePipeLineInterface- Returns:
- overall heat transfer coefficient in W/(m²·K) based on inner diameter
-
setBurialDepth
public void setBurialDepth(double depth) Set the burial depth below ground surface.- Specified by:
setBurialDepthin interfacePipeLineInterface- Parameters:
depth- burial depth in meters
-
getBurialDepth
public double getBurialDepth()Get the burial depth.- Specified by:
getBurialDepthin interfacePipeLineInterface- Returns:
- burial depth in meters
-
setSoilConductivity
public void setSoilConductivity(double conductivity) Set the soil thermal conductivity.- Specified by:
setSoilConductivityin interfacePipeLineInterface- Parameters:
conductivity- soil thermal conductivity in W/(m·K)
-
getSoilConductivity
public double getSoilConductivity()Get the soil thermal conductivity.- Specified by:
getSoilConductivityin interfacePipeLineInterface- Returns:
- soil thermal conductivity in W/(m·K)
-
isBuried
public boolean isBuried()Check if the pipe is buried.- Specified by:
isBuriedin interfacePipeLineInterface- Returns:
- true if pipe is buried
-
setBuried
public void setBuried(boolean buried) Set whether the pipe is buried.- Specified by:
setBuriedin interfacePipeLineInterface- Parameters:
buried- true if pipe is buried
-
addFitting
Add a fitting with a specified L/D ratio.The L/D ratio represents the equivalent length of the fitting in terms of pipe diameters. For example, a standard 90° elbow has L/D ≈ 30, meaning it causes the same pressure drop as 30 diameters of straight pipe.
Example usage:
pipe.addFitting("90-degree elbow", 30.0); pipe.addFitting("gate valve", 8.0);- Parameters:
name- descriptive name for the fittingLdivD- equivalent length ratio (L/D), dimensionless
-
addFittingFromDatabase
Add a fitting by name, loading L/D from database.The fitting name must exist in the 'fittings' database table. Standard fitting names include:
- "Standard elbow (R=1.5D), 90deg" - L/D = 16
- "Standard elbow (R=1D), 90deg" - L/D = 30
- "Gate valve, fully open" - L/D = 8
- "Globe valve, fully open" - L/D = 340
- Parameters:
name- fitting name as stored in database
-
addStandardFitting
Add a standard fitting type with predefined L/D value.Uses built-in L/D values from Crane TP-410. See
Fittings.addStandard(String)for available types.- Parameters:
type- standard fitting type- Returns:
- true if fitting was added, false if type not recognized
-
addFittings
Add multiple identical fittings with specified L/D ratio.Convenience method for adding several fittings of the same type. For example, adding 6 elbows with L/D = 30:
pipe.addFittings("90-degree elbow", 30.0, 6);- Parameters:
name- fitting nameLdivD- L/D ratio for each fittingcount- number of fittings to add
-
addStandardFittings
Add multiple standard fittings of the same type.- Parameters:
type- standard fitting type (e.g., "elbow_90_standard", "valve_gate_open")count- number of fittings to add- Returns:
- true if fittings were added, false if type not recognized
-
getFittings
Get the fittings collection.- Returns:
- Fittings object containing all added fittings
-
clearFittings
public void clearFittings()Clear all fittings from the pipe. -
getTotalFittingsLdRatio
public double getTotalFittingsLdRatio()Get the total L/D ratio of all fittings.This is the sum of all individual fitting L/D ratios.
- Returns:
- total L/D ratio (dimensionless)
-
getEquivalentLength
public double getEquivalentLength()Calculate the total equivalent length from all fittings.The equivalent length is calculated as:
L_eq = Σ(L/D)_i × D
where D is the pipe internal diameter.
- Returns:
- equivalent length from fittings in meters
-
getEffectiveLength
public double getEffectiveLength()Get the effective pipe length for pressure drop calculations.The effective length includes both the physical pipe length and the equivalent length from all fittings:
L_eff = L_physical + L_equivalent = L_physical + Σ(L/D)_i × DThis effective length should be used in the Darcy-Weisbach equation:
ΔP = f × (L_eff / D) × (ρV² / 2)
- Returns:
- effective pipe length in meters
-
setUseFittings
public void setUseFittings(boolean enable) Enable or disable fittings in pressure drop calculations.When disabled, the equivalent length from fittings is not added to the physical pipe length. This is useful for comparing pressure drop with and without fittings.
- Parameters:
enable- true to include fittings (default), false to exclude
-
isUseFittings
public boolean isUseFittings()Check if fittings are enabled in pressure drop calculations.- Returns:
- true if fittings are included, false if excluded
-
getNumberOfFittings
public int getNumberOfFittings()Get the number of fittings added to this pipe.- Returns:
- number of fittings
-
printFittingsSummary
public void printFittingsSummary()Print a summary of all fittings to the console. -
setOutputFileName
Set output file name for detailed results.- Specified by:
setOutputFileNamein interfacePipeLineInterface- Parameters:
name- output file name
-
setInitialFlowPattern
Set initial flow pattern for simulation initialization.- Specified by:
setInitialFlowPatternin interfacePipeLineInterface- Parameters:
flowPattern- initial flow pattern (e.g., "stratified", "slug")
-
getPipe
Get the underlying flow system (for advanced models).- Specified by:
getPipein interfacePipeLineInterface- Returns:
- flow system interface or null if not applicable
-
setPipeSpecification
Set pipe specification from database.- Specified by:
setPipeSpecificationin interfacePipeLineInterface- Parameters:
nominalDiameter- nominal diameter in mm or inchesspecification- pipe specification code (e.g., "API 5L", "ANSI B36.10")
-
initMechanicalDesign
public void initMechanicalDesign()Initialize a
initMechanicalDesignfor the equipment.- Specified by:
initMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
initMechanicalDesignin classProcessEquipmentBaseClass
-
getMechanicalDesign
Get a
mechanicalDesignfor the equipment.- Specified by:
getMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
getMechanicalDesignin classProcessEquipmentBaseClass- Returns:
- a
MechanicalDesignobject
-
getMechanicalDesignCalculator
Get the mechanical design calculator for this pipeline.The calculator provides standards-based calculations for:
- Wall thickness calculation per ASME B31.3/B31.4/B31.8 or DNV-OS-F101
- Maximum Allowable Operating Pressure (MAOP)
- Stress analysis (hoop, longitudinal, von Mises)
- Test pressure calculation
- Specified by:
getMechanicalDesignCalculatorin interfacePipeLineInterface- Returns:
- mechanical design calculator
-
setDesignPressure
public void setDesignPressure(double pressure) Set design pressure for mechanical design calculations.- Specified by:
setDesignPressurein interfacePipeLineInterface- Parameters:
pressure- design pressure in MPa
-
getDesignPressure
public double getDesignPressure()Get design pressure.- Specified by:
getDesignPressurein interfacePipeLineInterface- Returns:
- design pressure in MPa
-
setDesignPressure
Set design pressure with unit.- Specified by:
setDesignPressurein interfacePipeLineInterface- Parameters:
pressure- design pressure valueunit- pressure unit ("MPa", "bar", "bara", "psi")
-
setDesignTemperature
public void setDesignTemperature(double temperature) Set maximum design temperature for mechanical design.- Specified by:
setDesignTemperaturein interfacePipeLineInterface- Parameters:
temperature- design temperature in Celsius
-
getDesignTemperature
public double getDesignTemperature()Get maximum design temperature.- Specified by:
getDesignTemperaturein interfacePipeLineInterface- Returns:
- design temperature in Celsius
-
setMaterialGrade
Set the pipe material grade per API 5L.- Specified by:
setMaterialGradein interfacePipeLineInterface- Parameters:
grade- material grade (e.g., "X42", "X52", "X65", "X70", "X80")
-
getMaterialGrade
Get the pipe material grade.- Specified by:
getMaterialGradein interfacePipeLineInterface- Returns:
- material grade
-
setDesignCode
Set the design code for wall thickness and pressure calculations.- Specified by:
setDesignCodein interfacePipeLineInterface- Parameters:
code- design code (e.g., "ASME_B31_8", "ASME_B31_4", "ASME_B31_3", "DNV_OS_F101")
-
getDesignCode
Get the design code.- Specified by:
getDesignCodein interfacePipeLineInterface- Returns:
- design code
-
setLocationClass
public void setLocationClass(int locationClass) Set the location class per ASME B31.8.Location classes:
- Class 1: Offshore and remote areas (F=0.72)
- Class 2: Fringe areas (F=0.60)
- Class 3: Suburban areas (F=0.50)
- Class 4: Urban areas (F=0.40)
- Specified by:
setLocationClassin interfacePipeLineInterface- Parameters:
locationClass- location class 1-4
-
getLocationClass
public int getLocationClass()Get the location class.- Specified by:
getLocationClassin interfacePipeLineInterface- Returns:
- location class 1-4
-
setCorrosionAllowance
public void setCorrosionAllowance(double allowance) Set the corrosion allowance.- Specified by:
setCorrosionAllowancein interfacePipeLineInterface- Parameters:
allowance- corrosion allowance in meters
-
getCorrosionAllowance
public double getCorrosionAllowance()Get the corrosion allowance.- Specified by:
getCorrosionAllowancein interfacePipeLineInterface- Returns:
- corrosion allowance in meters
-
calculateMinimumWallThickness
public double calculateMinimumWallThickness()Calculate minimum required wall thickness based on design code.- Specified by:
calculateMinimumWallThicknessin interfacePipeLineInterface- Returns:
- minimum wall thickness in meters
-
calculateMAOP
public double calculateMAOP()Calculate Maximum Allowable Operating Pressure (MAOP).- Specified by:
calculateMAOPin interfacePipeLineInterface- Returns:
- MAOP in MPa
-
getMAOP
Get MAOP in specified unit.- Specified by:
getMAOPin interfacePipeLineInterface- Parameters:
unit- pressure unit ("MPa", "bar", "psi")- Returns:
- MAOP in specified unit
-
calculateTestPressure
public double calculateTestPressure()Calculate hydrostatic test pressure.- Specified by:
calculateTestPressurein interfacePipeLineInterface- Returns:
- test pressure in MPa
-
calculateHoopStress
public double calculateHoopStress()Calculate hoop stress at operating pressure.- Specified by:
calculateHoopStressin interfacePipeLineInterface- Returns:
- hoop stress in MPa
-
calculateVonMisesStress
public double calculateVonMisesStress(double deltaT) Calculate von Mises equivalent stress.- Specified by:
calculateVonMisesStressin interfacePipeLineInterface- Parameters:
deltaT- temperature change from installation in Celsius- Returns:
- von Mises stress in MPa
-
isMechanicalDesignSafe
public boolean isMechanicalDesignSafe()Check if the mechanical design is within allowable stress limits.- Specified by:
isMechanicalDesignSafein interfacePipeLineInterface- Returns:
- true if design stress is below allowable limit
-
generateMechanicalDesignReport
Generate a mechanical design report.- Specified by:
generateMechanicalDesignReportin interfacePipeLineInterface- Returns:
- formatted design report string
-
getCapacityDuty
public double getCapacityDuty()getCapacityDuty.
- Specified by:
getCapacityDutyin interfaceProcessEquipmentInterface- Returns:
- a double
-
getCapacityMax
public double getCapacityMax()getCapacityMax.
- Specified by:
getCapacityMaxin interfaceProcessEquipmentInterface- Returns:
- a double
-
setPipeOuterHeatTransferCoefficients
public void setPipeOuterHeatTransferCoefficients(double[] heatCoefs) Set pipe outer heat transfer coefficients for each leg.- Parameters:
heatCoefs- array of heat transfer coefficients
-
setPipeWallHeatTransferCoefficients
public void setPipeWallHeatTransferCoefficients(double[] heatCoefs) Set pipe wall heat transfer coefficients for each leg.- Parameters:
heatCoefs- array of heat transfer coefficients
-
setEquilibriumMassTransfer
public void setEquilibriumMassTransfer(boolean equilibriumMassTransfer) Set equilibrium mass transfer flag.- Parameters:
equilibriumMassTransfer- true to enable equilibrium mass transfer
-
setEquilibriumHeatTransfer
public void setEquilibriumHeatTransfer(boolean equilibriumHeatTransfer) Set equilibrium heat transfer flag.- Parameters:
equilibriumHeatTransfer- true to enable equilibrium heat transfer
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Parameters:
id- UUID
-
runTransient
runTransient
This method calculates thermodynamic and unit operations using difference equations if available and calculateSteadyState is true. Use setCalculateSteadyState to set the parameter. Sets calc identifier UUID.- Specified by:
runTransientin interfaceSimulationInterface- Parameters:
dt- Delta time [s]id- Calculation identifier
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classProcessEquipmentBaseClass
-
getTimes
public double[] getTimes()Get the time array for transient simulations.- Returns:
- array of times in seconds
-
setTimeSeries
Set time series for transient simulation.- Parameters:
times- array of timessystems- array of thermodynamic systems at each timetimestepininterval- number of time steps in each interval
-
getEntropyProduction
getEntropyProduction.
- Specified by:
getEntropyProductionin interfaceProcessEquipmentInterface- Overrides:
getEntropyProductionin classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classTwoPortEquipment- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classTwoPortEquipment- Parameters:
cfg- report configuration- Returns:
- json string
-
initializeCapacityConstraints
protected void initializeCapacityConstraints()Initializes default capacity constraints for the pipeline.NOTE: All constraints are disabled by default for backwards compatibility. Enable specific constraints when pipeline capacity analysis is needed (e.g., after sizing).
-
getCapacityConstraints
Gets all capacity constraints defined for this equipment.The map keys are constraint names (e.g., "speed", "gasLoadFactor") and values are the corresponding CapacityConstraint objects containing design values, current values, and utilization calculations.
- Specified by:
getCapacityConstraintsin interfaceCapacityConstrainedEquipment- Returns:
- unmodifiable map of constraint name to CapacityConstraint
-
getBottleneckConstraint
Gets the constraint with the highest utilization (the bottleneck).This method identifies which constraint is closest to or exceeding its design limit. Use this to determine what is limiting equipment capacity.
- Specified by:
getBottleneckConstraintin interfaceCapacityConstrainedEquipment- Returns:
- the bottleneck constraint, or null if no constraints are defined
-
isCapacityExceeded
public boolean isCapacityExceeded()Checks if any capacity constraint is violated (exceeds 100% utilization).A violated constraint means the equipment is operating beyond its design capacity. For HARD constraints, this may indicate equipment trip or failure. For SOFT constraints, this indicates reduced efficiency or accelerated wear.
- Specified by:
isCapacityExceededin interfaceCapacityConstrainedEquipment- Returns:
- true if any constraint utilization exceeds 1.0 (100%)
-
isHardLimitExceeded
public boolean isHardLimitExceeded()Checks if any HARD constraint limit is exceeded.HARD limits represent absolute equipment limits (e.g., maximum speed) that cannot be exceeded without equipment trip or damage. This is more severe than general capacity exceedance.
- Specified by:
isHardLimitExceededin interfaceCapacityConstrainedEquipment- Returns:
- true if any HARD constraint's max value is exceeded
-
getMaxUtilization
public double getMaxUtilization()Gets the maximum utilization across all constraints.This gives a single number representing how close the equipment is to its limiting constraint. Values above 1.0 indicate the equipment is over capacity.
- Specified by:
getMaxUtilizationin interfaceCapacityConstrainedEquipment- Returns:
- maximum utilization as fraction (1.0 = 100% of design capacity)
-
addCapacityConstraint
Adds a new capacity constraint to this equipment.This allows dynamic addition of constraints at runtime. Constraints can be added during equipment configuration or based on operating conditions.
- Specified by:
addCapacityConstraintin interfaceCapacityConstrainedEquipment- Parameters:
constraint- the constraint to add
-
removeCapacityConstraint
Removes a capacity constraint by name.- Specified by:
removeCapacityConstraintin interfaceCapacityConstrainedEquipment- Parameters:
constraintName- the name of the constraint to remove- Returns:
- true if the constraint was found and removed
-
clearCapacityConstraints
public void clearCapacityConstraints()Clears all capacity constraints from this equipment.- Specified by:
clearCapacityConstraintsin interfaceCapacityConstrainedEquipment
-