Class ThrottlingValve
- All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, 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 booleanFlag indicating if valve has been auto-sized.private final Map<String, CapacityConstraint> Storage for capacity constraints.private doubleprivate static final doubleDefault design opening percentage for valve sizing (50% for good control range).private doubleprivate boolean(package private) booleanprivate booleanprivate double(package private) static org.apache.logging.log4j.LoggerLogger object for class.private doubleMaximum design AIV (Acoustic-Induced Vibration) power level in kW.private doubleprivate doubleprivate static final doubleMinimum design Cv when flow is zero or very low.private 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 TypeMethodDescriptionvoidaddCapacityConstraint(CapacityConstraint constraint) Adds a new capacity constraint to this equipment.private 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 voidvoidautoSize()Automatically size using default safety factor (1.2 = 20% margin).voidautoSize(double safetyFactor) Auto-sizes the valve based on current flow conditions.voidautoSize(double safetyFactor, double designOpeningPercent) Auto-sizes the valve based on current flow conditions with specified design opening.voidAutomatically size using company-specific design standards.voidcalcKv()calcKv.doubleCalculate Acoustic-Induced Vibration (AIV) power level.doublecalculateAIVLikelihoodOfFailure(double downstreamDiameter, double downstreamThickness) Calculate AIV Likelihood of Failure based on acoustic power and downstream pipe geometry.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) voidClears all capacity constraints from this equipment.voiddisplayResult.private doubleensureValidMolarFlow(double flow) private doubleestimateCvForZeroFlowValve(double safetyFactor) Estimates Cv for a valve with zero or negligible flow.private doubleestimateCvFromFlow(double flowRateKghr) Estimates Cv from flow rate using simplified correlation.Gets the constraint with the highest utilization (the bottleneck).Gets all capacity constraints defined for this equipment.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.doubleGet maximum design AIV power level.doubleGets the maximum valve opening in percent.doubleGets the maximum utilization across all constraints.Get amechanicalDesignfor the equipment.doubleGets the minimum valve opening in percent.doubleReturns the configured opening travel time (seconds).doubleGet outlet pressure of twoport.doublegetPercentValveOpening.String[][]getResultTable.Get a detailed sizing report after auto-sizing.Get sizing report as JSON for programmatic access.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.protected voidInitializes default capacity constraints for the valve.voidInitialize ainitMechanicalDesignfor the equipment.booleanisAcceptNegativeDP.booleanisAllowChoked.booleanisAllowLaminar.booleanCheck if equipment has been auto-sized.booleanChecks if any capacity constraint is violated (exceeds 100% utilization).booleanisGasValve.booleanChecks if any HARD constraint limit is exceeded.booleanisIsoThermal.private booleanisNegligibleFlow(double flow) booleanisValveKvSet.booleanCheck if process equipment needs recalculating.booleanremoveCapacityConstraint(String constraintName) Removes a capacity constraint by name.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.voidsetMaxDesignAIV(double aivKW) Set maximum design AIV power level for capacity constraints.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, setOutletTemperature, validateSetupMethods inherited from class ProcessEquipmentBaseClass
copy, equals, getConditionAnalysisMessage, getController, getEffectiveCapacityFactor, getEnergyStream, getFailureMode, getMassBalance, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getSpecification, getTemperature, getTemperature, hashCode, isActive, isActive, isCapacityAnalysisEnabled, isFailed, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, 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 CapacityConstrainedEquipment
disableAllConstraints, enableAllConstraints, getAvailableMargin, getAvailableMarginPercent, getMaxUtilizationPercent, getUtilizationSummary, isCapacityAnalysisEnabled, isNearCapacityLimit, setCapacityAnalysisEnabledMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
equals, getConditionAnalysisMessage, getController, getExergyChange, getFluid, getMassBalance, getMassBalance, getOperatingEnvelopeViolation, getPressure, getPressure, getReport_json, getRestCapacity, getSimulationValidationErrors, getSpecification, getTemperature, getTemperature, hashCode, isSimulationValid, isWithinOperatingEnvelope, 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, setOutletTemperature, setOutPressure, setOutPressure, setOutTemperature, setOutTemperature
-
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 -
autoSized
private boolean autoSizedFlag indicating if valve has been auto-sized. -
maxDesignAIV
private double maxDesignAIVMaximum design AIV (Acoustic-Induced Vibration) power level in kW. -
minimumMolarFlow
private static final double minimumMolarFlow- See Also:
-
capacityConstraints
Storage for capacity constraints. -
DESIGN_OPENING_PERCENT
private static final double DESIGN_OPENING_PERCENTDefault design opening percentage for valve sizing (50% for good control range).- See Also:
-
MIN_DEFAULT_CV
private static final double MIN_DEFAULT_CVMinimum design Cv when flow is zero or very low.- 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
setOutletPressure.
- Specified by:
setOutletPressurein interfaceTwoPortInterface- Overrides:
setOutletPressurein classTwoPortEquipment- Parameters:
pressure- a doubleunit- aStringobject
-
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
-
getMaximumValveOpening
public double getMaximumValveOpening()Gets the maximum valve opening in percent.- Returns:
- maximum valve opening percentage (0 to 100)
-
getMinimumValveOpening
public double getMinimumValveOpening()Gets the minimum valve opening in percent.- Returns:
- minimum valve opening percentage (0 to 100)
-
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
-
calculateAIV
public double calculateAIV()Calculate Acoustic-Induced Vibration (AIV) power level.AIV is most significant at control valves where high pressure drops occur. The acoustic power generated is a function of mass flow rate, pressure drop, and temperature. This method implements the Energy Institute Guidelines formula for AIV screening.
AIV Power Level interpretation (per Energy Institute Guidelines):
- < 1 kW: Low risk - no special measures required
- 1 - 10 kW: Medium risk - screening required
- 10 - 25 kW: High risk - detailed assessment required
- > 25 kW: Very high risk - design modifications needed
- Returns:
- AIV acoustic power level in kW
-
calculateAIVLikelihoodOfFailure
public double calculateAIVLikelihoodOfFailure(double downstreamDiameter, double downstreamThickness) Calculate AIV Likelihood of Failure based on acoustic power and downstream pipe geometry.AIV LOF interpretation:
- < 0.3: Low risk
- 0.3 - 0.5: Medium risk - monitoring recommended
- 0.5 - 0.7: High risk - detailed assessment required
- > 0.7: Very high risk - design changes needed
- Parameters:
downstreamDiameter- downstream pipe diameter in metersdownstreamThickness- downstream pipe wall thickness in meters- Returns:
- AIV likelihood of failure (0.0-1.0)
-
setMaxDesignAIV
public void setMaxDesignAIV(double aivKW) Set maximum design AIV power level for capacity constraints.- Parameters:
aivKW- maximum AIV power level in kW
-
getMaxDesignAIV
public double getMaxDesignAIV()Get maximum design AIV power level.- Returns:
- maximum AIV power level in kW
-
initializeCapacityConstraints
protected void initializeCapacityConstraints()Initializes default capacity constraints for the valve.NOTE: All constraints are disabled by default for backwards compatibility. Enable specific constraints when valve capacity analysis is needed (e.g., when Cv has been sized).
-
getCapacityConstraints
Gets all capacity constraints defined for this equipment.The map keys are constraint names (e.g., "speed", "gasLoadFactor") and values are the corresponding CapacityConstraint objects containing design values, current values, and utilization calculations.
- Specified by:
getCapacityConstraintsin interfaceCapacityConstrainedEquipment- Returns:
- unmodifiable map of constraint name to CapacityConstraint
-
getBottleneckConstraint
Gets the constraint with the highest utilization (the bottleneck).This method identifies which constraint is closest to or exceeding its design limit. Use this to determine what is limiting equipment capacity.
- Specified by:
getBottleneckConstraintin interfaceCapacityConstrainedEquipment- Returns:
- the bottleneck constraint, or null if no constraints are defined
-
isCapacityExceeded
public boolean isCapacityExceeded()Checks if any capacity constraint is violated (exceeds 100% utilization).A violated constraint means the equipment is operating beyond its design capacity. For HARD constraints, this may indicate equipment trip or failure. For SOFT constraints, this indicates reduced efficiency or accelerated wear.
- Specified by:
isCapacityExceededin interfaceCapacityConstrainedEquipment- Returns:
- true if any constraint utilization exceeds 1.0 (100%)
-
isHardLimitExceeded
public boolean isHardLimitExceeded()Checks if any HARD constraint limit is exceeded.HARD limits represent absolute equipment limits (e.g., maximum speed) that cannot be exceeded without equipment trip or damage. This is more severe than general capacity exceedance.
- Specified by:
isHardLimitExceededin interfaceCapacityConstrainedEquipment- Returns:
- true if any HARD constraint's max value is exceeded
-
getMaxUtilization
public double getMaxUtilization()Gets the maximum utilization across all constraints.This gives a single number representing how close the equipment is to its limiting constraint. Values above 1.0 indicate the equipment is over capacity.
- Specified by:
getMaxUtilizationin interfaceCapacityConstrainedEquipment- Returns:
- maximum utilization as fraction (1.0 = 100% of design capacity)
-
addCapacityConstraint
Adds a new capacity constraint to this equipment.This allows dynamic addition of constraints at runtime. Constraints can be added during equipment configuration or based on operating conditions.
- Specified by:
addCapacityConstraintin interfaceCapacityConstrainedEquipment- Parameters:
constraint- the constraint to add
-
removeCapacityConstraint
Removes a capacity constraint by name.- Specified by:
removeCapacityConstraintin interfaceCapacityConstrainedEquipment- Parameters:
constraintName- the name of the constraint to remove- Returns:
- true if the constraint was found and removed
-
clearCapacityConstraints
public void clearCapacityConstraints()Clears all capacity constraints from this equipment.- Specified by:
clearCapacityConstraintsin interfaceCapacityConstrainedEquipment
-
autoSize
public void autoSize(double safetyFactor) Auto-sizes the valve based on current flow conditions.This method calculates the required Cv value so that the valve operates at approximately 50% opening at the current flow rate. This provides good control range - the valve can open further for higher flows or close for lower flows.
Design philosophy:
- At normal flow, valve should be at ~50% opening (design point)
- Maximum Cv (100% opening) = Cv needed at 50% opening * 2 (approximately)
- This gives control range from ~25% to 100% opening for typical flow variations
- For zero flow valves (bypass, emergency), uses minimum default Cv or estimates from connected equipment
- Specified by:
autoSizein interfaceAutoSizeable- Parameters:
safetyFactor- safety factor to apply (e.g., 1.2 for 20% margin)
-
autoSize
public void autoSize(double safetyFactor, double designOpeningPercent) Auto-sizes the valve based on current flow conditions with specified design opening.- Parameters:
safetyFactor- safety factor to apply (e.g., 1.2 for 20% margin)designOpeningPercent- the target valve opening percentage at design flow (typically 50%)
-
estimateCvFromFlow
private double estimateCvFromFlow(double flowRateKghr) Estimates Cv from flow rate using simplified correlation.This is a rough estimate when the standard calculation fails. Uses typical valve sizing rules of thumb.
- Parameters:
flowRateKghr- mass flow rate in kg/hr- Returns:
- estimated Cv value
-
estimateCvForZeroFlowValve
private double estimateCvForZeroFlowValve(double safetyFactor) Estimates Cv for a valve with zero or negligible flow.For valves like bypass valves, emergency relief valves, or startup valves that normally have no flow, this method estimates an appropriate Cv based on:
- Connected stream design conditions (if available)
- Pressure drop across the valve
- Default minimum values based on valve type
- Parameters:
safetyFactor- safety factor to apply- Returns:
- estimated design Cv
-
autoSize
public void autoSize()Automatically size using default safety factor (1.2 = 20% margin).- Specified by:
autoSizein interfaceAutoSizeable
-
autoSize
Automatically size using company-specific design standards.This method applies design rules from the specified company's technical requirements (TR) documents. The standards are loaded from the NeqSim design database.
- Specified by:
autoSizein interfaceAutoSizeable- Parameters:
company- company name (e.g., "Equinor", "Shell", "TotalEnergies")trDocument- TR document reference (e.g., "TR2000", "DEP-31.38.01.11")
-
isAutoSized
public boolean isAutoSized()Check if equipment has been auto-sized.- Specified by:
isAutoSizedin interfaceAutoSizeable- Returns:
- true if autoSize() has been called successfully
-
getSizingReport
Get a detailed sizing report after auto-sizing.The report includes:
- Design basis (flow rates, pressures, temperatures)
- Calculated dimensions
- Design parameters (K-factor, Cv, velocity, etc.)
- Safety margins
- Specified by:
getSizingReportin interfaceAutoSizeable- Returns:
- formatted sizing report string
-
getSizingReportJson
Get sizing report as JSON for programmatic access.- Specified by:
getSizingReportJsonin interfaceAutoSizeable- Returns:
- JSON string with sizing data
-