SIZE_CV_LIQUID
This function calculates the required metric control-valve coefficient K_v for liquid service using the IEC 60534 liquid sizing method. It evaluates the required valve capacity from liquid properties, vapor-pressure limits, pressure conditions, viscosity, and target volumetric flow.
The sizing objective can be represented as:
K_v = g\left(\rho, P_{sat}, P_c, \mu, P_1, P_2, Q\right)
where g(\cdot) is the IEC-compliant liquid-flow model that captures pressure-recovery effects and cavitation-related constraints through valve factors.
Excel Usage
=SIZE_CV_LIQUID(rho, psat, pc, mu, p_in, p_out, q, fl, fd)
rho(float, required): Density of the liquid at the inlet [kg/m^3]psat(float, required): Saturation pressure of the fluid at inlet temperature [Pa]pc(float, required): Critical pressure of the fluid [Pa]mu(float, required): Viscosity of the fluid [Pa*s]p_in(float, required): Inlet pressure of the fluid before valves and reducers [Pa]p_out(float, required): Outlet pressure of the fluid after valves and reducers [Pa]q(float, required): Volumetric flow rate of the fluid [m^3/s]fl(float, optional, default: 0.9): Liquid pressure recovery factor (0 < fl <= 1)fd(float, optional, default: 1): Valve style modifier (0 < fd <= 1)
Returns (float): Metric Kv valve coefficient (float), or error message string.
Example 1: Basic control valve sizing
Inputs:
| rho | psat | pc | mu | p_in | p_out | q | fl | fd |
|---|---|---|---|---|---|---|---|---|
| 965.4 | 70100 | 221200000 | 0.00031472 | 680000 | 220000 | 0.1 | 0.9 | 0.46 |
Excel formula:
=SIZE_CV_LIQUID(965.4, 70100, 221200000, 0.00031472, 680000, 220000, 0.1, 0.9, 0.46)
Expected output:
164.995
Example 2: With default FL and FD values
Inputs:
| rho | psat | pc | mu | p_in | p_out | q |
|---|---|---|---|---|---|---|
| 1000 | 2337 | 22064000 | 0.001 | 500000 | 300000 | 0.05 |
Excel formula:
=SIZE_CV_LIQUID(1000, 2337, 22064000, 0.001, 500000, 300000, 0.05)
Expected output:
127.336
Example 3: Different FL and FD values
Inputs:
| rho | psat | pc | mu | p_in | p_out | q | fl | fd |
|---|---|---|---|---|---|---|---|---|
| 965.4 | 70100 | 221200000 | 0.00031472 | 680000 | 220000 | 0.1 | 0.6 | 0.98 |
Excel formula:
=SIZE_CV_LIQUID(965.4, 70100, 221200000, 0.00031472, 680000, 220000, 0.1, 0.6, 0.98)
Expected output:
238.205
Example 4: Low flow rate application
Inputs:
| rho | psat | pc | mu | p_in | p_out | q | fl | fd |
|---|---|---|---|---|---|---|---|---|
| 800 | 1000 | 15000000 | 0.0005 | 400000 | 350000 | 0.001 | 0.85 | 0.9 |
Excel formula:
=SIZE_CV_LIQUID(800, 1000, 15000000, 0.0005, 400000, 350000, 0.001, 0.85, 0.9)
Expected output:
4.55572
Python Code
Show Code
import math
from fluids.control_valve import size_control_valve_l as fluids_size_control_valve_l
def size_cv_liquid(rho, psat, pc, mu, p_in, p_out, q, fl=0.9, fd=1):
"""
Calculates the flow coefficient (Kv) of a control valve passing a liquid according to IEC 60534.
See: https://fluids.readthedocs.io/fluids.control_valve.html#fluids.control_valve.size_control_valve_l
This example function is provided as-is without any representation of accuracy.
Args:
rho (float): Density of the liquid at the inlet [kg/m^3]
psat (float): Saturation pressure of the fluid at inlet temperature [Pa]
pc (float): Critical pressure of the fluid [Pa]
mu (float): Viscosity of the fluid [Pa*s]
p_in (float): Inlet pressure of the fluid before valves and reducers [Pa]
p_out (float): Outlet pressure of the fluid after valves and reducers [Pa]
q (float): Volumetric flow rate of the fluid [m^3/s]
fl (float, optional): Liquid pressure recovery factor (0 < fl <= 1) Default is 0.9.
fd (float, optional): Valve style modifier (0 < fd <= 1) Default is 1.
Returns:
float: Metric Kv valve coefficient (float), or error message string.
"""
try:
def validate_positive(value, name):
try:
val = float(value)
if val <= 0:
return None, f"Error: {name} must be a positive number."
return val, None
except (ValueError, TypeError):
return None, f"Error: {name} must be a numeric value."
def validate_non_negative(value, name):
try:
val = float(value)
if val < 0:
return None, f"Error: {name} must be a non-negative number."
return val, None
except (ValueError, TypeError):
return None, f"Error: {name} must be a numeric value."
def validate_range(value, name, low, high):
try:
val = float(value)
if val <= low or val > high:
return None, f"Error: {name} must be between {low} (exclusive) and {high} (inclusive)."
return val, None
except (ValueError, TypeError):
return None, f"Error: {name} must be a numeric value."
# Validate input parameters
rho, err = validate_positive(rho, "rho")
if err:
return err
psat, err = validate_non_negative(psat, "psat")
if err:
return err
pc, err = validate_positive(pc, "pc")
if err:
return err
mu, err = validate_positive(mu, "mu")
if err:
return err
p_in, err = validate_non_negative(p_in, "p_in")
if err:
return err
p_out, err = validate_non_negative(p_out, "p_out")
if err:
return err
if p_out > p_in:
return "Error: p_out must be less than or equal to p_in."
q, err = validate_non_negative(q, "q")
if err:
return err
fl, err = validate_range(fl, "fl", 0, 1)
if err:
return err
fd, err = validate_range(fd, "fd", 0, 1)
if err:
return err
# Check for non-finite values
if any(not math.isfinite(val) for val in [rho, psat, pc, mu, p_in, p_out, q, fl, fd]):
return "Error: All parameters must be finite numbers."
# Call the actual function from the fluids library
try:
result = fluids_size_control_valve_l(
rho=rho, Psat=psat, Pc=pc, mu=mu, P1=p_in, P2=p_out, Q=q, FL=fl, Fd=fd
)
if not isinstance(result, (int, float)) or not math.isfinite(result):
return "Error: Result is not a finite number."
return result
except Exception as e:
return f"Error: Failed to compute liquid valve sizing: {str(e)}"
except Exception as e:
return f"Error: {str(e)}"