Class SafeSplineSurgeCurve

All Implemented Interfaces:
Serializable, BoundaryCurveInterface

public class SafeSplineSurgeCurve extends SurgeCurve
Spline based implementation of the surge curve with safe extrapolation.
Author:
esol
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • logger

      static org.apache.logging.log4j.Logger logger
    • sortedHead

      private double[] sortedHead
    • sortedFlow

      private double[] sortedFlow
    • headFromFlow

      private transient org.apache.commons.math3.analysis.UnivariateFunction headFromFlow
    • flowFromHead

      private transient org.apache.commons.math3.analysis.UnivariateFunction flowFromHead
    • isSinglePoint

      private boolean isSinglePoint
      Flag indicating single-point surge (for single-speed compressors). When true, surge flow is constant regardless of head.
    • singleSurgeFlow

      private double singleSurgeFlow
      Single surge flow value used when isSinglePoint is true.
    • singleSurgeHead

      private double singleSurgeHead
      Single surge head value used when isSinglePoint is true.
  • Constructor Details

    • SafeSplineSurgeCurve

      public SafeSplineSurgeCurve()
      Default constructor.
    • SafeSplineSurgeCurve

      public SafeSplineSurgeCurve(double[] flow, double[] head)
      Create a spline based surge curve from flow and head arrays.
      Parameters:
      flow - array of flow values
      head - array of head values
  • Method Details

    • getSortedHead

      public double[] getSortedHead()

      Getter for the field sortedHead.

      Returns:
      an array of
      invalid reference
      double
      objects
    • getSortedFlow

      public double[] getSortedFlow()

      Getter for the field sortedFlow.

      Returns:
      an array of
      invalid reference
      double
      objects
    • setCurve

      public void setCurve(double[] chartConditions, double[] flow, double[] head)
      Define the curve from arrays of flow and head values with optional chart conditions.
      Specified by:
      setCurve in interface BoundaryCurveInterface
      Overrides:
      setCurve in class BoundaryCurve
      Parameters:
      chartConditions - conditions for the reference curve, or null
      flow - array of flow values
      head - array of head values
    • getFlow

      public double getFlow(double headValue)
      Get the flow corresponding to a given head value on the curve.
      Specified by:
      getFlow in interface BoundaryCurveInterface
      Overrides:
      getFlow in class BoundaryCurve
      Parameters:
      headValue - the head value
      Returns:
      the corresponding flow
    • getSurgeFlow

      public double getSurgeFlow(double headValue)
      Get the surge flow for a given head.

      Wrapper retaining old API.

      Overrides:
      getSurgeFlow in class SurgeCurve
      Parameters:
      headValue - head value
      Returns:
      surge flow
    • getSurgeHead

      public double getSurgeHead(double flowValue)
      Get head value corresponding to a given flow.
      Parameters:
      flowValue - flow value
      Returns:
      corresponding head
    • isSurge

      public boolean isSurge(double headValue, double flowValue)
      Check if the given point is in surge.

      Wrapper retaining old API.

      Overrides:
      isSurge in class SurgeCurve
      Parameters:
      headValue - head value
      flowValue - flow value
      Returns:
      true if the point is in surge
    • isSinglePointSurge

      public boolean isSinglePointSurge()
      Check if this surge curve represents a single-point surge (for single-speed compressors).
      Returns:
      true if this is a single-point surge curve
    • getSingleSurgeFlow

      public double getSingleSurgeFlow()
      Get the single surge flow value for single-speed compressors.
      Returns:
      the single surge flow value, or 0.0 if not a single-point surge
    • getSingleSurgeHead

      public double getSingleSurgeHead()
      Get the single surge head value for single-speed compressors.
      Returns:
      the single surge head value, or 0.0 if not a single-point surge