Class Pump
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, PumpInterface, TwoPortInterface, SimulationInterface, NamedInterface
- Direct Known Subclasses:
ESPPump
This class simulates a centrifugal pump using either:
- Isentropic compression with specified outlet pressure and efficiency
- Manufacturer pump curves via
PumpChartfor 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 Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate boolean(package private) doubledouble(package private) static org.apache.logging.log4j.LoggerLogger object for class.private PumpMechanicalDesignMechanical design for the pump.private doubleprivate doubleprivate doubleprivate doubleboolean(package private) doubleprivate Stringprivate PumpChartInterfaceprivate static final longSerialization version UID.private double(package private) SystemInterfaceprivate booleanFields inherited from class TwoPortEquipment
inStream, outStreamFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for Pump.Pump(String name, StreamInterface inletStream) Constructor for Pump. -
Method Summary
Modifier and TypeMethodDescriptionvoidcalculateAsCompressor(boolean setPumpCalcType) calculateAsCompressor.voiddisplayResult.doublegetCapacityDuty.doublegetCapacityMax.doublegetDuty()getDuty.doublegetEnergy.doublegetEntropyProduction(String unit) getEntropyProduction.doubleGetter for the fieldisentropicEfficiency.Get amechanicalDesignfor the equipment.doubleGetter for the fieldminimumFlow, e.g., the minimum flow rate for the pump.doubleGetter for the fieldmolarFlow.doubleCalculate the Net Positive Suction Head Available (NPSHa) at the pump inlet.doubleGet the NPSH safety margin factor.doubleGet the required Net Positive Suction Head (NPSHr) for the pump at current operating conditions.doubleGetter for the fieldoutTemperature.doublegetPower()getPower.doublegetPower.Getter for the fieldpumpChart.doublegetSpeed()Getter for the fieldspeed.getThermoSystem.voidInitialize ainitMechanicalDesignfor the equipment.booleanCheck if the pump is at risk of cavitation based on NPSH criteria.booleanGet whether NPSH checking is enabled.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidsetCheckNPSH(boolean checkNPSH) Enable or disable NPSH checking during pump operation.voidsetIsentropicEfficiency(double isentropicEfficiency) Setter for the fieldisentropicEfficiency.voidsetMinimumFlow(double minimumFlow) Setter for the fieldminimumFlow, e.g., the minimum flow rate for the pump.voidsetMolarFlow(double molarFlow) Setter for the fieldmolarFlow.voidsetNPSHMargin(double npshMargin) Set the NPSH safety margin.voidsetOutletPressure(double pressure) Set outlet pressure of twoport.voidsetOutletPressure(double pressure, String unit) Setter for the fieldpressure.voidsetOutTemperature(double outTemperature) Setter for the fieldoutTemperature.voidsetPressure(double pressure) Setter for the fieldpressure.voidsetPressure(double pressure, String unit) Setter for the fieldpressure.voidsetPumpChartType(String type) setPumpChartType.voidsetSpeed(double speed) Setter for the fieldspeed.toJson()Serializes the Process Equipment along with its state to a JSON string.toJson(ReportConfig cfg) Serializes the Process Equipment with configurable level of detail.Methods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletTemperature, getMassBalance, getOutletPressure, getOutletStream, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, setOutletStream, setOutletTemperature, validateSetupMethods inherited from class ProcessEquipmentBaseClass
copy, equals, getConditionAnalysisMessage, getController, getEnergyStream, getExergyChange, getMassBalance, getPressure, getPressure, getProperty, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, hashCode, isActive, isActive, isSetEnergyStream, reportResults, run_step, runConditionAnalysis, setController, setEnergyStream, setEnergyStream, setFlowValveController, setRegulatorOutSignal, setSpecification, setTemperature, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
equals, getConditionAnalysisMessage, getController, getExergyChange, getExergyChange, getFluid, getMassBalance, getMassBalance, getPressure, getPressure, getReport_json, getRestCapacity, getResultTable, getSpecification, getTemperature, getTemperature, hashCode, needRecalculation, reportResults, runConditionAnalysis, setController, setRegulatorOutSignal, setSpecification, setTemperature, validateSetupMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solvedMethods inherited from interface TwoPortInterface
getInletPressure, getInletStream, getInletTemperature, getInStream, getOutletPressure, getOutletStream, getOutletTemperature, getOutStream, setInletPressure, setInletStream, setInletTemperature, setOutletStream, setOutletTemperature
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
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
-
pumpChart
-
checkNPSH
private boolean checkNPSH -
npshMargin
private double npshMargin
-
-
Constructor Details
-
Pump
-
Pump
Constructor for Pump.
- Parameters:
name- name of pumpinletStream- aStreamInterfaceobject
-
-
Method Details
-
getMechanicalDesign
Get a
mechanicalDesignfor the equipment.- Specified by:
getMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
getMechanicalDesignin classProcessEquipmentBaseClass- Returns:
- a
MechanicalDesignobject
-
initMechanicalDesign
public void initMechanicalDesign()Initialize a
initMechanicalDesignfor the equipment.- Specified by:
initMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
initMechanicalDesignin classProcessEquipmentBaseClass
-
getEnergy
public double getEnergy()getEnergy.
- Specified by:
getEnergyin interfacePumpInterface- Returns:
- a double
-
getPower
public double getPower()getPower.
- Specified by:
getPowerin interfacePumpInterface- Returns:
- a double
-
getCapacityDuty
public double getCapacityDuty()getCapacityDuty.
- Specified by:
getCapacityDutyin interfaceProcessEquipmentInterface- Returns:
- a double
-
getCapacityMax
public double getCapacityMax()getCapacityMax.
- Specified by:
getCapacityMaxin interfaceProcessEquipmentInterface- Returns:
- a double
-
getPower
-
getDuty
public double getDuty()getDuty.
- Returns:
- a double
-
calculateAsCompressor
public void calculateAsCompressor(boolean setPumpCalcType) calculateAsCompressor.
- Parameters:
setPumpCalcType- a boolean
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Parameters:
id- UUID
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classProcessEquipmentBaseClass
-
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
getThermoSystem.
- Specified by:
getThermoSystemin interfaceProcessEquipmentInterface- Overrides:
getThermoSystemin classProcessEquipmentBaseClass- Returns:
- a
SystemInterfaceobject
-
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
getEntropyProduction.
- Specified by:
getEntropyProductionin interfaceProcessEquipmentInterface- Overrides:
getEntropyProductionin classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
setPressure
public void setPressure(double pressure) Setter for the field
pressure.- Specified by:
setPressurein interfaceProcessEquipmentInterface- Overrides:
setPressurein classProcessEquipmentBaseClass- Parameters:
pressure- a double
-
setPressure
-
setOutletPressure
public void setOutletPressure(double pressure) Set outlet pressure of twoport.- Specified by:
setOutletPressurein interfaceTwoPortInterface- Overrides:
setOutletPressurein classTwoPortEquipment- Parameters:
pressure- value to set in unit bara
-
setOutletPressure
-
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
Getter for the field
pumpChart.- Returns:
- a
PumpChartobject
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classTwoPortEquipment- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classTwoPortEquipment- Parameters:
cfg- report configuration- Returns:
- json string
-
setPumpChartType
setPumpChartType.
- Specified by:
setPumpChartTypein interfacePumpInterface- Parameters:
type- aStringobject
-
getMinimumFlow
public double getMinimumFlow()Getter for the field
minimumFlow, e.g., the minimum flow rate for the pump.- Specified by:
getMinimumFlowin interfacePumpInterface- Overrides:
getMinimumFlowin classProcessEquipmentBaseClass- 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:
setMinimumFlowin interfacePumpInterface- Overrides:
setMinimumFlowin classProcessEquipmentBaseClass- 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:
getNPSHAvailablein interfacePumpInterface- 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:
getNPSHRequiredin interfacePumpInterface- 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:
isCavitatingin interfacePumpInterface- 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:
setCheckNPSHin interfacePumpInterface- 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
-