Interface CompressorChartInterface
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
CompressorChart, CompressorChartAlternativeMapLookup, CompressorChartAlternativeMapLookupExtrapolate, CompressorChartKhader2015, CompressorChartMWInterpolation, PumpChartAlternativeMapLookupExtrapolate
CompressorChartInterface interface.
- Version:
- $Id: $Id
- Author:
- asmund
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCurve(double speed, double[] flow, double[] head, double[] polytropicEfficiency) This method is used add a curve to the CompressorChart object.voidaddCurve(double speed, double[] flowHead, double[] head, double[] flowPolytropicEfficiency, double[] polytropicEfficiency) This method is used add a curve to the CompressorChart object.booleanvoidgenerateStoneWallCurve.voidgenerateSurgeCurve.double[]Get the chart conditions (e.g., reference molecular weight).default double[][]Get the discharge temperature values for all compressor curves.doublegetFlow(double head, double speed, double guessFlow) getFlow.double[][]getFlows()Get the flow values for all compressor curves.default doublegetGamma()Get the heat capacity ratio.double[][]getHeads()Get the head values for all compressor curves.get the selected unit of head.default doubleGet the inlet pressure.default StreamInterfaceGet the inlet stream reference.default doubleGet the inlet temperature.doubleGetter for the fieldmaxSpeedCurve.doubleGetter for the fieldminSpeedCurve.default doubleGet the current operating molecular weight.double[][]Get the polytropic efficiency values for all compressor curves.doublegetPolytropicEfficiency(double flow, double speed) Get method for polytropic efficiency from reference curves.default doubleGet the polytropic exponent.doublegetPolytropicHead(double flow, double speed) Get method for polytropic head from reference curves.default double[][]Get the power values for all compressor curves.default double[][]Get the pressure ratio values for all compressor curves.default doublegetRatioToMaxSpeed(double calculatedSpeed) Get the ratio of the calculated speed to the maximum speed in the compressor curves.default doublegetRatioToMinSpeed(double calculatedSpeed) Get the ratio of the calculated speed to the minimum speed in the compressor curves.default doubleGet the reference density used for calculations.intgetSpeed(double flow, double head) getSpeed.double[]Get the speed values for all compressor curves.default doublegetSpeedValue(double flow, double head) Calculate the speed required to achieve a given head at a given flow rate.getStoneWallCurve.doublegetStoneWallFlowAtSpeed(double speed) Get the stone wall flow (maximum flow) at a specific speed.doublegetStoneWallHeadAtSpeed(double speed) Get the stone wall head (polytropic head at maximum flow) at a specific speed.getSurgeCurve.doublegetSurgeFlowAtSpeed(double speed) Get the surge flow (minimum flow) at a specific speed.doublegetSurgeHeadAtSpeed(double speed) Get the surge head (polytropic head at minimum flow) at a specific speed.inthashCode()default booleanisHigherThanMaxSpeed(double calculatedSpeed) Check if the calculated speed is higher than the maximum speed in the compressor curves.default booleanisLowerThanMinSpeed(double calculatedSpeed) Check if the calculated speed is lower than the minimum speed in the compressor curves.default booleanisSpeedWithinRange(double calculatedSpeed) Check if the calculated speed is within the defined compressor curve speed range.booleanChecks if set to use compressor chart for compressor calculations (chart is set for compressor).voidplot()plot.voidsetCurves(double[] chartConditions, double[] speed, double[][] flow, double[][] head, double[][] polyEff) This method is used add a set of curves to the CompressorChart object.voidsetCurves(double[] chartConditions, double[] speed, double[][] flow, double[][] head, double[][] flowPolyEff, double[][] polyEff) This method is used add a set of curves to the CompressorChart object.default voidsetGamma(double gamma) Set the heat capacity ratio (gamma = Cp/Cv) for temperature calculations.voidsetHeadUnit(String headUnit) set unit of head.default voidsetInletPressure(double pressure) Set the inlet pressure for pressure ratio calculations.default voidsetInletStream(StreamInterface stream) Set the inlet stream reference for automatic MW detection.default voidsetInletTemperature(double temperature) Set the inlet temperature for discharge temperature calculations.default voidsetOperatingMW(double mw) Set the current operating molecular weight for charts that support MW interpolation.default voidsetPolytropicExponent(double exponent) Set the polytropic exponent for pressure ratio calculations.voidsetReferenceConditions(double refMW, double refTemperature, double refPressure, double refZ) Set method for the reference conditions of the compressor chart.default voidsetReferenceDensity(double density) Set the reference density for power and pressure ratio calculations.voidsetStoneWallCurve(StoneWallCurve stoneWallCurve) setStoneWallCurve.voidsetSurgeCurve(SafeSplineSurgeCurve surgeCurve) setSurgeCurve.voidsetUseCompressorChart(boolean useCompressorChart) Set compressor calculations to use compressor chart.voidsetUseRealKappa(boolean useRealKappa) set method for kappa setting. true = real kappa is used, false = ideal kappa is usedbooleanget method for kappa setting. true = real kappa is used, false = ideal kappa is used
-
Method Details
-
addCurve
void addCurve(double speed, double[] flow, double[] head, double[] polytropicEfficiency) This method is used add a curve to the CompressorChart object.- Parameters:
speed- a doubleflow- an array of type doublehead- an array of type doublepolytropicEfficiency- an array of type double
-
addCurve
void addCurve(double speed, double[] flowHead, double[] head, double[] flowPolytropicEfficiency, double[] polytropicEfficiency) This method is used add a curve to the CompressorChart object.- Parameters:
speed- a doubleflowHead- an array of type doublehead- an array of type doubleflowPolytropicEfficiency- an array of type doublepolytropicEfficiency- an array of type double
-
setCurves
void setCurves(double[] chartConditions, double[] speed, double[][] flow, double[][] head, double[][] polyEff) This method is used add a set of curves to the CompressorChart object.- Parameters:
chartConditions- an array of type doublespeed- an array of type doubleflow- an array of type doublehead- an array of type doublepolyEff- an array of type double
-
setCurves
void setCurves(double[] chartConditions, double[] speed, double[][] flow, double[][] head, double[][] flowPolyEff, double[][] polyEff) This method is used add a set of curves to the CompressorChart object.- Parameters:
chartConditions- an array of type doublespeed- an array of type doubleflow- an array of type doublehead- an array of type doubleflowPolyEff- an array of type doublepolyEff- an array of type double
-
getPolytropicHead
double getPolytropicHead(double flow, double speed) Get method for polytropic head from reference curves.- Parameters:
flow- [m3/h], speed in [rpm].speed- a double- Returns:
- polytropic head in unit [getHeadUnit]
-
getPolytropicEfficiency
double getPolytropicEfficiency(double flow, double speed) Get method for polytropic efficiency from reference curves.- Parameters:
flow- [m3/h], speed in [rpm].speed- a double- Returns:
- polytropic efficiency [%].
-
setReferenceConditions
void setReferenceConditions(double refMW, double refTemperature, double refPressure, double refZ) Set method for the reference conditions of the compressor chart.- Parameters:
refMW- a doublerefTemperature- a doublerefPressure- a doublerefZ- a double
-
isUseCompressorChart
boolean isUseCompressorChart()Checks if set to use compressor chart for compressor calculations (chart is set for compressor).- Returns:
- a boolean
-
setUseCompressorChart
void setUseCompressorChart(boolean useCompressorChart) Set compressor calculations to use compressor chart.- Parameters:
useCompressorChart- a boolean
-
getHeadUnit
-
setHeadUnit
-
useRealKappa
boolean useRealKappa()get method for kappa setting. true = real kappa is used, false = ideal kappa is used- Returns:
- true/false flag
-
setUseRealKappa
void setUseRealKappa(boolean useRealKappa) set method for kappa setting. true = real kappa is used, false = ideal kappa is used- Parameters:
useRealKappa- a boolean
-
getSurgeCurve
-
setSurgeCurve
setSurgeCurve.
- Parameters:
surgeCurve- aSafeSplineSurgeCurveobject
-
getStoneWallCurve
-
setStoneWallCurve
setStoneWallCurve.
- Parameters:
stoneWallCurve- aStoneWallCurveobject
-
getSpeed
int getSpeed(double flow, double head) getSpeed.
- Parameters:
flow- a doublehead- a double- Returns:
- a int
-
getSpeedValue
default double getSpeedValue(double flow, double head) Calculate the speed required to achieve a given head at a given flow rate.This method returns the speed as a double for full precision. It uses a robust algorithm that works both within and outside the defined speed curve range by using fan law extrapolation.
The algorithm uses:
- Fan-law based initial guess: N ∝ √H at constant Q/N
- Damped Newton-Raphson iteration for fast convergence
- Bounds protection to prevent divergence
- Bisection fallback for guaranteed convergence
- Parameters:
flow- the volumetric flow rate in m³/hrhead- the required polytropic head in the chart's head unit- Returns:
- the calculated speed in RPM as a double
-
plot
void plot()plot.
-
equals
-
hashCode
-
getFlow
double getFlow(double head, double speed, double guessFlow) getFlow.
- Parameters:
head- a doublespeed- a doubleguessFlow- a double- Returns:
- a double
-
getMinSpeedCurve
double getMinSpeedCurve()Getter for the field
minSpeedCurve.- Returns:
- the minimum speed curve value in RPM
-
getMaxSpeedCurve
double getMaxSpeedCurve()Getter for the field
maxSpeedCurve.- Returns:
- the maximum speed curve value in RPM
-
isHigherThanMaxSpeed
default boolean isHigherThanMaxSpeed(double calculatedSpeed) Check if the calculated speed is higher than the maximum speed in the compressor curves.This method is useful for detecting when the compressor operation requires extrapolation beyond the defined performance curves, which may indicate that the compressor is undersized or operating outside its design envelope.
- Parameters:
calculatedSpeed- the speed to check in RPM- Returns:
- true if the calculated speed exceeds the maximum curve speed, false otherwise
-
getRatioToMaxSpeed
default double getRatioToMaxSpeed(double calculatedSpeed) Get the ratio of the calculated speed to the maximum speed in the compressor curves.A ratio greater than 1.0 indicates the speed exceeds the maximum curve speed. This is useful for quantifying how far outside the design envelope the compressor is operating.
- Parameters:
calculatedSpeed- the speed to compare in RPM- Returns:
- the ratio calculatedSpeed/maxSpeedCurve (dimensionless)
-
isLowerThanMinSpeed
default boolean isLowerThanMinSpeed(double calculatedSpeed) Check if the calculated speed is lower than the minimum speed in the compressor curves.This method is useful for detecting when the compressor operation requires extrapolation below the defined performance curves, which may indicate turndown issues or that the compressor is oversized for the current operating conditions.
- Parameters:
calculatedSpeed- the speed to check in RPM- Returns:
- true if the calculated speed is below the minimum curve speed, false otherwise
-
getRatioToMinSpeed
default double getRatioToMinSpeed(double calculatedSpeed) Get the ratio of the calculated speed to the minimum speed in the compressor curves.A ratio less than 1.0 indicates the speed is below the minimum curve speed. This is useful for quantifying how far below the design envelope the compressor is operating.
- Parameters:
calculatedSpeed- the speed to compare in RPM- Returns:
- the ratio calculatedSpeed/minSpeedCurve (dimensionless)
-
isSpeedWithinRange
default boolean isSpeedWithinRange(double calculatedSpeed) Check if the calculated speed is within the defined compressor curve speed range.This is a convenience method that checks both minimum and maximum speed limits.
- Parameters:
calculatedSpeed- the speed to check in RPM- Returns:
- true if the speed is within [minSpeedCurve, maxSpeedCurve], false otherwise
-
generateSurgeCurve
void generateSurgeCurve()generateSurgeCurve.
-
generateStoneWallCurve
void generateStoneWallCurve()generateStoneWallCurve.
-
getSurgeFlowAtSpeed
double getSurgeFlowAtSpeed(double speed) Get the surge flow (minimum flow) at a specific speed.
- Parameters:
speed- The compressor speed in RPM- Returns:
- The surge flow (minimum flow) at the specified speed in m3/hr, or Double.NaN if no curves exist
-
getSurgeHeadAtSpeed
double getSurgeHeadAtSpeed(double speed) Get the surge head (polytropic head at minimum flow) at a specific speed.
- Parameters:
speed- The compressor speed in RPM- Returns:
- The surge head at the specified speed in kJ/kg or meter (depending on headUnit), or Double.NaN if no curves exist
-
getStoneWallFlowAtSpeed
double getStoneWallFlowAtSpeed(double speed) Get the stone wall flow (maximum flow) at a specific speed.
- Parameters:
speed- The compressor speed in RPM- Returns:
- The stone wall flow (maximum flow) at the specified speed in m3/hr, or Double.NaN if no curves exist
-
getStoneWallHeadAtSpeed
double getStoneWallHeadAtSpeed(double speed) Get the stone wall head (polytropic head at maximum flow) at a specific speed.
- Parameters:
speed- The compressor speed in RPM- Returns:
- The stone wall head at the specified speed in kJ/kg or meter (depending on headUnit), or Double.NaN if no curves exist
-
setInletStream
Set the inlet stream reference for automatic MW detection.For charts that support MW interpolation (e.g., CompressorChartMWInterpolation), this allows the chart to automatically update the operating molecular weight from the inlet stream's fluid during calculations.
- Parameters:
stream- the inlet stream
-
getInletStream
Get the inlet stream reference.- Returns:
- the inlet stream, or null if not set
-
setOperatingMW
default void setOperatingMW(double mw) Set the current operating molecular weight for charts that support MW interpolation.- Parameters:
mw- the molecular weight in g/mol
-
getOperatingMW
default double getOperatingMW()Get the current operating molecular weight.- Returns:
- the molecular weight in g/mol, or NaN if not set
-
getSpeeds
double[] getSpeeds()Get the speed values for all compressor curves.- Returns:
- an array of speed values in RPM, or null if not set
-
getFlows
double[][] getFlows()Get the flow values for all compressor curves.- Returns:
- a 2D array where each row corresponds to a speed and contains flow values in m3/hr, or null if not set
-
getHeads
double[][] getHeads()Get the head values for all compressor curves.- Returns:
- a 2D array where each row corresponds to a speed and contains head values in the unit specified by getHeadUnit(), or null if not set
-
getPolytropicEfficiencies
double[][] getPolytropicEfficiencies()Get the polytropic efficiency values for all compressor curves.- Returns:
- a 2D array where each row corresponds to a speed and contains polytropic efficiency values in %, or null if not set
-
getChartConditions
double[] getChartConditions()Get the chart conditions (e.g., reference molecular weight).- Returns:
- an array of chart condition values, or null if not set
-
getPowers
default double[][] getPowers()Get the power values for all compressor curves.Power is calculated from: P = mass_flow * head / efficiency. This curve is critical for driver selection and energy analysis.
- Returns:
- a 2D array where each row corresponds to a speed and contains power values in kW, or null if not available
-
getPressureRatios
default double[][] getPressureRatios()Get the pressure ratio values for all compressor curves.Pressure ratio is calculated from polytropic head and gas properties. Useful for process design and control system configuration.
- Returns:
- a 2D array where each row corresponds to a speed and contains pressure ratio values (dimensionless), or null if not available
-
setReferenceDensity
default void setReferenceDensity(double density) Set the reference density for power and pressure ratio calculations.- Parameters:
density- the reference gas density in kg/m3
-
getReferenceDensity
default double getReferenceDensity()Get the reference density used for calculations.- Returns:
- the reference density in kg/m3, or NaN if not set
-
setInletPressure
default void setInletPressure(double pressure) Set the inlet pressure for pressure ratio calculations.- Parameters:
pressure- the inlet pressure in bara
-
getInletPressure
default double getInletPressure()Get the inlet pressure.- Returns:
- the inlet pressure in bara, or NaN if not set
-
setPolytropicExponent
default void setPolytropicExponent(double exponent) Set the polytropic exponent for pressure ratio calculations.- Parameters:
exponent- the polytropic exponent (n)
-
getPolytropicExponent
default double getPolytropicExponent()Get the polytropic exponent.- Returns:
- the polytropic exponent, or NaN if not set
-
getDischargeTemperatures
default double[][] getDischargeTemperatures()Get the discharge temperature values for all compressor curves.Discharge temperature is calculated from inlet temperature, pressure ratio, and polytropic efficiency using: T2 = T1 * PR^((n-1)/n) where n is related to efficiency and heat capacity ratio. This is important for downstream equipment design and material temperature limits.
- Returns:
- a 2D array where each row corresponds to a speed and contains discharge temperature values in Kelvin, or null if not available
-
setInletTemperature
default void setInletTemperature(double temperature) Set the inlet temperature for discharge temperature calculations.- Parameters:
temperature- the inlet temperature in Kelvin
-
getInletTemperature
default double getInletTemperature()Get the inlet temperature.- Returns:
- the inlet temperature in Kelvin, or NaN if not set
-
setGamma
default void setGamma(double gamma) Set the heat capacity ratio (gamma = Cp/Cv) for temperature calculations.- Parameters:
gamma- the heat capacity ratio (typically 1.2-1.4 for gases)
-
getGamma
default double getGamma()Get the heat capacity ratio.- Returns:
- the heat capacity ratio, or NaN if not set
-