Class PipeBeggsAndBrills
- All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, PipeLineInterface, ProcessEquipmentInterface, TwoPortInterface, SimulationInterface, NamedInterface
- Direct Known Subclasses:
Riser, TopsidePiping
This class implements the Beggs and Brill (1973) correlation for pressure drop and liquid holdup prediction in multiphase pipeline flow. It supports both single-phase and multiphase (gas-liquid) flow in horizontal, inclined, and vertical pipes.
Reference
Beggs, H.D. and Brill, J.P., "A Study of Two-Phase Flow in Inclined Pipes", Journal of Petroleum Technology, May 1973, pp. 607-617. SPE-4007-PA.
Calculation Modes
The pipeline supports two primary calculation modes via PipeBeggsAndBrills.CalculationMode:
- CALCULATE_OUTLET_PRESSURE (default) - Given inlet conditions and flow rate, calculate the outlet pressure
- CALCULATE_FLOW_RATE - Given inlet and outlet pressures, calculate the flow rate using iterative methods
Flow Regime Determination
The Beggs and Brill correlation classifies flow into four regimes based on the Froude number (Fr) and input liquid volume fraction (λL):
- SEGREGATED - Stratified, wavy, or annular flow where phases are separated
- INTERMITTENT - Plug or slug flow with alternating liquid slugs and gas pockets
- DISTRIBUTED - Bubble or mist flow where one phase is dispersed in the other
- TRANSITION - Flow in transition zone between segregated and intermittent
- SINGLE_PHASE - Only gas or only liquid present
Flow regime boundaries are defined by correlations L1-L4:
L1 = 316 × λL^0.302 L2 = 0.0009252 × λL^(-2.4684) L3 = 0.1 × λL^(-1.4516) L4 = 0.5 × λL^(-6.738)
Pressure Drop Calculation
Total pressure drop consists of three components:
ΔP_total = ΔP_friction + ΔP_hydrostatic + ΔP_acceleration
where:
- Friction pressure drop - Uses two-phase friction factor with slip correction
- Hydrostatic pressure drop - Based on mixture density and elevation change
- Acceleration pressure drop - Usually negligible, included in friction term
Liquid Holdup Calculation
Liquid holdup (EL) is calculated based on flow regime:
- Segregated: EL = 0.98 × λL^0.4846 / Fr^0.0868
- Intermittent: EL = 0.845 × λL^0.5351 / Fr^0.0173
- Distributed: EL = 1.065 × λL^0.5824 / Fr^0.0609
Inclination correction factor (Bθ) is applied for non-horizontal pipes.
Friction Factor Calculation
The friction factor is calculated using:
- Laminar (Re < 2300): f = 64/Re
- Transition (2300-4000): Linear interpolation
- Turbulent (Re > 4000): Haaland equation
Two-phase friction factor: f_tp = f × exp(S), where S is a slip correction factor.
Heat Transfer Modes
The pipeline supports five heat transfer calculation modes via PipeBeggsAndBrills.HeatTransferMode:
- ADIABATIC - No heat transfer (Q=0). Temperature changes only from Joule-Thomson effect.
- ISOTHERMAL - Constant temperature along the pipe (outlet T = inlet T).
- SPECIFIED_U - Use a user-specified overall heat transfer coefficient (U-value).
- ESTIMATED_INNER_H - Calculate inner h from flow conditions using Gnielinski correlation for turbulent flow, use as U.
- DETAILED_U - Calculate inner h from flow, then compute overall U including pipe wall conduction, insulation (if present), and outer convection resistances.
NTU-Effectiveness Method
Heat transfer is calculated using the analytical NTU (Number of Transfer Units) method:
NTU = U × A / (ṁ × Cp) T_out = T_wall + (T_in - T_wall) × exp(-NTU)
This provides an exact analytical solution for constant wall temperature boundary conditions.
Inner Heat Transfer Coefficient
For ESTIMATED_INNER_H and DETAILED_U modes, the inner convective heat transfer coefficient is calculated using:
- Laminar flow (Re < 2300): Nu = 3.66 (fully developed pipe flow)
- Transition (2300 < Re < 3000): Linear interpolation
- Turbulent flow (Re > 3000): Gnielinski correlation: Nu = (f/8)(Re-1000)Pr / [1 + 12.7(f/8)^0.5(Pr^(2/3)-1)]
- Two-phase flow: Shah/Martinelli enhancement factor applied
Overall U-Value (DETAILED_U mode)
The overall heat transfer coefficient includes thermal resistances in series:
1/U = 1/h_inner + R_wall + R_insulation + 1/h_outer R_wall = r_i × ln(r_o/r_i) / k_wall R_insulation = r_i × ln(r_ins/r_o) / k_ins
where:
- h_inner = inner convective coefficient from flow calculation
- R_wall = pipe wall conductive resistance (cylindrical geometry)
- R_insulation = insulation layer resistance (if thickness > 0)
- h_outer = outer convective coefficient (e.g., seawater ~500 W/(m²·K))
Energy Equation Components
The energy balance can include three optional components:
- Wall heat transfer - Heat exchange with surroundings using NTU-effectiveness method
- Joule-Thomson effect - Temperature change due to gas expansion (cooling): ΔT_JT = -μ_JT × ΔP
- Friction heating - Viscous dissipation adding energy to the fluid: Q_friction = ΔP_friction × V̇
Joule-Thomson Coefficient
The JT coefficient is calculated from rigorous thermodynamics (mass-weighted average across phases). Typical values:
- Methane: ~4×10⁻⁶ K/Pa (0.4 K/bar)
- Natural gas: 3-5×10⁻⁶ K/Pa
- CO₂: ~10⁻⁵ K/Pa (1 K/bar)
Usage Examples
Example 1: Basic Horizontal Pipeline
// Create fluid system
SystemInterface fluid = new SystemSrkEos(303.15, 50.0);
fluid.addComponent("methane", 0.9);
fluid.addComponent("ethane", 0.1);
fluid.setMixingRule("classic");
// Create inlet stream
Stream inlet = new Stream("inlet", fluid);
inlet.setFlowRate(50000, "kg/hr");
inlet.run();
// Create pipeline
PipeBeggsAndBrills pipe = new PipeBeggsAndBrills("pipeline", inlet);
pipe.setDiameter(0.2032); // 8 inch
pipe.setLength(10000.0); // 10 km
pipe.setElevation(0.0); // horizontal
pipe.setNumberOfIncrements(20);
pipe.run();
System.out.println("Pressure drop: " + pipe.getPressureDrop() + " bar");
System.out.println("Flow regime: " + pipe.getFlowRegime());
Example 2: Pipeline with Heat Transfer
// Hot fluid in cold environment
PipeBeggsAndBrills pipe = new PipeBeggsAndBrills("subsea_pipe", hotStream);
pipe.setDiameter(0.1524); // 6 inch
pipe.setLength(5000.0); // 5 km
pipe.setElevation(0.0); // horizontal
pipe.setConstantSurfaceTemperature(5.0, "C"); // Sea temperature
pipe.setHeatTransferCoefficient(25.0); // W/(m²·K) - SPECIFIED_U mode
pipe.run();
System.out.println("Inlet T: " + pipe.getInletStream().getTemperature("C") + " °C");
System.out.println("Outlet T: " + pipe.getOutletStream().getTemperature("C") + " °C");
Example 3: Detailed U-Value with Insulation
pipe.setConstantSurfaceTemperature(5.0, "C"); // Seawater
pipe.setOuterHeatTransferCoefficient(500.0); // Seawater forced convection
pipe.setPipeWallThermalConductivity(45.0); // Carbon steel
pipe.setInsulation(0.05, 0.04); // 50mm foam, k=0.04 W/(m·K)
pipe.setHeatTransferMode(HeatTransferMode.DETAILED_U);
pipe.run();
Example 4: Inclined Pipeline (Riser)
// Vertical riser
PipeBeggsAndBrills riser = new PipeBeggsAndBrills("riser", feedStream);
riser.setDiameter(0.1524); // 6 inch
riser.setLength(500.0); // 500 m length
riser.setElevation(500.0); // 500 m vertical rise
riser.setAngle(90.0); // Vertical
riser.run();
System.out.println("Hydrostatic head: " + riser.getSegmentPressure(0)
- riser.getSegmentPressure(riser.getNumberOfIncrements()) + " bar");
Example 5: Adiabatic with Joule-Thomson Effect
// High-pressure gas expansion
pipe.setHeatTransferMode(HeatTransferMode.ADIABATIC);
pipe.setIncludeJouleThomsonEffect(true);
pipe.run();
// For natural gas with ~20 bar pressure drop:
// Expected JT cooling: ~8-10 K
Example 6: Calculate Flow Rate from Pressures
pipe.setCalculationMode(CalculationMode.CALCULATE_FLOW_RATE);
pipe.setSpecifiedOutletPressure(40.0, "bara"); // Target outlet pressure
pipe.setMaxFlowIterations(50);
pipe.setFlowConvergenceTolerance(1e-4);
pipe.run();
System.out.println("Calculated flow: " + pipe.getOutletStream().getFlowRate("kg/hr") + " kg/hr");
Transient Simulation
The class supports transient (time-dependent) simulation using the runTransient() method.
This solves the time-dependent mass, momentum, and energy conservation equations using an
explicit finite difference scheme.
Typical Parameter Values
| Environment | h [W/(m²·K)] |
|---|---|
| Still air (natural convection) | 5-25 |
| Forced air | 25-250 |
| Still water | 100-500 |
| Seawater (flowing) | 500-1000 |
| Buried in soil | 1-5 |
| Material | k [W/(m·K)] |
|---|---|
| Carbon steel | 45-50 |
| Stainless steel | 15-20 |
| Mineral wool insulation | 0.03-0.05 |
| Polyurethane foam | 0.02-0.03 |
| Concrete coating | 1.0-1.5 |
The pipeline implements CapacityConstrainedEquipment (inherited from Pipeline) with constraints:
- Velocity - SOFT limit based on erosional velocity
- LOF (Likelihood of Failure) - SOFT limit for flow-induced vibration
- FRMS - SOFT limit for flow-induced vibration intensity
- Volume flow - DESIGN limit from mechanical design
- Pressure drop - DESIGN limit
- Version:
- $Id: $Id
- Author:
- Even Solbraa, Sviatoslav Eroshkin
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCalculation modes for pipeline simulation.static enumFlow regimes available in Beggs and Brill correlations.static enumHeat transfer calculation modes for pipeline thermal modeling. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate doubleprivate doubleprivate booleanFlag indicating if pipeline has been auto-sized.private double(package private) double(package private) doubleprivate doubleprivate doubleprivate double(package private) doubleprivate double(package private) double(package private) doubleprivate doubleprivate List<PipeBeggsAndBrills.FlowRegime> (package private) doubleprivate double(package private) doubleprivate double(package private) doubleprivate doubleprivate booleanprivate booleanprivate doubleprivate doubleprivate doubleprivate doubleprivate double(package private) int(package private) double(package private) doubleprivate doubleMaximum design AIV (Acoustic-Induced Vibration) power level in kW.private doubleMaximum design FRMS value.private doubleMaximum design LOF value.private doubleMaximum design velocity in m/s.private int(package private) Stringprivate static final doubleprivate static final doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate double(package private) doubleprivate double(package private) doubleprivate intprivate doubleprivate Stringprivate Booleanprivate doubleprivate doubleprivate double(package private) doubleprivate doubleprotected double(package private) double(package private) doubleprivate PipeBeggsAndBrills.FlowRegime(package private) doubleprivate RhonePoulencVelocityRhone-Poulenc velocity calculator.(package private) doubleprivate booleanprivate booleanprivate boolean(package private) doubleprivate doubleprivate static final longprivate doubleprivate Stringprivate doubleprivate doubleprivate doubleprivate StringSupport arrangement for FIV calculations.protected double(package private) double(package private) double(package private) doubleprivate doubleprivate doubleprivate doubleprivate boolean(package private) double(package private) doubleFields inherited from class Pipeline
adiabatic, ambientTemperature, burialDepth, buried, coatingConductivity, coatingThickness, corrosionAllowance, designCode, designPressure, designTemperature, diameter, equilibriumHeatTransfer, equilibriumMassTransfer, fileName, fittings, flowPattern, flowRegime, inletElevation, innerHeatTransferCoefficient, insulationConductivity, insulationType, legHeights, legPositions, liquidHoldup, locationClass, logger, materialGrade, mechanicalDesignCalculator, numberOfLegs, numberOfNodesInLeg, outerHeatTransferCoeffs, outerTemperature, outletElevation, pipe, pipeDiameters, pipelineMechanicalDesign, pipeMaterial, pipeSchedule, pipeWallConductivity, reynoldsNumber, roughness, soilConductivity, surfaceTemperature, system, times, useFittings, velocity, wallHeatTransferCoeffs, wallThicknessFields 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
ConstructorsConstructorDescriptionPipeBeggsAndBrills(String name) Constructor for PipeBeggsAndBrills.PipeBeggsAndBrills(String name, StreamInterface inStream) Constructor for PipeBeggsAndBrills. -
Method Summary
Modifier and TypeMethodDescriptionvoidautoSize()Automatically size using default safety factor (1.2 = 20% margin).voidautoSize(double safetyFactor) Auto-sizes the pipeline based on current flow conditions.voidAutomatically size using company-specific design standards.calcFlowRegime.doublecalcFrictionPressureLoss.private doublecalcGnielinskiNu(double Re, double Pr) Calculates the Nusselt number using the Gnielinski correlation for turbulent pipe flow.doublecalcHeatBalance(double enthalpy, SystemInterface system, ThermodynamicOperations testOps) Calculates the heat balance for the given system.doublecalcHydrostaticPressureDifference.private doublecalcOverallHeatTransferCoefficient(double innerHTC) Calculates the overall heat transfer coefficient including inner convection, pipe wall conduction, insulation (if present), and outer convection.doublecalcPressureDrop.doubleCalculates the temperature difference between the outlet and inlet of the system.private doublecalcTransientFrictionPressureDrop(double velocity, double density, double viscosity, double segmentLength) Calculates friction pressure drop for transient simulation.private doublecalcTransientHydrostaticPressureDrop(double density, double elevationChange) Calculates hydrostatic pressure drop for transient simulation.private doublecalcTwoPhaseHeatTransferCoefficient(SystemInterface system, double singlePhaseHTC) Calculates the two-phase heat transfer coefficient using Shah correlation.doubleCalculate Acoustic-Induced Vibration (AIV) power level.doubleCalculate AIV Likelihood of Failure based on acoustic power and pipe geometry.private doubleCalculates the angle based on the length and elevation.private doubleCalculates the elevation based on the length and angle.doubleCalculate Flow-induced vibration RMS (FRMS).doublecalculateFRMS(double frmsConstant) Calculate Flow-induced vibration RMS (FRMS) with specified constant.private doubleCalculates the length based on the elevation and angle.doubleCalculate Likelihood of Failure (LOF) for flow-induced vibration.voidcalculateMissingValue.voidConverts the input values from the system measurement units to imperial units.voidConverts the input values from imperial units to the system measurement units.voidDisable Rhone-Poulenc maximum velocity and revert to API RP 14E erosional velocity.voiddisplayResult.private voiddoubleEstimates the inner heat transfer coefficient for the given system.doublegetAngle()Getter for the fieldangle.Gets the current calculation mode.doubleGet the pipe inner diameter.doubleGet the elevation change from inlet to outlet.Getter for the fieldelevationProfile.doubleCalculate erosional velocity with default C-factor of 100.doublegetErosionalVelocity(double cFactor) Calculate erosional velocity per API RP 14E.Get comprehensive FIV analysis results as a map.Get FIV analysis as JSON string.Get the determined flow regime.Get the flow regime as an enum.Getter for the fieldflowRegimeProfile.private doubleGet the gas density used for velocity calculations.Getter for the fieldgasSuperficialVelocityProfile.doubleGetter for the fieldheatTransferCoefficient.Gets the current heat transfer calculation mode.Getter for the fieldincrementsProfile.doublegetInletSuperficialVelocity.doubleGets the insulation thermal conductivity.doubleGets the insulation thickness.doubleGetter for the fieldLastSegmentPressureDrop.doubleGet the total pipe length.Getter for the fieldlengthProfile.Getter for the fieldliquidDensityProfile.double[]Get the liquid holdup profile along the pipe.Get the liquid holdup profile as a list.Getter for the fieldliquidSuperficialVelocityProfile.doubleGet the effective maximum allowable velocity using the currently configured method.doubleGet maximum design AIV power level.Get the name of the currently active maximum velocity method.Getter for the fieldmixtureDensityProfile.Getter for the fieldmixtureReynoldsNumber.Getter for the fieldmixtureSuperficialVelocityProfile.doubleGet the mixture velocity in m/s.Getter for the fieldmixtureViscosityProfile.intgetNumberOfIncrements.doubleGets the outer (external) heat transfer coefficient.doublegetOutletSuperficialVelocity.doubleGets the pipe wall thermal conductivity.doubleGet the total pressure drop across the pipeline.Get Pressure drop profile.double[]Get the pressure profile along the pipe.Get the pressure profile as a list.Get the Rhone-Poulenc velocity calculator, or null if not enabled.doubleCalculate the maximum allowable gas velocity using the Rhone-Poulenc curves.getSegmentElevation(int index) getSegmentElevation.getSegmentFlowRegime(int index) getSegmentFlowRegime.getSegmentGasSuperficialVelocity(int index) getSegmentGasSuperficialVelocity.getSegmentLength(int index) getSegmentLength.getSegmentLiquidDensity(int index) getSegmentLiquidDensity.getSegmentLiquidHoldup(int index) getSegmentLiquidHoldup.getSegmentLiquidSuperficialVelocity(int index) getSegmentLiquidSuperficialVelocity.getSegmentMixtureDensity(int index) getSegmentMixtureDensity.getSegmentMixtureReynoldsNumber(int index) getSegmentMixtureReynoldsNumber.getSegmentMixtureSuperficialVelocity(int index) getSegmentMixtureSuperficialVelocity.getSegmentMixtureViscosity(int index) getSegmentMixtureViscosity.getSegmentPressure(int index) getSegmentPressure.getSegmentPressureDrop(int index) getSegmentPressureDrop.getSegmentTemperature(int index) getSegmentTemperature.Get a detailed sizing report after auto-sizing.Get sizing report as JSON for programmatic access.doubleGets the specified outlet pressure.Gets the specified outlet pressure unit.Get support arrangement for FIV calculations.double[]Get the temperature profile along the pipe.Get the temperature profile as a list.getThermoSystem.doublegetThickness.protected voidOverride parent's capacity constraint initialization to add FIV/FRMS/AIV constraints.private voidbooleanCheck if equipment has been auto-sized.booleanGets whether friction heating is included in energy calculations.booleanGets whether Joule-Thomson effect is included in energy calculations.booleanCheck if Rhone-Poulenc maximum velocity is enabled.booleanDeprecated.voidReinitialize capacity constraints with current design values.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunTransient(double dt, UUID id) runTransientprivate voidRun pipeline calculation with specified flow rate (calculate outlet pressure).private voidRun pipeline calculation with specified outlet pressure (calculate flow rate).private doubleselectStandardPipeSize(double calculatedDiameterInches) Selects standard pipe nominal diameter based on calculated diameter.voidsetAngle(double angle) Setter for the fieldangle.voidSets the calculation mode for the pipeline.voidsetConstantSurfaceTemperature(double temperature, String unit) Setter for the fieldconstantSurfaceTemperature.voidsetDiameter(double diameter) Set the pipe inner diameter.voidsetElevation(double elevation) Set the elevation change from inlet to outlet.voidsetFlowConvergenceTolerance(double tolerance) Sets the convergence tolerance for flow rate calculation when outlet pressure is specified.voidsetHeatTransferCoefficient(double heatTransferCoefficient) Sets the overall heat transfer coefficient (U-value) and switches to SPECIFIED_U mode.voidSets the heat transfer calculation mode.voidsetIncludeFrictionHeating(boolean include) Sets whether to include friction heating in energy calculations.voidsetIncludeJouleThomsonEffect(boolean include) Sets whether to include Joule-Thomson effect in energy calculations.voidsetInsulation(double thickness, double conductivity) Sets the insulation layer properties.voidsetLength(double length) Set the total pipe length.voidsetMaxDesignAIV(double aivKW) Set maximum design AIV power level for capacity constraints.voidsetMaxDesignFRMS(double frms) Set maximum design FRMS for capacity constraints.voidsetMaxDesignLOF(double lof) Set maximum design LOF for capacity constraints.voidsetMaxDesignVelocity(double velocity) Set maximum design velocity for capacity constraints.voidsetMaxFlowIterations(int maxIterations) Sets the maximum number of iterations for flow rate calculation when outlet pressure is specified.voidsetNumberOfIncrements(int numberOfIncrements) Setter for the fieldnumberOfIncrements.voidsetOuterHeatTransferCoefficient(double coefficient) Sets the outer (external) heat transfer coefficient for calculating overall U-value.voidsetOutletPressure(double pressure) Sets the specified outlet pressure and switches to flow rate calculation mode.voidsetOutletPressure(double pressure, String unit) Sets the specified outlet pressure with unit and switches to flow rate calculation mode.voidsetPipeSpecification(double nominalDiameter, String pipeSec) Setter for the fieldpipeSpecification.voidsetPipeWallRoughness(double pipeWallRoughness) Setter for the fieldpipeWallRoughness.voidsetPipeWallThermalConductivity(double conductivity) Sets the pipe wall thermal conductivity.voidEnable Rhone-Poulenc maximum velocity calculation for gas pipes.voidsetRhonePoulencServiceType(RhonePoulencVelocity.ServiceType serviceType, boolean useInterpolation) Enable Rhone-Poulenc maximum velocity calculation using tabulated data with log-log interpolation for higher accuracy.voidsetRunIsothermal(boolean runIsothermal) Deprecated.voidsetSupportArrangement(String arrangement) Set support arrangement for FIV calculations.voidsetThickness(double pipeThickness) setThickness.voidsetUseOverallHeatTransferCoefficient(boolean use) Deprecated.UsesetHeatTransferMode(HeatTransferMode)insteadtoJson()Serializes the Process Equipment along with its state to a JSON string.toJson(ReportConfig cfg) Serializes the Process Equipment with configurable level of detail.private doubletryCalculatePressure(double flowRate, String flowUnit, UUID id) Helper method to calculate outlet pressure for a given flow rate, handling exceptions when pressure goes negative (indicating flow rate is too high).voidEnable Rhone-Poulenc maximum velocity calculation with default non-corrosive gas settings.Methods inherited from class Pipeline
addCapacityConstraint, addFitting, addFittingFromDatabase, addFittings, addStandardFitting, addStandardFittings, calculateHoopStress, calculateMAOP, calculateMinimumWallThickness, calculateOverallHeatTransferCoefficient, calculateTestPressure, calculateVonMisesStress, clearCapacityConstraints, clearFittings, generateMechanicalDesignReport, getAmbientTemperature, getBottleneckConstraint, getBurialDepth, getCapacityConstraints, getCapacityDuty, getCapacityMax, getCoatingConductivity, getCoatingThickness, getCorrosionAllowance, getDesignCode, getDesignPressure, getDesignTemperature, getEffectiveLength, getEntropyProduction, getEquivalentLength, getFittings, getFrictionFactor, getInletElevation, getInnerHeatTransferCoefficient, getInsulationConductivity, getInsulationType, getLiquidHoldup, getLocationClass, getMAOP, getMaterialGrade, getMaxUtilization, getMechanicalDesign, getMechanicalDesignCalculator, getNumberOfFittings, getNumberOfLegs, getOutletElevation, getOutletPressure, getOutletTemperature, getPipe, getPipeMaterial, getPipeSchedule, getPipeWallConductivity, getPipeWallRoughness, getReynoldsNumber, getSoilConductivity, getSuperficialVelocity, getSuperficialVelocity, getTimes, getTotalFittingsLdRatio, getVelocity, getWallThickness, initMechanicalDesign, isAdiabatic, isBuried, isCapacityExceeded, isHardLimitExceeded, isMechanicalDesignSafe, isUseFittings, printFittingsSummary, removeCapacityConstraint, setAdiabatic, setAmbientTemperature, setAmbientTemperatures, setBurialDepth, setBuried, setCoatingConductivity, setCoatingThickness, setConstantSurfaceTemperature, setCorrosionAllowance, setDesignCode, setDesignPressure, setDesignPressure, setDesignTemperature, setEquilibriumHeatTransfer, setEquilibriumMassTransfer, setHeightProfile, setInitialFlowPattern, setInletElevation, setInnerHeatTransferCoefficient, setInsulationConductivity, setInsulationThickness, setInsulationType, setLegPositions, setLocationClass, setMaterialGrade, setNumberOfLegs, setNumberOfNodesInLeg, setOuterHeatTransferCoefficients, setOuterTemperatures, setOutletElevation, setOutletTemperature, setOutputFileName, setPipeDiameters, setPipeMaterial, setPipeOuterHeatTransferCoefficients, setPipeSchedule, setPipeWallConductivity, setPipeWallHeatTransferCoefficients, setPipeWallRoughness, setSoilConductivity, setTimeSeries, setUseFittings, setWallHeatTransferCoefficients, setWallThicknessMethods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletTemperature, getMassBalance, getOutletPressure, getOutletStream, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, 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, 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, setOutletStream, setOutletTemperature, setOutPressure, setOutTemperature
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
iteration
int iteration -
nominalDiameter
private double nominalDiameter -
PipeSpecSet
-
inletPressure
private double inletPressure -
totalPressureDrop
private double totalPressureDrop -
temperatureOut
protected double temperatureOut -
pressureOut
protected double pressureOut -
calculationMode
-
specifiedOutletPressure
private double specifiedOutletPressure -
specifiedOutletPressureUnit
-
maxFlowIterations
private int maxFlowIterations -
flowConvergenceTolerance
private double flowConvergenceTolerance -
maxflowunit
String maxflowunit -
insideDiameter
private double insideDiameter -
pipeThickness
private double pipeThickness -
pipeWallRoughness
private double pipeWallRoughness -
runIsothermal
private boolean runIsothermal -
regime
-
inputVolumeFractionLiquid
private double inputVolumeFractionLiquid -
mixtureFroudeNumber
private double mixtureFroudeNumber -
pipeSpecification
-
A
private double A -
area
private double area -
supGasVel
private double supGasVel -
supLiquidVel
private double supLiquidVel -
mixtureDensity
private double mixtureDensity -
hydrostaticPressureDrop
private double hydrostaticPressureDrop -
El
private double El -
supMixVel
private double supMixVel -
frictionPressureLoss
private double frictionPressureLoss -
pressureDrop
private double pressureDrop -
numberOfIncrements
private int numberOfIncrements -
totalLength
private double totalLength -
totalElevation
private double totalElevation -
angle
private double angle -
mixtureLiquidDensity
private double mixtureLiquidDensity -
mixtureLiquidViscosity
private double mixtureLiquidViscosity -
mixtureOilMassFraction
private double mixtureOilMassFraction -
mixtureOilVolumeFraction
private double mixtureOilVolumeFraction -
cumulativeLength
private double cumulativeLength -
cumulativeElevation
private double cumulativeElevation -
length
double length -
elevation
double elevation -
pressureProfile
-
temperatureProfile
-
pressureDropProfile
-
flowRegimeProfile
-
liquidSuperficialVelocityProfile
-
gasSuperficialVelocityProfile
-
mixtureSuperficialVelocityProfile
-
mixtureViscosityProfile
-
mixtureDensityProfile
-
liquidDensityProfile
-
liquidHoldupProfile
-
mixtureReynoldsNumber
-
lengthProfile
-
elevationProfile
-
incrementsProfile
-
transientInitialized
private boolean transientInitialized -
transientPressureProfile
-
transientTemperatureProfile
-
transientMassFlowProfile
-
transientVelocityProfile
-
transientDensityProfile
-
segmentLengthMeters
private double segmentLengthMeters -
crossSectionArea
private double crossSectionArea -
MIN_TRANSIT_VELOCITY
private static final double MIN_TRANSIT_VELOCITY- See Also:
-
MIN_DENSITY
private static final double MIN_DENSITY- See Also:
-
autoSized
private boolean autoSizedFlag indicating if pipeline has been auto-sized. -
runAdiabatic
private boolean runAdiabatic -
runConstantSurfaceTemperature
private boolean runConstantSurfaceTemperature -
constantSurfaceTemperature
private double constantSurfaceTemperature -
heatTransferCoefficient
private double heatTransferCoefficient -
heatTransferMode
-
includeJouleThomsonEffect
private boolean includeJouleThomsonEffect -
includeFrictionHeating
private boolean includeFrictionHeating -
Tmi
double Tmi -
Tmo
double Tmo -
Ts
double Ts -
error
double error -
iterationT
double iterationT -
dTlm
double dTlm -
cp
double cp -
q1
double q1 -
q2
double q2 -
ReNoSlip
double ReNoSlip -
S
double S -
rhoNoSlip
double rhoNoSlip -
muNoSlip
double muNoSlip -
thermalConductivity
double thermalConductivity -
Pr
double Pr -
frictionFactor
double frictionFactor -
frictionTwoPhase
double frictionTwoPhase -
Nu
double Nu -
criticalPressure
double criticalPressure -
hmax
double hmax -
X
double X -
outerHeatTransferCoefficient
private double outerHeatTransferCoefficient -
pipeWallThermalConductivity
private double pipeWallThermalConductivity -
insulationThickness
private double insulationThickness -
insulationThermalConductivity
private double insulationThermalConductivity -
supportArrangement
Support arrangement for FIV calculations. -
maxDesignVelocity
private double maxDesignVelocityMaximum design velocity in m/s. -
maxDesignLOF
private double maxDesignLOFMaximum design LOF value. -
maxDesignFRMS
private double maxDesignFRMSMaximum design FRMS value. -
maxDesignAIV
private double maxDesignAIVMaximum design AIV (Acoustic-Induced Vibration) power level in kW. -
rhonePoulencVelocity
Rhone-Poulenc velocity calculator. When non-null, maximum velocity is determined from the Rhone-Poulenc curves instead of API RP 14E.
-
-
Constructor Details
-
PipeBeggsAndBrills
Constructor for PipeBeggsAndBrills.- Parameters:
name- name of pipe
-
PipeBeggsAndBrills
Constructor for PipeBeggsAndBrills.- Parameters:
name- name of pipeinStream- input stream
-
-
Method Details
-
setPipeSpecification
Setter for the field
pipeSpecification.- Specified by:
setPipeSpecificationin interfacePipeLineInterface- Overrides:
setPipeSpecificationin classPipeline- Parameters:
nominalDiameter- a double in inchpipeSec- aStringobject
-
getThermoSystem
getThermoSystem.
- Specified by:
getThermoSystemin interfaceProcessEquipmentInterface- Overrides:
getThermoSystemin classProcessEquipmentBaseClass- Returns:
- a
SystemInterfaceobject
-
setElevation
public void setElevation(double elevation) Set the elevation change from inlet to outlet.- Specified by:
setElevationin interfacePipeLineInterface- Overrides:
setElevationin classPipeline- Parameters:
elevation- elevation change in meters (positive = uphill)
-
setLength
public void setLength(double length) Set the total pipe length.- Specified by:
setLengthin interfacePipeLineInterface- Overrides:
setLengthin classPipeline- Parameters:
length- the pipe length in meters
-
setDiameter
public void setDiameter(double diameter) Set the pipe inner diameter.- Specified by:
setDiameterin interfacePipeLineInterface- Overrides:
setDiameterin classPipeline- Parameters:
diameter- the inner diameter in meters
-
setThickness
public void setThickness(double pipeThickness) setThickness.
- Parameters:
pipeThickness- the thickness to set
-
getThickness
public double getThickness()getThickness.
- Returns:
- a double
-
setAngle
public void setAngle(double angle) Setter for the field
angle.- Specified by:
setAnglein interfacePipeLineInterface- Overrides:
setAnglein classPipeline- Parameters:
angle- a double
-
setPipeWallRoughness
public void setPipeWallRoughness(double pipeWallRoughness) Setter for the field
pipeWallRoughness.- Specified by:
setPipeWallRoughnessin interfacePipeLineInterface- Overrides:
setPipeWallRoughnessin classPipeline- Parameters:
pipeWallRoughness- the pipeWallRoughness to set
-
setNumberOfIncrements
public void setNumberOfIncrements(int numberOfIncrements) Setter for the field
numberOfIncrements.- Specified by:
setNumberOfIncrementsin interfacePipeLineInterface- Overrides:
setNumberOfIncrementsin classPipeline- Parameters:
numberOfIncrements- a int
-
setRunIsothermal
Deprecated.Sets whether to run isothermal calculations.- Parameters:
runIsothermal- a boolean
-
setConstantSurfaceTemperature
-
setHeatTransferMode
Sets the heat transfer calculation mode.Available modes:
- ADIABATIC: No heat transfer (Q=0)
- ISOTHERMAL: Constant temperature along the pipe
- SPECIFIED_U: Use a user-specified overall U-value
- ESTIMATED_INNER_H: Calculate h from flow (Gnielinski), use as U
- DETAILED_U: Calculate full U including wall, insulation, outer convection
- Parameters:
mode- the heat transfer calculation mode
-
getHeatTransferMode
Gets the current heat transfer calculation mode.- Returns:
- the heat transfer mode
-
setHeatTransferCoefficient
public void setHeatTransferCoefficient(double heatTransferCoefficient) Sets the overall heat transfer coefficient (U-value) and switches to SPECIFIED_U mode.This is the effective U-value used in the heat transfer equation Q = U * A * LMTD. When set, the mode automatically changes to SPECIFIED_U, meaning this value is used directly without flow-based calculation.
- Specified by:
setHeatTransferCoefficientin interfacePipeLineInterface- Overrides:
setHeatTransferCoefficientin classPipeline- Parameters:
heatTransferCoefficient- the overall heat transfer coefficient in W/(m²·K)- Throws:
IllegalArgumentException- if heatTransferCoefficient is negative
-
setOutletPressure
public void setOutletPressure(double pressure) Sets the specified outlet pressure and switches to flow rate calculation mode. When outlet pressure is specified, the run() method will iterate to find the flow rate that achieves the specified outlet pressure.- Specified by:
setOutletPressurein interfacePipeLineInterface- Specified by:
setOutletPressurein interfaceTwoPortInterface- Overrides:
setOutletPressurein classPipeline- Parameters:
pressure- the desired outlet pressure in bara
-
setOutletPressure
Sets the specified outlet pressure with unit and switches to flow rate calculation mode. When outlet pressure is specified, the run() method will iterate to find the flow rate that achieves the specified outlet pressure.- Specified by:
setOutletPressurein interfaceTwoPortInterface- Overrides:
setOutletPressurein classTwoPortEquipment- Parameters:
pressure- the desired outlet pressureunit- the pressure unit (e.g., "bara", "barg", "Pa", "MPa")
-
getSpecifiedOutletPressure
public double getSpecifiedOutletPressure()Gets the specified outlet pressure.- Returns:
- the specified outlet pressure in the unit set, or NaN if not specified
-
getSpecifiedOutletPressureUnit
Gets the specified outlet pressure unit.- Returns:
- the pressure unit
-
setCalculationMode
Sets the calculation mode for the pipeline.- Parameters:
mode- the calculation mode (CALCULATE_OUTLET_PRESSURE or CALCULATE_FLOW_RATE)
-
getCalculationMode
Gets the current calculation mode.- Returns:
- the calculation mode
-
setMaxFlowIterations
public void setMaxFlowIterations(int maxIterations) Sets the maximum number of iterations for flow rate calculation when outlet pressure is specified.- Parameters:
maxIterations- the maximum number of iterations
-
setFlowConvergenceTolerance
public void setFlowConvergenceTolerance(double tolerance) Sets the convergence tolerance for flow rate calculation when outlet pressure is specified.- Parameters:
tolerance- the relative convergence tolerance (default 1e-4)
-
convertSystemUnitToImperial
public void convertSystemUnitToImperial()Converts the input values from the system measurement units to imperial units. Needed because the main equations and coefficients are developed for imperial systemThe conversions applied are:
- Inside Diameter (m) - (feet): multiplied by 3.2808399
- Angle (m) - (feet): multiplied by 0.01745329
- Elevation (m) - (feet): multiplied by 3.2808399
- Length (m) - (feet): multiplied by 3.2808399
- Pipe Wall Roughness (m) - (feet): multiplied by 3.2808399
-
convertSystemUnitToMetric
public void convertSystemUnitToMetric()Converts the input values from imperial units to the system measurement units. Needed because the main equations and coefficients are developed for imperial systemThe conversions applied are the inverse of those in the
convertSystemUnitToImperial()method:- Inside Diameter (ft - m): divided by 3.2808399
- Angle (ft - m): divided by 0.01745329
- Elevation (ft - m): divided by 3.2808399
- Length (ft - m): divided by 3.2808399
- Pipe Wall Roughness (ft - m): divided by 3.2808399
- Pressure Drop (lb/inch) -(bar): multiplied by 1.48727E-05
-
calculateMissingValue
public void calculateMissingValue()calculateMissingValue.
-
calculateLength
private double calculateLength()Calculates the length based on the elevation and angle.- Returns:
- the calculated length.
-
calculateElevation
private double calculateElevation()Calculates the elevation based on the length and angle.- Returns:
- the calculated elevation.
-
calculateAngle
private double calculateAngle()Calculates the angle based on the length and elevation.- Returns:
- the calculated angle.
-
calcFlowRegime
calcFlowRegime.
- Returns:
- the determined flow regime
-
calcHydrostaticPressureDifference
public double calcHydrostaticPressureDifference()calcHydrostaticPressureDifference.
- Returns:
- a double
-
calcFrictionPressureLoss
public double calcFrictionPressureLoss()calcFrictionPressureLoss.
- Returns:
- a double
-
calcPressureDrop
public double calcPressureDrop()calcPressureDrop.
- Returns:
- a double
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Overrides:
runin classPipeline- Parameters:
id- UUID
-
runWithSpecifiedFlowRate
Run pipeline calculation with specified flow rate (calculate outlet pressure). This is the default calculation mode.- Parameters:
id- calculation identifier
-
runWithSpecifiedOutletPressure
Run pipeline calculation with specified outlet pressure (calculate flow rate). Uses bisection method to find the flow rate that achieves the target outlet pressure.- Parameters:
id- calculation identifier
-
tryCalculatePressure
Helper method to calculate outlet pressure for a given flow rate, handling exceptions when pressure goes negative (indicating flow rate is too high).- Parameters:
flowRate- the flow rate to testflowUnit- the unit for flow rateid- calculation identifier- Returns:
- the outlet pressure, or a very low value if calculation fails (pressure went negative)
-
calcGnielinskiNu
private double calcGnielinskiNu(double Re, double Pr) Calculates the Nusselt number using the Gnielinski correlation for turbulent pipe flow. Valid for 0.5 < Pr < 2000 and 3000 < Re < 5E6.- Parameters:
Re- Reynolds numberPr- Prandtl number- Returns:
- the Nusselt number
-
estimateHeatTransferCoefficent
Estimates the inner heat transfer coefficient for the given system.For single-phase flow, uses standard correlations:
- Laminar (Re < 2300): Nu = 3.66 (fully developed)
- Transition (2300-3000): Linear interpolation
- Turbulent (Re > 3000): Gnielinski correlation
For two-phase flow, uses Shah correlation enhancement factor.
- Parameters:
system- the thermodynamic system for which the heat transfer coefficient is to be estimated- Returns:
- the estimated inner heat transfer coefficient [W/(m²·K)]
-
calcTwoPhaseHeatTransferCoefficient
Calculates the two-phase heat transfer coefficient using Shah correlation.The Shah correlation provides enhancement factors for convective heat transfer in two-phase flow. It accounts for the increased turbulence and interfacial effects in gas-liquid flow.
- Parameters:
system- the thermodynamic systemsinglePhaseHTC- the single-phase heat transfer coefficient [W/(m²·K)]- Returns:
- the two-phase heat transfer coefficient [W/(m²·K)]
-
calcOverallHeatTransferCoefficient
private double calcOverallHeatTransferCoefficient(double innerHTC) Calculates the overall heat transfer coefficient including inner convection, pipe wall conduction, insulation (if present), and outer convection.The overall U-value is based on the inner surface area and accounts for:
- Inner convective resistance: 1/h_i
- Pipe wall conductive resistance: (r_o/r_i) × ln(r_o/r_i) / k_wall
- Insulation resistance (if present): (r_ins/r_i) × ln(r_ins/r_o) / k_ins
- Outer convective resistance: (r_o/r_i) / h_o or (r_ins/r_i) / h_o
- Parameters:
innerHTC- the inner heat transfer coefficient [W/(m²·K)]- Returns:
- the overall heat transfer coefficient based on inner area [W/(m²·K)]
-
setOuterHeatTransferCoefficient
public void setOuterHeatTransferCoefficient(double coefficient) Sets the outer (external) heat transfer coefficient for calculating overall U-value.This is the convective heat transfer coefficient on the outside of the pipe (or insulation). Typical values:
- Still air: 5-10 W/(m²·K)
- Moving air (wind): 10-50 W/(m²·K)
- Still water: 100-500 W/(m²·K)
- Flowing water (subsea): 200-1000 W/(m²·K)
- Specified by:
setOuterHeatTransferCoefficientin interfacePipeLineInterface- Overrides:
setOuterHeatTransferCoefficientin classPipeline- Parameters:
coefficient- the outer heat transfer coefficient [W/(m²·K)]- Throws:
IllegalArgumentException- if coefficient is negative
-
getOuterHeatTransferCoefficient
public double getOuterHeatTransferCoefficient()Gets the outer (external) heat transfer coefficient.- Specified by:
getOuterHeatTransferCoefficientin interfacePipeLineInterface- Overrides:
getOuterHeatTransferCoefficientin classPipeline- Returns:
- the outer heat transfer coefficient [W/(m²·K)]
-
setPipeWallThermalConductivity
public void setPipeWallThermalConductivity(double conductivity) Sets the pipe wall thermal conductivity.Typical values:
- Carbon steel: 45-50 W/(m·K)
- Stainless steel: 15-20 W/(m·K)
- Duplex steel: 15-17 W/(m·K)
- Parameters:
conductivity- the thermal conductivity [W/(m·K)]
-
getPipeWallThermalConductivity
public double getPipeWallThermalConductivity()Gets the pipe wall thermal conductivity.- Returns:
- the thermal conductivity [W/(m·K)]
-
setInsulation
public void setInsulation(double thickness, double conductivity) Sets the insulation layer properties.Typical thermal conductivity values:
- Mineral wool: 0.03-0.05 W/(m·K)
- Polyurethane foam: 0.02-0.03 W/(m·K)
- Polypropylene (wet insulation): 0.22-0.25 W/(m·K)
- Syntactic foam (subsea): 0.10-0.15 W/(m·K)
- Parameters:
thickness- the insulation thickness [m]conductivity- the thermal conductivity [W/(m·K)]- Throws:
IllegalArgumentException- if thickness or conductivity is negative
-
getInsulationThickness
public double getInsulationThickness()Gets the insulation thickness.- Specified by:
getInsulationThicknessin interfacePipeLineInterface- Overrides:
getInsulationThicknessin classPipeline- Returns:
- the insulation thickness [m]
-
getInsulationThermalConductivity
public double getInsulationThermalConductivity()Gets the insulation thermal conductivity.- Returns:
- the thermal conductivity [W/(m·K)]
-
setUseOverallHeatTransferCoefficient
Deprecated.UsesetHeatTransferMode(HeatTransferMode)insteadEnables or disables use of detailed overall heat transfer coefficient calculation.When enabled (true), switches to DETAILED_U mode which includes pipe wall resistance, insulation resistance (if set), and outer convection resistance (if set). When disabled (false), switches to ESTIMATED_INNER_H mode which uses only the inner convective heat transfer coefficient.
- Parameters:
use- true to use DETAILED_U mode, false to use ESTIMATED_INNER_H mode
-
isUseOverallHeatTransferCoefficient
Deprecated.UsegetHeatTransferMode()insteadGets whether detailed overall heat transfer coefficient is being used.- Returns:
- true if using DETAILED_U mode
-
calcTemperatureDifference
Calculates the temperature difference between the outlet and inlet of the system.Uses the analytical solution for a pipe with constant wall temperature (like a heat exchanger):
T_out = T_wall + (T_in - T_wall) * exp(-U * A / (m_dot * Cp))
This is derived from the energy balance dQ = U*(T-Ts)*dA = -m_dot*Cp*dT integrated along the pipe length.
- Parameters:
system- the thermodynamic system for which the temperature difference is to be calculated- Returns:
- the temperature difference between the outlet and inlet (negative for cooling)
-
calcHeatBalance
public double calcHeatBalance(double enthalpy, SystemInterface system, ThermodynamicOperations testOps) Calculates the heat balance for the given system.This method calculates the enthalpy change due to:
- Wall heat transfer (LMTD method) - when not adiabatic
- Joule-Thomson effect - cooling/heating due to pressure change (calculated from thermodynamics)
- Friction heating - viscous dissipation
The final PHflash operation determines the equilibrium state at the new enthalpy and pressure, which inherently accounts for heat of vaporization/condensation in two-phase flow. Phase changes (liquid evaporation or vapor condensation) are properly handled through the enthalpy balance.
- Parameters:
enthalpy- the initial enthalpy of the systemsystem- the thermodynamic system for which the heat balance is to be calculatedtestOps- the thermodynamic operations to be performed- Returns:
- the calculated enthalpy after performing the heat balance
-
setIncludeJouleThomsonEffect
public void setIncludeJouleThomsonEffect(boolean include) Sets whether to include Joule-Thomson effect in energy calculations.The Joule-Thomson effect accounts for temperature change during gas expansion. For natural gas, this typically results in cooling during pressure drop. The JT coefficient is automatically calculated from the gas phase thermodynamics using NeqSim's rigorous equation of state, providing accurate values for the actual fluid composition and conditions.
Typical Joule-Thomson coefficients (calculated automatically):
- Methane: ~4×10⁻⁶ K/Pa (0.4 K/bar)
- Natural gas: 3-5×10⁻⁶ K/Pa
- CO2: ~10⁻⁵ K/Pa (1 K/bar)
- Parameters:
include- true to include JT effect, false otherwise
-
isIncludeJouleThomsonEffect
public boolean isIncludeJouleThomsonEffect()Gets whether Joule-Thomson effect is included in energy calculations.When enabled, the energy equation accounts for temperature change due to gas expansion, typically resulting in cooling for natural gas flows. The JT coefficient is automatically calculated from the gas phase thermodynamics.
- Returns:
- true if JT effect is included in the energy balance
- See Also:
-
setIncludeFrictionHeating
public void setIncludeFrictionHeating(boolean include) Sets whether to include friction heating in energy calculations.Friction heating accounts for viscous dissipation, where mechanical energy lost to friction is converted to thermal energy in the fluid. The heat added is calculated as: Q_friction = ΔP_friction × Q_volumetric
For typical pipeline conditions, friction heating is a small effect (typically 0.01-0.1 K per bar of friction pressure drop) compared to wall heat transfer or Joule-Thomson cooling. However, for high-velocity or long pipelines, it may become significant.
- Parameters:
include- true to include friction heating, false otherwise
-
isIncludeFrictionHeating
public boolean isIncludeFrictionHeating()Gets whether friction heating is included in energy calculations.When enabled, the energy equation accounts for viscous dissipation, where friction pressure losses are converted to thermal energy in the fluid.
- Returns:
- true if friction heating is included in the energy balance
- See Also:
-
initializeTransientState
-
ensureTransientState
-
calcTransientFrictionPressureDrop
private double calcTransientFrictionPressureDrop(double velocity, double density, double viscosity, double segmentLength) Calculates friction pressure drop for transient simulation. Uses simplified correlations that don't depend on steady-state flow regime detection.- Parameters:
velocity- mixture velocity in m/sdensity- mixture density in kg/m3viscosity- mixture viscosity in Pa.s (not cP)segmentLength- length of segment in m- Returns:
- friction pressure drop in bar
-
calcTransientHydrostaticPressureDrop
private double calcTransientHydrostaticPressureDrop(double density, double elevationChange) Calculates hydrostatic pressure drop for transient simulation.- Parameters:
density- mixture density in kg/m3elevationChange- elevation change in m (positive = uphill)- Returns:
- hydrostatic pressure drop in bar
-
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- Overrides:
runTransientin classPipeline- Parameters:
dt- Delta time [s]id- Calculation identifier
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classPipeline
-
getInletSuperficialVelocity
public double getInletSuperficialVelocity()getInletSuperficialVelocity.
- Returns:
- a double
-
getHeatTransferCoefficient
public double getHeatTransferCoefficient()Getter for the fieldheatTransferCoefficient.- Specified by:
getHeatTransferCoefficientin interfacePipeLineInterface- Overrides:
getHeatTransferCoefficientin classPipeline- Returns:
- the heat transfer coefficient
-
getOutletSuperficialVelocity
public double getOutletSuperficialVelocity()getOutletSuperficialVelocity.
- Returns:
- a double
-
getNumberOfIncrements
public int getNumberOfIncrements()getNumberOfIncrements.
- Specified by:
getNumberOfIncrementsin interfacePipeLineInterface- Overrides:
getNumberOfIncrementsin classPipeline- Returns:
- a double
-
getAngle
public double getAngle()Getter for the field
angle.- Specified by:
getAnglein interfacePipeLineInterface- Overrides:
getAnglein classPipeline- Returns:
- angle in degrees
-
getLength
public double getLength()Get the total pipe length.- Specified by:
getLengthin interfacePipeLineInterface- Overrides:
getLengthin classPipeline- Returns:
- the pipe length in meters
-
getElevation
public double getElevation()Get the elevation change from inlet to outlet.- Specified by:
getElevationin interfacePipeLineInterface- Overrides:
getElevationin classPipeline- Returns:
- elevation change in meters
-
getDiameter
public double getDiameter()Get the pipe inner diameter.- Specified by:
getDiameterin interfacePipeLineInterface- Overrides:
getDiameterin classPipeline- Returns:
- the inner diameter in meters
-
getFlowRegimeEnum
Get the flow regime as an enum.- Returns:
- flow regime enum value
-
getFlowRegime
Get the determined flow regime.- Specified by:
getFlowRegimein interfacePipeLineInterface- Overrides:
getFlowRegimein classPipeline- Returns:
- flow regime as string (e.g., "stratified", "slug", "annular", "dispersed bubble")
-
getLastSegmentPressureDrop
public double getLastSegmentPressureDrop()Getter for the field
LastSegmentPressureDrop.- Returns:
- pressure drop last segment
-
getPressureDrop
public double getPressureDrop()Get the total pressure drop across the pipeline.- Specified by:
getPressureDropin interfacePipeLineInterface- Overrides:
getPressureDropin classPipeline- Returns:
- pressure drop in bar
-
getPressureProfile
public double[] getPressureProfile()Get the pressure profile along the pipe.- Specified by:
getPressureProfilein interfacePipeLineInterface- Overrides:
getPressureProfilein classPipeline- Returns:
- array of pressures in bar at each increment
-
getPressureProfileList
-
getSegmentPressure
getSegmentPressure.
- Parameters:
index- segment number- Returns:
- segment pressure as double
-
getPressureDropProfile
-
getSegmentPressureDrop
getSegmentPressureDrop.
- Parameters:
index- segment number- Returns:
- Double
-
getTemperatureProfile
public double[] getTemperatureProfile()Get the temperature profile along the pipe.- Specified by:
getTemperatureProfilein interfacePipeLineInterface- Overrides:
getTemperatureProfilein classPipeline- Returns:
- array of temperatures in Kelvin at each increment
-
getTemperatureProfileList
-
getSegmentTemperature
getSegmentTemperature.
- Parameters:
index- segment number- Returns:
- Double
-
getFlowRegimeProfileList
Getter for the field
flowRegimeProfile.- Returns:
- list of flow regime names
-
getSegmentFlowRegime
getSegmentFlowRegime.
- Parameters:
index- segment number- Returns:
- String
-
getLiquidSuperficialVelocityProfile
-
getGasSuperficialVelocityProfile
-
getMixtureSuperficialVelocityProfile
-
getMixtureViscosityProfile
-
getMixtureDensityProfile
-
getLiquidDensityProfile
-
getLiquidHoldupProfile
public double[] getLiquidHoldupProfile()Get the liquid holdup profile along the pipe.- Specified by:
getLiquidHoldupProfilein interfacePipeLineInterface- Overrides:
getLiquidHoldupProfilein classPipeline- Returns:
- array of liquid holdup values at each increment
-
getLiquidHoldupProfileList
-
getMixtureReynoldsNumber
-
getLengthProfile
-
getIncrementsProfile
-
getElevationProfile
-
getSegmentLiquidSuperficialVelocity
getSegmentLiquidSuperficialVelocity.
- Parameters:
index- segment number- Returns:
- Double
-
getSegmentGasSuperficialVelocity
getSegmentGasSuperficialVelocity.
- Parameters:
index- segment number- Returns:
- Double
-
getSegmentMixtureSuperficialVelocity
getSegmentMixtureSuperficialVelocity.
- Parameters:
index- segment number- Returns:
- Double
-
getSegmentMixtureViscosity
getSegmentMixtureViscosity.
- Parameters:
index- segment number- Returns:
- Double
-
getSegmentMixtureDensity
getSegmentMixtureDensity.
- Parameters:
index- segment number- Returns:
- Double
-
getSegmentLiquidDensity
getSegmentLiquidDensity.
- Parameters:
index- segment number- Returns:
- Double
-
getSegmentLiquidHoldup
getSegmentLiquidHoldup.
- Parameters:
index- segment number- Returns:
- Double
-
getSegmentMixtureReynoldsNumber
getSegmentMixtureReynoldsNumber.
- Parameters:
index- segment number- Returns:
- Double
-
getSegmentLength
getSegmentLength.
- Parameters:
index- segment number- Returns:
- Double
-
getSegmentElevation
getSegmentElevation.
- Parameters:
index- segment number- Returns:
- Double
-
getSupportArrangement
Get support arrangement for FIV calculations.- Returns:
- support arrangement (Stiff, Medium stiff, Medium, Flexible)
-
setSupportArrangement
Set support arrangement for FIV calculations.- Parameters:
arrangement- support arrangement (Stiff, Medium stiff, Medium, Flexible)
-
getErosionalVelocity
public double getErosionalVelocity(double cFactor) Calculate erosional velocity per API RP 14E.The erosional velocity is calculated using the formula:
V_e = C / sqrt(rho_mix)
where C is typically 100-150 for continuous service.- Parameters:
cFactor- erosional C-factor (typically 100-150)- Returns:
- erosional velocity in m/s
-
getErosionalVelocity
public double getErosionalVelocity()Calculate erosional velocity with default C-factor of 100.- Returns:
- erosional velocity in m/s
-
getMixtureVelocity
public double getMixtureVelocity()Get the mixture velocity in m/s.- Returns:
- mixture superficial velocity in m/s
-
calculateLOF
public double calculateLOF()Calculate Likelihood of Failure (LOF) for flow-induced vibration.LOF interpretation:
- < 0.5: Low risk - acceptable
- 0.5 - 1.0: Medium risk - monitoring recommended
- > 1.0: High risk - design review required
- Returns:
- LOF value (dimensionless)
-
calculateFRMS
public double calculateFRMS()Calculate Flow-induced vibration RMS (FRMS).FRMS provides an alternative measure of vibration intensity based on mixture properties. Higher values indicate greater vibration risk.
- Returns:
- FRMS value
-
calculateFRMS
public double calculateFRMS(double frmsConstant) Calculate Flow-induced vibration RMS (FRMS) with specified constant.- Parameters:
frmsConstant- FRMS constant (typically 6.7)- Returns:
- FRMS value
-
calculateAIV
public double calculateAIV()Calculate Acoustic-Induced Vibration (AIV) power level.AIV occurs at pressure-reducing elements (valves, orifices, restrictions) where high-velocity gas flow creates acoustic energy. This is most relevant for:
- High pressure drop across the pipe segment
- Gas-dominated flows (GVF > 0.8)
- Downstream of control valves, chokes, or restrictions
AIV Power Level interpretation (per Energy Institute Guidelines):
- < 1 kW: Low risk - no special measures required
- 1 - 10 kW: Medium risk - screening required
- 10 - 25 kW: High risk - detailed assessment required
- > 25 kW: Very high risk - design modifications needed
- Returns:
- AIV acoustic power level in kW
-
calculateAIVLikelihoodOfFailure
public double calculateAIVLikelihoodOfFailure()Calculate AIV Likelihood of Failure based on acoustic power and pipe geometry.AIV LOF interpretation:
- < 0.3: Low risk
- 0.3 - 0.5: Medium risk - monitoring recommended
- 0.5 - 0.7: High risk - detailed assessment required
- > 0.7: Very high risk - design changes needed
- Returns:
- AIV likelihood of failure (0.0-1.0)
-
setMaxDesignAIV
public void setMaxDesignAIV(double aivKW) Set maximum design AIV power level for capacity constraints. Clears cached constraints so they will be recreated with the new value on next access.- Parameters:
aivKW- maximum AIV power level in kW
-
getMaxDesignAIV
public double getMaxDesignAIV()Get maximum design AIV power level.- Returns:
- maximum AIV power level in kW
-
getFIVAnalysis
-
getFIVAnalysisJson
Get FIV analysis as JSON string.- Returns:
- JSON string with FIV analysis
-
setRhonePoulencServiceType
Enable Rhone-Poulenc maximum velocity calculation for gas pipes.When enabled, the maximum allowable velocity is determined from the Rhone-Poulenc curves instead of the API RP 14E erosional velocity. The Rhone-Poulenc method uses a power-law correlation between gas density and maximum velocity, with service-type-dependent constants.
- Parameters:
serviceType- the gas service type (NON_CORROSIVE_GAS or CORROSIVE_GAS)
-
useRhonePoulencVelocity
public void useRhonePoulencVelocity()Enable Rhone-Poulenc maximum velocity calculation with default non-corrosive gas settings.Equivalent to calling
setRhonePoulencServiceType(ServiceType.NON_CORROSIVE_GAS). -
setRhonePoulencServiceType
public void setRhonePoulencServiceType(RhonePoulencVelocity.ServiceType serviceType, boolean useInterpolation) Enable Rhone-Poulenc maximum velocity calculation using tabulated data with log-log interpolation for higher accuracy.- Parameters:
serviceType- the gas service typeuseInterpolation- true to use tabulated interpolation, false for power-law formula
-
disableRhonePoulencVelocity
public void disableRhonePoulencVelocity()Disable Rhone-Poulenc maximum velocity and revert to API RP 14E erosional velocity. -
isRhonePoulencEnabled
public boolean isRhonePoulencEnabled()Check if Rhone-Poulenc maximum velocity is enabled.- Returns:
- true if Rhone-Poulenc method is active
-
getRhonePoulencCalculator
Get the Rhone-Poulenc velocity calculator, or null if not enabled.- Returns:
- the RhonePoulencVelocity calculator or null
-
getRhonePoulencMaxVelocity
public double getRhonePoulencMaxVelocity()Calculate the maximum allowable gas velocity using the Rhone-Poulenc curves.This method uses the current gas/mixture density from the simulation to look up the maximum velocity from the Rhone-Poulenc correlation. If Rhone-Poulenc is not enabled, returns 0.0.
- Returns:
- maximum allowable velocity in m/s, or 0.0 if not enabled or density unavailable
-
getMaxAllowableVelocity
public double getMaxAllowableVelocity()Get the effective maximum allowable velocity using the currently configured method.Returns Rhone-Poulenc max velocity if enabled, otherwise the API RP 14E erosional velocity.
- Returns:
- maximum allowable velocity in m/s
-
getMaxVelocityMethod
Get the name of the currently active maximum velocity method.- Returns:
- "RHONE_POULENC" or "API_RP_14E"
-
getGasDensityForVelocity
private double getGasDensityForVelocity()Get the gas density used for velocity calculations.Uses mixture density from Beggs and Brill calculations if available; otherwise falls back to the inlet stream density.
- Returns:
- gas density in kg/m3, or 0.0 if unavailable
-
setMaxDesignVelocity
public void setMaxDesignVelocity(double velocity) Set maximum design velocity for capacity constraints. Clears cached constraints so they will be recreated with the new value on next access.- Parameters:
velocity- maximum velocity in m/s
-
setMaxDesignLOF
public void setMaxDesignLOF(double lof) Set maximum design LOF for capacity constraints. Clears cached constraints so they will be recreated with the new value on next access.- Parameters:
lof- maximum LOF value
-
setMaxDesignFRMS
public void setMaxDesignFRMS(double frms) Set maximum design FRMS for capacity constraints. Clears cached constraints so they will be recreated with the new value on next access.- Parameters:
frms- maximum FRMS value
-
initializeCapacityConstraints
protected void initializeCapacityConstraints()Override parent's capacity constraint initialization to add FIV/FRMS/AIV constraints.- Overrides:
initializeCapacityConstraintsin classPipeline
-
reinitializeCapacityConstraints
public void reinitializeCapacityConstraints()Reinitialize capacity constraints with current design values.Call this method after changing design limits (velocity, LOF, FRMS, AIV) if constraints have already been accessed. This clears existing constraints and recreates them based on current settings.
Note: The setter methods (setMaxDesignVelocity, setMaxDesignLOF, etc.) automatically clear the constraints, so this method is only needed if you want to explicitly reinitialize.
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classPipeline- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classPipeline- Parameters:
cfg- report configuration- Returns:
- json string
-
autoSize
public void autoSize(double safetyFactor) Auto-sizes the pipeline based on current flow conditions.This method calculates the required pipe diameter to achieve target velocity criteria. The sizing is based on erosion velocity limits and pressure drop constraints.
- Specified by:
autoSizein interfaceAutoSizeable- Parameters:
safetyFactor- safety factor to apply (e.g., 1.2 for 20% margin)
-
selectStandardPipeSize
private double selectStandardPipeSize(double calculatedDiameterInches) Selects standard pipe nominal diameter based on calculated diameter.- Parameters:
calculatedDiameterInches- calculated inside diameter in inches- Returns:
- nearest standard pipe nominal diameter in inches
-
autoSize
public void autoSize()Automatically size using default safety factor (1.2 = 20% margin).- Specified by:
autoSizein interfaceAutoSizeable
-
autoSize
Automatically size using company-specific design standards.This method applies design rules from the specified company's technical requirements (TR) documents. The standards are loaded from the NeqSim design database.
- Specified by:
autoSizein interfaceAutoSizeable- Parameters:
company- company name (e.g., "Equinor", "Shell", "TotalEnergies")trDocument- TR document reference (e.g., "TR2000", "DEP-31.38.01.11")
-
isAutoSized
public boolean isAutoSized()Check if equipment has been auto-sized.- Specified by:
isAutoSizedin interfaceAutoSizeable- Returns:
- true if autoSize() has been called successfully
-
getSizingReport
Get a detailed sizing report after auto-sizing.The report includes:
- Design basis (flow rates, pressures, temperatures)
- Calculated dimensions
- Design parameters (K-factor, Cv, velocity, etc.)
- Safety margins
- Specified by:
getSizingReportin interfaceAutoSizeable- Returns:
- formatted sizing report string
-
getSizingReportJson
Get sizing report as JSON for programmatic access.- Specified by:
getSizingReportJsonin interfaceAutoSizeable- Returns:
- JSON string with sizing data
-
getHeatTransferMode()instead