Class ThreePhaseSeparator

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

public class ThreePhaseSeparator extends Separator

ThreePhaseSeparator 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.
    • waterOutStream

      StreamInterface waterOutStream
    • specifiedStream

      String specifiedStream
    • gasInAqueous

      double gasInAqueous
    • gasInAqueousSpec

      String gasInAqueousSpec
    • gasInOil

      double gasInOil
    • gasInOilSpec

      String gasInOilSpec
    • oilInGas

      double oilInGas
    • oilInGasSpec

      String oilInGasSpec
    • oilInAqueous

      double oilInAqueous
    • oilInAqueousSpec

      String oilInAqueousSpec
    • aqueousInGas

      double aqueousInGas
    • aqueousInGasSpec

      String aqueousInGasSpec
    • aqueousInOil

      double aqueousInOil
    • aqueousInOilSpec

      String aqueousInOilSpec
    • useTempMultiPhaseCheck

      boolean useTempMultiPhaseCheck
    • lastEnthalpy

      private double lastEnthalpy
    • lastFlowRate

      private double lastFlowRate
    • lastPressure

      private double lastPressure
    • waterLevel

      private double waterLevel
      Water level height in meters (bottom of separator to water-oil interface).
    • oilLevel

      private double oilLevel
      Oil level height in meters (bottom of separator to top of oil phase).
    • gasOutletFlowFraction

      private double gasOutletFlowFraction
      Gas outlet valve flow fraction (0.0 = fully closed, 1.0 = fully open).
    • oilOutletFlowFraction

      private double oilOutletFlowFraction
      Oil outlet valve flow fraction (0.0 = fully closed, 1.0 = fully open).
    • waterOutletFlowFraction

      private double waterOutletFlowFraction
      Water outlet valve flow fraction (0.0 = fully closed, 1.0 = fully open).
  • Constructor Details

    • ThreePhaseSeparator

      public ThreePhaseSeparator(String name)
      Constructor for ThreePhaseSeparator.
      Parameters:
      name - name of separator
    • ThreePhaseSeparator

      public ThreePhaseSeparator(String name, StreamInterface inletStream)

      Constructor for ThreePhaseSeparator.

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

    • setEntrainment

      public void setEntrainment(double val, String specType, String specifiedStream, String phaseFrom, String phaseTo)

      setEntrainment.

      Overrides:
      setEntrainment in class Separator
      Parameters:
      val - a double
      specType - a String object
      specifiedStream - a String object
      phaseFrom - a String object
      phaseTo - a String object
    • setInletStream

      public void setInletStream(StreamInterface inletStream)

      setInletStream.

      Overrides:
      setInletStream in class Separator
      Parameters:
      inletStream - a StreamInterface object
    • getWaterOutStream

      public StreamInterface getWaterOutStream()

      Getter for the field waterOutStream.

      Returns:
      a StreamInterface object
    • getOilOutStream

      public StreamInterface getOilOutStream()

      getOilOutStream.

      Returns:
      a StreamInterface object
    • setWaterLevel

      public void setWaterLevel(double level)
      Set the water level (height from bottom of separator to water-oil interface).
      Parameters:
      level - water level in meters
    • getWaterLevel

      public double getWaterLevel()
      Get the water level (height from bottom of separator to water-oil interface).
      Returns:
      water level in meters
    • setOilLevel

      public void setOilLevel(double level)
      Set the oil level (height from bottom of separator to top of oil phase).
      Parameters:
      level - oil level in meters
    • getOilLevel

      public double getOilLevel()
      Get the oil level (height from bottom of separator to top of oil phase).
      Returns:
      oil level in meters
    • getOilThickness

      public double getOilThickness()
      Get the oil phase thickness (oil level minus water level).
      Returns:
      oil thickness in meters
    • setGasOutletFlowFraction

      public void setGasOutletFlowFraction(double fraction)
      Set the gas outlet valve flow fraction (simulates valve position).
      Parameters:
      fraction - flow fraction (0.0 = fully closed, 1.0 = fully open)
    • getGasOutletFlowFraction

      public double getGasOutletFlowFraction()
      Get the gas outlet valve flow fraction.
      Returns:
      flow fraction (0.0 = fully closed, 1.0 = fully open)
    • setOilOutletFlowFraction

      public void setOilOutletFlowFraction(double fraction)
      Set the oil outlet valve flow fraction (simulates valve position).
      Parameters:
      fraction - flow fraction (0.0 = fully closed, 1.0 = fully open)
    • getOilOutletFlowFraction

      public double getOilOutletFlowFraction()
      Get the oil outlet valve flow fraction.
      Returns:
      flow fraction (0.0 = fully closed, 1.0 = fully open)
    • setWaterOutletFlowFraction

      public void setWaterOutletFlowFraction(double fraction)
      Set the water outlet valve flow fraction (simulates valve position).
      Parameters:
      fraction - flow fraction (0.0 = fully closed, 1.0 = fully open)
    • getWaterOutletFlowFraction

      public double getWaterOutletFlowFraction()
      Get the water outlet valve flow fraction.
      Returns:
      flow fraction (0.0 = fully closed, 1.0 = fully open)
    • updateLiquidLevelFromWaterAndOil

      private void updateLiquidLevelFromWaterAndOil()
      Updates the parent class liquidLevel based on water and oil levels.
    • updateWaterAndOilLevelsFromPhases

      private void updateWaterAndOilLevelsFromPhases()
      Updates water and oil levels from phase volumes in the thermodynamic system.
    • 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 Separator
      Parameters:
      id - UUID
    • initializeTransientCalculation

      public void initializeTransientCalculation()
      Initializes three-phase separator for transient calculations.
      Overrides:
      initializeTransientCalculation in class Separator
    • 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.
      Specified by:
      runTransient in interface SimulationInterface
      Overrides:
      runTransient in class Separator
      Parameters:
      dt - Delta time [s]
      id - Calculation identifier
    • setTempPres

      public void setTempPres(double temp, double pres)

      setTempPres.

      Overrides:
      setTempPres in class Separator
      Parameters:
      temp - a double
      pres - a double
    • displayResult

      public void displayResult()

      displayResult.

      Specified by:
      displayResult in interface ProcessEquipmentInterface
      Overrides:
      displayResult in class Separator
    • getEntropyProduction

      public double getEntropyProduction(String unit)

      getEntropyProduction.

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

      public double getMassBalance(String unit)

      getMassBalance.

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

      public double getExergyChange(String unit, double surroundingTemperature)
      Get exergy change production of the process equipment.
      Specified by:
      getExergyChange in interface ProcessEquipmentInterface
      Overrides:
      getExergyChange in class Separator
      Parameters:
      unit - Supported units are J and kJ
      surroundingTemperature - The surrounding temperature in Kelvin
      Returns:
      change in exergy in specified 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 Separator
      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 Separator
      Parameters:
      cfg - report configuration
      Returns:
      json string