CV_CAV_INDEX
Overview
Calculates the cavitation index of a control valve.
Excel Usage
=CV_CAV_INDEX(p_inlet, p_outlet, p_sat)
p_inlet(float, required): Inlet absolute pressure (Pa)p_outlet(float, required): Outlet absolute pressure (Pa)p_sat(float, required): Saturation absolute pressure (Pa)
Returns (float): Cavitation index sigma (-)
Examples
Example 1: Documentation example
Inputs:
| p_inlet | p_outlet | p_sat |
|---|---|---|
| 1000000 | 800000 | 200000 |
Excel formula:
=CV_CAV_INDEX(1000000, 800000, 200000)
Expected output:
4
Example 2: Low outlet pressure
Inputs:
| p_inlet | p_outlet | p_sat |
|---|---|---|
| 1000000 | 100000 | 50000 |
Excel formula:
=CV_CAV_INDEX(1000000, 100000, 50000)
Expected output:
1.05556
Example 3: Near saturation
Inputs:
| p_inlet | p_outlet | p_sat |
|---|---|---|
| 1000000 | 500000 | 990000 |
Excel formula:
=CV_CAV_INDEX(1000000, 500000, 990000)
Expected output:
0.02
Example 4: High index (low delta P)
Inputs:
| p_inlet | p_outlet | p_sat |
|---|---|---|
| 1000000 | 990000 | 100000 |
Excel formula:
=CV_CAV_INDEX(1000000, 990000, 100000)
Expected output:
90
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.control_valve import cavitation_index
def cv_cav_index(p_inlet, p_outlet, p_sat):
"""
Calculates the cavitation index of a control valve.
See: https://fluids.readthedocs.io/fluids.control_valve.html#fluids.control_valve.cavitation_index
This example function is provided as-is without any representation of accuracy.
Args:
p_inlet (float): Inlet absolute pressure (Pa)
p_outlet (float): Outlet absolute pressure (Pa)
p_sat (float): Saturation absolute pressure (Pa)
Returns:
float: Cavitation index sigma (-)
"""
if p_inlet <= p_outlet:
return "Error: Inlet pressure must be greater than outlet pressure."
if p_inlet <= p_sat:
return "Error: Inlet pressure must be greater than saturation pressure."
return float(cavitation_index(P1=p_inlet, P2=p_outlet, Psat=p_sat))