Class ControlValveSizing_IEC_60534_full
- All Implemented Interfaces:
Serializable, ControlValveSizingInterface
- Piping geometry factors (Fp, FLP, xTP) for valves installed with reducers/expanders.
- Reynolds number corrections (FR) for laminar or transitional flow regimes.
- Author:
- esol
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ControlValveSizing_IEC_60534
ControlValveSizing_IEC_60534.FluidType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleConvergence tolerance for iterative calculations.private booleanprivate static final intMaximum number of iterations for convergence loops.private static final doubleConstant for Reynolds factor calculation (full trim).private static final doubleConstant related to valve geometry for Reynolds number calculation.private static final doubleConstant for Reynolds factor calculation (reduced trim).private static final doubleConstant for Reynolds number calculation.private static final doubleConstant related to gas piping geometry for xTP calculation.Fields inherited from class ControlValveSizing_IEC_60534
allowLaminar, d, D1, D2, Fd, FD, FL, fullOutput, KV_TO_CV_FACTOR, N1, N9, R, rho0Fields inherited from class ControlValveSizing
allowChoked, valveMechanicalDesign, xT -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for ControlValveSizing_IEC_60534_full.ControlValveSizing_IEC_60534_full(ValveMechanicalDesign valveMechanicalDesign) Constructor for ControlValveSizing_IEC_60534_full. -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateFlowRateFromValveOpening(double adjustedKv, StreamInterface inletStream, StreamInterface outletStream) calculateFlowRateFromValveOpening.private doublecalculateFlowRateFromValveOpeningGas_full(double adjustedKv, StreamInterface inletStream, StreamInterface outletStream) Numerically solves for gas flow rate using a bisection search.private doublecalculateFlowRateFromValveOpeningLiquid_full(double adjustedKv, StreamInterface inletStream, StreamInterface outletStream) Numerically solves for liquid flow rate using a bisection search.doublecalculateValveOpeningFromFlowRate(double Q, double Kv, StreamInterface inletStream, StreamInterface outletStream, double percentValveOpening) Calculates the required valve opening for a given flow rate using the full, iterative model.doublefindOutletPressureForFixedKv(double adjustedKv, StreamInterface inletStream) findOutletPressureForFixedKv.private booleanisChokedTurbulentL(double dP, double P1, double Psat, double FF, Double FLP, Double FP) Overloaded method to check for choked flow with piping factors.booleanisFullTrim.private doublelossCoefficientPiping(double d, Double D1, Double D2) Calculates the sum of loss coefficients from inlet/outlet reducers/expanders.private doublereynoldsFactor(double FL, double C, double d, double Rev, boolean fullTrim) Calculates the Reynolds number factor FR for laminar or transitional flow.private doublereynoldsValve(double nu, double Q, double D1, double FL, double Fd, double C) Calculates the Reynolds number of a control valve.voidsetFullTrim(boolean isFullTrim) setFullTrim.sizeControlValveGas(double T, double MW, double gamma, double Z, double P1, double P2, double Q, double percentOpening) Sizes a control valve for a gas based on the provided parameters.sizeControlValveLiquid(double rho, double Psat, double Pc, double P1, double P2, double Q, double percentOpening) Sizes a control valve for a liquid based on the provided parameters.Methods inherited from class ControlValveSizing_IEC_60534
calculateFlowRateFromKvAndValveOpeningGas, calculateFlowRateFromKvAndValveOpeningGas, calculateFlowRateFromValveOpeningGas, calculateFlowRateFromValveOpeningLiquid, calculateFlowRateFromValveOpeningLiquid, calculateValveOpeningFromFlowRateGas, calculateValveOpeningFromFlowRateGas, calculateValveOpeningFromFlowRateLiquid, calculateValveOpeningFromFlowRateLiquid, calcValveSize, Cv_to_Kv, ffCriticalPressureRatioL, findOutletPressureForFixedKvGas, findOutletPressureForFixedKvGas, findOutletPressureForFixedKvLiquid, findOutletPressureForFixedKvLiquid, getD, getD1, getD2, getFd, getFL, getValve, isAllowChoked, isAllowLaminar, isChokedTurbulentG, isChokedTurbulentL, isFullOutput, Kv_to_Cv, setAllowChoked, setAllowLaminar, setD, setD1, setD2, setFd, setFL, setFullOutput, sizeControlValveMethods inherited from class ControlValveSizing
calcKv, calculateMolarFlow, calculateOutletPressure, calculateValveOpeningFromFlowRate, getValveMechanicalDesign, getxT, setxT
-
Field Details
-
N2
private static final double N2Constant related to valve geometry for Reynolds number calculation. Units: mm.- See Also:
-
N4
private static final double N4Constant for Reynolds number calculation. Units: m^3/hr, m^2/s.- See Also:
-
N5
private static final double N5Constant related to gas piping geometry for xTP calculation. Units: mm.- See Also:
-
N18
private static final double N18Constant for Reynolds factor calculation (full trim). Units: mm.- See Also:
-
N32
private static final double N32Constant for Reynolds factor calculation (reduced trim). Units: mm.- See Also:
-
MAX_ITERATIONS
private static final int MAX_ITERATIONSMaximum number of iterations for convergence loops.- See Also:
-
CONVERGENCE_TOLERANCE
private static final double CONVERGENCE_TOLERANCEConvergence tolerance for iterative calculations.- See Also:
-
isFullTrim
private boolean isFullTrim
-
-
Constructor Details
-
ControlValveSizing_IEC_60534_full
public ControlValveSizing_IEC_60534_full()Constructor for ControlValveSizing_IEC_60534_full.
-
ControlValveSizing_IEC_60534_full
Constructor for ControlValveSizing_IEC_60534_full.
- Parameters:
valveMechanicalDesign- aValveMechanicalDesignobject
-
-
Method Details
-
isFullTrim
public boolean isFullTrim()isFullTrim.
- Returns:
- a boolean
-
setFullTrim
public void setFullTrim(boolean isFullTrim) setFullTrim.
- Parameters:
isFullTrim- a boolean
-
sizeControlValveLiquid
public Map<String,Object> sizeControlValveLiquid(double rho, double Psat, double Pc, double P1, double P2, double Q, double percentOpening) Sizes a control valve for a liquid based on the provided parameters. Aligned with IEC 60534 and 'fluids' library.Overrides the simplified liquid sizing method to provide a full, iterative calculation including piping geometry and Reynolds number corrections.
- Overrides:
sizeControlValveLiquidin classControlValveSizing_IEC_60534- Parameters:
rho- Density of the liquid [kg/m^3]Psat- Saturation pressure of the liquid [Pa]Pc- Critical pressure of the liquid [Pa]P1- Upstream pressure [Pa]P2- Downstream pressure [Pa]Q- Volumetric flow rate [m^3/s]percentOpening- Valve opening percentage (0-100)- Returns:
- A map containing the sizing results (Kv, Kv, choked, etc.).
-
sizeControlValveGas
public Map<String,Object> sizeControlValveGas(double T, double MW, double gamma, double Z, double P1, double P2, double Q, double percentOpening) Sizes a control valve for a gas based on the provided parameters. CORRECTED to include Fgamma, aligning with IEC 60534 and 'fluids' library.Overrides the simplified gas sizing method to provide a full, iterative calculation including piping geometry and Reynolds number corrections.
- Overrides:
sizeControlValveGasin classControlValveSizing_IEC_60534- Parameters:
T- Temperature of the gas [K]MW- Molecular weight of the gas [g/mol]gamma- Specific heat ratioZ- Compressibility factorP1- Upstream pressure [Pa]P2- Downstream pressure [Pa]Q- Volumetric flow rate at inlet conditions [m^3/s]percentOpening- Valve opening percentage (0-100)- Returns:
- A map containing the sizing results (Kv, Kv, Y, choked, etc.).
-
lossCoefficientPiping
Calculates the sum of loss coefficients from inlet/outlet reducers/expanders. IEC 60534-2-1, Equation (6).- Parameters:
d- valve diameter (mm)D1- upstream pipe diameter (mm)D2- downstream pipe diameter (mm)- Returns:
- the total loss coefficient
-
reynoldsValve
private double reynoldsValve(double nu, double Q, double D1, double FL, double Fd, double C) Calculates the Reynolds number of a control valve. IEC 60534-2-1, Equation (20).- Parameters:
nu- kinematic viscosity (mm^2/s)Q- volumetric flow rate (m^3/h)D1- upstream pipe diameter (mm)FL- liquid pressure recovery factorFd- valve style modifierC- flow coefficient- Returns:
- the Reynolds number
-
reynoldsFactor
private double reynoldsFactor(double FL, double C, double d, double Rev, boolean fullTrim) Calculates the Reynolds number factor FR for laminar or transitional flow. IEC 60534-2-1, Section 7.3.- Parameters:
FL- liquid pressure recovery factorC- flow coefficientd- valve diameter (mm)Rev- Reynolds numberfullTrim- true if full trim, false if reduced trim- Returns:
- the Reynolds factor FR
-
isChokedTurbulentL
private boolean isChokedTurbulentL(double dP, double P1, double Psat, double FF, Double FLP, Double FP) Overloaded method to check for choked flow with piping factors.- Parameters:
dP- pressure drop (kPa)P1- upstream pressure (kPa)Psat- saturation pressure (kPa)FF- critical pressure ratio factorFLP- liquid pressure recovery factor with pipingFP- piping geometry factor- Returns:
- true if flow is choked, false otherwise
-
findOutletPressureForFixedKv
findOutletPressureForFixedKv.
Finds the outlet pressure for a given Kv, valve opening, and inlet stream.
Finds the outlet pressure for a given flow rate and fixed Kv, for both gas and liquid.
Finds the outlet pressure for a given flow rate and fixed Kv. This method is inherited, but it remains consistent due to polymorphism. Its internal calls to `sizeControlValveGas` or `sizeControlValveLiquid` will correctly resolve to the overridden, full implementations in this class. It is overridden here for clarity and completeness.
- Specified by:
findOutletPressureForFixedKvin interfaceControlValveSizingInterface- Overrides:
findOutletPressureForFixedKvin classControlValveSizing_IEC_60534- Parameters:
adjustedKv- a doubleinletStream- aStreamInterfaceobject- Returns:
- a double
-
calculateFlowRateFromValveOpening
public double calculateFlowRateFromValveOpening(double adjustedKv, StreamInterface inletStream, StreamInterface outletStream) calculateFlowRateFromValveOpening.
Calculates the flow rate through a control valve based on the valve opening, Kv, and inlet/outlet streams.
Calculates the flow rate through a control valve based on the valve opening, Kv, and inlet/outlet streams.
Calculates the flow rate for a given valve opening using the full, iterative model. This method overrides the simplified base class implementation to ensure consistency.
- Specified by:
calculateFlowRateFromValveOpeningin interfaceControlValveSizingInterface- Overrides:
calculateFlowRateFromValveOpeningin classControlValveSizing_IEC_60534- Parameters:
adjustedKv- a doubleinletStream- aStreamInterfaceobjectoutletStream- aStreamInterfaceobject- Returns:
- a double
-
calculateValveOpeningFromFlowRate
public double calculateValveOpeningFromFlowRate(double Q, double Kv, StreamInterface inletStream, StreamInterface outletStream, double percentValveOpening) Calculates the required valve opening for a given flow rate using the full, iterative model. This method overrides the simplified base class implementation.- Parameters:
Q- The desired flow rate [m^3/s].Kv- The maximum flow coefficient of the valve.inletStream- The stream entering the valve.outletStream- The stream leaving the valve.percentValveOpening- The current percent valve opening.- Returns:
- The required valve opening (0-100).
-
calculateFlowRateFromValveOpeningLiquid_full
private double calculateFlowRateFromValveOpeningLiquid_full(double adjustedKv, StreamInterface inletStream, StreamInterface outletStream) Numerically solves for liquid flow rate using a bisection search.- Parameters:
adjustedKv- valve flow coefficientinletStream- inlet stream to the valveoutletStream- outlet stream from the valve- Returns:
- calculated flow rate [m^3/s]
-
calculateFlowRateFromValveOpeningGas_full
private double calculateFlowRateFromValveOpeningGas_full(double adjustedKv, StreamInterface inletStream, StreamInterface outletStream) Numerically solves for gas flow rate using a bisection search.- Parameters:
adjustedKv- valve flow coefficientinletStream- inlet stream to the valveoutletStream- outlet stream from the valve- Returns:
- calculated flow rate [m^3/s]
-