Class Pump

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

public class Pump extends TwoPortEquipment implements PumpInterface
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
  • 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
    • setOutTemperature

      public void setOutTemperature(double outTemperature)

      Setter for the field outTemperature.

      Parameters:
      outTemperature - a double
    • 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.

      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