Class GasTurbine

All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, ProcessEquipmentInterface, TwoPortInterface, ProcessElementInterface, SimulationInterface, NamedInterface

public class GasTurbine extends TwoPortEquipment implements CapacityConstrainedEquipment, AutoSizeable
Gas turbine model with integrated air compression, combustion, and expansion.

Implements CapacityConstrainedEquipment and AutoSizeable for integration with the production optimization framework. Capacity constraints track power output vs rated capacity and thermal efficiency.

Version:
$Id: $Id
Author:
asmund
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • logger

      static org.apache.logging.log4j.Logger logger
      Logger object for class.
    • thermoSystem

      public SystemInterface thermoSystem
    • airStream

      public StreamInterface airStream
    • airCompressor

      public Compressor airCompressor
    • combustionpressure

      public double combustionpressure
    • airGasRatio

      double airGasRatio
    • expanderPower

      double expanderPower
    • compressorPower

      double compressorPower
    • heat

      private double heat
    • power

      public double power
    • ratedPowerW

      private double ratedPowerW
      Rated (maximum) power output in Watts. Used for capacity constraint calculations.
    • autoSized

      private boolean autoSized
      Whether this equipment has been auto-sized.
    • capacityConstraints

      private final Map<String, CapacityConstraint> capacityConstraints
      Storage for capacity constraints.
  • Constructor Details

    • GasTurbine

      public GasTurbine()

      Constructor for GasTurbine.

    • GasTurbine

      public GasTurbine(String name)

      Constructor for GasTurbine.

      Parameters:
      name - a String object
    • GasTurbine

      public GasTurbine(String name, StreamInterface inletStream)

      Constructor for GasTurbine.

      Parameters:
      name - a String object
      inletStream - a StreamInterface object
  • Method Details

    • getMechanicalDesign

      public CompressorMechanicalDesign getMechanicalDesign()

      Get a mechanicalDesign for the equipment.

      Specified by:
      getMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      getMechanicalDesign in class ProcessEquipmentBaseClass
      Returns:
      a MechanicalDesign object
    • getHeat

      public double getHeat()

      Getter for the field heat.

      Returns:
      a double
    • getPower

      public double getPower()

      Getter for the field power.

      Returns:
      a double
    • setInletStream

      public void setInletStream(StreamInterface inletStream)
      Set inlet Stream of twoport.

      Setter for the field inletStream.

      Specified by:
      setInletStream in interface TwoPortInterface
      Overrides:
      setInletStream in class TwoPortEquipment
      Parameters:
      inletStream - value to set
    • run

      public void run(UUID id)

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

      Specified by:
      run in interface SimulationInterface
      Parameters:
      id - UUID
    • calcIdealAirFuelRatio

      public double calcIdealAirFuelRatio()

      Calculates ideal air fuel ratio [kg air/kg fuel].

      Returns:
      ideal air fuel ratio [kg air/kg fuel]
    • getPower

      public double getPower(String unit)
      Get power output in specified unit.
      Parameters:
      unit - power unit ("W", "kW", "MW", "hp")
      Returns:
      power output in specified unit
    • getRatedPower

      public double getRatedPower()
      Get the rated (maximum) power output.
      Returns:
      rated power in Watts
    • getRatedPower

      public double getRatedPower(String unit)
      Get the rated (maximum) power output in specified unit.
      Parameters:
      unit - power unit ("W", "kW", "MW", "hp")
      Returns:
      rated power in specified unit
    • setRatedPower

      public void setRatedPower(double ratedPower)
      Set the rated (maximum) power output.
      Parameters:
      ratedPower - rated power in Watts
    • setRatedPower

      public void setRatedPower(double ratedPower, String unit)
      Set the rated (maximum) power output with unit.
      Parameters:
      ratedPower - rated power value
      unit - power unit ("W", "kW", "MW", "hp")
    • getCapacityDuty

      public double getCapacityDuty()

      getCapacityDuty.

      Specified by:
      getCapacityDuty in interface ProcessEquipmentInterface
      Returns:
      a double
    • getCapacityMax

      public double getCapacityMax()

      getCapacityMax.

      Specified by:
      getCapacityMax in interface ProcessEquipmentInterface
      Returns:
      a double
    • initializeCapacityConstraints

      private void initializeCapacityConstraints()
      Initialize capacity constraints for the gas turbine.
    • getCapacityConstraints

      public Map<String, CapacityConstraint> getCapacityConstraints()
      Gets all capacity constraints defined for this equipment.

      Returns an unmodifiable map of constraint name to constraint object. Constraints are used by the optimization framework to detect bottlenecks, enforce limits, and guide production allocation. Equipment subclasses populate this map via ProcessEquipmentInterface.addCapacityConstraint(CapacityConstraint).

      Specified by:
      getCapacityConstraints in interface CapacityConstrainedEquipment
      Specified by:
      getCapacityConstraints in interface ProcessEquipmentInterface
      Overrides:
      getCapacityConstraints in class ProcessEquipmentBaseClass
      Returns:
      unmodifiable map of constraint name to constraint, empty if none defined
    • getBottleneckConstraint

      public CapacityConstraint getBottleneckConstraint()
      Gets the bottleneck (most limiting) constraint for this equipment.

      Returns the enabled constraint with the highest utilization ratio. If no constraints are defined or enabled, returns null.

      Specified by:
      getBottleneckConstraint in interface CapacityConstrainedEquipment
      Specified by:
      getBottleneckConstraint in interface ProcessEquipmentInterface
      Overrides:
      getBottleneckConstraint in class ProcessEquipmentBaseClass
      Returns:
      the most limiting constraint, or null if none
    • isCapacityExceeded

      public boolean isCapacityExceeded()
      Checks if any capacity constraint is violated (exceeds 100% utilization).

      A violated constraint means the equipment is operating beyond its design capacity. For HARD constraints, this may indicate equipment trip or failure. For SOFT constraints, this indicates reduced efficiency or accelerated wear.

      Specified by:
      isCapacityExceeded in interface CapacityConstrainedEquipment
      Specified by:
      isCapacityExceeded in interface ProcessEquipmentInterface
      Overrides:
      isCapacityExceeded in class ProcessEquipmentBaseClass
      Returns:
      true if any enabled constraint utilization exceeds 1.0 (100%)
    • isHardLimitExceeded

      public boolean isHardLimitExceeded()
      Checks if any HARD constraint limit is exceeded.

      HARD limits represent absolute equipment limits (e.g., maximum speed) that cannot be exceeded without equipment trip or damage. This is more severe than general capacity exceedance.

      Specified by:
      isHardLimitExceeded in interface CapacityConstrainedEquipment
      Specified by:
      isHardLimitExceeded in interface ProcessEquipmentInterface
      Overrides:
      isHardLimitExceeded in class ProcessEquipmentBaseClass
      Returns:
      true if any enabled HARD constraint's max value is exceeded
    • getMaxUtilization

      public double getMaxUtilization()
      Gets the maximum utilization across all enabled constraints.

      Returns the highest utilization ratio across all enabled constraints. Values above 1.0 indicate the equipment is over capacity. Returns 0.0 if no constraints are defined or enabled.

      Specified by:
      getMaxUtilization in interface CapacityConstrainedEquipment
      Specified by:
      getMaxUtilization in interface ProcessEquipmentInterface
      Overrides:
      getMaxUtilization in class ProcessEquipmentBaseClass
      Returns:
      maximum utilization as fraction (1.0 = 100% of design capacity)
    • addCapacityConstraint

      public void addCapacityConstraint(CapacityConstraint constraint)
      Adds a capacity constraint to this equipment.

      Constraints can be added at any time. If a constraint with the same name already exists, it is replaced. Use the fluent builder API on CapacityConstraint to configure the constraint before adding.

      Specified by:
      addCapacityConstraint in interface CapacityConstrainedEquipment
      Specified by:
      addCapacityConstraint in interface ProcessEquipmentInterface
      Overrides:
      addCapacityConstraint in class ProcessEquipmentBaseClass
      Parameters:
      constraint - the capacity constraint to add (ignored if null)
    • removeCapacityConstraint

      public boolean removeCapacityConstraint(String constraintName)
      Removes a capacity constraint by name.
      Specified by:
      removeCapacityConstraint in interface CapacityConstrainedEquipment
      Parameters:
      constraintName - the name of the constraint to remove
      Returns:
      true if the constraint was found and removed
    • clearCapacityConstraints

      public void clearCapacityConstraints()
      Clears all capacity constraints from this equipment.
      Specified by:
      clearCapacityConstraints in interface CapacityConstrainedEquipment
    • autoSize

      public void autoSize(double safetyFactor)
      Automatically size the equipment based on connected stream conditions.

      This method calculates dimensions and design parameters using the inlet stream properties and applies the specified safety factor. The equipment must have a valid inlet stream connected before calling this method.

      Specified by:
      autoSize in interface AutoSizeable
      Parameters:
      safetyFactor - multiplier for design capacity, typically 1.1-1.3 (10-30% over design)
    • getSizingReport

      public String getSizingReport()
      Get a detailed sizing report after auto-sizing.

      The report includes:

      • Design basis (flow rates, pressures, temperatures)
      • Calculated dimensions
      • Design parameters (K-factor, Cv, velocity, etc.)
      • Safety margins
      Specified by:
      getSizingReport in interface AutoSizeable
      Returns:
      formatted sizing report string
    • isAutoSized

      public boolean isAutoSized()
      Check if equipment has been auto-sized.
      Specified by:
      isAutoSized in interface AutoSizeable
      Returns:
      true if autoSize() has been called successfully