Class Pump
- All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, 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 booleanFlag indicating if pump has been auto-sized.private booleanprivate final Map<String, CapacityConstraint> Storage for capacity constraints.private 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 TypeMethodDescriptionvoidaddCapacityConstraint(CapacityConstraint constraint) Adds a new capacity constraint to this equipment.voidautoSize()Automatically size using default safety factor (1.2 = 20% margin).voidautoSize(double safetyFactor) Automatically size the equipment based on connected stream conditions.voidAutomatically size using company-specific design standards.voidcalculateAsCompressor(boolean setPumpCalcType) calculateAsCompressor.voidClears all capacity constraints from this equipment.voiddisplayResult.Gets the constraint with the highest utilization (the bottleneck).Gets all capacity constraints defined for this equipment.doublegetCapacityDuty.doublegetCapacityMax.doublegetDuty()getDuty.doublegetEnergy.doublegetEntropyProduction(String unit) getEntropyProduction.doubleGetter for the fieldisentropicEfficiency.doubleGets the maximum utilization across all constraints.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.Get a detailed sizing report after auto-sizing.Get sizing report as JSON for programmatic access.doublegetSpeed()Getter for the fieldspeed.getThermoSystem.protected voidInitializes default capacity constraints for the pump.voidInitialize ainitMechanicalDesignfor the equipment.booleanCheck if equipment has been auto-sized.booleanChecks if any capacity constraint is violated (exceeds 100% utilization).booleanCheck if the pump is at risk of cavitation based on NPSH criteria.booleanGet whether NPSH checking is enabled.booleanChecks if any HARD constraint limit is exceeded.booleanremoveCapacityConstraint(String constraintName) Removes a capacity constraint by name.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.voidsetOutletTemperature(double outTemperature) Set the outlet temperature of the pump.voidsetOutletTemperature(double temperature, String unit) Set the outlet temperature of the pump with unit specification.voidsetOutTemperature(double outTemperature) Deprecated.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, validateSetupMethods inherited from class ProcessEquipmentBaseClass
copy, equals, getConditionAnalysisMessage, getController, getEffectiveCapacityFactor, getEnergyStream, getExergyChange, getFailureMode, getMassBalance, getPressure, getPressure, getProperty, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, hashCode, isActive, isActive, isCapacityAnalysisEnabled, isFailed, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, 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 CapacityConstrainedEquipment
disableAllConstraints, enableAllConstraints, getAvailableMargin, getAvailableMarginPercent, getMaxUtilizationPercent, getUtilizationSummary, isCapacityAnalysisEnabled, isNearCapacityLimit, setCapacityAnalysisEnabledMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
equals, getConditionAnalysisMessage, getController, getExergyChange, getExergyChange, getFluid, getMassBalance, getMassBalance, getOperatingEnvelopeViolation, getPressure, getPressure, getReport_json, getRestCapacity, getResultTable, getSimulationValidationErrors, getSpecification, getTemperature, getTemperature, hashCode, isSimulationValid, isWithinOperatingEnvelope, 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, setOutPressure, setOutPressure, setOutTemperature
-
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 -
autoSized
private boolean autoSizedFlag indicating if pump has been auto-sized. -
capacityConstraints
Storage for capacity constraints.
-
-
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
-
setOutletTemperature
public void setOutletTemperature(double outTemperature) Set the outlet temperature of the pump.
- Specified by:
setOutletTemperaturein interfaceTwoPortInterface- Overrides:
setOutletTemperaturein classTwoPortEquipment- Parameters:
outTemperature- outlet temperature in Kelvin
-
setOutletTemperature
Set the outlet temperature of the pump with unit specification.
- Specified by:
setOutletTemperaturein interfaceTwoPortInterface- Overrides:
setOutletTemperaturein classTwoPortEquipment- Parameters:
temperature- outlet temperature valueunit- temperature unit (e.g., "K", "C", "R", "F")
-
setOutTemperature
Deprecated.usesetOutletTemperature(double)insteadSetter for the field
outTemperature.- Specified by:
setOutTemperaturein interfaceTwoPortInterface- Parameters:
outTemperature- outlet temperature in Kelvin
-
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
Setter for the field
pressure.- Specified by:
setOutletPressurein interfaceTwoPortInterface- Overrides:
setOutletPressurein classTwoPortEquipment- Parameters:
pressure- a doubleunit- aStringobject
-
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
-
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:
autoSizein interfaceAutoSizeable- 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:
autoSizein interfaceAutoSizeable
-
autoSize
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:
autoSizein interfaceAutoSizeable- 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:
isAutoSizedin interfaceAutoSizeable- Returns:
- true if autoSize() has been called successfully
-
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:
getSizingReportin interfaceAutoSizeable- Returns:
- formatted sizing report string
-
getSizingReportJson
Get sizing report as JSON for programmatic access.- Specified by:
getSizingReportJsonin interfaceAutoSizeable- 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
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:
getCapacityConstraintsin interfaceCapacityConstrainedEquipment- Returns:
- unmodifiable map of constraint name to 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:
getBottleneckConstraintin interfaceCapacityConstrainedEquipment- 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:
isCapacityExceededin interfaceCapacityConstrainedEquipment- 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:
isHardLimitExceededin interfaceCapacityConstrainedEquipment- 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:
getMaxUtilizationin interfaceCapacityConstrainedEquipment- Returns:
- maximum utilization as fraction (1.0 = 100% of design capacity)
-
addCapacityConstraint
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:
addCapacityConstraintin interfaceCapacityConstrainedEquipment- Parameters:
constraint- the constraint to add
-
removeCapacityConstraint
Removes a capacity constraint by name.- Specified by:
removeCapacityConstraintin interfaceCapacityConstrainedEquipment- 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:
clearCapacityConstraintsin interfaceCapacityConstrainedEquipment
-
setOutletTemperature(double)instead