Class SafeSplineStoneWallCurve

All Implemented Interfaces:
Serializable, BoundaryCurveInterface

public class SafeSplineStoneWallCurve extends StoneWallCurve
Spline based representation of the stone wall 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 stone wall (for single-speed compressors). When true, stone wall flow is constant regardless of head.
    • singleStoneWallFlow

      private double singleStoneWallFlow
      Single stone wall flow value used when isSinglePoint is true.
    • singleStoneWallHead

      private double singleStoneWallHead
      Single stone wall head value used when isSinglePoint is true.
  • Constructor Details

    • SafeSplineStoneWallCurve

      public SafeSplineStoneWallCurve()
      Default constructor.
    • SafeSplineStoneWallCurve

      public SafeSplineStoneWallCurve(double[] flow, double[] head)
      Create a spline based stone wall 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
    • getStoneWallFlow

      public double getStoneWallFlow(double headValue)
      Get the stone wall flow for a given head.

      Wrapper retaining old API.

      Overrides:
      getStoneWallFlow in class StoneWallCurve
      Parameters:
      headValue - head value
      Returns:
      stone wall flow
    • getStoneWallHead

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

      public boolean isStoneWall(double headValue, double flowValue)
      Check if the given point is beyond the stone wall limit.

      Wrapper retaining old API.

      Overrides:
      isStoneWall in class StoneWallCurve
      Parameters:
      headValue - head value
      flowValue - flow value
      Returns:
      true if the point is beyond the stone wall limit
    • isSinglePointStoneWall

      public boolean isSinglePointStoneWall()
      Check if this stone wall curve represents a single-point (for single-speed compressors).
      Returns:
      true if this is a single-point stone wall curve
    • getSingleStoneWallFlow

      public double getSingleStoneWallFlow()
      Get the single stone wall flow value for single-speed compressors.
      Returns:
      the single stone wall flow value, or 0.0 if not a single-point stone wall
    • getSingleStoneWallHead

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