Class Flare

All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, SimulationInterface, NamedInterface

public class Flare extends TwoPortEquipment
Flare unit operation for combustion of a process stream.
Author:
esol
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • heatDuty

      private double heatDuty
    • co2Emission

      private double co2Emission
    • flameHeight

      private double flameHeight
    • radiantFraction

      private double radiantFraction
    • tipDiameter

      private double tipDiameter
    • designHeatDutyCapacityW

      private double designHeatDutyCapacityW
    • designMassFlowCapacityKgS

      private double designMassFlowCapacityKgS
    • designMolarFlowCapacityMoleS

      private double designMolarFlowCapacityMoleS
    • lastCapacityCheck

      private transient Flare.CapacityCheckResult lastCapacityCheck
    • cumulativeHeatReleasedGJ

      private double cumulativeHeatReleasedGJ
    • cumulativeGasBurnedKg

      private double cumulativeGasBurnedKg
    • cumulativeCO2EmissionKg

      private double cumulativeCO2EmissionKg
    • lastTransientTime

      private double lastTransientTime
  • Constructor Details

    • Flare

      public Flare(String name)
      Default constructor.
      Parameters:
      name - name of the flare
    • Flare

      public Flare(String name, StreamInterface inletStream)
      Constructor setting inlet stream.
      Parameters:
      name - name of flare
      inletStream - inlet stream
  • Method Details

    • setInletStream

      public void setInletStream(StreamInterface stream)
      Set inlet Stream of twoport.
      Specified by:
      setInletStream in interface TwoPortInterface
      Overrides:
      setInletStream in class TwoPortEquipment
      Parameters:
      stream - 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.

      Parameters:
      id - UUID
    • updateCumulative

      public void updateCumulative(double timeStep)
      Update cumulative values for dynamic/transient operation.
      Parameters:
      timeStep - time step in seconds
    • resetCumulative

      public void resetCumulative()
      Reset cumulative values (useful when starting a new transient simulation).
    • reset

      public void reset()
      Reset cumulative values. Shorthand for resetCumulative().
    • getCumulativeHeatReleased

      public double getCumulativeHeatReleased(String unit)
      Get cumulative heat released.
      Parameters:
      unit - engineering unit, e.g. "GJ", "MJ", "MMBtu"
      Returns:
      cumulative heat released in specified unit
    • getCumulativeGasBurned

      public double getCumulativeGasBurned(String unit)
      Get cumulative gas burned.
      Parameters:
      unit - engineering unit, e.g. "kg", "tonnes"
      Returns:
      cumulative gas burned in specified unit
    • getCumulativeCO2Emission

      public double getCumulativeCO2Emission(String unit)
      Get cumulative CO2 emissions.
      Parameters:
      unit - engineering unit, e.g. "kg", "tonnes"
      Returns:
      cumulative CO2 emissions in specified unit
    • getTransientTime

      public double getTransientTime()
      Get total transient simulation time tracked.
      Returns:
      time in seconds
    • getHeatDuty

      public double getHeatDuty()
      Get heat released from flare.
      Returns:
      heat duty in W
    • getHeatDuty

      public double getHeatDuty(String unit)
      Get heat released in desired unit.
      Parameters:
      unit - engineering unit, e.g. "MW"
      Returns:
      heat duty in specified unit
    • getCO2Emission

      public double getCO2Emission()
      Get CO2 emissions in kg/s.
      Returns:
      CO2 emission rate
    • getCO2Emission

      public double getCO2Emission(String unit)
      Get CO2 emissions in specified unit. Supported units: kg/sec, kg/hr, kg/day
      Parameters:
      unit - desired unit
      Returns:
      emission in specified unit
    • setFlameHeight

      public void setFlameHeight(double flameHeight)
      Set the effective flame centerline height used for radiation calculations.
      Parameters:
      flameHeight - flame height in meters
    • setRadiantFraction

      public void setRadiantFraction(double radiantFraction)
      Define the radiant fraction of the flare heat release used for point-source radiation.
      Parameters:
      radiantFraction - fraction (0-1)
    • setTipDiameter

      public void setTipDiameter(double tipDiameter)
      Set flare tip diameter used for exit velocity and dispersion surrogate estimates.
      Parameters:
      tipDiameter - tip diameter in meters
    • setDesignHeatDutyCapacity

      public void setDesignHeatDutyCapacity(double value, String unit)
      Configure the design heat-release capacity for capacity validation.
      Parameters:
      value - heat-duty value
      unit - engineering unit (W, kW, MW)
    • setDesignMassFlowCapacity

      public void setDesignMassFlowCapacity(double value, String unit)
      Configure the design mass-flow capacity for capacity validation.
      Parameters:
      value - mass-flow value
      unit - supported units: kg/sec, kg/hr, kg/day
    • setDesignMolarFlowCapacity

      public void setDesignMolarFlowCapacity(double value, String unit)
      Configure the design molar-flow capacity for capacity validation.
      Parameters:
      value - molar-flow value
      unit - supported units: mole/sec, kmole/hr
    • estimateRadiationHeatFlux

      public double estimateRadiationHeatFlux(double groundDistanceM)
      Estimate the flame radiation heat flux at a horizontal ground distance using the currently calculated heat duty.
      Parameters:
      groundDistanceM - horizontal distance from flare base [m]
      Returns:
      radiant heat flux [W/m2]
    • estimateRadiationHeatFlux

      public double estimateRadiationHeatFlux(double scenarioHeatDutyW, double groundDistanceM)
      Estimate the flame radiation heat flux at a horizontal ground distance for a specified heat duty.
      Parameters:
      scenarioHeatDutyW - heat duty in W
      groundDistanceM - horizontal distance from flare base [m]
      Returns:
      radiant heat flux [W/m2]
    • radiationDistanceForFlux

      public double radiationDistanceForFlux(double fluxThresholdWm2)
      Determine the horizontal distance at which the radiation level drops to the specified threshold.
      Parameters:
      fluxThresholdWm2 - target heat flux [W/m2]
      Returns:
      horizontal distance from flare base [m]
    • radiationDistanceForFlux

      public double radiationDistanceForFlux(double scenarioHeatDutyW, double fluxThresholdWm2)
      Determine the horizontal distance at which the radiation level drops to the specified threshold for a scenario heat duty.
      Parameters:
      scenarioHeatDutyW - heat duty in W
      fluxThresholdWm2 - target heat flux [W/m2]
      Returns:
      horizontal distance from flare base [m]
    • getDispersionSurrogate

      public FlareDispersionSurrogateDTO getDispersionSurrogate()
      Build a dispersion surrogate descriptor for the current operating point.
      Returns:
      surrogate DTO with momentum-like metrics
    • getDispersionSurrogate

      public FlareDispersionSurrogateDTO getDispersionSurrogate(double massRateKgS, double molarRateMoleS)
      Build a dispersion surrogate descriptor for a specified mass and molar rate.
      Parameters:
      massRateKgS - mass flow in kg/s
      molarRateMoleS - molar flow in mole/s
      Returns:
      surrogate DTO with momentum-like metrics
    • evaluateCapacity

      public Flare.CapacityCheckResult evaluateCapacity()
      Evaluate the current operation against configured design capacities.
      Returns:
      capacity check result
    • evaluateCapacity

      public Flare.CapacityCheckResult evaluateCapacity(double scenarioHeatDutyW, double massRateKgS, double molarRateMoleS)
      Evaluate a hypothetical load case against configured design capacities.
      Parameters:
      scenarioHeatDutyW - heat duty in W
      massRateKgS - mass flow in kg/s
      molarRateMoleS - molar flow in mole/s
      Returns:
      capacity check result for the specified scenario
    • evaluateCapacityInternal

      private Flare.CapacityCheckResult evaluateCapacityInternal(double scenarioHeatDutyW, double massRateKgS, double molarRateMoleS)
    • getLastCapacityCheck

      public Flare.CapacityCheckResult getLastCapacityCheck()
      Latest computed capacity check result.
      Returns:
      last capacity result
    • getPerformanceSummary

      public FlarePerformanceDTO getPerformanceSummary()
      Produce a performance summary DTO for the current operating point.
      Returns:
      performance DTO containing emissions, radiation and capacity data
    • getPerformanceSummary

      public FlarePerformanceDTO getPerformanceSummary(String scenarioName, double scenarioHeatDutyW, double massRateKgS, double molarRateMoleS)
      Produce a performance summary DTO for a hypothetical load case.
      Parameters:
      scenarioName - label for the scenario
      scenarioHeatDutyW - heat duty in W (if <=0 the value will be estimated from mass rate)
      massRateKgS - mass flow in kg/s
      molarRateMoleS - molar flow in mole/s (optional, negative to auto-estimate)
      Returns:
      performance DTO containing emissions, radiation and capacity data
    • buildPerformanceSummary

      private FlarePerformanceDTO buildPerformanceSummary(String label, double scenarioHeatDutyW, double massRateKgS, double molarRateMoleS, double co2RateKgS, Map<String,Double> emissionMap)
    • estimateHeatDutyFromMassRate

      private double estimateHeatDutyFromMassRate(double massRateKgS)
    • estimateMolarRateFromMassRate

      private double estimateMolarRateFromMassRate(double massRateKgS)
    • estimateCO2EmissionFromMassRate

      private double estimateCO2EmissionFromMassRate(double massRateKgS)
    • buildEmissionMap

      private Map<String,Double> buildEmissionMap()
    • scaleEmissionMap

      private Map<String,Double> scaleEmissionMap(double massRateKgS)
    • convertMassFlowToKgPerSec

      private double convertMassFlowToKgPerSec(double value, String unit)
    • convertMolarFlowToMolePerSec

      private double convertMolarFlowToMolePerSec(double value, String unit)
    • 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 TwoPortEquipment
      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 TwoPortEquipment
      Parameters:
      cfg - report configuration
      Returns:
      json string