Class PipeMechanicalDesignCalculator
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
RiserMechanicalDesignCalculator, TopsidePipingMechanicalDesignCalculator
This class provides methods to calculate wall thickness, pressure ratings, and stress analysis according to various pipeline design codes including:
- ASME B31.3 - Process Piping
- ASME B31.4 - Pipeline Transportation of Liquids
- ASME B31.8 - Gas Transmission and Distribution
- DNV-OS-F101 - Submarine Pipeline Systems
- API 5L - Line Pipe Specifications
Usage Example
PipeMechanicalDesignCalculator calc = new PipeMechanicalDesignCalculator();
calc.setDesignPressure(150.0); // bara
calc.setDesignTemperature(80.0); // Celsius
calc.setOuterDiameter(0.508); // 20 inch
calc.setMaterialGrade("X65");
calc.setDesignCode("ASME_B31_8");
calc.setLocationClass(2);
double wallThickness = calc.calculateMinimumWallThickness();
double maop = calc.calculateMAOP();
- Version:
- 1.0
- Author:
- Even Solbraa
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleSpan length for free spans in meters.private doubleAmbient temperature in Celsius.private doubleAnchor cost in USD each.private doubleAnchor spacing in meters.Map of API 5L material grades to SMYS (MPa).static final StringASME B31.3 - Process Piping.static final StringASME B31.4 - Liquid Transportation.static final StringASME B31.8 - Gas Transmission.private doubleBurial depth in meters.private doubleCoating cost in USD.private doubleCoating density in kg/m3.private doubleCoating price in USD/m2.private doubleExternal coating thickness in meters.private StringExternal coating type (e.g., "3LPE", "FBE", "CTE").private doubleCoating weight per meter in kg/m.private doubleCollapse pressure in MPa.private doubleConcrete weight coating thickness in meters.private doubleConcrete coating cost in USD.private doubleConcrete density in kg/m3.private doubleConcrete price in USD/m3.private doubleConcrete weight per meter in kg/m.private doubleContent weight per meter in kg/m.private doubleContingency cost in USD.private doubleContingency percentage.private doubleCorrosion allowance in meters.private StringDesign code to use.private doubleDesign factor (F).private doubleDesign pressure in MPa.private doubleDesign temperature in Celsius.static final StringDNV-OS-F101 - Submarine Pipelines.private doubleEngineering cost in USD.private doubleEngineering and design cost percentage.private doubleExpansion loop length in meters.private doubleExternal pressure at seabed in MPa.private doubleExternal surface area per meter in m2/m.private doubleFabrication tolerance factor (typically 0.875 for seamless).private doubleFatigue life in years.private doubleField weld cost in USD per weld.Map of ASME B16.5 flange pressure-temperature ratings at 38°C in MPa.private intFlange class per ASME B16.5.private doubleFlange pair cost in USD.private doubleFlanges and fittings cost in USD.private doubleCalculated hoop stress in MPa.private doublePipe inner diameter in meters (calculated).private doubleInstallation cost in USD.private doubleInstallation cost in USD/m (varies by method).private doubleInstallation manhours per meter.private StringInstallation method (e.g., "S-lay", "J-lay", "Reel-lay", "Onshore").private doubleInsulation thermal conductivity in W/(m·K).private doubleInsulation cost in USD.private doubleInsulation density in kg/m3.private doubleInsulation price in USD/m3.private doubleInsulation thickness in meters.private StringInsulation type (e.g., "PUF", "mineral wool", "none").private doubleInsulation weight per meter in kg/m.private doubleInternal surface area per meter in m2/m.private doubleLongitudinal joint factor (E).private doubleLateral buckling force in N.private intLocation class (1-4 for ASME B31.8).private doubleCalculated longitudinal stress in MPa.private doubleMaximum Allowable Operating Pressure in MPa.private StringMaterial grade (e.g., "X52", "X65", "X70").private doubleBending radius for field bends in meters.private doubleCalculated minimum wall thickness in meters.private doubleNominal wall thickness in meters.private intNumber of anchors.private intNumber of expansion loops required.private intNumber of field welds.private intNumber of flange pairs.private intNumber of pipe joints (12m standard length).private intNumber of pipe supports.private intNumber of valves.private doublePipe outer diameter in meters.private doublePipeline length in meters.private doublePoisson's ratio.private doublePropagation buckling pressure in MPa.private doubleRequired negative buoyancy in N/m.private doubleSeawater density in kg/m3.private static final longSerialization version UID.private doubleSpecified Minimum Tensile Strength in MPa.private doubleSpecified Minimum Yield Strength in MPa.private static final doubleStandard pipe joint length in meters.Map of nominal pipe sizes to OD in meters (API 5L / ASME B36.10).private doubleSteel density in kg/m3.private doubleSteel material cost in USD.private doubleSteel price in USD/kg.private doublePipe steel weight per meter in kg/m.private doubleSubmerged weight per meter in kg/m (negative = buoyant).private doubleSupport cost in USD each.private doubleSupports and anchors cost in USD.private doublePipe support spacing in meters.private doubleTemperature derating factor (T).private doubleTesting cost in USD.private doubleTesting and commissioning cost percentage.private doubleThermal expansion coefficient in 1/K.private doubleTotal direct cost in USD.private doubleTotal dry weight per meter in kg/m.private doubleTotal external surface area in m2.private doubleTotal labor manhours.private doubleTotal pipeline dry weight in kg.private doubleTotal project cost in USD.private doubleUpheaval buckling force in N.private doubleValve cost in USD.private doubleValves cost in USD.private StringValve type (e.g., "Ball", "Gate", "Check").private doubleCalculated von Mises stress in MPa.private doubleWater depth in meters.private doubleWelding cost in USD.private doubleWelding manhours per joint.private doubleWeld joint efficiency.private doubleYoung's modulus in MPa. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PipeMechanicalDesignCalculator(double outerDiameter, double designPressure, double designTemperature) Constructor with basic parameters. -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateAllowableSpanLength(double currentVelocity) Calculate allowable free span length for subsea pipelines.doubleCalculate collapse pressure per DNV-OS-F101.doublecalculateExpansionLoopLength(double deltaT, String loopType) Calculate expansion loop length for thermal expansion.doubleCalculate external pressure at seabed.doublecalculateHoopStress(double pressure) Calculate hoop (circumferential) stress.doublecalculateInsulationThickness(double inletTemperature, double minArrivalTemperature, double massFlowRate, double specificHeat) Calculate insulation thickness for heat loss control.voidCalculate number of pipe joints and welds.doubleCalculate labor manhours estimate.doublecalculateLongitudinalStress(double pressure, double deltaT, boolean restrained) Calculate longitudinal (axial) stress.doubleCalculate Maximum Allowable Operating Pressure (MAOP).doubleCalculate minimum bend radius for field bends.doubleCalculate minimum required wall thickness based on selected design code.doubleCalculate complete project cost estimate.doubleCalculate propagation buckling pressure.doublecalculateRequiredConcreteThickness(double contentDensity, double targetSubmergedWeight) Calculate required concrete coating thickness for on-bottom stability.doubleCalculate safety margin as percentage of SMYS.doublecalculateSubmergedWeight(double contentDensity) Calculate submerged weight for subsea pipelines.doublecalculateSupportSpacing(double maxDeflection) Calculate pipe support spacing for above-ground pipelines.doubleCalculate test pressure for hydrostatic testing.doublecalculateVonMisesStress(double pressure, double deltaT, boolean restrained) Calculate von Mises equivalent stress.private doubleCalculate wall thickness per ASME B31.3 (Process Piping).private doubleCalculate wall thickness per ASME B31.4 (Liquid Transportation).private doubleCalculate wall thickness per ASME B31.8 (Gas Transmission).private doublecalculateWallThicknessBarlow(double safetyFactor) Calculate wall thickness using basic Barlow formula.private doubleCalculate wall thickness per DNV-OS-F101 (Submarine Pipelines).voidCalculate all weight and surface area values.doubleestimateFatigueLife(double stressRange, double numberOfCycles) Estimate fatigue life based on DNV-RP-C203.Generate Bill of Materials (BOM).Generate a design summary report.doubleGet ambient temperature.doubleGet anchor spacing.doubleGet burial depth.doubleGet coating price per m2.doubleGet external coating thickness.Get external coating type.doubleGet collapse pressure.doubleGet concrete weight coating thickness.doubleGet contingency percentage.doubleGet corrosion allowance.Get design code.doubleGet design factor.doubleGet design pressure.doubleGet design temperature.doubleGet fabrication tolerance factor.doubleGet fatigue life.doubleGet field weld cost.intGet flange class.doubleGet calculated hoop stress.doubleGet inner diameter.Get installation method.doubleGet insulation thickness.Get insulation type.doubleGet longitudinal joint factor.intGet location class.doublegetMaop()Get calculated MAOP.doubleGet MAOP in specified unit.Get material grade.doubleGet calculated minimum wall thickness.doubleGet nominal wall thickness.intGet number of field welds.intGet number of flange pairs.intGet number of pipe joints.intGet number of supports.intGet number of valves.doubleGet outer diameter.doubleGet pipeline length.doubleGet Poisson's ratio.doublegetSmts()Get Specified Minimum Tensile Strength (SMTS).doublegetSmys()Get Specified Minimum Yield Strength (SMYS).doubleGet steel density.doubleGet steel price per kg.doubleGet steel weight per meter.doubleGet submerged weight per meter.doubleGet support spacing.doubleGet thermal expansion coefficient.doubleGet total direct cost.doubleGet total dry weight per meter.doubleGet total external surface area.doubleGet total labor manhours.doubleGet total pipeline weight.doubleGet total project cost.Get valve type.doubleGet calculated von Mises stress.doubleGet water depth.doubleGet weld joint efficiency.doubleGet Young's modulus.booleanCheck if design is within allowable stress limits.voidloadDesignFactorsFromDatabase(String company) Deprecated.voidloadFromDatabase(String materialGrade, String company) Deprecated.UsePipelineMechanicalDesign.loadFromDatabase()instead.voidloadMaterialFromDatabase(String grade) Deprecated.intSelect appropriate flange class based on design conditions.Select standard nominal pipe size.voidsetAmbientTemperature(double ambientTemperature) Set ambient temperature.voidsetAnchorSpacing(double anchorSpacing) Set anchor spacing.voidsetBurialDepth(double burialDepth) Set burial depth.voidsetCoatingPricePerM2(double coatingPricePerM2) Set coating price per m2.voidsetCoatingThickness(double coatingThickness) Set external coating thickness.voidsetCoatingType(String coatingType) Set external coating type.voidsetConcreteCoatingThickness(double concreteCoatingThickness) Set concrete weight coating thickness.voidsetContingencyPercentage(double contingencyPercentage) Set contingency percentage.voidsetCorrosionAllowance(double corrosionAllowance) Set corrosion allowance.voidsetCorrosionAllowance(double allowance, String unit) Set corrosion allowance with unit.voidsetDesignCode(String designCode) Set design code.voidsetDesignFactor(double designFactor) Set design factor (overrides automatic calculation).voidsetDesignPressure(double designPressure) Set design pressure.voidsetDesignPressure(double pressure, String unit) Set design pressure with unit.voidsetDesignTemperature(double designTemperature) Set design temperature.voidsetFabricationTolerance(double fabricationTolerance) Set fabrication tolerance factor.voidsetFieldWeldCost(double fieldWeldCost) Set field weld cost.voidsetFlangeClass(int flangeClass) Set flange class.voidsetInstallationMethod(String installationMethod) Set installation method.voidsetInsulationThickness(double insulationThickness) Set insulation thickness.voidsetInsulationType(String insulationType) Set insulation type.voidsetJointFactor(double jointFactor) Set longitudinal joint factor.voidsetLocationClass(int locationClass) Set location class for ASME B31.8.voidsetMaterialGrade(String materialGrade) Set material grade per API 5L.voidsetNominalWallThickness(double nominalWallThickness) Set nominal wall thickness.voidsetNominalWallThickness(double thickness, String unit) Set nominal wall thickness with unit.voidsetNumberOfFlangePairs(int numberOfFlangePairs) Set number of flange pairs.voidsetNumberOfValves(int numberOfValves) Set number of valves.voidsetOuterDiameter(double outerDiameter) Set outer diameter.voidsetOuterDiameter(double diameter, String unit) Set outer diameter with unit.voidsetPipelineLength(double pipelineLength) Set pipeline length.voidsetPoissonsRatio(double poissonsRatio) Set Poisson's ratio.voidsetSmts(double smts) Set Specified Minimum Tensile Strength manually.voidsetSmys(double smys) Set Specified Minimum Yield Strength manually.voidsetSteelDensity(double steelDensity) Set steel density.voidsetSteelPricePerKg(double steelPricePerKg) Set steel price per kg.voidsetThermalExpansion(double thermalExpansion) Set thermal expansion coefficient.voidsetValveType(String valveType) Set valve type.voidsetWaterDepth(double waterDepth) Set water depth.voidsetWeldJointEfficiency(double weldJointEfficiency) Set weld joint efficiency for B31.3.voidsetYoungsModulus(double youngsModulus) Set Young's modulus.Export mechanical design data to compact JSON format.toJson()Export mechanical design data to JSON format.toMap()Convert mechanical design data to a Map for JSON serialization.private voidUpdate design factors based on design code and location class.private voidUpdate installation cost per meter based on installation method.private voidUpdate material properties based on material grade.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
ASME_B31_3
-
ASME_B31_4
-
ASME_B31_8
-
DNV_OS_F101
-
designPressure
private double designPressureDesign pressure in MPa. -
designTemperature
private double designTemperatureDesign temperature in Celsius. -
outerDiameter
private double outerDiameterPipe outer diameter in meters. -
innerDiameter
private double innerDiameterPipe inner diameter in meters (calculated). -
nominalWallThickness
private double nominalWallThicknessNominal wall thickness in meters. -
corrosionAllowance
private double corrosionAllowanceCorrosion allowance in meters. -
fabricationTolerance
private double fabricationToleranceFabrication tolerance factor (typically 0.875 for seamless). -
materialGrade
Material grade (e.g., "X52", "X65", "X70"). -
smys
private double smysSpecified Minimum Yield Strength in MPa. -
smts
private double smtsSpecified Minimum Tensile Strength in MPa. -
youngsModulus
private double youngsModulusYoung's modulus in MPa. -
poissonsRatio
private double poissonsRatioPoisson's ratio. -
thermalExpansion
private double thermalExpansionThermal expansion coefficient in 1/K. -
designCode
Design code to use. -
locationClass
private int locationClassLocation class (1-4 for ASME B31.8). -
designFactor
private double designFactorDesign factor (F). -
jointFactor
private double jointFactorLongitudinal joint factor (E). -
temperatureDerating
private double temperatureDeratingTemperature derating factor (T). -
weldJointEfficiency
private double weldJointEfficiencyWeld joint efficiency. -
pipelineLength
private double pipelineLengthPipeline length in meters. -
steelDensity
private double steelDensitySteel density in kg/m3. -
numberOfJoints
private int numberOfJointsNumber of pipe joints (12m standard length). -
numberOfFieldWelds
private int numberOfFieldWeldsNumber of field welds. -
coatingType
External coating type (e.g., "3LPE", "FBE", "CTE"). -
coatingThickness
private double coatingThicknessExternal coating thickness in meters. -
coatingDensity
private double coatingDensityCoating density in kg/m3. -
insulationType
Insulation type (e.g., "PUF", "mineral wool", "none"). -
insulationThickness
private double insulationThicknessInsulation thickness in meters. -
insulationDensity
private double insulationDensityInsulation density in kg/m3. -
insulationConductivity
private double insulationConductivityInsulation thermal conductivity in W/(m·K). -
concreteCoatingThickness
private double concreteCoatingThicknessConcrete weight coating thickness in meters. -
concreteDensity
private double concreteDensityConcrete density in kg/m3. -
requiredNegativeBuoyancy
private double requiredNegativeBuoyancyRequired negative buoyancy in N/m. -
installationMethod
Installation method (e.g., "S-lay", "J-lay", "Reel-lay", "Onshore"). -
waterDepth
private double waterDepthWater depth in meters. -
burialDepth
private double burialDepthBurial depth in meters. -
ambientTemperature
private double ambientTemperatureAmbient temperature in Celsius. -
seawaterDensity
private double seawaterDensitySeawater density in kg/m3. -
supportSpacing
private double supportSpacingPipe support spacing in meters. -
numberOfSupports
private int numberOfSupportsNumber of pipe supports. -
expansionLoopLength
private double expansionLoopLengthExpansion loop length in meters. -
numberOfExpansionLoops
private int numberOfExpansionLoopsNumber of expansion loops required. -
anchorSpacing
private double anchorSpacingAnchor spacing in meters. -
numberOfAnchors
private int numberOfAnchorsNumber of anchors. -
flangeClass
private int flangeClassFlange class per ASME B16.5. -
numberOfFlangePairs
private int numberOfFlangePairsNumber of flange pairs. -
numberOfValves
private int numberOfValvesNumber of valves. -
valveType
Valve type (e.g., "Ball", "Gate", "Check"). -
minimumWallThickness
private double minimumWallThicknessCalculated minimum wall thickness in meters. -
maop
private double maopMaximum Allowable Operating Pressure in MPa. -
hoopStress
private double hoopStressCalculated hoop stress in MPa. -
longitudinalStress
private double longitudinalStressCalculated longitudinal stress in MPa. -
vonMisesStress
private double vonMisesStressCalculated von Mises stress in MPa. -
externalPressure
private double externalPressureExternal pressure at seabed in MPa. -
collapsePressure
private double collapsePressureCollapse pressure in MPa. -
propagationBucklingPressure
private double propagationBucklingPressurePropagation buckling pressure in MPa. -
upheavalBucklingForce
private double upheavalBucklingForceUpheaval buckling force in N. -
lateralBucklingForce
private double lateralBucklingForceLateral buckling force in N. -
allowableSpanLength
private double allowableSpanLengthSpan length for free spans in meters. -
fatigueLife
private double fatigueLifeFatigue life in years. -
minimumBendRadius
private double minimumBendRadiusBending radius for field bends in meters. -
steelWeightPerMeter
private double steelWeightPerMeterPipe steel weight per meter in kg/m. -
coatingWeightPerMeter
private double coatingWeightPerMeterCoating weight per meter in kg/m. -
insulationWeightPerMeter
private double insulationWeightPerMeterInsulation weight per meter in kg/m. -
concreteWeightPerMeter
private double concreteWeightPerMeterConcrete weight per meter in kg/m. -
totalDryWeightPerMeter
private double totalDryWeightPerMeterTotal dry weight per meter in kg/m. -
contentWeightPerMeter
private double contentWeightPerMeterContent weight per meter in kg/m. -
submergedWeightPerMeter
private double submergedWeightPerMeterSubmerged weight per meter in kg/m (negative = buoyant). -
totalPipelineWeight
private double totalPipelineWeightTotal pipeline dry weight in kg. -
externalSurfaceAreaPerMeter
private double externalSurfaceAreaPerMeterExternal surface area per meter in m2/m. -
internalSurfaceAreaPerMeter
private double internalSurfaceAreaPerMeterInternal surface area per meter in m2/m. -
totalExternalSurfaceArea
private double totalExternalSurfaceAreaTotal external surface area in m2. -
steelPricePerKg
private double steelPricePerKgSteel price in USD/kg. -
coatingPricePerM2
private double coatingPricePerM2Coating price in USD/m2. -
insulationPricePerM3
private double insulationPricePerM3Insulation price in USD/m3. -
concretePricePerM3
private double concretePricePerM3Concrete price in USD/m3. -
fieldWeldCost
private double fieldWeldCostField weld cost in USD per weld. -
flangePairCost
private double flangePairCostFlange pair cost in USD. -
valveCost
private double valveCostValve cost in USD. -
supportCost
private double supportCostSupport cost in USD each. -
anchorCost
private double anchorCostAnchor cost in USD each. -
installationCostPerMeter
private double installationCostPerMeterInstallation cost in USD/m (varies by method). -
testingCostPercentage
private double testingCostPercentageTesting and commissioning cost percentage. -
engineeringCostPercentage
private double engineeringCostPercentageEngineering and design cost percentage. -
contingencyPercentage
private double contingencyPercentageContingency percentage. -
steelMaterialCost
private double steelMaterialCostSteel material cost in USD. -
coatingCost
private double coatingCostCoating cost in USD. -
insulationCost
private double insulationCostInsulation cost in USD. -
concreteCost
private double concreteCostConcrete coating cost in USD. -
weldingCost
private double weldingCostWelding cost in USD. -
flangesAndFittingsCost
private double flangesAndFittingsCostFlanges and fittings cost in USD. -
valvesCost
private double valvesCostValves cost in USD. -
supportsAndAnchorsCost
private double supportsAndAnchorsCostSupports and anchors cost in USD. -
installationCost
private double installationCostInstallation cost in USD. -
totalDirectCost
private double totalDirectCostTotal direct cost in USD. -
engineeringCost
private double engineeringCostEngineering cost in USD. -
testingCost
private double testingCostTesting cost in USD. -
contingencyCost
private double contingencyCostContingency cost in USD. -
totalProjectCost
private double totalProjectCostTotal project cost in USD. -
weldingManhoursPerJoint
private double weldingManhoursPerJointWelding manhours per joint. -
installationManhoursPerMeter
private double installationManhoursPerMeterInstallation manhours per meter. -
totalLaborManhours
private double totalLaborManhoursTotal labor manhours. -
API_5L_GRADES
-
STANDARD_PIPE_SIZES
-
FLANGE_CLASS_RATINGS
-
STANDARD_JOINT_LENGTH
private static final double STANDARD_JOINT_LENGTHStandard pipe joint length in meters.- See Also:
-
-
Constructor Details
-
PipeMechanicalDesignCalculator
public PipeMechanicalDesignCalculator()Default constructor. -
PipeMechanicalDesignCalculator
public PipeMechanicalDesignCalculator(double outerDiameter, double designPressure, double designTemperature) Constructor with basic parameters.- Parameters:
outerDiameter- pipe outer diameter in metersdesignPressure- design pressure in MPadesignTemperature- design temperature in Celsius
-
-
Method Details
-
calculateMinimumWallThickness
public double calculateMinimumWallThickness()Calculate minimum required wall thickness based on selected design code.- Returns:
- minimum wall thickness in meters
-
calculateMAOP
public double calculateMAOP()Calculate Maximum Allowable Operating Pressure (MAOP).- Returns:
- MAOP in MPa
-
calculateTestPressure
public double calculateTestPressure()Calculate test pressure for hydrostatic testing.- Returns:
- test pressure in MPa
-
calculateHoopStress
public double calculateHoopStress(double pressure) Calculate hoop (circumferential) stress.Uses the Barlow formula for thin-walled cylinders: σh = P × D / (2 × t)
- Parameters:
pressure- internal pressure in MPa- Returns:
- hoop stress in MPa
-
calculateLongitudinalStress
public double calculateLongitudinalStress(double pressure, double deltaT, boolean restrained) Calculate longitudinal (axial) stress.For restrained pipe: σL = ν × σh - E × α × ΔT + P × D / (4 × t)
- Parameters:
pressure- internal pressure in MPadeltaT- temperature change from installation in Celsiusrestrained- true if pipe is restrained (buried or anchored)- Returns:
- longitudinal stress in MPa
-
calculateVonMisesStress
public double calculateVonMisesStress(double pressure, double deltaT, boolean restrained) Calculate von Mises equivalent stress.σvm = √(σh² + σL² - σh × σL + 3τ²)
- Parameters:
pressure- internal pressure in MPadeltaT- temperature change from installation in Celsiusrestrained- true if pipe is restrained- Returns:
- von Mises stress in MPa
-
isDesignSafe
public boolean isDesignSafe()Check if design is within allowable stress limits.- Returns:
- true if von Mises stress is within 90% of SMYS
-
calculateSafetyMargin
public double calculateSafetyMargin()Calculate safety margin as percentage of SMYS.- Returns:
- safety margin (e.g., 0.2 means 20% margin)
-
calculateWeightsAndAreas
public void calculateWeightsAndAreas()Calculate all weight and surface area values.This method calculates steel weight, coating weight, insulation weight, concrete weight, surface areas, and buoyancy for subsea applications.
-
calculateSubmergedWeight
public double calculateSubmergedWeight(double contentDensity) Calculate submerged weight for subsea pipelines.- Parameters:
contentDensity- density of pipe contents in kg/m3- Returns:
- submerged weight per meter in kg/m (negative = buoyant)
-
calculateRequiredConcreteThickness
public double calculateRequiredConcreteThickness(double contentDensity, double targetSubmergedWeight) Calculate required concrete coating thickness for on-bottom stability.- Parameters:
contentDensity- density of pipe contents in kg/m3targetSubmergedWeight- target submerged weight in kg/m- Returns:
- required concrete coating thickness in meters
-
calculateJointsAndWelds
public void calculateJointsAndWelds()Calculate number of pipe joints and welds. -
calculateSupportSpacing
public double calculateSupportSpacing(double maxDeflection) Calculate pipe support spacing for above-ground pipelines.Based on beam deflection limits and stress criteria per ASME B31.3.
- Parameters:
maxDeflection- maximum allowable deflection in meters- Returns:
- recommended support spacing in meters
-
calculateExpansionLoopLength
Calculate expansion loop length for thermal expansion.- Parameters:
deltaT- temperature change from installation in CelsiusloopType- "U-loop", "Z-loop", or "L-loop"- Returns:
- required loop leg length in meters
-
calculateMinimumBendRadius
public double calculateMinimumBendRadius()Calculate minimum bend radius for field bends.- Returns:
- minimum bend radius in meters
-
selectFlangeClass
public int selectFlangeClass()Select appropriate flange class based on design conditions.- Returns:
- selected flange class per ASME B16.5
-
calculateExternalPressure
public double calculateExternalPressure()Calculate external pressure at seabed.- Returns:
- external pressure in MPa
-
calculateCollapsePressure
public double calculateCollapsePressure()Calculate collapse pressure per DNV-OS-F101.Uses the elastic-plastic collapse formula for combined external pressure and bending.
- Returns:
- collapse pressure in MPa
-
calculatePropagationBucklingPressure
public double calculatePropagationBucklingPressure()Calculate propagation buckling pressure.- Returns:
- propagation buckling pressure in MPa
-
calculateAllowableSpanLength
public double calculateAllowableSpanLength(double currentVelocity) Calculate allowable free span length for subsea pipelines.- Parameters:
currentVelocity- current velocity in m/s- Returns:
- maximum allowable span length in meters
-
estimateFatigueLife
public double estimateFatigueLife(double stressRange, double numberOfCycles) Estimate fatigue life based on DNV-RP-C203.- Parameters:
stressRange- stress range per cycle in MPanumberOfCycles- expected number of cycles per year- Returns:
- estimated fatigue life in years
-
calculateInsulationThickness
public double calculateInsulationThickness(double inletTemperature, double minArrivalTemperature, double massFlowRate, double specificHeat) Calculate insulation thickness for heat loss control.- Parameters:
inletTemperature- fluid inlet temperature in CelsiusminArrivalTemperature- minimum arrival temperature in CelsiusmassFlowRate- mass flow rate in kg/sspecificHeat- fluid specific heat in J/(kg·K)- Returns:
- required insulation thickness in meters
-
calculateProjectCost
public double calculateProjectCost()Calculate complete project cost estimate.This method calculates all cost components including materials, fabrication, installation, engineering, testing, and contingency.
- Returns:
- total project cost in USD
-
updateInstallationCostPerMeter
private void updateInstallationCostPerMeter()Update installation cost per meter based on installation method. -
calculateLaborManhours
public double calculateLaborManhours()Calculate labor manhours estimate.- Returns:
- total labor manhours
-
selectStandardPipeSize
Select standard nominal pipe size.- Returns:
- standard NPS size string
-
generateBillOfMaterials
-
calculateWallThicknessASMEB318
private double calculateWallThicknessASMEB318()Calculate wall thickness per ASME B31.8 (Gas Transmission).t = P × D / (2 × S × F × E × T)
- Returns:
- minimum wall thickness in meters
-
calculateWallThicknessASMEB314
private double calculateWallThicknessASMEB314()Calculate wall thickness per ASME B31.4 (Liquid Transportation).Same formula as B31.8 but different design factors.
- Returns:
- minimum wall thickness in meters
-
calculateWallThicknessASMEB313
private double calculateWallThicknessASMEB313()Calculate wall thickness per ASME B31.3 (Process Piping).t = P × D / (2 × (S × E + P × Y))
- Returns:
- minimum wall thickness in meters
-
calculateWallThicknessDNV
private double calculateWallThicknessDNV()Calculate wall thickness per DNV-OS-F101 (Submarine Pipelines).Uses characteristic material properties with safety factors.
- Returns:
- minimum wall thickness in meters
-
calculateWallThicknessBarlow
private double calculateWallThicknessBarlow(double safetyFactor) Calculate wall thickness using basic Barlow formula.- Parameters:
safetyFactor- safety factor to apply- Returns:
- minimum wall thickness in meters
-
updateMaterialProperties
private void updateMaterialProperties()Update material properties based on material grade. -
updateDesignFactors
private void updateDesignFactors()Update design factors based on design code and location class. -
generateDesignReport
Generate a design summary report.- Returns:
- formatted design summary string
-
getDesignPressure
public double getDesignPressure()Get design pressure.- Returns:
- design pressure in MPa
-
setDesignPressure
public void setDesignPressure(double designPressure) Set design pressure.- Parameters:
designPressure- design pressure in MPa
-
setDesignPressure
Set design pressure with unit.- Parameters:
pressure- design pressure valueunit- pressure unit ("MPa", "bar", "bara", "psi")
-
getDesignTemperature
public double getDesignTemperature()Get design temperature.- Returns:
- design temperature in Celsius
-
setDesignTemperature
public void setDesignTemperature(double designTemperature) Set design temperature.- Parameters:
designTemperature- design temperature in Celsius
-
getOuterDiameter
public double getOuterDiameter()Get outer diameter.- Returns:
- outer diameter in meters
-
setOuterDiameter
public void setOuterDiameter(double outerDiameter) Set outer diameter.- Parameters:
outerDiameter- outer diameter in meters
-
setOuterDiameter
Set outer diameter with unit.- Parameters:
diameter- outer diameter valueunit- diameter unit ("m", "mm", "inch", "in")
-
getInnerDiameter
public double getInnerDiameter()Get inner diameter.- Returns:
- inner diameter in meters
-
getNominalWallThickness
public double getNominalWallThickness()Get nominal wall thickness.- Returns:
- nominal wall thickness in meters
-
setNominalWallThickness
public void setNominalWallThickness(double nominalWallThickness) Set nominal wall thickness.- Parameters:
nominalWallThickness- nominal wall thickness in meters
-
setNominalWallThickness
Set nominal wall thickness with unit.- Parameters:
thickness- wall thickness valueunit- thickness unit ("m", "mm", "inch")
-
getCorrosionAllowance
public double getCorrosionAllowance()Get corrosion allowance.- Returns:
- corrosion allowance in meters
-
setCorrosionAllowance
public void setCorrosionAllowance(double corrosionAllowance) Set corrosion allowance.- Parameters:
corrosionAllowance- corrosion allowance in meters
-
setCorrosionAllowance
Set corrosion allowance with unit.- Parameters:
allowance- corrosion allowance valueunit- unit ("m", "mm")
-
getFabricationTolerance
public double getFabricationTolerance()Get fabrication tolerance factor.- Returns:
- fabrication tolerance factor
-
setFabricationTolerance
public void setFabricationTolerance(double fabricationTolerance) Set fabrication tolerance factor.- Parameters:
fabricationTolerance- fabrication tolerance factor (e.g., 0.875 for seamless pipe)
-
getMaterialGrade
-
setMaterialGrade
Set material grade per API 5L.- Parameters:
materialGrade- material grade (e.g., "X42", "X52", "X65", "X70", "X80")
-
getSmys
public double getSmys()Get Specified Minimum Yield Strength (SMYS).- Returns:
- SMYS in MPa
-
setSmys
public void setSmys(double smys) Set Specified Minimum Yield Strength manually.- Parameters:
smys- SMYS in MPa
-
getSmts
public double getSmts()Get Specified Minimum Tensile Strength (SMTS).- Returns:
- SMTS in MPa
-
setSmts
public void setSmts(double smts) Set Specified Minimum Tensile Strength manually.- Parameters:
smts- SMTS in MPa
-
getDesignCode
-
setDesignCode
Set design code.- Parameters:
designCode- design code (use constants like ASME_B31_8)
-
getLocationClass
public int getLocationClass()Get location class.- Returns:
- location class (1-4)
-
setLocationClass
public void setLocationClass(int locationClass) Set location class for ASME B31.8.- Parameters:
locationClass- location class 1-4
-
getDesignFactor
public double getDesignFactor()Get design factor.- Returns:
- design factor
-
setDesignFactor
public void setDesignFactor(double designFactor) Set design factor (overrides automatic calculation).- Parameters:
designFactor- design factor
-
getJointFactor
public double getJointFactor()Get longitudinal joint factor.- Returns:
- joint factor
-
setJointFactor
public void setJointFactor(double jointFactor) Set longitudinal joint factor.- Parameters:
jointFactor- joint factor (1.0 for seamless, 0.85 for ERW)
-
getWeldJointEfficiency
public double getWeldJointEfficiency()Get weld joint efficiency.- Returns:
- weld joint efficiency
-
setWeldJointEfficiency
public void setWeldJointEfficiency(double weldJointEfficiency) Set weld joint efficiency for B31.3.- Parameters:
weldJointEfficiency- weld joint efficiency (0-1)
-
getMinimumWallThickness
public double getMinimumWallThickness()Get calculated minimum wall thickness.- Returns:
- minimum wall thickness in meters
-
getMaop
public double getMaop()Get calculated MAOP.- Returns:
- MAOP in MPa
-
getMaop
Get MAOP in specified unit.- Parameters:
unit- pressure unit ("MPa", "bar", "psi")- Returns:
- MAOP in specified unit
-
getHoopStress
public double getHoopStress()Get calculated hoop stress.- Returns:
- hoop stress in MPa
-
getVonMisesStress
public double getVonMisesStress()Get calculated von Mises stress.- Returns:
- von Mises stress in MPa
-
getYoungsModulus
public double getYoungsModulus()Get Young's modulus.- Returns:
- Young's modulus in MPa
-
setYoungsModulus
public void setYoungsModulus(double youngsModulus) Set Young's modulus.- Parameters:
youngsModulus- Young's modulus in MPa
-
getPoissonsRatio
public double getPoissonsRatio()Get Poisson's ratio.- Returns:
- Poisson's ratio
-
setPoissonsRatio
public void setPoissonsRatio(double poissonsRatio) Set Poisson's ratio.- Parameters:
poissonsRatio- Poisson's ratio
-
getThermalExpansion
public double getThermalExpansion()Get thermal expansion coefficient.- Returns:
- thermal expansion coefficient in 1/K
-
setThermalExpansion
public void setThermalExpansion(double thermalExpansion) Set thermal expansion coefficient.- Parameters:
thermalExpansion- thermal expansion coefficient in 1/K
-
getPipelineLength
public double getPipelineLength()Get pipeline length.- Returns:
- pipeline length in meters
-
setPipelineLength
public void setPipelineLength(double pipelineLength) Set pipeline length.- Parameters:
pipelineLength- pipeline length in meters
-
getSteelDensity
public double getSteelDensity()Get steel density.- Returns:
- steel density in kg/m3
-
setSteelDensity
public void setSteelDensity(double steelDensity) Set steel density.- Parameters:
steelDensity- steel density in kg/m3
-
getCoatingType
-
setCoatingType
Set external coating type.- Parameters:
coatingType- coating type (e.g., "3LPE", "FBE", "CTE")
-
getCoatingThickness
public double getCoatingThickness()Get external coating thickness.- Returns:
- coating thickness in meters
-
setCoatingThickness
public void setCoatingThickness(double coatingThickness) Set external coating thickness.- Parameters:
coatingThickness- coating thickness in meters
-
getInsulationType
-
setInsulationType
Set insulation type.- Parameters:
insulationType- insulation type (e.g., "PUF", "mineral wool", "none")
-
getInsulationThickness
public double getInsulationThickness()Get insulation thickness.- Returns:
- insulation thickness in meters
-
setInsulationThickness
public void setInsulationThickness(double insulationThickness) Set insulation thickness.- Parameters:
insulationThickness- insulation thickness in meters
-
getConcreteCoatingThickness
public double getConcreteCoatingThickness()Get concrete weight coating thickness.- Returns:
- concrete coating thickness in meters
-
setConcreteCoatingThickness
public void setConcreteCoatingThickness(double concreteCoatingThickness) Set concrete weight coating thickness.- Parameters:
concreteCoatingThickness- concrete coating thickness in meters
-
getInstallationMethod
-
setInstallationMethod
Set installation method.- Parameters:
installationMethod- installation method (e.g., "S-lay", "J-lay", "Reel-lay", "Onshore")
-
getWaterDepth
public double getWaterDepth()Get water depth.- Returns:
- water depth in meters
-
setWaterDepth
public void setWaterDepth(double waterDepth) Set water depth.- Parameters:
waterDepth- water depth in meters
-
getBurialDepth
public double getBurialDepth()Get burial depth.- Returns:
- burial depth in meters
-
setBurialDepth
public void setBurialDepth(double burialDepth) Set burial depth.- Parameters:
burialDepth- burial depth in meters
-
getAmbientTemperature
public double getAmbientTemperature()Get ambient temperature.- Returns:
- ambient temperature in Celsius
-
setAmbientTemperature
public void setAmbientTemperature(double ambientTemperature) Set ambient temperature.- Parameters:
ambientTemperature- ambient temperature in Celsius
-
getFlangeClass
public int getFlangeClass()Get flange class.- Returns:
- flange class per ASME B16.5
-
setFlangeClass
public void setFlangeClass(int flangeClass) Set flange class.- Parameters:
flangeClass- flange class (150, 300, 600, 900, 1500, 2500)
-
getNumberOfFlangePairs
public int getNumberOfFlangePairs()Get number of flange pairs.- Returns:
- number of flange pairs
-
setNumberOfFlangePairs
public void setNumberOfFlangePairs(int numberOfFlangePairs) Set number of flange pairs.- Parameters:
numberOfFlangePairs- number of flange pairs
-
getNumberOfValves
public int getNumberOfValves()Get number of valves.- Returns:
- number of valves
-
setNumberOfValves
public void setNumberOfValves(int numberOfValves) Set number of valves.- Parameters:
numberOfValves- number of valves
-
getValveType
-
setValveType
Set valve type.- Parameters:
valveType- valve type (e.g., "Ball", "Gate", "Check")
-
getAnchorSpacing
public double getAnchorSpacing()Get anchor spacing.- Returns:
- anchor spacing in meters
-
setAnchorSpacing
public void setAnchorSpacing(double anchorSpacing) Set anchor spacing.- Parameters:
anchorSpacing- anchor spacing in meters
-
getSteelPricePerKg
public double getSteelPricePerKg()Get steel price per kg.- Returns:
- steel price in USD/kg
-
setSteelPricePerKg
public void setSteelPricePerKg(double steelPricePerKg) Set steel price per kg.- Parameters:
steelPricePerKg- steel price in USD/kg
-
getCoatingPricePerM2
public double getCoatingPricePerM2()Get coating price per m2.- Returns:
- coating price in USD/m2
-
setCoatingPricePerM2
public void setCoatingPricePerM2(double coatingPricePerM2) Set coating price per m2.- Parameters:
coatingPricePerM2- coating price in USD/m2
-
getFieldWeldCost
public double getFieldWeldCost()Get field weld cost.- Returns:
- field weld cost in USD per weld
-
setFieldWeldCost
public void setFieldWeldCost(double fieldWeldCost) Set field weld cost.- Parameters:
fieldWeldCost- field weld cost in USD per weld
-
getContingencyPercentage
public double getContingencyPercentage()Get contingency percentage.- Returns:
- contingency percentage (e.g., 0.15 for 15%)
-
setContingencyPercentage
public void setContingencyPercentage(double contingencyPercentage) Set contingency percentage.- Parameters:
contingencyPercentage- contingency percentage (e.g., 0.15 for 15%)
-
getSteelWeightPerMeter
public double getSteelWeightPerMeter()Get steel weight per meter.- Returns:
- steel weight in kg/m
-
getTotalDryWeightPerMeter
public double getTotalDryWeightPerMeter()Get total dry weight per meter.- Returns:
- total dry weight in kg/m
-
getSubmergedWeightPerMeter
public double getSubmergedWeightPerMeter()Get submerged weight per meter.- Returns:
- submerged weight in kg/m (negative = buoyant)
-
getTotalPipelineWeight
public double getTotalPipelineWeight()Get total pipeline weight.- Returns:
- total pipeline dry weight in kg
-
getTotalExternalSurfaceArea
public double getTotalExternalSurfaceArea()Get total external surface area.- Returns:
- total external surface area in m2
-
getNumberOfJoints
public int getNumberOfJoints()Get number of pipe joints.- Returns:
- number of pipe joints
-
getNumberOfFieldWelds
public int getNumberOfFieldWelds()Get number of field welds.- Returns:
- number of field welds
-
getSupportSpacing
public double getSupportSpacing()Get support spacing.- Returns:
- support spacing in meters
-
getNumberOfSupports
public int getNumberOfSupports()Get number of supports.- Returns:
- number of supports
-
getCollapsePressure
public double getCollapsePressure()Get collapse pressure.- Returns:
- collapse pressure in MPa
-
getFatigueLife
public double getFatigueLife()Get fatigue life.- Returns:
- fatigue life in years
-
getTotalProjectCost
public double getTotalProjectCost()Get total project cost.- Returns:
- total project cost in USD
-
getTotalDirectCost
public double getTotalDirectCost()Get total direct cost.- Returns:
- total direct cost in USD
-
getTotalLaborManhours
public double getTotalLaborManhours()Get total labor manhours.- Returns:
- total labor manhours
-
toJson
Export mechanical design data to JSON format.This method creates a structured JSON representation of the pipeline mechanical design including design parameters, material properties, design factors, and calculated results.
- Returns:
- JSON string representation of the mechanical design
-
toCompactJson
Export mechanical design data to compact JSON format.- Returns:
- compact JSON string
-
toMap
-
loadMaterialFromDatabase
Deprecated.UsePipelineMechanicalDesign.loadMaterialFromDatabase(String)instead. The PipelineMechanicalDesign class provides centralized database access via PipelineMechanicalDesignDataSource, following the same pattern as separators.Load material properties from database.This method queries the NeqSim process design database for material properties based on the specified material grade. Supported tables: MaterialPipeProperties.
- Parameters:
grade- API 5L material grade (e.g., "X52", "X65", "X70")
-
loadDesignFactorsFromDatabase
Deprecated.UsePipelineMechanicalDesign.loadDesignFactorsFromDatabase()instead. The PipelineMechanicalDesign class provides centralized database access via PipelineMechanicalDesignDataSource, following the same pattern as separators.Load design factors from database based on company identifier.This method queries the TechnicalRequirements_Process table for company-specific design factors.
- Parameters:
company- company identifier (e.g., "Equinor", "Statoil")
-
loadFromDatabase
Deprecated.UsePipelineMechanicalDesign.loadFromDatabase()instead. The PipelineMechanicalDesign class provides centralized database access via PipelineMechanicalDesignDataSource, following the same pattern as separators.Load all design data from database.This method loads both material properties and design factors from the database.
- Parameters:
materialGrade- API 5L material gradecompany- company identifier
-
PipelineMechanicalDesign.loadDesignFactorsFromDatabase()instead.