Class SafetyValve

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

public class SafetyValve extends ThrottlingValve

SafetyValve class.

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

    • serialVersionUID

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

      private double pressureSpec
    • fullOpenPressure

      private double fullOpenPressure
    • blowdownPressure

      private double blowdownPressure
    • isValveOpen

      private boolean isValveOpen
    • relievingScenarios

      private final List<SafetyValve.RelievingScenario> relievingScenarios
    • activeScenarioName

      private String activeScenarioName
  • Constructor Details

    • SafetyValve

      public SafetyValve(String name)
      Constructor for SafetyValve.
      Parameters:
      name - name of valve
    • SafetyValve

      public SafetyValve(String name, StreamInterface inletStream)

      Constructor for SafetyValve.

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

    • initMechanicalDesign

      public void initMechanicalDesign()

      Initialize a initMechanicalDesign for the equipment.

      Specified by:
      initMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      initMechanicalDesign in class ThrottlingValve
    • addScenario

      public SafetyValve addScenario(SafetyValve.RelievingScenario scenario)
      Adds a relieving scenario definition to the valve.
      Parameters:
      scenario - the scenario to add
      Returns:
      the current valve instance for chaining
    • setRelievingScenarios

      public void setRelievingScenarios(List<SafetyValve.RelievingScenario> scenarios)
      Replace the relieving scenarios with the provided collection.
      Parameters:
      scenarios - scenarios to store on the valve
    • clearRelievingScenarios

      public void clearRelievingScenarios()
      Removes all relieving scenarios from the valve.
    • getRelievingScenarios

      public List<SafetyValve.RelievingScenario> getRelievingScenarios()
      Returns:
      immutable view of configured scenarios
    • setActiveScenario

      public void setActiveScenario(String name)
      Sets the active relieving scenario by name. If the scenario does not exist the active definition is not changed.
      Parameters:
      name - scenario identifier
    • getActiveScenarioName

      public Optional<String> getActiveScenarioName()
      Returns:
      the name of the active scenario, if any
    • getActiveScenario

      public Optional<SafetyValve.RelievingScenario> getActiveScenario()
      Returns the active relieving scenario or Optional.empty() if no scenario is active.
      Returns:
      optional containing the active scenario
    • ensureDefaultScenario

      public void ensureDefaultScenario()
      Ensures that at least one scenario exists by creating a default vapor relieving scenario when no user supplied definitions are present.
    • getPressureSpec

      public double getPressureSpec()

      Getter for the field pressureSpec.

      Returns:
      the pressureSpec
    • setPressureSpec

      public void setPressureSpec(double pressureSpec)

      Setter for the field pressureSpec.

      Parameters:
      pressureSpec - the pressureSpec to set
    • getFullOpenPressure

      public double getFullOpenPressure()

      Getter for the field fullOpenPressure.

      Returns:
      the fullOpenPressure
    • setFullOpenPressure

      public void setFullOpenPressure(double fullOpenPressure)

      Setter for the field fullOpenPressure.

      Parameters:
      fullOpenPressure - the fullOpenPressure to set
    • getBlowdownPressure

      public double getBlowdownPressure()

      Getter for the field blowdownPressure.

      Returns:
      the blowdownPressure
    • setBlowdownPressure

      public void setBlowdownPressure(double blowdownPressure)

      Setter for the field blowdownPressure.

      Parameters:
      blowdownPressure - the blowdownPressure to set (pressure at which PSV reseats)
    • setBlowdown

      public void setBlowdown(double blowdownPercent)
      Sets the blowdown as a percentage of set pressure. Typical values: 7-10% for gas service, 10-20% for liquid service.
      Parameters:
      blowdownPercent - percentage below set pressure (e.g., 10.0 for 10% blowdown)
    • 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 ThrottlingValve
      Parameters:
      dt - Delta time [s]
      id - Calculation identifier