Skip to content

polykin.transport.flow¤

DP_tube ¤

DP_tube(
    Q: float,
    D: float,
    L: float,
    rho: float,
    mu: float,
    er: float = 0.0,
) -> float

Calculate the pressure drop in a circular pipe for both laminar and turbulent flow.

This method acts as a convenience wrapper for DP_Darcy_Weisbach. It determines the flow regime and estimates the Darcy friction factor using the appropriate equation. For laminar flow, it applies \(f_D=64/Re\). For turbulent flow, it uses fD_Haaland. Finally, the method calls DP_Darcy_Weisbach with the correct parameters.

Tip

In laminar flow, \(\Delta P \propto Q/D^4\), while in turbulent flow, \(\Delta P \propto Q^2/D^5\).

PARAMETER DESCRIPTION
Q

Volume flowrate (m³/s).

TYPE: float

D

Diameter (m).

TYPE: float

L

Length (m).

TYPE: float

rho

Density (kg/m³).

TYPE: float

mu

Viscosity (Pa·s).

TYPE: float

er

Relative pipe roughness, \(\epsilon/D\). Only required for turbulent flow.

TYPE: float DEFAULT: 0.0

RETURNS DESCRIPTION
float

Pressure drop (Pa).

Source code in src/polykin/transport/flow.py
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
def DP_tube(Q: float,
            D: float,
            L: float,
            rho: float,
            mu: float,
            er: float = 0.0
            ) -> float:
    r"""Calculate the pressure drop in a circular pipe for both laminar and
    turbulent flow.

    This method acts as a convenience wrapper for
    [`DP_Darcy_Weisbach`](DP_Darcy_Weisbach.md). It determines the flow regime
    and estimates the Darcy friction factor using the appropriate equation. For
    laminar flow, it applies $f_D=64/Re$. For turbulent flow, it uses
    [`fD_Haaland`](fD_Haaland.md). Finally, the method calls
    [`DP_Darcy_Weisbach`](DP_Darcy_Weisbach.md) with the correct parameters. 

    !!! tip

        In laminar flow, $\Delta P \propto Q/D^4$, while in turbulent flow, 
        $\Delta P \propto Q^2/D^5$.

    Parameters
    ----------
    Q : float
        Volume flowrate (m³/s).
    D : float
        Diameter (m).
    L : float
        Length (m).
    rho : float
        Density (kg/m³).
    mu : float
        Viscosity (Pa·s).
    er : float
        Relative pipe roughness, $\epsilon/D$. Only required for turbulent flow.

    Returns
    -------
    float
        Pressure drop (Pa).
    """

    v = 4*Q/(pi*D**2)
    Re = rho*v*D/mu
    if Re < 2.3e3:
        fD = 64/Re
    else:
        fD = fD_Haaland(Re, er)

    return DP_Darcy_Weisbach(v, D, L, rho, fD)