Class TurboExpanderCompressor

All Implemented Interfaces:
Serializable, Runnable, CompressorInterface, ExpanderInterface, ProcessEquipmentInterface, TwoPortInterface, StateVectorProvider, SimulationInterface, NamedInterface

public class TurboExpanderCompressor extends Expander
TurboExpanderCompressor models a coupled expander and compressor system with design and performance parameters, polynomial curve fits for efficiency and head, and Newton-Raphson iteration for speed matching.

This class provides configuration for impeller, speed, efficiency, and curve fit parameters, and exposes all relevant design and result values via getters/setters. The main run() method matches expander and compressor power using a robust Newton-Raphson approach, updating all result fields and output streams.

Author:
esol
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • expanderOutPressure

      private double expanderOutPressure
      Expander outlet pressure [bar abs].
    • IGVopening

      private double IGVopening
      IGV opening (1.0 = 100% open, fraction of max area).
    • bearingLossPower

      private double bearingLossPower
      Mechanical bearing loss power [W].
    • expanderSpeed

      private double expanderSpeed
      Matched expander speed [rpm].
    • compressorSpeed

      private double compressorSpeed
    • gearRatio

      private double gearRatio
    • compressorFeedStream

      StreamInterface compressorFeedStream
    • compressorOutletStream

      StreamInterface compressorOutletStream
    • expanderFeedStream

      StreamInterface expanderFeedStream
    • expanderOutletStream

      StreamInterface expanderOutletStream
    • impellerDiameter

      private double impellerDiameter
      Impeller diameter [m].
    • designSpeed

      private double designSpeed
      Design speed [rpm].
    • designUC

      private double designUC
      Design UC (velocity ratio, expander).
    • UCratioexpander

      private double UCratioexpander
      UC ratio for expander (actual/ideal).
    • UCratiocompressor

      private double UCratiocompressor
      UC ratio for compressor (actual/ideal).
    • QNratioexpander

      private double QNratioexpander
      QN ratio for expander (actual/ideal).
    • QNratiocompressor

      private double QNratiocompressor
      QN ratio for compressor (actual/ideal).
    • designQn

      private double designQn
      Design Q/N (flow/speed ratio).
    • designExpanderQn

      private double designExpanderQn
      Design Q/N for the expander (flow/speed ratio).
    • Qn

      private double Qn
      Actual Q/N (flow/speed ratio).
    • maximumIGVArea

      private double maximumIGVArea
      Maximum IGV area [mm^2] for the installed hardware.
    • igvAreaIncreaseFactor

      private double igvAreaIncreaseFactor
      Allowable IGV area increase factor (e.g. 1.14 for +14%).
    • usingExpandedIGVArea

      private boolean usingExpandedIGVArea
      Flag indicating whether the enlarged IGV area is being used.
    • currentIGVArea

      private double currentIGVArea
      Current effective IGV area [mm^2].
    • lastStageEnthalpyDrop

      private double lastStageEnthalpyDrop
      Last calculated stage isentropic enthalpy drop [J/kg].
    • compressorDesignPolytropicEfficiency

      private double compressorDesignPolytropicEfficiency
      Compressor polytropic efficiency (design/actual).
    • compressorPolytropicEfficiency

      private double compressorPolytropicEfficiency
    • compressorDesignPolytropicHead

      private double compressorDesignPolytropicHead
      Compressor design polytropic head [kJ/kg].
    • compressorPolytropicHead

      private double compressorPolytropicHead
      Compressor actual polytropic head [kJ/kg].
    • expanderIsentropicEfficiency

      private double expanderIsentropicEfficiency
      Expander isentropic efficiency (actual, result).
    • expanderDesignIsentropicEfficiency

      private double expanderDesignIsentropicEfficiency
    • powerExpander

      private double powerExpander
      Expander shaft power [W].
    • powerCompressor

      private double powerCompressor
      Compressor shaft power [W].
    • ucCurveA

      private double ucCurveA
      UC/efficiency curve fit parameter.
    • ucCurveH

      private double ucCurveH
    • ucCurveK

      private double ucCurveK
    • qnCurveA

      private double qnCurveA
      QN/efficiency curve fit parameter.
    • qnCurveH

      private double qnCurveH
    • qnCurveK

      private double qnCurveK
    • qnHeadCurveA

      private double qnHeadCurveA
      QN/head curve fit parameter.
    • qnHeadCurveH

      private double qnHeadCurveH
    • qnHeadCurveK

      private double qnHeadCurveK
    • qnHeadCurveQnValues

      private double[] qnHeadCurveQnValues
    • qnHeadCurveHeadValues

      private double[] qnHeadCurveHeadValues
    • qnEffCurveQnValues

      private double[] qnEffCurveQnValues
    • qnEffCurveEffValues

      private double[] qnEffCurveEffValues
  • Constructor Details

    • TurboExpanderCompressor

      public TurboExpanderCompressor(String name, StreamInterface inletStream)
      Construct a TurboExpanderCompressor with the specified name and inlet stream.
      Parameters:
      name - the name of the turbo expander compressor
      inletStream - the inlet stream for the expander
  • Method Details

    • run

      public void run(UUID id)

      In this method all thermodynamic and unit operations will be calculated in a steady state calculation.

      Run the expander/compressor calculation, matching expander and compressor power using Newton-Raphson iteration. Updates all result fields and output streams.

      Specified by:
      run in interface SimulationInterface
      Overrides:
      run in class Expander
      Parameters:
      id - UUID
    • getCompressorPolytropicHead

      public double getCompressorPolytropicHead()

      Getter for the field compressorPolytropicHead.

      Returns:
      a double
    • getUCratioexpander

      public double getUCratioexpander()
      Get the UC ratio for the expander after calculation.
      Returns:
      the UC ratio (expander)
    • getUCratiocompressor

      public double getUCratiocompressor()
      Get the UC ratio for the compressor after calculation.
      Returns:
      the UC ratio (compressor)
    • getQNratioexpander

      public double getQNratioexpander()
      Get the QN ratio for the expander after calculation.
      Returns:
      the QN ratio (expander)
    • getQNratiocompressor

      public double getQNratiocompressor()
      Get the QN ratio for the compressor after calculation.
      Returns:
      the QN ratio (compressor)
    • getQn

      public double getQn()

      getQn.

      Returns:
      a double
    • setQn

      public void setQn(double qn)

      setQn.

      Parameters:
      qn - a double
    • getPowerExpander

      public double getPowerExpander()

      Getter for the field powerExpander.

      Returns:
      a double
    • getPowerExpander

      public double getPowerExpander(String unit)

      Getter for the field powerExpander with unit conversion.

      Parameters:
      unit - the desired unit ("W", "kW" or "MW")
      Returns:
      expander power in the requested unit
    • getPowerCompressor

      public double getPowerCompressor()

      Getter for the field powerCompressor.

      Returns:
      a double
    • getPowerCompressor

      public double getPowerCompressor(String unit)

      Getter for the field powerCompressor with unit conversion.

      Parameters:
      unit - the desired unit ("W", "kW" or "MW")
      Returns:
      compressor power in the requested unit
    • getExpanderIsentropicEfficiency

      public double getExpanderIsentropicEfficiency()

      Getter for the field expanderIsentropicEfficiency.

      Returns:
      a double
    • setExpanderIsentropicEfficiency

      public void setExpanderIsentropicEfficiency(double expanderIsentropicEfficiency)

      Setter for the field expanderIsentropicEfficiency.

      Parameters:
      expanderIsentropicEfficiency - a double
    • getDesignCompressorPolytropicEfficiency

      public double getDesignCompressorPolytropicEfficiency()

      getDesignCompressorPolytropicEfficiency.

      Returns:
      a double
    • setCompressorDesignPolytropicEfficiency

      public void setCompressorDesignPolytropicEfficiency(double compressorPolytropicEfficiency)

      Setter for the field compressorDesignPolytropicEfficiency.

      Parameters:
      compressorPolytropicEfficiency - a double
    • getCompressorDesignPolytropicHead

      public double getCompressorDesignPolytropicHead()

      Getter for the field compressorDesignPolytropicHead.

      Returns:
      a double
    • setCompressorDesignPolytropicHead

      public void setCompressorDesignPolytropicHead(double compressorDesignPolytropicHead)

      Setter for the field compressorDesignPolytropicHead.

      Parameters:
      compressorDesignPolytropicHead - a double
    • setUCcurve

      public void setUCcurve(double[] ucValues, double[] efficiencyValues)
      Fit a constrained parabola: efficiency = a*(uc - h)^2 + k, with vertex at (h, k) = (1, 1).
      Parameters:
      ucValues - array of uc values
      efficiencyValues - array of efficiency values
    • getEfficiencyFromUC

      public double getEfficiencyFromUC(double uc)
      Evaluate the fitted UC curve at a given uc value.
      Parameters:
      uc - the uc value
      Returns:
      the efficiency
    • setQNEfficiencycurve

      public void setQNEfficiencycurve(double[] qnValues, double[] efficiencyValues)
      Fit a Q/N efficiency curve using cubic spline interpolation.
      Parameters:
      qnValues - array of Q/N values (does not need to be sorted)
      efficiencyValues - array of efficiency values
    • getEfficiencyFromQN

      public double getEfficiencyFromQN(double qn)
      Evaluate the fitted Q/N efficiency curve at a given qn value using cubic spline interpolation. Linear extrapolation is used outside the data range.
      Parameters:
      qn - the Q/N value
      Returns:
      the efficiency
    • setQNHeadcurve

      public void setQNHeadcurve(double[] qnValues, double[] headValues)
      Fit a Q/N head curve using cubic spline interpolation.
      Parameters:
      qnValues - array of Q/N values (does not need to be sorted)
      headValues - array of head values
    • getHeadFromQN

      public double getHeadFromQN(double qn)
      Evaluate the fitted Q/N head curve at a given qn value using cubic spline interpolation. Linear extrapolation is used outside the data range.
      Parameters:
      qn - the Q/N value
      Returns:
      the head
    • calcIGVOpening

      public double calcIGVOpening()
      Calculate the IGV opening based on the current IGV opening fraction.
      Returns:
      IGV opening (fraction of max area)
    • calcIGVOpenArea

      public double calcIGVOpenArea()
      Calculate the current IGV (Inlet Guide Vane) open area.
      Returns:
      the IGV open area in mm²
    • calcIGVOpeningFromFlow

      public double calcIGVOpeningFromFlow()
      Calculate the IGV (Inlet Guide Vane) opening using the current flow conditions and last computed stage enthalpy drop.
      Returns:
      IGV opening (fraction of max area, capped at 1.0)
    • evaluateIGV

      private TurboExpanderCompressor.IGVModelResult evaluateIGV(double stageDrop, double massFlow, double volumetricFlow)
    • updateIGVState

      private void updateIGVState(double stageDrop, double massFlow, double volumetricFlow)
    • setImpellerDiameter

      public void setImpellerDiameter(double impellerDiameter)

      Setter for the field impellerDiameter.

      Parameters:
      impellerDiameter - a double
    • setDesignSpeed

      public void setDesignSpeed(double designSpeed)

      Setter for the field designSpeed.

      Parameters:
      designSpeed - a double
    • setDesignUC

      public void setDesignUC(double designUC)

      Setter for the field designUC.

      Parameters:
      designUC - a double
    • setDesignQn

      public void setDesignQn(double designQn)

      Setter for the field designQn.

      Parameters:
      designQn - a double
    • getDesignExpanderQn

      public double getDesignExpanderQn()
    • setDesignExpanderQn

      public void setDesignExpanderQn(double designExpanderQn)
    • setMaximumIGVArea

      public void setMaximumIGVArea(double maximumIGVArea)

      Setter for the field maximumIGVArea.

      Parameters:
      maximumIGVArea - a double
    • getIgvAreaIncreaseFactor

      public double getIgvAreaIncreaseFactor()
    • setIgvAreaIncreaseFactor

      public void setIgvAreaIncreaseFactor(double igvAreaIncreaseFactor)
    • getImpellerDiameter

      public double getImpellerDiameter()

      Getter for the field impellerDiameter.

      Returns:
      a double
    • getDesignSpeed

      public double getDesignSpeed()

      Getter for the field designSpeed.

      Returns:
      a double
    • getDesignUC

      public double getDesignUC()

      Getter for the field designUC.

      Returns:
      a double
    • getDesignQn

      public double getDesignQn()

      Getter for the field designQn.

      Returns:
      a double
    • getMaximumIGVArea

      public double getMaximumIGVArea()

      Getter for the field maximumIGVArea.

      Returns:
      a double
    • getCompressorPolytropicEfficieny

      public double getCompressorPolytropicEfficieny()

      getCompressorPolytropicEfficieny.

      Returns:
      a double
    • getCompressorDesingPolytropicHead

      public double getCompressorDesingPolytropicHead()

      getCompressorDesingPolytropicHead.

      Returns:
      a double
    • getIGVopening

      public double getIGVopening()

      getIGVopening.

      Returns:
      a double
    • setIGVopening

      public void setIGVopening(double iGVopening)

      setIGVopening.

      Parameters:
      iGVopening - a double
    • isUsingExpandedIGVArea

      public boolean isUsingExpandedIGVArea()
    • getCurrentIGVArea

      public double getCurrentIGVArea()
    • setExpanderOutPressure

      public void setExpanderOutPressure(double expanderOutPressure)
      Set the expander outlet pressure (absolute, bar).
      Parameters:
      expanderOutPressure - the desired expander outlet pressure in bar abs
    • setCompressorFeedStream

      public void setCompressorFeedStream(StreamInterface compressorFeedStream)
      Set the compressor feed stream for the turbo expander-compressor system.
      Parameters:
      compressorFeedStream - the feed stream to use for the compressor
    • getCompressorOutletStream

      public StreamInterface getCompressorOutletStream()
      Get the compressor outlet stream after calculation.
      Returns:
      the compressor outlet stream
    • getSpeed

      public double getSpeed()

      Getter for the field speed.

      Overrides:
      getSpeed in class Compressor
      Returns:
      a double
    • getOutletStream

      public StreamInterface getOutletStream()
      Get outlet Stream of twoport.
      Specified by:
      getOutletStream in interface TwoPortInterface
      Overrides:
      getOutletStream in class TwoPortEquipment
      Returns:
      outlet Stream of TwoPortEquipment
    • setUCratioexpander

      public void setUCratioexpander(double UCratioexpander)

      setUCratioexpander.

      Parameters:
      UCratioexpander - a double
    • setUCratiocompressor

      public void setUCratiocompressor(double UCratiocompressor)

      setUCratiocompressor.

      Parameters:
      UCratiocompressor - a double
    • setQNratioexpander

      public void setQNratioexpander(double QNratioexpander)

      setQNratioexpander.

      Parameters:
      QNratioexpander - a double
    • setQNratiocompressor

      public void setQNratiocompressor(double QNratiocompressor)

      setQNratiocompressor.

      Parameters:
      QNratiocompressor - a double
    • getSerialversionuid

      public static long getSerialversionuid()

      getSerialversionuid.

      Returns:
      a long
    • getExpanderOutPressure

      public double getExpanderOutPressure()

      Getter for the field expanderOutPressure.

      Returns:
      a double
    • getBearingLossPower

      public double getBearingLossPower()

      Getter for the field bearingLossPower.

      Returns:
      a double
    • getExpanderSpeed

      public double getExpanderSpeed()

      Getter for the field expanderSpeed.

      Returns:
      a double
    • getCompressorSpeed

      public double getCompressorSpeed()

      Getter for the field compressorSpeed.

      Returns:
      a double
    • getGearRatio

      public double getGearRatio()

      Getter for the field gearRatio.

      Returns:
      a double
    • getCompressorFeedStream

      public StreamInterface getCompressorFeedStream()

      Getter for the field compressorFeedStream.

      Returns:
      a StreamInterface object
    • getExpanderFeedStream

      public StreamInterface getExpanderFeedStream()

      Getter for the field expanderFeedStream.

      Returns:
      a StreamInterface object
    • getExpanderOutletStream

      public StreamInterface getExpanderOutletStream()

      Getter for the field expanderOutletStream.

      Returns:
      a StreamInterface object
    • getUcCurveA

      public double getUcCurveA()

      Getter for the field ucCurveA.

      Returns:
      a double
    • getUcCurveH

      public double getUcCurveH()

      Getter for the field ucCurveH.

      Returns:
      a double
    • getUcCurveK

      public double getUcCurveK()

      Getter for the field ucCurveK.

      Returns:
      a double
    • getQnCurveA

      public double getQnCurveA()

      Getter for the field qnCurveA.

      Returns:
      a double
    • getQnCurveH

      public double getQnCurveH()

      Getter for the field qnCurveH.

      Returns:
      a double
    • getQnCurveK

      public double getQnCurveK()

      Getter for the field qnCurveK.

      Returns:
      a double
    • getQnHeadCurveA

      public double getQnHeadCurveA()

      Getter for the field qnHeadCurveA.

      Returns:
      a double
    • getQnHeadCurveH

      public double getQnHeadCurveH()

      Getter for the field qnHeadCurveH.

      Returns:
      a double
    • getQnHeadCurveK

      public double getQnHeadCurveK()

      Getter for the field qnHeadCurveK.

      Returns:
      a double
    • toJson

      public String toJson()

      Serializes the Process Equipment along with its state to a JSON string.

      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class Compressor
      Returns:
      json string.
    • toJson

      public String toJson(ReportConfig cfg)
      Serializes the Process Equipment with configurable level of detail.
      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class Compressor
      Parameters:
      cfg - report configuration
      Returns:
      json string
    • getCompressorDesignPolytropicEfficiency

      public double getCompressorDesignPolytropicEfficiency()

      Getter for the field compressorDesignPolytropicEfficiency.

      Returns:
      a double
    • getCompressorPolytropicEfficiency

      public double getCompressorPolytropicEfficiency()

      Getter for the field compressorPolytropicEfficiency.

      Returns:
      a double
    • getExpanderDesignIsentropicEfficiency

      public double getExpanderDesignIsentropicEfficiency()

      Getter for the field expanderDesignIsentropicEfficiency.

      Returns:
      a double
    • setExpanderDesignIsentropicEfficiency

      public void setExpanderDesignIsentropicEfficiency(double expanderDesignIsentropicEfficiency)

      Setter for the field expanderDesignIsentropicEfficiency.

      Parameters:
      expanderDesignIsentropicEfficiency - a double
    • getMassBalance

      public double getMassBalance(String unit)

      getMassBalance.

      Specified by:
      getMassBalance in interface ProcessEquipmentInterface
      Overrides:
      getMassBalance in class TwoPortEquipment
      Parameters:
      unit - a String object
      Returns:
      a double