Class SystemMechanicalDesign

java.lang.Object
neqsim.process.mechanicaldesign.SystemMechanicalDesign
All Implemented Interfaces:
Serializable

public class SystemMechanicalDesign extends Object implements Serializable
Provides whole-process mechanical design aggregation and reporting.

This class aggregates mechanical design data from all equipment in a ProcessSystem, providing:

  • Total weight, volume, and plot space for the entire process
  • Weight breakdown by equipment type (separators, compressors, heat exchangers, etc.)
  • Weight breakdown by discipline (mechanical, piping, E&I, structural)
  • Utility requirements summary (power, heating duty, cooling duty)
  • Equipment list with key design parameters
  • Summary reports in various formats

Usage example:


ProcessSystem process = new ProcessSystem();
// ... add equipment to process ...
process.run();

SystemMechanicalDesign mecDesign = new SystemMechanicalDesign(process);
mecDesign.runDesignCalculation();

// Get summaries
System.out.println("Total weight: " + mecDesign.getTotalWeight() + " kg");
System.out.println(
    "Compressor weight: " + mecDesign.getWeightByEquipmentType().get("Compressor") + " kg");
System.out.println("Total power: " + mecDesign.getTotalPowerRequired() + " kW");

// Print full report
System.out.println(mecDesign.generateSummaryReport());

Version:
2.0
Author:
esol
See Also:
  • Field Details

    • serialVersionUID

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

      static org.apache.logging.log4j.Logger logger
      Logger object for class.
    • processSystem

      ProcessSystem processSystem
    • totalPlotSpace

      double totalPlotSpace
    • totalVolume

      double totalVolume
    • totalWeight

      double totalWeight
    • numberOfModules

      int numberOfModules
    • weightByEquipmentType

      private Map<String,Double> weightByEquipmentType
      Weight breakdown by equipment type (e.g., "Separator", "Compressor", "Valve").
    • weightByDiscipline

      private Map<String,Double> weightByDiscipline
      Weight breakdown by discipline (Mechanical, Piping, E and I, Structural).
    • equipmentCountByType

      private Map<String,Integer> equipmentCountByType
      Equipment count by type.
    • equipmentList

      Equipment list with design data.
    • totalPowerRequired

      private double totalPowerRequired
      Total power required (compressors, pumps) [kW].
    • totalPowerRecovered

      private double totalPowerRecovered
      Total power recovered (expanders) [kW].
    • totalHeatingDuty

      private double totalHeatingDuty
      Total heating duty (heaters) [kW].
    • totalCoolingDuty

      private double totalCoolingDuty
      Total cooling duty (coolers) [kW].
    • totalFootprintLength

      private double totalFootprintLength
      Total footprint length [m].
    • totalFootprintWidth

      private double totalFootprintWidth
      Total footprint width [m].
    • maxEquipmentHeight

      private double maxEquipmentHeight
      Maximum equipment height [m].
  • Constructor Details

    • SystemMechanicalDesign

      public SystemMechanicalDesign(ProcessSystem processSystem)

      Constructor for SystemMechanicalDesign.

      Parameters:
      processSystem - a ProcessSystem object
  • Method Details

    • getProcess

      public ProcessSystem getProcess()

      getProcess.

      Returns:
      a ProcessSystem object
    • setCompanySpecificDesignStandards

      public void setCompanySpecificDesignStandards(String name)

      setCompanySpecificDesignStandards.

      Parameters:
      name - a String object
    • runDesignCalculation

      public void runDesignCalculation()
      Run design calculations for all equipment in the process system.

      This method iterates through all unit operations, initializes their mechanical design, runs calculations, and aggregates the results. After calling this method, all getters will return updated values.

    • resetAccumulators

      private void resetAccumulators()
      Reset all accumulators before running calculations.
    • classifyEquipment

      private String classifyEquipment(ProcessEquipmentInterface equipment)
      Classify equipment into a type category.
      Parameters:
      equipment - the equipment to classify
      Returns:
      the equipment type name
    • accumulateByType

      private void accumulateByType(String type, double weight)
      Accumulate weight by equipment type.
      Parameters:
      type - equipment type
      weight - weight to add
    • accumulateByDiscipline

      private void accumulateByDiscipline(MechanicalDesign mecDesign)
      Accumulate weight by discipline.
      Parameters:
      mecDesign - mechanical design object
    • accumulateUtilities

      private void accumulateUtilities(ProcessEquipmentInterface equipment)
      Accumulate utility requirements from equipment.
      Parameters:
      equipment - the equipment to check
    • createEquipmentSummary

      private SystemMechanicalDesign.EquipmentDesignSummary createEquipmentSummary(ProcessEquipmentInterface equipment, MechanicalDesign mecDesign)
      Create an equipment design summary.
      Parameters:
      equipment - the equipment
      mecDesign - the mechanical design
      Returns:
      equipment design summary
    • setDesign

      public void setDesign()

      setDesign.

    • getTotalPlotSpace

      public double getTotalPlotSpace()

      Getter for the field totalPlotSpace.

      Returns:
      a double
    • getTotalVolume

      public double getTotalVolume()

      Getter for the field totalVolume.

      Returns:
      a double
    • getTotalWeight

      public double getTotalWeight()

      Getter for the field totalWeight.

      Returns:
      a double
    • getTotalNumberOfModules

      public int getTotalNumberOfModules()
      Get the total number of modules.
      Returns:
      number of modules
    • getWeightByEquipmentType

      public Map<String,Double> getWeightByEquipmentType()
      Get weight breakdown by equipment type.
      Returns:
      map of equipment type to total weight in kg
    • getWeightByDiscipline

      public Map<String,Double> getWeightByDiscipline()
      Get weight breakdown by discipline.
      Returns:
      map of discipline to total weight in kg
    • getEquipmentCountByType

      public Map<String,Integer> getEquipmentCountByType()
      Get equipment count by type.
      Returns:
      map of equipment type to count
    • getEquipmentList

      Get list of all equipment with design summaries.
      Returns:
      list of equipment design summaries
    • getTotalPowerRequired

      public double getTotalPowerRequired()
      Get total power required (compressors + pumps).
      Returns:
      total power in kW
    • getTotalPowerRecovered

      public double getTotalPowerRecovered()
      Get total power recovered (expanders).
      Returns:
      total recovered power in kW
    • getNetPowerRequirement

      public double getNetPowerRequirement()
      Get net power requirement.
      Returns:
      net power (required - recovered) in kW
    • getTotalHeatingDuty

      public double getTotalHeatingDuty()
      Get total heating duty.
      Returns:
      total heating duty in kW
    • getTotalCoolingDuty

      public double getTotalCoolingDuty()
      Get total cooling duty.
      Returns:
      total cooling duty in kW
    • getTotalFootprintLength

      public double getTotalFootprintLength()
      Get total footprint length.
      Returns:
      total length in meters
    • getTotalFootprintWidth

      public double getTotalFootprintWidth()
      Get total footprint width.
      Returns:
      maximum width in meters
    • getMaxEquipmentHeight

      public double getMaxEquipmentHeight()
      Get maximum equipment height.
      Returns:
      maximum height in meters
    • generateSummaryReport

      public String generateSummaryReport()
      Generate a comprehensive summary report.
      Returns:
      formatted summary report string
    • generateJsonSummary

      @Deprecated public String generateJsonSummary()
      Deprecated.
      Use toJson() instead for proper Gson serialization
      Generate a JSON-format summary (legacy method).
      Returns:
      JSON string
    • 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 system-level totals, weight breakdowns by type and discipline, utility requirements, and an equipment list with key design parameters.

      Usage example:

      
      SystemMechanicalDesign mecDesign = new SystemMechanicalDesign(process);
      mecDesign.runDesignCalculation();
      String json = mecDesign.toJson();
      // json contains properly formatted JSON with all design data
      
      
      Returns:
      JSON string representation of the mechanical design
    • toCompactJson

      public String toCompactJson()
      Export mechanical design data to compact JSON format (no pretty printing).
      Returns:
      compact JSON string
    • getResponse

      public MechanicalDesignResponse getResponse()
      Get the mechanical design response object.

      This method returns a MechanicalDesignResponse object that can be further customized or combined with other data before serialization.

      Returns:
      MechanicalDesignResponse object
    • truncate

      private String truncate(String str, int maxLen)
      Truncate a string to a maximum length.
      Parameters:
      str - the string
      maxLen - maximum length
      Returns:
      truncated string
    • repeat

      private static String repeat(String str, int count)
      Repeat a string n times (Java 8 compatible).
      Parameters:
      str - string to repeat
      count - number of times
      Returns:
      repeated string
    • getMechanicalWeight

      public double getMechanicalWeight(String unit)

      getMechanicalWeight.

      Parameters:
      unit - a String object
      Returns:
      a double
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object