Class SafetyValve
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, ValveInterface, SimulationInterface, NamedInterface
SafetyValve class.
- Version:
- $Id: $Id
- Author:
- esol
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSupported fluid service categories used for selecting the sizing strategy.static final classImmutable description of a relieving scenario.static enumAvailable sizing standards for the relieving calculations. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate doubleprivate doubleprivate booleanprivate doubleprivate final List<SafetyValve.RelievingScenario> private static final longSerialization version UID.Fields inherited from class ThrottlingValve
isCalcPressure, logger, molarFlow, pressure, thermoSystem, valveMechanicalDesignFields inherited from class TwoPortEquipment
inStream, outStreamFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionSafetyValve(String name) Constructor for SafetyValve.SafetyValve(String name, StreamInterface inletStream) Constructor for SafetyValve. -
Method Summary
Modifier and TypeMethodDescriptionaddScenario(SafetyValve.RelievingScenario scenario) Adds a relieving scenario definition to the valve.voidRemoves all relieving scenarios from the valve.voidEnsures that at least one scenario exists by creating a default vapor relieving scenario when no user supplied definitions are present.Returns the active relieving scenario orOptional.empty()if no scenario is active.doubleGetter for the fieldblowdownPressure.doubleGetter for the fieldfullOpenPressure.doubleGetter for the fieldpressureSpec.voidInitialize ainitMechanicalDesignfor the equipment.voidrunTransient(double dt, UUID id) runTransientvoidsetActiveScenario(String name) Sets the active relieving scenario by name.voidsetBlowdown(double blowdownPercent) Sets the blowdown as a percentage of set pressure.voidsetBlowdownPressure(double blowdownPressure) Setter for the fieldblowdownPressure.voidsetFullOpenPressure(double fullOpenPressure) Setter for the fieldfullOpenPressure.voidsetPressureSpec(double pressureSpec) Setter for the fieldpressureSpec.voidsetRelievingScenarios(List<SafetyValve.RelievingScenario> scenarios) Replace the relieving scenarios with the provided collection.Methods inherited from class ThrottlingValve
calcKv, calculateMolarFlow, calculateOutletPressure, displayResult, getCapacityDuty, getCapacityMax, getCg, getClosingTravelTime, getCv, getCv, getDeltaPressure, getDeltaPressure, getEntropyProduction, getExergyChange, getFp, getInletPressure, getKv, getMechanicalDesign, getOpeningTravelTime, getOutletPressure, getPercentValveOpening, getResultTable, getTargetPercentValveOpening, getThermoSystem, getTravelModel, getTravelTime, getTravelTimeConstant, isAcceptNegativeDP, isAllowChoked, isAllowLaminar, isGasValve, isIsoThermal, isValveKvSet, needRecalculation, run, runController, setAcceptNegativeDP, setAllowChoked, setAllowLaminar, setClosingTravelTime, setCv, setCv, setDeltaPressure, setFp, setGasValve, setIsCalcOutPressure, setIsoThermal, setKv, setMaximumValveOpening, setMinimumValveOpening, setOpeningTravelTime, setOutletPressure, setOutletPressure, setPercentValveOpening, setPressure, setPressure, setTargetPercentValveOpening, setTravelModel, setTravelTime, setTravelTimeConstant, setValveKvSet, toJson, toJsonMethods inherited from class TwoPortEquipment
getInletStream, getInletTemperature, getMassBalance, getOutletStream, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, setOutletStream, setOutletTemperature, validateSetupMethods inherited from class ProcessEquipmentBaseClass
copy, equals, getConditionAnalysisMessage, getController, getEnergyStream, getMassBalance, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getSpecification, getTemperature, getTemperature, hashCode, isActive, isActive, isSetEnergyStream, reportResults, run_step, runConditionAnalysis, setController, setEnergyStream, setEnergyStream, setFlowValveController, setMinimumFlow, setRegulatorOutSignal, setSpecification, setTemperature, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
equals, getConditionAnalysisMessage, getController, getExergyChange, getFluid, getMassBalance, getMassBalance, getPressure, getPressure, getReport_json, getRestCapacity, getSpecification, getTemperature, getTemperature, hashCode, reportResults, runConditionAnalysis, setController, setRegulatorOutSignal, setSpecification, setTemperature, validateSetupMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, run_step, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solvedMethods inherited from interface TwoPortInterface
getInletStream, getInletTemperature, getInStream, getOutletStream, getOutletTemperature, getOutStream, setInletPressure, setInletStream, setInletTemperature, setOutletStream, setOutletTemperature
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
pressureSpec
private double pressureSpec -
fullOpenPressure
private double fullOpenPressure -
blowdownPressure
private double blowdownPressure -
isValveOpen
private boolean isValveOpen -
relievingScenarios
-
activeScenarioName
-
-
Constructor Details
-
Method Details
-
initMechanicalDesign
public void initMechanicalDesign()Initialize a
initMechanicalDesignfor the equipment.- Specified by:
initMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
initMechanicalDesignin classThrottlingValve
-
addScenario
Adds a relieving scenario definition to the valve.- Parameters:
scenario- the scenario to add- Returns:
- the current valve instance for chaining
-
setRelievingScenarios
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
- Returns:
- immutable view of configured scenarios
-
setActiveScenario
Sets the active relieving scenario by name. If the scenario does not exist the active definition is not changed.- Parameters:
name- scenario identifier
-
getActiveScenarioName
-
getActiveScenario
Returns the active relieving scenario orOptional.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
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:
runTransientin interfaceSimulationInterface- Overrides:
runTransientin classThrottlingValve- Parameters:
dt- Delta time [s]id- Calculation identifier
-