DIFF_PRESS_C_EPS
This function returns the discharge coefficient C and expansibility factor \epsilon for a differential-pressure flow meter at specified operating conditions. These two factors are used together to convert measured pressure drop into mass flow rate.
The meter discharge relation has the form:
m = A_o C \epsilon \frac{\sqrt{2\rho (P_1 - P_2)}}{\sqrt{1-\beta^4}}
where A_o is the characteristic meter area, \rho is upstream density, and \beta is the meter beta ratio. The implementation uses meter-type-specific correlations from the wrapped library and returns the pair as [[C, epsilon]].
Excel Usage
=DIFF_PRESS_C_EPS(D, D_two, m, P_one, P_two, rho, mu, k, c_eps_meter_type, c_eps_taps, c_eps_tap_position)
D(float, required): Upstream internal pipe diameter (m)D_two(float, required): Orifice or meter characteristic diameter (m)m(float, required): Mass flow rate through the meter (kg/s)P_one(float, required): Static pressure upstream of meter at pressure tap (Pa)P_two(float, required): Static pressure downstream of meter at pressure tap (Pa)rho(float, required): Density of fluid at P1 (kg/m³)mu(float, required): Viscosity of fluid at P1 (Pa·s)k(float, required): Isentropic exponent of fluid (-)c_eps_meter_type(str, optional, default: “ISO 5167 orifice”): Type of differential pressure flow meterc_eps_taps(str, optional, default: null): Pressure tap orientation for orifice-meter correlations (-)c_eps_tap_position(str, optional, default: null): Pressure tap rotation for eccentric orifice configurations (-)
Returns (list[list]): 2D list containing discharge coefficient and expansibility factor [[C, epsilon]]
Example 1: ISO 5167 orifice with D taps
Inputs:
| D | D_two | m | P_one | P_two | rho | mu | k | c_eps_meter_type | c_eps_taps |
|---|---|---|---|---|---|---|---|---|---|
| 0.07366 | 0.05 | 7.702338 | 200000 | 183000 | 999.1 | 0.0011 | 1.33 | ISO 5167 orifice | D |
Excel formula:
=DIFF_PRESS_C_EPS(0.07366, 0.05, 7.702338, 200000, 183000, 999.1, 0.0011, 1.33, "ISO 5167 orifice", "D")
Expected output:
| Result | |
|---|---|
| 0.615125 | 0.971103 |
Example 2: Machined venturi tube
Inputs:
| D | D_two | m | P_one | P_two | rho | mu | k | c_eps_meter_type |
|---|---|---|---|---|---|---|---|---|
| 0.1 | 0.06 | 5 | 150000 | 140000 | 1000 | 0.001 | 1.4 | machined convergent venturi tube |
Excel formula:
=DIFF_PRESS_C_EPS(0.1, 0.06, 5, 150000, 140000, 1000, 0.001, 1.4, "machined convergent venturi tube")
Expected output:
| Result | |
|---|---|
| 0.995 | 0.956963 |
Example 3: V-cone meter
Inputs:
| D | D_two | m | P_one | P_two | rho | mu | k | c_eps_meter_type |
|---|---|---|---|---|---|---|---|---|
| 0.2 | 0.15 | 10 | 300000 | 280000 | 850 | 0.002 | 1.3 | cone meter |
Excel formula:
=DIFF_PRESS_C_EPS(0.2, 0.15, 10, 300000, 280000, 850, 0.002, 1.3, "cone meter")
Expected output:
| Result | |
|---|---|
| 0.82 | 0.959886 |
Example 4: Wedge flow meter
Inputs:
| D | D_two | m | P_one | P_two | rho | mu | k | c_eps_meter_type |
|---|---|---|---|---|---|---|---|---|
| 0.15 | 0.05 | 3 | 100000 | 95000 | 800 | 0.0015 | 1.35 | wedge meter |
Excel formula:
=DIFF_PRESS_C_EPS(0.15, 0.05, 3, 100000, 95000, 800, 0.0015, 1.35, "wedge meter")
Expected output:
| Result | |
|---|---|
| 0.721384 | 0.968564 |
Python Code
Show Code
from fluids.flow_meter import differential_pressure_meter_C_epsilon
def diff_press_c_eps(D, D_two, m, P_one, P_two, rho, mu, k, c_eps_meter_type='ISO 5167 orifice', c_eps_taps=None, c_eps_tap_position=None):
"""
Calculate discharge coefficient and expansibility factor for differential pressure flow meters.
See: https://fluids.readthedocs.io/fluids.flow_meter.html#fluids.flow_meter.differential_pressure_meter_C_epsilon
This example function is provided as-is without any representation of accuracy.
Args:
D (float): Upstream internal pipe diameter (m)
D_two (float): Orifice or meter characteristic diameter (m)
m (float): Mass flow rate through the meter (kg/s)
P_one (float): Static pressure upstream of meter at pressure tap (Pa)
P_two (float): Static pressure downstream of meter at pressure tap (Pa)
rho (float): Density of fluid at P1 (kg/m³)
mu (float): Viscosity of fluid at P1 (Pa·s)
k (float): Isentropic exponent of fluid (-)
c_eps_meter_type (str, optional): Type of differential pressure flow meter Valid options: ISO 5167 Orifice, Orifice, Conical Orifice, Eccentric Orifice, Segmental Orifice, Quarter Circle Orifice, ISO 15377 Conical Orifice, ISO 15377 Eccentric Orifice, ISO 15377 Quarter-circle Orifice, Miller Orifice, Miller Conical Orifice, Miller Eccentric Orifice, Miller Segmental Orifice, Miller Quarter Circle Orifice, Hollingshead Orifice, Venturi Nozzle, ISA 1932 Nozzle, Long Radius Nozzle, Machined Convergent Venturi Tube, Rough Welded Convergent Venturi Tube, As Cast Convergent Venturi Tube, Hollingshead Venturi Smooth, Hollingshead Venturi Sharp, Cone Meter, Hollingshead V Cone, Wedge Meter, Hollingshead Wedge, Unspecified Meter. Default is 'ISO 5167 orifice'.
c_eps_taps (str, optional): Pressure tap orientation for orifice-meter correlations (-) Valid options: Corner, Flange, D, D/2. Default is None.
c_eps_tap_position (str, optional): Pressure tap rotation for eccentric orifice configurations (-) Valid options: 180 Degree, 90 Degree. Default is None.
Returns:
list[list]: 2D list containing discharge coefficient and expansibility factor [[C, epsilon]]
"""
try:
if D <= 0:
return "Error: D (upstream diameter) must be positive."
if D_two <= 0:
return "Error: D_two (meter diameter) must be positive."
if m <= 0:
return "Error: m (mass flow rate) must be positive."
if P_one <= 0 or P_two <= 0:
return "Error: P_one and P_two must be positive."
if rho <= 0:
return "Error: rho (density) must be positive."
if mu <= 0:
return "Error: mu (viscosity) must be positive."
if k <= 0:
return "Error: k (isentropic exponent) must be positive."
result = differential_pressure_meter_C_epsilon(
D=D,
D2=D_two,
m=m,
P1=P_one,
P2=P_two,
rho=rho,
mu=mu,
k=k,
meter_type=c_eps_meter_type,
taps=c_eps_taps,
tap_position=c_eps_tap_position,
C_specified=None,
epsilon_specified=None
)
# Result is a tuple (C, epsilon) - return as 2D list
C, epsilon = result
return [[float(C), float(epsilon)]]
except Exception as e:
return f"Error: {str(e)}"