Class PipelineMechanicalDesign

java.lang.Object
neqsim.process.mechanicaldesign.MechanicalDesign
neqsim.process.mechanicaldesign.pipeline.PipelineMechanicalDesign
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RiserMechanicalDesign, TopsidePipingMechanicalDesign

public class PipelineMechanicalDesign extends MechanicalDesign
Mechanical design class for pipelines.

This class integrates pipeline mechanical design calculations with the NeqSim mechanical design framework, providing:

  • Wall thickness calculation per ASME B31.3/B31.4/B31.8 and DNV-OS-F101
  • Integration with TORG (Technical Requirements Documents)
  • JSON export for data exchange
  • Database lookup for material properties and design standards

Usage Example

AdiabaticPipe pipe = new AdiabaticPipe("pipeline", stream);
pipe.setDiameter(0.508); // 20 inch
pipe.setLength(50000.0); // 50 km

// Initialize mechanical design
pipe.initMechanicalDesign();
PipelineMechanicalDesign design = (PipelineMechanicalDesign) pipe.getMechanicalDesign();

// Set design conditions
design.setMaxOperationPressure(150.0); // bara
design.setMaxOperationTemperature(80.0 + 273.15); // K

// Apply company standards
design.setCompanySpecificDesignStandards("Equinor");
design.readDesignSpecifications();

// Calculate design
design.calcDesign();

// Export to JSON
String json = design.toJson();
Version:
2.0
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • innerDiameter

      double innerDiameter
      Inner diameter in meters.
    • designStandardCode

      String designStandardCode
      Design standard code.
    • calculator

      private transient PipeMechanicalDesignCalculator calculator
      Internal calculator for standards-based calculations.
    • pipelineLength

      private double pipelineLength
      Pipeline length in meters.
    • materialGrade

      private String materialGrade
      Material grade per API 5L.
    • locationClass

      private int locationClass
      Location class per ASME B31.8.
    • dataSource

      private transient PipelineMechanicalDesignDataSource dataSource
      Data source for loading from database.
  • Constructor Details

  • Method Details

    • initializeFromPipeline

      private void initializeFromPipeline()
      Initialize design parameters from pipeline equipment.
    • getDataSource

      public PipelineMechanicalDesignDataSource getDataSource()
      Get the data source for database access.
      Returns:
      the data source instance
    • getCalculator

      public PipeMechanicalDesignCalculator getCalculator()
      Get the internal calculator for standards-based calculations.
      Returns:
      the calculator instance
    • loadFromDatabase

      public void loadFromDatabase()
      Load all design parameters from database tables.

      This method loads material properties and design factors from the NeqSim process design database based on the configured material grade and company identifier.

    • loadMaterialFromDatabase

      public void loadMaterialFromDatabase(String grade)
      Load material properties from database.
      Parameters:
      grade - API 5L material grade (e.g., "X52", "X65", "X70")
    • loadDesignFactorsFromDatabase

      public void loadDesignFactorsFromDatabase()
      Load design factors from database for the current company.
    • readDesignSpecifications

      public void readDesignSpecifications()

      readDesignSpecifications.

      Overrides:
      readDesignSpecifications in class MechanicalDesign
    • calcDesign

      public void calcDesign()

      calcDesign.

      Overrides:
      calcDesign in class MechanicalDesign
    • getMAOP

      public double getMAOP(String unit)
      Get the calculated MAOP (Maximum Allowable Operating Pressure).
      Parameters:
      unit - pressure unit ("bar", "MPa", "psi")
      Returns:
      MAOP in specified unit
    • getTestPressure

      public double getTestPressure()
      Get the calculated test pressure.
      Returns:
      test pressure in MPa
    • isDesignSafe

      public boolean isDesignSafe()
      Check if the mechanical design is within safe limits.
      Returns:
      true if design is safe
    • setMaterialGrade

      public void setMaterialGrade(String grade)
      Set the material grade per API 5L.
      Parameters:
      grade - material grade (e.g., "X52", "X65", "X70")
    • getMaterialGrade

      public String getMaterialGrade()
      Get the material grade.
      Returns:
      material grade
    • setLocationClass

      public void setLocationClass(int locationClass)
      Set the location class per ASME B31.8.
      Parameters:
      locationClass - location class 1-4
    • getLocationClass

      public int getLocationClass()
      Get the location class.
      Returns:
      location class 1-4
    • setDesignStandardCode

      public void setDesignStandardCode(String code)
      Set the design standard code.
      Parameters:
      code - design standard code
    • getDesignStandardCode

      public String getDesignStandardCode()
      Get the design standard code.
      Returns:
      design standard code
    • getPipelineLength

      public double getPipelineLength()
      Get the pipeline length.
      Returns:
      pipeline length in meters
    • setPipelineLength

      public void setPipelineLength(double length)
      Set the pipeline length.
      Parameters:
      length - pipeline length in meters
    • toJson

      public String toJson()
      Export mechanical design data to JSON format.

      This method creates a MechanicalDesignResponse object and serializes it to JSON using Gson. The JSON includes equipment identification, weight breakdown, design conditions, dimensions, and materials information.

      Usage example:

      
      MechanicalDesign mecDesign = separator.getMechanicalDesign();
      mecDesign.calcDesign();
      String json = mecDesign.toJson();
      
      
      Overrides:
      toJson in class MechanicalDesign
      Returns:
      JSON string representation of the mechanical design
    • main

      public static void main(String[] args)

      main.

      Parameters:
      args - an array of String objects