Class ThrottlingValve
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, ValveInterface, SimulationInterface, NamedInterface
- Direct Known Subclasses:
BlowdownValve, CheckValve, ControlValve, ESDValve, HIPPSValve, PressureDrop, PSDValve, RuptureDisk, SafetyReliefValve, SafetyValve
ThrottlingValve class.
- Version:
- $Id: $Id
- Author:
- esol
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate booleanprivate doubleprivate doubleprivate boolean(package private) booleanprivate booleanprivate double(package private) static org.apache.logging.log4j.LoggerLogger object for class.private doubleprivate doubleprivate static final doubleprivate doubleprivate double(package private) doubleprivate double(package private) doubleprivate Stringprivate doubleprivate static final longSerialization version UID.(package private) SystemInterfaceprivate ValveTravelModelprivate doubleprivate boolean(package private) ValveMechanicalDesignprivate doubleprivate doubleprivate doubleprivate doubleFields 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
ConstructorsConstructorDescriptionThrottlingValve(String name) * Constructor for ThrottlingValve.ThrottlingValve(String name, StreamInterface inletStream) Constructor for ThrottlingValve. -
Method Summary
Modifier and TypeMethodDescriptionprivate doubleadjustKv(double Kv, double percentValveOpening) Adjusts the flow coefficient (Kv) based on the percentage valve opening.private doubleapplyTravelDynamics(double current, double target, double dt) private voidvoidcalcKv()calcKv.doubleCalculates molar flow for a gas based on IEC 60534 standards.doublecalculateOutletPressure(double KvAdjusted) Calculates the outlet pressure based on the adjusted Kv value.private doubleclampValveOpening(double value) voiddisplayResult.private doubleensureValidMolarFlow(double flow) doublegetCapacityDuty.doublegetCapacityMax.doublegetCg()getCg.doubleReturns the configured closing travel time (seconds).doublegetCv()getCv.doublegetCv.doubleGetter for the fielddeltaPressure.doublegetDeltaPressure(String unit) getDeltaPressure.private doubleprivate doubledoublegetEntropyProduction(String unit) getEntropyProduction.doublegetExergyChange(String unit, double surroundingTemperature) Get exergy change production of the process equipment.doublegetFp()getFp.doubleGet inlet pressure of twoport.doublegetKv()Gets the Kv (metric flow coefficient) of the valve.Get amechanicalDesignfor the equipment.doubleReturns the configured opening travel time (seconds).doubleGet outlet pressure of twoport.doublegetPercentValveOpening.String[][]getResultTable.doubleReturns the requested (target) valve opening before dynamic travel limitations are applied.getThermoSystem.Returns the current valve travel model.doubleReturns the configured full travel time (seconds) for the valve.doubleReturns the configured time constant (seconds) for first-order travel dynamics.voidInitialize ainitMechanicalDesignfor the equipment.booleanisAcceptNegativeDP.booleanisAllowChoked.booleanisAllowLaminar.booleanisGasValve.booleanisIsoThermal.private booleanisNegligibleFlow(double flow) booleanisValveKvSet.booleanCheck if process equipment needs recalculating.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunController(double dt, UUID id) runController.voidrunTransient(double dt, UUID id) runTransientvoidsetAcceptNegativeDP(boolean acceptNegativeDP) Setter for the fieldacceptNegativeDP.voidsetAllowChoked(boolean allowChoked) Setter for the fieldallowChoked.voidsetAllowLaminar(boolean allowLaminar) Setter for the fieldallowLaminar.voidsetClosingTravelTime(double travelTimeSec) Sets the travel time for closing actions (seconds).voidsetCv(double Cv) setCv.voidsetCv.voidsetDeltaPressure(double deltaPressure, String unit) Setter for the fielddeltaPressure.voidsetFp(double fp) setFp.voidsetGasValve(boolean gasValve) Setter for the fieldgasValve.voidsetIsCalcOutPressure(boolean isSetPres) setIsCalcOutPressure.voidsetIsoThermal(boolean isoThermal) setIsoThermal.voidsetKv(double Kv) Sets the Kv (metric flow coefficient) of the valve.voidsetMaximumValveOpening(double maxopen) Sets the maximum valve opening in percent.voidsetMinimumValveOpening(double minopen) setMinimumValveOpening.voidsetOpeningTravelTime(double travelTimeSec) Sets the travel time for opening actions (seconds).voidsetOutletPressure(double pressure) Set outlet pressure of twoport.voidsetOutletPressure(double pressure, String unit) setOutletPressure.voidsetPercentValveOpening(double percentValveOpening) setPercentValveOpening.voidsetPressure(double pressure) Setter for the fieldpressure.voidsetPressure(double pressure, String unit) Setter for the fieldpressure.voidsetTargetPercentValveOpening(double percentValveOpening) Sets the requested (target) valve opening in percent.voidsetTravelModel(ValveTravelModel travelModel) Sets the valve travel model used to translate requested opening to actual position.voidsetTravelTime(double travelTimeSec) Sets the total travel time (seconds) corresponding to a movement from fully closed to fully open.voidsetTravelTimeConstant(double timeConstantSec) Sets the time constant (seconds) for first-order travel dynamics.voidsetValveKvSet(boolean valveKvSet) Setter for the fieldvalveKvSet.toJson()Serializes the Process Equipment along with its state to a JSON string.toJson(ReportConfig cfg) Serializes the Process Equipment with configurable level of detail.Methods 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:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
thermoSystem
SystemInterface thermoSystem -
valveKvSet
private boolean valveKvSet -
isoThermal
private boolean isoThermal -
pressure
double pressure -
Kv
private double Kv -
maxMolarFlow
private double maxMolarFlow -
minMolarFlow
private double minMolarFlow -
maxValveOpening
private double maxValveOpening -
minValveOpening
private double minValveOpening -
percentValveOpening
private double percentValveOpening -
requestedValveOpening
private double requestedValveOpening -
valveTravelTimeSec
private double valveTravelTimeSec -
valveOpeningTravelTimeSec
private double valveOpeningTravelTimeSec -
valveClosingTravelTimeSec
private double valveClosingTravelTimeSec -
valveTimeConstantSec
private double valveTimeConstantSec -
travelModel
-
molarFlow
double molarFlow -
pressureUnit
-
acceptNegativeDP
private boolean acceptNegativeDP -
valveMechanicalDesign
ValveMechanicalDesign valveMechanicalDesign -
isCalcPressure
boolean isCalcPressure -
gasValve
private boolean gasValve -
Fp
private double Fp -
deltaPressure
private double deltaPressure -
allowChoked
private boolean allowChoked -
allowLaminar
private boolean allowLaminar -
xt
private double xt -
minimumMolarFlow
private static final double minimumMolarFlow- See Also:
-
-
Constructor Details
-
ThrottlingValve
* Constructor for ThrottlingValve.- Parameters:
name- name of valve
-
ThrottlingValve
Constructor for ThrottlingValve.
- Parameters:
name- aStringobjectinletStream- aStreamInterfaceobject
-
-
Method Details
-
getDeltaPressure
-
getCapacityDuty
public double getCapacityDuty()getCapacityDuty.
- Specified by:
getCapacityDutyin interfaceProcessEquipmentInterface- Returns:
- a double
-
getCapacityMax
public double getCapacityMax()getCapacityMax.
- Specified by:
getCapacityMaxin interfaceProcessEquipmentInterface- Returns:
- a double
-
getOutletPressure
public double getOutletPressure()Get outlet pressure of twoport.- Specified by:
getOutletPressurein interfaceTwoPortInterface- Overrides:
getOutletPressurein classTwoPortEquipment- Returns:
- outlet pressure of TwoPortEquipment in unit bara
-
getThermoSystem
getThermoSystem.
- Specified by:
getThermoSystemin interfaceProcessEquipmentInterface- Specified by:
getThermoSystemin interfaceValveInterface- Overrides:
getThermoSystemin classProcessEquipmentBaseClass- Returns:
- a
SystemInterfaceobject
-
getInletPressure
public double getInletPressure()Get inlet pressure of twoport.- Specified by:
getInletPressurein interfaceTwoPortInterface- Overrides:
getInletPressurein classTwoPortEquipment- Returns:
- inlet pressure of TwoPortEquipment in unit bara
-
setPressure
public void setPressure(double pressure) Setter for the field
pressure.- Specified by:
setPressurein interfaceProcessEquipmentInterface- Overrides:
setPressurein classProcessEquipmentBaseClass- Parameters:
pressure- a double
-
setPressure
-
setOutletPressure
public void setOutletPressure(double pressure) Set outlet pressure of twoport.- Specified by:
setOutletPressurein interfaceTwoPortInterface- Overrides:
setOutletPressurein classTwoPortEquipment- Parameters:
pressure- value to set in unit bara
-
setOutletPressure
-
needRecalculation
public boolean needRecalculation()Check if process equipment needs recalculating.
- Specified by:
needRecalculationin interfaceProcessEquipmentInterface- Returns:
- true or false
-
calcKv
public void calcKv()calcKv. -
calculateMolarFlow
public double calculateMolarFlow()Calculates molar flow for a gas based on IEC 60534 standards. This method accounts for choked (critical) flow.- Returns:
- Molar flow in mole/sec.
-
calculateOutletPressure
public double calculateOutletPressure(double KvAdjusted) Calculates the outlet pressure based on the adjusted Kv value.- Parameters:
KvAdjusted- the adjusted flow coefficient (Kv)- Returns:
- the calculated outlet pressure
-
adjustKv
private double adjustKv(double Kv, double percentValveOpening) Adjusts the flow coefficient (Kv) based on the percentage valve opening.- Parameters:
Kv- Flow coefficient SI (for 100% opening)percentValveOpening- Percentage valve opening (0 to 100).- Returns:
- Adjusted flow coefficient (Kv)
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Parameters:
id- UUID
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classProcessEquipmentBaseClass
-
getResultTable
getResultTable.
- Specified by:
getResultTablein interfaceProcessEquipmentInterface- Overrides:
getResultTablein classProcessEquipmentBaseClass- Returns:
- an array of
Stringobjects
-
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- Parameters:
dt- Delta time [s]id- Calculation identifier
-
ensureValidMolarFlow
private double ensureValidMolarFlow(double flow) -
isNegligibleFlow
private boolean isNegligibleFlow(double flow) -
applyZeroFlowState
-
runController
runController.
- Parameters:
dt- a doubleid- Calculation identifier
-
clampValveOpening
private double clampValveOpening(double value) -
applyTravelDynamics
private double applyTravelDynamics(double current, double target, double dt) -
getEffectiveOpeningTravelTime
private double getEffectiveOpeningTravelTime() -
getEffectiveClosingTravelTime
private double getEffectiveClosingTravelTime() -
setMinimumValveOpening
public void setMinimumValveOpening(double minopen) setMinimumValveOpening.
- Parameters:
minopen- a double
-
setMaximumValveOpening
public void setMaximumValveOpening(double maxopen) Sets the maximum valve opening in percent.- Parameters:
maxopen- a double representing the maximum permitted opening
-
getKv
public double getKv()Gets the Kv (metric flow coefficient) of the valve.- Specified by:
getKvin interfaceValveInterface- Returns:
- the metric flow coefficient
-
getCv
-
getCv
getCv.
- Specified by:
getCvin interfaceValveInterface- Parameters:
unit- can be SI or US SI is unit litre/minute US is gallons per minute- Returns:
- a double
-
setCv
public void setCv(double Cv) setCv.
- Specified by:
setCvin interfaceValveInterface- Parameters:
Cv- a double
-
setKv
public void setKv(double Kv) Sets the Kv (metric flow coefficient) of the valve.- Specified by:
setKvin interfaceValveInterface- Parameters:
Kv- the metric flow coefficient
-
setCv
setCv.
- Specified by:
setCvin interfaceValveInterface- Parameters:
cv- a doubleunit- can be SI or US SI is unit litre/minute US is gallons per minute
-
setTravelTime
public void setTravelTime(double travelTimeSec) Sets the total travel time (seconds) corresponding to a movement from fully closed to fully open.- Specified by:
setTravelTimein interfaceValveInterface- Parameters:
travelTimeSec- full travel time in seconds
-
getTravelTime
public double getTravelTime()Returns the configured full travel time (seconds) for the valve.- Specified by:
getTravelTimein interfaceValveInterface- Returns:
- full travel time in seconds
-
setOpeningTravelTime
public void setOpeningTravelTime(double travelTimeSec) Sets the travel time for opening actions (seconds). When not specified, the symmetric travel time is used.- Specified by:
setOpeningTravelTimein interfaceValveInterface- Parameters:
travelTimeSec- opening travel time in seconds
-
getOpeningTravelTime
public double getOpeningTravelTime()Returns the configured opening travel time (seconds).- Specified by:
getOpeningTravelTimein interfaceValveInterface- Returns:
- opening travel time in seconds
-
setClosingTravelTime
public void setClosingTravelTime(double travelTimeSec) Sets the travel time for closing actions (seconds). When not specified, the symmetric travel time is used.- Specified by:
setClosingTravelTimein interfaceValveInterface- Parameters:
travelTimeSec- closing travel time in seconds
-
getClosingTravelTime
public double getClosingTravelTime()Returns the configured closing travel time (seconds).- Specified by:
getClosingTravelTimein interfaceValveInterface- Returns:
- closing travel time in seconds
-
setTravelTimeConstant
public void setTravelTimeConstant(double timeConstantSec) Sets the time constant (seconds) for first-order travel dynamics.- Specified by:
setTravelTimeConstantin interfaceValveInterface- Parameters:
timeConstantSec- time constant in seconds
-
getTravelTimeConstant
public double getTravelTimeConstant()Returns the configured time constant (seconds) for first-order travel dynamics.- Specified by:
getTravelTimeConstantin interfaceValveInterface- Returns:
- time constant in seconds
-
setTravelModel
Sets the valve travel model used to translate requested opening to actual position.- Specified by:
setTravelModelin interfaceValveInterface- Parameters:
travelModel- travel model implementation
-
getTravelModel
Returns the current valve travel model.- Specified by:
getTravelModelin interfaceValveInterface- Returns:
- travel model
-
getCg
-
getPercentValveOpening
public double getPercentValveOpening()getPercentValveOpening.
- Specified by:
getPercentValveOpeningin interfaceValveInterface- Returns:
- a double
-
setPercentValveOpening
public void setPercentValveOpening(double percentValveOpening) setPercentValveOpening.
- Specified by:
setPercentValveOpeningin interfaceValveInterface- Parameters:
percentValveOpening- a double
-
getTargetPercentValveOpening
public double getTargetPercentValveOpening()Returns the requested (target) valve opening before dynamic travel limitations are applied.- Specified by:
getTargetPercentValveOpeningin interfaceValveInterface- Returns:
- requested valve opening in percent
-
setTargetPercentValveOpening
public void setTargetPercentValveOpening(double percentValveOpening) Sets the requested (target) valve opening in percent. The actual valve opening may lag the request depending on the selected travel model.- Specified by:
setTargetPercentValveOpeningin interfaceValveInterface- Parameters:
percentValveOpening- target valve opening in percent
-
isValveKvSet
public boolean isValveKvSet()isValveKvSet.
- Returns:
- a boolean
-
setValveKvSet
public void setValveKvSet(boolean valveKvSet) Setter for the field
valveKvSet.- Parameters:
valveKvSet- a boolean
-
isIsoThermal
public boolean isIsoThermal()isIsoThermal.
- Specified by:
isIsoThermalin interfaceValveInterface- Returns:
- a boolean
-
setIsoThermal
public void setIsoThermal(boolean isoThermal) setIsoThermal.
- Specified by:
setIsoThermalin interfaceValveInterface- Parameters:
isoThermal- a boolean
-
getEntropyProduction
getEntropyProduction.
- Specified by:
getEntropyProductionin interfaceProcessEquipmentInterface- Overrides:
getEntropyProductionin classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
getExergyChange
Get exergy change production of the process equipment.- Specified by:
getExergyChangein interfaceProcessEquipmentInterface- Overrides:
getExergyChangein classProcessEquipmentBaseClass- Parameters:
unit- Supported units are J and kJsurroundingTemperature- The surrounding temperature in Kelvin- Returns:
- change in exergy in specified unit
-
isAcceptNegativeDP
public boolean isAcceptNegativeDP()isAcceptNegativeDP.
- Returns:
- a boolean
-
setAcceptNegativeDP
public void setAcceptNegativeDP(boolean acceptNegativeDP) Setter for the field
acceptNegativeDP.- Parameters:
acceptNegativeDP- a boolean
-
initMechanicalDesign
public void initMechanicalDesign()Initialize a
initMechanicalDesignfor the equipment.- Specified by:
initMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
initMechanicalDesignin classProcessEquipmentBaseClass
-
getMechanicalDesign
Get a
mechanicalDesignfor the equipment.- Specified by:
getMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
getMechanicalDesignin classProcessEquipmentBaseClass- Returns:
- a
MechanicalDesignobject
-
setIsCalcOutPressure
public void setIsCalcOutPressure(boolean isSetPres) setIsCalcOutPressure.
- Parameters:
isSetPres- a boolean
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classTwoPortEquipment- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classTwoPortEquipment- Parameters:
cfg- report configuration- Returns:
- json string
-
isGasValve
public boolean isGasValve()isGasValve.
- Returns:
- a boolean
-
setGasValve
public void setGasValve(boolean gasValve) Setter for the field
gasValve.- Parameters:
gasValve- a boolean
-
getFp
public double getFp()getFp.
- Returns:
- a double
-
setFp
public void setFp(double fp) setFp.
- Parameters:
fp- a double
-
getDeltaPressure
public double getDeltaPressure()Getter for the field
deltaPressure.- Returns:
- a double
-
setDeltaPressure
-
isAllowChoked
public boolean isAllowChoked()isAllowChoked.
- Returns:
- a boolean
-
setAllowChoked
public void setAllowChoked(boolean allowChoked) Setter for the field
allowChoked.- Parameters:
allowChoked- a boolean
-
isAllowLaminar
public boolean isAllowLaminar()isAllowLaminar.
- Returns:
- a boolean
-
setAllowLaminar
public void setAllowLaminar(boolean allowLaminar) Setter for the field
allowLaminar.- Parameters:
allowLaminar- a boolean
-