Class ControlValveSizing
- All Implemented Interfaces:
Serializable, ControlValveSizingInterface
- Direct Known Subclasses:
ControlValveSizing_IEC_60534, ControlValveSizing_simple
- Author:
- esol
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) booleanprivate static final doubleprivate static final intprivate static final doubleprivate static final double(package private) ValveMechanicalDesign(package private) double -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for ControlValveSizing.ControlValveSizing(ValveMechanicalDesign valveMechanicalDesign) Constructor for ControlValveSizing. -
Method Summary
Modifier and TypeMethodDescriptiondoublecalcKv(double percentOpening) calcKv.doublecalculateFlowRateFromValveOpening(double actualKv, StreamInterface inletStream, StreamInterface outletStream) calculateFlowRateFromValveOpening.doublecalculateMolarFlow(double actualKv, StreamInterface inStream, StreamInterface outStream) calculateMolarFlow.doublecalculateOutletPressure(double KvAdjusted, StreamInterface inStream) calculateOutletPressure.doublecalculateValveOpeningFromFlowRate(double Q, double actualKv, StreamInterface inletStream, StreamInterface outletStream) calculateValveOpeningFromFlowRate.calcValveSize(double percentOpening) Calculates the valve size based on the fluid properties and operating conditions.private doubleCv_to_Kv(double Cv) doublefindOutletPressureForFixedKv(double actualKv, StreamInterface inletStream) findOutletPressureForFixedKv.Getter for the fieldvalveMechanicalDesign.doublegetxT()Getter for the fieldxT.booleanisAllowChoked.private doubleKv_to_Cv(double Kv) voidsetAllowChoked(boolean allowChoked) setAllowChoked.voidsetxT(double xT) setxT.
-
Field Details
-
valveMechanicalDesign
ValveMechanicalDesign valveMechanicalDesign -
KV_TO_CV_FACTOR
private static final double KV_TO_CV_FACTOR- See Also:
-
SECONDS_PER_HOUR
private static final double SECONDS_PER_HOUR- See Also:
-
MAX_BISECTION_ITERATIONS
private static final int MAX_BISECTION_ITERATIONS- See Also:
-
MAX_VALVE_OPENING_PERCENTAGE
private static final double MAX_VALVE_OPENING_PERCENTAGE- See Also:
-
xT
double xT -
allowChoked
boolean allowChoked
-
-
Constructor Details
-
ControlValveSizing
public ControlValveSizing()Constructor for ControlValveSizing.
-
ControlValveSizing
Constructor for ControlValveSizing.
- Parameters:
valveMechanicalDesign- aValveMechanicalDesignobject
-
-
Method Details
-
getValveMechanicalDesign
Getter for the field
valveMechanicalDesign.- Returns:
- a
ValveMechanicalDesignobject
-
getxT
public double getxT()Getter for the field
xT.- Specified by:
getxTin interfaceControlValveSizingInterface- Returns:
- a double
-
setxT
public void setxT(double xT) setxT.
- Specified by:
setxTin interfaceControlValveSizingInterface- Parameters:
xT- a double
-
isAllowChoked
public boolean isAllowChoked()isAllowChoked.
- Specified by:
isAllowChokedin interfaceControlValveSizingInterface- Returns:
- a boolean
-
setAllowChoked
public void setAllowChoked(boolean allowChoked) setAllowChoked.
- Specified by:
setAllowChokedin interfaceControlValveSizingInterface- Parameters:
allowChoked- a boolean
-
calcValveSize
Calculates the valve size based on the fluid properties and operating conditions.- Specified by:
calcValveSizein interfaceControlValveSizingInterface- Parameters:
percentOpening- a double- Returns:
- a
Mapobject
-
calcKv
public double calcKv(double percentOpening) calcKv.
Calculates valve flow coefficient Kv using simplified formulas:
- For liquids: Kv = Q / sqrt(deltaP / SG) where SG = rho/1000
- For gases: Uses simplified IEC 60534 formula with expansion factor
- Parameters:
percentOpening- valve opening percentage (0-100)- Returns:
- the calculated Kv value
-
calculateFlowRateFromValveOpening
public double calculateFlowRateFromValveOpening(double actualKv, StreamInterface inletStream, StreamInterface outletStream) calculateFlowRateFromValveOpening.
Calculates the flow rate through a control valve based on the valve opening, Kv, and inlet/outlet streams.
- Specified by:
calculateFlowRateFromValveOpeningin interfaceControlValveSizingInterface- Parameters:
actualKv- a doubleinletStream- aStreamInterfaceobjectoutletStream- aStreamInterfaceobject- Returns:
- a double
-
calculateMolarFlow
public double calculateMolarFlow(double actualKv, StreamInterface inStream, StreamInterface outStream) calculateMolarFlow.
Calculates flow rate from valve Kv using IEC 60534 formulas.
- Parameters:
actualKv- the valve flow coefficient at the current openinginStream- inlet streamoutStream- outlet stream- Returns:
- volumetric flow rate in m3/s
-
calculateValveOpeningFromFlowRate
public double calculateValveOpeningFromFlowRate(double Q, double actualKv, StreamInterface inletStream, StreamInterface outletStream) calculateValveOpeningFromFlowRate.
Calculates the required valve opening fraction for a given flow rate, Kv, and inlet/outlet streams.
- Specified by:
calculateValveOpeningFromFlowRatein interfaceControlValveSizingInterface- Parameters:
Q- a doubleactualKv- a doubleinletStream- aStreamInterfaceobjectoutletStream- aStreamInterfaceobject- Returns:
- a double
-
findOutletPressureForFixedKv
findOutletPressureForFixedKv.
Finds the outlet pressure for a given Kv, valve opening, and inlet stream.
- Specified by:
findOutletPressureForFixedKvin interfaceControlValveSizingInterface- Parameters:
actualKv- a doubleinletStream- aStreamInterfaceobject- Returns:
- a double
-
calculateOutletPressure
calculateOutletPressure.
Calculates outlet pressure for a given Kv and inlet conditions using IEC 60534 formulas. Uses bisection search for gas valves due to the complex relationship between Kv and pressure.
- Parameters:
KvAdjusted- the adjusted Kv (at current valve opening)inStream- inlet stream- Returns:
- outlet pressure in Pa
-
Kv_to_Cv
private double Kv_to_Cv(double Kv) -
Cv_to_Kv
private double Cv_to_Kv(double Cv)
-