Class Pump

All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, ProcessEquipmentInterface, PumpInterface, TwoPortInterface, SimulationInterface, NamedInterface
Direct Known Subclasses:
ESPPump

Centrifugal pump simulation model for process systems.

This class simulates a centrifugal pump using either:

  • Isentropic compression with specified outlet pressure and efficiency
  • Manufacturer pump curves via PumpChart for realistic performance

Key Features

  • Pump Curves: Support for head, efficiency, and NPSH curves with affinity law scaling
  • Density Correction: Automatic head correction when pumping fluids different from chart test fluid
  • NPSH Monitoring: Cavitation detection based on available vs required NPSH
  • Operating Status: Surge, stonewall, and efficiency monitoring

Usage Example

// Simple usage with outlet pressure
Pump pump = new Pump("MainPump", feedStream);
pump.setOutletPressure(10.0, "bara");
pump.setIsentropicEfficiency(0.75);
pump.run();

// With manufacturer pump curves
double[] speed = {1000.0, 1500.0};
double[][] flow = {{10, 20, 30}, {15, 30, 45}};
double[][] head = {{100, 95, 85}, {225, 214, 191}};
double[][] efficiency = {{70, 80, 75}, {72, 82, 77}};
double[] chartConditions = {18.0, 298.15, 1.0, 1.0, 998.0}; // Include ref density
pump.getPumpChart().setCurves(chartConditions, speed, flow, head, efficiency);
pump.getPumpChart().setHeadUnit("meter");
pump.setSpeed(1200.0);
pump.run();
Version:
$Id: $Id
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.
    • mechanicalDesign

      private PumpMechanicalDesign mechanicalDesign
      Mechanical design for the pump.
    • thermoSystem

      SystemInterface thermoSystem
    • dH

      double dH
    • pressure

      double pressure
    • molarFlow

      private double molarFlow
    • speed

      private double speed
    • minimumFlow

      private double minimumFlow
    • outTemperature

      private double outTemperature
    • useOutTemperature

      private boolean useOutTemperature
    • calculateAsCompressor

      private boolean calculateAsCompressor
    • isentropicEfficiency

      public double isentropicEfficiency
    • powerSet

      public boolean powerSet
    • pressureUnit

      private String pressureUnit
    • pumpChart

      private PumpChartInterface pumpChart
    • checkNPSH

      private boolean checkNPSH
    • npshMargin

      private double npshMargin
    • autoSized

      private boolean autoSized
      Flag indicating if pump has been auto-sized.
    • capacityConstraints

      private final Map<String, CapacityConstraint> capacityConstraints
      Storage for capacity constraints.
  • Constructor Details

    • Pump

      public Pump(String name)
      Constructor for Pump.
      Parameters:
      name - name of pump
    • Pump

      public Pump(String name, StreamInterface inletStream)

      Constructor for Pump.

      Parameters:
      name - name of pump
      inletStream - a StreamInterface object
  • Method Details

    • getMechanicalDesign

      public PumpMechanicalDesign getMechanicalDesign()

      Get a mechanicalDesign for the equipment.

      Specified by:
      getMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      getMechanicalDesign in class ProcessEquipmentBaseClass
      Returns:
      a MechanicalDesign object
    • initMechanicalDesign

      public void initMechanicalDesign()

      Initialize a initMechanicalDesign for the equipment.

      Specified by:
      initMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      initMechanicalDesign in class ProcessEquipmentBaseClass
    • getEnergy

      public double getEnergy()

      getEnergy.

      Specified by:
      getEnergy in interface PumpInterface
      Returns:
      a double
    • getPower

      public double getPower()

      getPower.

      Specified by:
      getPower in interface PumpInterface
      Returns:
      a double
    • getCapacityDuty

      public double getCapacityDuty()

      getCapacityDuty.

      Specified by:
      getCapacityDuty in interface ProcessEquipmentInterface
      Returns:
      a double
    • getCapacityMax

      public double getCapacityMax()

      getCapacityMax.

      Specified by:
      getCapacityMax in interface ProcessEquipmentInterface
      Returns:
      a double
    • getPower

      public double getPower(String unit)

      getPower.

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

      public double getDuty()

      getDuty.

      Returns:
      a double
    • calculateAsCompressor

      public void calculateAsCompressor(boolean setPumpCalcType)

      calculateAsCompressor.

      Parameters:
      setPumpCalcType - a boolean
    • run

      public void run(UUID id)

      In this method all thermodynamic and unit operations will be calculated in a steady state calculation.

      Specified by:
      run in interface SimulationInterface
      Parameters:
      id - UUID
    • displayResult

      public void displayResult()

      displayResult.

      Specified by:
      displayResult in interface ProcessEquipmentInterface
      Overrides:
      displayResult in class ProcessEquipmentBaseClass
    • getMolarFlow

      public double getMolarFlow()

      Getter for the field molarFlow.

      Returns:
      a double
    • setMolarFlow

      public void setMolarFlow(double molarFlow)

      Setter for the field molarFlow.

      Parameters:
      molarFlow - a double
    • getThermoSystem

      public SystemInterface getThermoSystem()

      getThermoSystem.

      Specified by:
      getThermoSystem in interface ProcessEquipmentInterface
      Overrides:
      getThermoSystem in class ProcessEquipmentBaseClass
      Returns:
      a SystemInterface object
    • getIsentropicEfficiency

      public double getIsentropicEfficiency()

      Getter for the field isentropicEfficiency.

      Returns:
      the isentropicEfficiency
    • setIsentropicEfficiency

      public void setIsentropicEfficiency(double isentropicEfficiency)

      Setter for the field isentropicEfficiency.

      Parameters:
      isentropicEfficiency - the isentropicEfficiency to set
    • getOutTemperature

      public double getOutTemperature()

      Getter for the field outTemperature.

      Returns:
      a double
    • setOutletTemperature

      public void setOutletTemperature(double outTemperature)

      Set the outlet temperature of the pump.

      Specified by:
      setOutletTemperature in interface TwoPortInterface
      Overrides:
      setOutletTemperature in class TwoPortEquipment
      Parameters:
      outTemperature - outlet temperature in Kelvin
    • setOutletTemperature

      public void setOutletTemperature(double temperature, String unit)

      Set the outlet temperature of the pump with unit specification.

      Specified by:
      setOutletTemperature in interface TwoPortInterface
      Overrides:
      setOutletTemperature in class TwoPortEquipment
      Parameters:
      temperature - outlet temperature value
      unit - temperature unit (e.g., "K", "C", "R", "F")
    • setOutTemperature

      @Deprecated public void setOutTemperature(double outTemperature)
      Deprecated.

      Setter for the field outTemperature.

      Specified by:
      setOutTemperature in interface TwoPortInterface
      Parameters:
      outTemperature - outlet temperature in Kelvin
    • getEntropyProduction

      public double getEntropyProduction(String unit)

      getEntropyProduction.

      Specified by:
      getEntropyProduction in interface ProcessEquipmentInterface
      Overrides:
      getEntropyProduction in class ProcessEquipmentBaseClass
      Parameters:
      unit - a String object
      Returns:
      a double
    • setPressure

      public void setPressure(double pressure)

      Setter for the field pressure.

      Specified by:
      setPressure in interface ProcessEquipmentInterface
      Overrides:
      setPressure in class ProcessEquipmentBaseClass
      Parameters:
      pressure - a double
    • setPressure

      public void setPressure(double pressure, String unit)

      Setter for the field pressure.

      Parameters:
      pressure - a double
      unit - a String object
    • setOutletPressure

      public void setOutletPressure(double pressure)
      Set outlet pressure of twoport.
      Specified by:
      setOutletPressure in interface TwoPortInterface
      Overrides:
      setOutletPressure in class TwoPortEquipment
      Parameters:
      pressure - value to set in unit bara
    • setOutletPressure

      public void setOutletPressure(double pressure, String unit)

      Setter for the field pressure.

      Specified by:
      setOutletPressure in interface TwoPortInterface
      Overrides:
      setOutletPressure in class TwoPortEquipment
      Parameters:
      pressure - a double
      unit - a String object
    • setSpeed

      public void setSpeed(double speed)

      Setter for the field speed.

      Parameters:
      speed - a double
    • getSpeed

      public double getSpeed()

      Getter for the field speed.

      Returns:
      a double
    • getPumpChart

      public PumpChartInterface getPumpChart()

      Getter for the field pumpChart.

      Returns:
      a PumpChart object
    • toJson

      public String toJson()

      Serializes the Process Equipment along with its state to a JSON string.

      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class TwoPortEquipment
      Returns:
      json string.
    • toJson

      public String toJson(ReportConfig cfg)
      Serializes the Process Equipment with configurable level of detail.
      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class TwoPortEquipment
      Parameters:
      cfg - report configuration
      Returns:
      json string
    • setPumpChartType

      public void setPumpChartType(String type)

      setPumpChartType.

      Specified by:
      setPumpChartType in interface PumpInterface
      Parameters:
      type - a String object
    • getMinimumFlow

      public double getMinimumFlow()

      Getter for the field minimumFlow, e.g., the minimum flow rate for the pump.

      Specified by:
      getMinimumFlow in interface PumpInterface
      Overrides:
      getMinimumFlow in class ProcessEquipmentBaseClass
      Returns:
      a double
    • setMinimumFlow

      public void setMinimumFlow(double minimumFlow)

      Setter for the field minimumFlow, e.g., the minimum flow rate for the pump.

      Specified by:
      setMinimumFlow in interface PumpInterface
      Overrides:
      setMinimumFlow in class ProcessEquipmentBaseClass
      Parameters:
      minimumFlow - a double
    • getNPSHAvailable

      public double getNPSHAvailable()
      Calculate the Net Positive Suction Head Available (NPSHa) at the pump inlet.

      NPSHa represents the absolute pressure head available at the pump suction above the fluid vapor pressure. It must exceed the pump's NPSHr to avoid cavitation.

      Formula: NPSHa = (P_suction - P_vapor) / (ρ·g) + v²/(2·g) + z

      Specified by:
      getNPSHAvailable in interface PumpInterface
      Returns:
      NPSHa in meters
    • getNPSHRequired

      public double getNPSHRequired()
      Get the required Net Positive Suction Head (NPSHr) for the pump at current operating conditions.

      If a pump chart with NPSH curve is available, uses manufacturer data. Otherwise returns a conservative estimate based on pump type and flow rate.

      Specified by:
      getNPSHRequired in interface PumpInterface
      Returns:
      NPSHr in meters
    • isCavitating

      public boolean isCavitating()
      Check if the pump is at risk of cavitation based on NPSH criteria.

      Cavitation occurs when NPSHa < NPSHr, causing vapor bubbles to form and collapse, potentially damaging the pump.

      Specified by:
      isCavitating in interface PumpInterface
      Returns:
      true if cavitation risk exists (NPSHa < npshMargin * NPSHr)
    • setCheckNPSH

      public void setCheckNPSH(boolean checkNPSH)
      Enable or disable NPSH checking during pump operation.
      Specified by:
      setCheckNPSH in interface PumpInterface
      Parameters:
      checkNPSH - true to enable NPSH checking
    • isCheckNPSH

      public boolean isCheckNPSH()
      Get whether NPSH checking is enabled.
      Returns:
      true if NPSH checking is enabled
    • setNPSHMargin

      public void setNPSHMargin(double npshMargin)
      Set the NPSH safety margin. NPSHa must be greater than npshMargin × NPSHr.
      Parameters:
      npshMargin - safety margin factor (typically 1.1 to 1.5)
    • getNPSHMargin

      public double getNPSHMargin()
      Get the NPSH safety margin factor.
      Returns:
      NPSH margin factor
    • autoSize

      public void autoSize(double safetyFactor)
      Automatically size the equipment based on connected stream conditions.

      This method calculates dimensions and design parameters using the inlet stream properties and applies the specified safety factor. The equipment must have a valid inlet stream connected before calling this method.

      Specified by:
      autoSize in interface AutoSizeable
      Parameters:
      safetyFactor - multiplier for design capacity, typically 1.1-1.3 (10-30% over design)
    • autoSize

      public void autoSize()
      Automatically size using default safety factor (1.2 = 20% margin).
      Specified by:
      autoSize in interface AutoSizeable
    • autoSize

      public void autoSize(String companyStandard, String trDocument)
      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:
      autoSize in interface AutoSizeable
      Parameters:
      companyStandard - 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:
      isAutoSized in interface AutoSizeable
      Returns:
      true if autoSize() has been called successfully
    • getSizingReport

      public String 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:
      getSizingReport in interface AutoSizeable
      Returns:
      formatted sizing report string
    • getSizingReportJson

      public String getSizingReportJson()
      Get sizing report as JSON for programmatic access.
      Specified by:
      getSizingReportJson in interface AutoSizeable
      Returns:
      JSON string with sizing data
    • initializeCapacityConstraints

      protected void initializeCapacityConstraints()
      Initializes default capacity constraints for the pump.

      NOTE: All constraints are disabled by default for backwards compatibility. Enable specific constraints when pump capacity analysis is needed (e.g., after sizing).

    • getCapacityConstraints

      public Map<String, CapacityConstraint> getCapacityConstraints()
      Gets all capacity constraints defined for this equipment.

      The map keys are constraint names (e.g., "speed", "gasLoadFactor") and values are the corresponding CapacityConstraint objects containing design values, current values, and utilization calculations.

      Specified by:
      getCapacityConstraints in interface CapacityConstrainedEquipment
      Returns:
      unmodifiable map of constraint name to CapacityConstraint
    • getBottleneckConstraint

      public CapacityConstraint getBottleneckConstraint()
      Gets the constraint with the highest utilization (the bottleneck).

      This method identifies which constraint is closest to or exceeding its design limit. Use this to determine what is limiting equipment capacity.

      Specified by:
      getBottleneckConstraint in interface CapacityConstrainedEquipment
      Returns:
      the bottleneck constraint, or null if no constraints are defined
    • isCapacityExceeded

      public boolean isCapacityExceeded()
      Checks if any capacity constraint is violated (exceeds 100% utilization).

      A violated constraint means the equipment is operating beyond its design capacity. For HARD constraints, this may indicate equipment trip or failure. For SOFT constraints, this indicates reduced efficiency or accelerated wear.

      Specified by:
      isCapacityExceeded in interface CapacityConstrainedEquipment
      Returns:
      true if any constraint utilization exceeds 1.0 (100%)
    • isHardLimitExceeded

      public boolean isHardLimitExceeded()
      Checks if any HARD constraint limit is exceeded.

      HARD limits represent absolute equipment limits (e.g., maximum speed) that cannot be exceeded without equipment trip or damage. This is more severe than general capacity exceedance.

      Specified by:
      isHardLimitExceeded in interface CapacityConstrainedEquipment
      Returns:
      true if any HARD constraint's max value is exceeded
    • getMaxUtilization

      public double getMaxUtilization()
      Gets the maximum utilization across all constraints.

      This gives a single number representing how close the equipment is to its limiting constraint. Values above 1.0 indicate the equipment is over capacity.

      Specified by:
      getMaxUtilization in interface CapacityConstrainedEquipment
      Returns:
      maximum utilization as fraction (1.0 = 100% of design capacity)
    • addCapacityConstraint

      public void addCapacityConstraint(CapacityConstraint constraint)
      Adds a new capacity constraint to this equipment.

      This allows dynamic addition of constraints at runtime. Constraints can be added during equipment configuration or based on operating conditions.

      Specified by:
      addCapacityConstraint in interface CapacityConstrainedEquipment
      Parameters:
      constraint - the constraint to add
    • removeCapacityConstraint

      public boolean removeCapacityConstraint(String constraintName)
      Removes a capacity constraint by name.
      Specified by:
      removeCapacityConstraint in interface CapacityConstrainedEquipment
      Parameters:
      constraintName - the name of the constraint to remove
      Returns:
      true if the constraint was found and removed
    • clearCapacityConstraints

      public void clearCapacityConstraints()
      Clears all capacity constraints from this equipment.
      Specified by:
      clearCapacityConstraints in interface CapacityConstrainedEquipment