Class ControlValveSizing_simple
- All Implemented Interfaces:
Serializable, ControlValveSizingInterface
This class implements production choke sizing formulas commonly used in oil and gas production. For gas flow, it uses a modified Perkins/Sachdeva approach with proper compressibility handling. For liquid flow, it uses the standard Kv formula.
The gas sizing formula is:
Cv = Q_std / (27.66 * P1 * Y * sqrt(1 / (MW * T * Z)))
where Q_std is standard volumetric flow (Sm³/h), P1 is inlet pressure (bara), Y is expansion factor, MW is molecular weight (g/mol), T is temperature (K), and Z is compressibility factor.
- Author:
- esol
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleDischarge coefficient for production chokes (typical value).Fields inherited from class ControlValveSizing
allowChoked, valveMechanicalDesign, xT -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for ControlValveSizing_simple.ControlValveSizing_simple(ValveMechanicalDesign valveMechanicalDesign) Constructor for ControlValveSizing_simple. -
Method Summary
Modifier and TypeMethodDescriptiondoublecalcKv(double percentOpening) calcKv.doublecalculateFlowRateFromValveOpening(double Kv, double valveOpening, StreamInterface inletStream, StreamInterface outletStream) Calculates the flow rate through a control valve based on the valve opening, Kv, and inlet/outlet streams.doublecalculateMolarFlow(double KvAdjusted, StreamInterface inStream, StreamInterface outStream) calculateMolarFlow.doublecalculateOutletPressure(double KvAdjusted, StreamInterface inStream) calculateOutletPressure.doublecalculateValveOpeningFromFlowRate(double Q, double Kv, double valveOpening, StreamInterface inletStream, StreamInterface outletStream) Calculates the required valve opening percentage for a given flow rate.doublefindOutletPressureForFixedKv(double Kv, double valveOpening, StreamInterface inletStream) Finds the outlet pressure for a given Kv, valve opening, and inlet stream.doublegetCd()Get the discharge coefficient.voidsetCd(double Cd) Set the discharge coefficient.
-
Field Details
-
Cd
private double CdDischarge coefficient for production chokes (typical value).
-
-
Constructor Details
-
ControlValveSizing_simple
public ControlValveSizing_simple()Constructor for ControlValveSizing_simple.
-
ControlValveSizing_simple
Constructor for ControlValveSizing_simple.
- Parameters:
valveMechanicalDesign- aValveMechanicalDesignobject
-
-
Method Details
-
getCd
public double getCd()Get the discharge coefficient.- Returns:
- discharge coefficient Cd
-
setCd
public void setCd(double Cd) Set the discharge coefficient.- Parameters:
Cd- discharge coefficient (typically 0.6-0.95)
-
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
- Overrides:
calcKvin classControlValveSizing- Parameters:
percentOpening- valve opening percentage (0-100)- Returns:
- the calculated Kv value
-
calculateFlowRateFromValveOpening
public double calculateFlowRateFromValveOpening(double Kv, double valveOpening, StreamInterface inletStream, StreamInterface outletStream) Calculates the flow rate through a control valve based on the valve opening, Kv, and inlet/outlet streams.- Parameters:
Kv- Flow coefficient (for 100% opening)valveOpening- Opening fraction of the valve (0.0 - 1.0)inletStream- Inlet stream to the valveoutletStream- Outlet stream from the valve- Returns:
- Calculated flow rate in m³/s
-
calculateMolarFlow
public double calculateMolarFlow(double KvAdjusted, StreamInterface inStream, StreamInterface outStream) calculateMolarFlow.
Calculates flow rate from valve Kv using IEC 60534 formulas.
- Overrides:
calculateMolarFlowin classControlValveSizing- Parameters:
KvAdjusted- 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 Kv, double valveOpening, StreamInterface inletStream, StreamInterface outletStream) Calculates the required valve opening percentage for a given flow rate.This method inverts the flow calculation to determine what valve opening percentage is needed to achieve the specified flow rate Q, given the valve's Kv and the inlet/outlet conditions.
- Parameters:
Q- Desired volumetric flow rate [m³/s]Kv- Flow coefficient at 100% openingvalveOpening- Current valve opening percentage (not used in calculation)inletStream- Inlet stream to the valveoutletStream- Outlet stream from the valve- Returns:
- Required valve opening percentage (0-100)
-
findOutletPressureForFixedKv
public double findOutletPressureForFixedKv(double Kv, double valveOpening, StreamInterface inletStream) Finds the outlet pressure for a given Kv, valve opening, and inlet stream.- Parameters:
Kv- Flow coefficient (for 100% opening)valveOpening- Opening fraction of the valve (0.0 - 1.0)inletStream- Inlet stream to the valve- Returns:
- Outlet pressure (unit Pa)
-
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.
- Overrides:
calculateOutletPressurein classControlValveSizing- Parameters:
KvAdjusted- the adjusted Kv (at current valve opening)inStream- inlet stream- Returns:
- outlet pressure in Pa
-