Class SimpleTray

All Implemented Interfaces:
Serializable, Runnable, CapacityConstrainedEquipment, TrayInterface, MixerInterface, ProcessEquipmentInterface, ProcessElementInterface, SimulationInterface, NamedInterface
Direct Known Subclasses:
Condenser, ReactiveTray, Reboiler, VLSolidTray

public class SimpleTray extends Mixer implements TrayInterface

SimpleTray class.

Version:
$Id: $Id
Author:
ESOL
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.
    • heatInput

      double heatInput
    • temperature

      private double temperature
    • trayPressure

      protected double trayPressure
      Tray operating pressure in bara. Negative means use stream pressure.
    • useReactiveFlash

      private boolean useReactiveFlash
      When true, the tray uses reactive flash (Modified RAND, simultaneous chemical + phase equilibrium) instead of standard VLE flash. Set via DistillationColumn.setReactive(boolean).
    • cachedGasOutStream

      private transient StreamInterface cachedGasOutStream
      Cached gas out stream, invalidated when run() is called.
    • cachedLiquidOutStream

      private transient StreamInterface cachedLiquidOutStream
      Cached liquid out stream, invalidated when run() is called.
  • Constructor Details

    • SimpleTray

      public SimpleTray(String name)

      Constructor for SimpleTray.

      Parameters:
      name - name of tray
  • Method Details

    • init

      public void init()

      init.

    • setHeatInput

      public void setHeatInput(double heatinp)

      setHeatInput.

      Specified by:
      setHeatInput in interface TrayInterface
      Parameters:
      heatinp - a double
    • calcMixStreamEnthalpy0

      public double calcMixStreamEnthalpy0()

      calcMixStreamEnthalpy0.

      Returns:
      a double
    • calcMixStreamEnthalpy

      public double calcMixStreamEnthalpy()

      calcMixStreamEnthalpy.

      Overrides:
      calcMixStreamEnthalpy in class Mixer
      Returns:
      a double
    • run2

      public void run2()

      run2.

    • TPflash

      public void TPflash()

      TPflash.

    • setUseReactiveFlash

      public void setUseReactiveFlash(boolean useReactiveFlash)
      Enable or disable reactive flash on this tray.
      Parameters:
      useReactiveFlash - true to use reactive (chemical + phase) equilibrium
    • isUseReactiveFlash

      public boolean isUseReactiveFlash()
      Check whether this tray uses reactive flash.
      Returns:
      true if reactive flash is enabled
    • 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
      Overrides:
      run in class Mixer
      Parameters:
      id - UUID
    • invalidateOutStreamCache

      public void invalidateOutStreamCache()
      Invalidate the cached gas and liquid output streams. Call this after modifying the tray's thermo system compositions externally (e.g. Murphree efficiency correction).
    • setCachedGasOutStream

      public void setCachedGasOutStream(StreamInterface stream)
      Set a pre-built gas out stream (e.g. Murphree-corrected) to be returned by getGasOutStream() instead of the equilibrium result.
      Parameters:
      stream - the corrected gas stream
    • setCachedLiquidOutStream

      public void setCachedLiquidOutStream(StreamInterface stream)
      Set a pre-built liquid out stream (e.g. Murphree-corrected) to be returned by getLiquidOutStream() instead of the equilibrium result.
      Parameters:
      stream - the corrected liquid stream
    • getGasOutStream

      public StreamInterface getGasOutStream()

      getGasOutStream.

      Returns:
      a Stream object
    • getLiquidOutStream

      public StreamInterface getLiquidOutStream()

      getLiquidOutStream.

      Returns:
      a Stream object
    • getTemperature

      public double getTemperature()

      Getter for the field temperature.

      Specified by:
      getTemperature in interface ProcessEquipmentInterface
      Overrides:
      getTemperature in class ProcessEquipmentBaseClass
      Returns:
      a double
    • setPressure

      public void setPressure(double pres)

      Setter for the field pressure.

      Specified by:
      setPressure in interface ProcessEquipmentInterface
      Overrides:
      setPressure in class Mixer
      Parameters:
      pres - a double
    • setTemperature

      public void setTemperature(double temperature)

      Setter for the field temperature.

      Specified by:
      setTemperature in interface ProcessEquipmentInterface
      Overrides:
      setTemperature in class Mixer
      Parameters:
      temperature - Temperature in Kelvin
    • guessTemperature

      public double guessTemperature()

      guessTemperature.

      Overrides:
      guessTemperature in class Mixer
      Returns:
      a double
    • getVaporFlowRate

      public double getVaporFlowRate(String unit)

      getVaporFlowRate.

      Parameters:
      unit - a String object
      Returns:
      a double
    • getLiquidFlowRate

      public double getLiquidFlowRate(String unit)

      getLiquidFlowRate.

      Parameters:
      unit - a String object
      Returns:
      a double
    • getFeedRate

      public double getFeedRate(String unit)

      getFeedRate.

      Parameters:
      unit - a String object
      Returns:
      a double
    • massBalance

      public double massBalance()

      massBalance.

      Calculates the mass balance by comparing the total mass input and output.
      Returns:
      the difference between mass input and mass output