Interface CompressorChartInterface

All Superinterfaces:
Cloneable
All Known Implementing Classes:
CompressorChart, CompressorChartAlternativeMapLookup, CompressorChartAlternativeMapLookupExtrapolate, CompressorChartKhader2015, CompressorChartMWInterpolation, PumpChartAlternativeMapLookupExtrapolate

public interface CompressorChartInterface extends Cloneable

CompressorChartInterface interface.

Version:
$Id: $Id
Author:
asmund
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addCurve(double speed, double[] flow, double[] head, double[] polytropicEfficiency)
    This method is used add a curve to the CompressorChart object.
    void
    addCurve(double speed, double[] flowHead, double[] head, double[] flowPolytropicEfficiency, double[] polytropicEfficiency)
    This method is used add a curve to the CompressorChart object.
    boolean
    void
    generateStoneWallCurve.
    void
    generateSurgeCurve.
    double[]
    Get the chart conditions (e.g., reference molecular weight).
    default double[][]
    Get the discharge temperature values for all compressor curves.
    double
    getFlow(double head, double speed, double guessFlow)
    getFlow.
    double[][]
    Get the flow values for all compressor curves.
    default double
    Get the heat capacity ratio.
    double[][]
    Get the head values for all compressor curves.
    get the selected unit of head.
    default double
    Get the inlet pressure.
    Get the inlet stream reference.
    default double
    Get the inlet temperature.
    double
    Getter for the field maxSpeedCurve.
    double
    Getter for the field minSpeedCurve.
    default double
    Get the current operating molecular weight.
    double[][]
    Get the polytropic efficiency values for all compressor curves.
    double
    getPolytropicEfficiency(double flow, double speed)
    Get method for polytropic efficiency from reference curves.
    default double
    Get the polytropic exponent.
    double
    getPolytropicHead(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 double
    getRatioToMaxSpeed(double calculatedSpeed)
    Get the ratio of the calculated speed to the maximum speed in the compressor curves.
    default double
    getRatioToMinSpeed(double calculatedSpeed)
    Get the ratio of the calculated speed to the minimum speed in the compressor curves.
    default double
    Get the reference density used for calculations.
    int
    getSpeed(double flow, double head)
    getSpeed.
    double[]
    Get the speed values for all compressor curves.
    default double
    getSpeedValue(double flow, double head)
    Calculate the speed required to achieve a given head at a given flow rate.
    getStoneWallCurve.
    double
    Get the stone wall flow (maximum flow) at a specific speed.
    double
    Get the stone wall head (polytropic head at maximum flow) at a specific speed.
    getSurgeCurve.
    double
    getSurgeFlowAtSpeed(double speed)
    Get the surge flow (minimum flow) at a specific speed.
    double
    getSurgeHeadAtSpeed(double speed)
    Get the surge head (polytropic head at minimum flow) at a specific speed.
    int
    default boolean
    isHigherThanMaxSpeed(double calculatedSpeed)
    Check if the calculated speed is higher than the maximum speed in the compressor curves.
    default boolean
    isLowerThanMinSpeed(double calculatedSpeed)
    Check if the calculated speed is lower than the minimum speed in the compressor curves.
    default boolean
    isSpeedWithinRange(double calculatedSpeed)
    Check if the calculated speed is within the defined compressor curve speed range.
    boolean
    Checks if set to use compressor chart for compressor calculations (chart is set for compressor).
    void
    plot.
    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.
    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.
    default void
    setGamma(double gamma)
    Set the heat capacity ratio (gamma = Cp/Cv) for temperature calculations.
    void
    setHeadUnit(String headUnit)
    set unit of head.
    default void
    setInletPressure(double pressure)
    Set the inlet pressure for pressure ratio calculations.
    default void
    Set the inlet stream reference for automatic MW detection.
    default void
    setInletTemperature(double temperature)
    Set the inlet temperature for discharge temperature calculations.
    default void
    setOperatingMW(double mw)
    Set the current operating molecular weight for charts that support MW interpolation.
    default void
    setPolytropicExponent(double exponent)
    Set the polytropic exponent for pressure ratio calculations.
    void
    setReferenceConditions(double refMW, double refTemperature, double refPressure, double refZ)
    Set method for the reference conditions of the compressor chart.
    default void
    setReferenceDensity(double density)
    Set the reference density for power and pressure ratio calculations.
    void
    setStoneWallCurve.
    void
    setSurgeCurve.
    void
    setUseCompressorChart(boolean useCompressorChart)
    Set compressor calculations to use compressor chart.
    void
    setUseRealKappa(boolean useRealKappa)
    set method for kappa setting. true = real kappa is used, false = ideal kappa is used
    boolean
    get 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 double
      flow - an array of type double
      head - an array of type double
      polytropicEfficiency - 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 double
      flowHead - an array of type double
      head - an array of type double
      flowPolytropicEfficiency - an array of type double
      polytropicEfficiency - 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 double
      speed - an array of type double
      flow - an array of type double
      head - an array of type double
      polyEff - 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 double
      speed - an array of type double
      flow - an array of type double
      head - an array of type double
      flowPolyEff - an array of type double
      polyEff - 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 double
      refTemperature - a double
      refPressure - a double
      refZ - 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

      String getHeadUnit()
      get the selected unit of head.
      Returns:
      unit of head
    • setHeadUnit

      void setHeadUnit(String headUnit)
      set unit of head.
      Parameters:
      headUnit - a String object
    • 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

      SafeSplineSurgeCurve getSurgeCurve()

      getSurgeCurve.

      Returns:
      a SafeSplineSurgeCurve object
    • setSurgeCurve

      void setSurgeCurve(SafeSplineSurgeCurve surgeCurve)

      setSurgeCurve.

      Parameters:
      surgeCurve - a SafeSplineSurgeCurve object
    • getStoneWallCurve

      StoneWallCurve getStoneWallCurve()

      getStoneWallCurve.

      Returns:
      a StoneWallCurve object
    • setStoneWallCurve

      void setStoneWallCurve(StoneWallCurve stoneWallCurve)

      setStoneWallCurve.

      Parameters:
      stoneWallCurve - a StoneWallCurve object
    • getSpeed

      int getSpeed(double flow, double head)

      getSpeed.

      Parameters:
      flow - a double
      head - 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³/hr
      head - the required polytropic head in the chart's head unit
      Returns:
      the calculated speed in RPM as a double
    • plot

      void plot()

      plot.

    • equals

      boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      int hashCode()
      Overrides:
      hashCode in class Object
    • getFlow

      double getFlow(double head, double speed, double guessFlow)

      getFlow.

      Parameters:
      head - a double
      speed - a double
      guessFlow - 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

      default void setInletStream(StreamInterface stream)
      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

      default StreamInterface 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