Class Tank

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

public class Tank extends ProcessEquipmentBaseClass

Tank class.

Version:
$Id: $Id
Author:
Even Solbraa
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.
    • mechanicalDesign

      private TankMechanicalDesign mechanicalDesign
      Mechanical design for the tank.
    • thermoSystem

      SystemInterface thermoSystem
    • gasSystem

      SystemInterface gasSystem
    • waterSystem

      SystemInterface waterSystem
    • liquidSystem

      SystemInterface liquidSystem
    • thermoSystemCloned

      SystemInterface thermoSystemCloned
    • gasOutStream

      Stream gasOutStream
    • liquidOutStream

      Stream liquidOutStream
    • numberOfInputStreams

      private int numberOfInputStreams
    • inletStreamMixer

      Mixer inletStreamMixer
    • efficiency

      private double efficiency
    • liquidCarryoverFraction

      private double liquidCarryoverFraction
    • gasCarryunderFraction

      private double gasCarryunderFraction
    • volume

      private double volume
    • steelWallTemperature

      double steelWallTemperature
    • steelWallMass

      double steelWallMass
    • steelWallArea

      double steelWallArea
    • heatTransferNumber

      double heatTransferNumber
    • steelCp

      double steelCp
    • separatorLength

      double separatorLength
    • separatorDiameter

      double separatorDiameter
    • liquidVolume

      double liquidVolume
    • gasVolume

      double gasVolume
    • liquidLevel

      private double liquidLevel
  • Constructor Details

    • Tank

      public Tank(String name)
      Constructor for Tank.
      Parameters:
      name - name of tank
    • Tank

      public Tank(String name, StreamInterface inletStream)

      Constructor for Tank.

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

    • getMechanicalDesign

      public TankMechanicalDesign getMechanicalDesign()

      Get a mechanicalDesign for the equipment.

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

      public void initMechanicalDesign()

      Initialize a initMechanicalDesign for the equipment.

      Specified by:
      initMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      initMechanicalDesign in class ProcessEquipmentBaseClass
    • setInletStream

      public void setInletStream(StreamInterface inletStream)

      setInletStream.

      Parameters:
      inletStream - a StreamInterface object
    • addStream

      public void addStream(StreamInterface newStream)

      addStream.

      Parameters:
      newStream - a StreamInterface object
    • getLiquidOutStream

      public StreamInterface getLiquidOutStream()

      Getter for the field liquidOutStream.

      Returns:
      a Stream object
    • getGasOutStream

      public StreamInterface getGasOutStream()

      Getter for the field gasOutStream.

      Returns:
      a Stream object
    • getGas

      public StreamInterface getGas()

      getGas.

      Returns:
      a Stream object
    • getLiquid

      public StreamInterface getLiquid()

      getLiquid.

      Returns:
      a Stream object
    • run

      public void run(UUID id)

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

      Calculates the following properties:

      • steelWallTemperature
      • gasOutStream
      • liquidOutStream
      • thermoSystem including properties
      • liquidLevel
      • liquidVolume
      • gasVolume
      Parameters:
      id - UUID
    • displayResult

      public void displayResult()

      displayResult.

      Specified by:
      displayResult in interface ProcessEquipmentInterface
      Overrides:
      displayResult in class ProcessEquipmentBaseClass
    • runTransient

      public void runTransient(double dt, UUID id)

      runTransient

      This method calculates thermodynamic and unit operations using difference equations if available and calculateSteadyState is true. Use setCalculateSteadyState to set the parameter. Sets calc identifier UUID.
      Parameters:
      dt - Delta time [s]
      id - Calculation identifier
    • setOutComposition

      public void setOutComposition(SystemInterface thermoSystem)

      setOutComposition.

      Parameters:
      thermoSystem - a SystemInterface object
    • setTempPres

      public void setTempPres(double temp, double pres)

      setTempPres.

      Parameters:
      temp - a double
      pres - a double
    • getEfficiency

      public double getEfficiency()

      Getter for the field efficiency.

      Returns:
      a double
    • setEfficiency

      public void setEfficiency(double efficiency)

      Setter for the field efficiency.

      Parameters:
      efficiency - a double
    • getLiquidCarryoverFraction

      public double getLiquidCarryoverFraction()

      Getter for the field liquidCarryoverFraction.

      Returns:
      a double
    • setLiquidCarryoverFraction

      public void setLiquidCarryoverFraction(double liquidCarryoverFraction)

      Setter for the field liquidCarryoverFraction.

      Parameters:
      liquidCarryoverFraction - a double
    • getGasCarryunderFraction

      public double getGasCarryunderFraction()

      Getter for the field gasCarryunderFraction.

      Returns:
      a double
    • setGasCarryunderFraction

      public void setGasCarryunderFraction(double gasCarryunderFraction)

      Setter for the field gasCarryunderFraction.

      Parameters:
      gasCarryunderFraction - a double
    • getLiquidLevel

      public double getLiquidLevel()

      Getter for the field liquidLevel.

      Returns:
      a double
    • getVolume

      public double getVolume()

      Getter for the field volume.

      Returns:
      a double
    • setVolume

      public void setVolume(double volume)

      Setter for the field volume.

      Parameters:
      volume - a double
    • getMassBalance

      public double getMassBalance(String unit)

      getMassBalance.

      Specified by:
      getMassBalance in interface ProcessEquipmentInterface
      Overrides:
      getMassBalance in class ProcessEquipmentBaseClass
      Parameters:
      unit - a String object
      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 ProcessEquipmentBaseClass
      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 ProcessEquipmentBaseClass
      Parameters:
      cfg - report configuration
      Returns:
      json string
    • validateSetup

      public ValidationResult validateSetup()
      Validate the process equipment before execution.

      Checks for common setup errors:

      • Equipment has a valid name
      • Input streams connected
      • Operating parameters in valid ranges

      Validates the tank setup before execution. Checks that:

      • Equipment has a valid name
      • At least one inlet stream is connected
      • Tank volume is positive
      • Liquid level is within valid range
      Returns:
      validation result with errors and warnings