Skip to content

pumping

Engineering models for pumping system analysis.

darcy_friction_haaland(reynolds, roughness_channel, radius_channel)

Calculate Darcy friction factor using the Haaland equation.

Parameters:

Name Type Description Default
reynolds float

Reynolds number.

required
roughness_channel float

Roughness of the first wall coolant channel (m).

required
radius_channel float

Radius of the first wall coolant channel (m).

required

Returns:

Type Description
float

Darcy friction factor.

Notes

The Haaland equation is an approximation to the implicit Colebrook-White equation. It is used to calculate the Darcy friction factor for turbulent flow in pipes.

References
- https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Haaland_equation
Source code in process/models/engineering/pumping.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def darcy_friction_haaland(
    reynolds: float, roughness_channel: float, radius_channel: float
) -> float:
    """Calculate Darcy friction factor using the Haaland equation.

    Parameters
    ----------
    reynolds:
        Reynolds number.
    roughness_channel:
        Roughness of the first wall coolant channel (m).
    radius_channel:
        Radius of the first wall coolant channel (m).

    Returns
    -------
    :
        Darcy friction factor.

    Notes
    -----
       The Haaland equation is an approximation to the implicit Colebrook-White equation.
       It is used to calculate the Darcy friction factor for turbulent flow in pipes.

    References
    ----------
        - https://en.wikipedia.org/wiki/Darcy_friction_factor_formulae#Haaland_equation
    """
    # Bracketed term in Haaland equation
    bracket = (roughness_channel / radius_channel / 3.7) ** 1.11 + 6.9 / reynolds

    # Calculate Darcy friction factor
    return (1.8 * np.log10(bracket)) ** (-2)

gnielinski_heat_transfer_coefficient(mflux_coolant, den_coolant, radius_channel, heatcap_coolant, visc_coolant, thermcond_coolant, roughness_channel)

Calculate heat transfer coefficient using Gnielinski correlation.

Parameters:

Name Type Description Default
mflux_coolant float

Coolant mass flux in a single channel (kg/m²/s).

required
den_coolant float

Coolant density (average of inlet and outlet) (kg/m³).

required
radius_channel float

Coolant pipe radius (m).

required
heatcap_coolant float

Coolant specific heat capacity (average of inlet and outlet) (J/kg/K).

required
visc_coolant float

Coolant viscosity (average of inlet and outlet) (Pa.s).

required
thermcond_coolant float

Thermal conductivity of coolant (average of inlet and outlet) (W/m.K).

required
roughness_channel float

Roughness of the coolant channel (m).

required

Returns:

Type Description
float

Heat transfer coefficient (W/m²K).

Notes

Gnielinski correlation. Ignore the distinction between wall and bulk temperatures. Valid for: 3000 < Re < 5e6, 0.5 < Pr < 2000

References
- https://en.wikipedia.org/wiki/Nusselt_number#Gnielinski_correlation
Source code in process/models/engineering/pumping.py
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
def gnielinski_heat_transfer_coefficient(
    mflux_coolant: float,
    den_coolant: float,
    radius_channel: float,
    heatcap_coolant: float,
    visc_coolant: float,
    thermcond_coolant: float,
    roughness_channel: float,
) -> float:
    """Calculate heat transfer coefficient using Gnielinski correlation.

    Parameters
    ----------
    mflux_coolant:
        Coolant mass flux in a single channel (kg/m²/s).
    den_coolant:
        Coolant density (average of inlet and outlet) (kg/m³).
    radius_channel:
        Coolant pipe radius (m).
    heatcap_coolant:
        Coolant specific heat capacity (average of inlet and outlet) (J/kg/K).
    visc_coolant:
        Coolant viscosity (average of inlet and outlet) (Pa.s).
    thermcond_coolant:
        Thermal conductivity of coolant (average of inlet and outlet) (W/m.K).
    roughness_channel:
        Roughness of the coolant channel (m).

    Returns
    -------
    :
        Heat transfer coefficient (W/m²K).

    Notes
    -----
    Gnielinski correlation. Ignore the distinction between wall and
    bulk temperatures. Valid for: 3000 < Re < 5e6, 0.5 < Pr < 2000

    References
    ----------
        - https://en.wikipedia.org/wiki/Nusselt_number#Gnielinski_correlation

    """
    # Calculate pipe diameter (m)
    diameter = 2 * radius_channel

    # Calculate flow velocity (m/s)
    vel_coolant = mflux_coolant / den_coolant

    # Calculate Reynolds number
    reynolds = calculate_reynolds_number(
        den_coolant=den_coolant,
        vel_coolant=vel_coolant,
        radius_channel=diameter / 2,
        visc_coolant=visc_coolant,
    )

    # Calculate Prandtl number
    pr = heatcap_coolant * visc_coolant / thermcond_coolant

    # Calculate Darcy friction factor, using Haaland equation
    f = darcy_friction_haaland(
        reynolds=reynolds,
        roughness_channel=roughness_channel,
        radius_channel=radius_channel,
    )

    # Calculate the Nusselt number
    nusselt = (
        (f / 8.0)
        * (reynolds - 1000.0)
        * pr
        / (1 + 12.7 * np.sqrt(f / 8.0) * (pr ** (2 / 3) - 1.0))
    )

    # Calculate the heat transfer coefficient (W/m^2K)
    heat_transfer_coefficient = nusselt * thermcond_coolant / (2.0 * radius_channel)

    # Check that Reynolds number is in valid range for the Gnielinski correlation
    if (reynolds <= 3000.0) or (reynolds > 5.0e6):
        logger.error("Reynolds number out of range : [3e3-5000e3]. %s", reynolds)

    # Check that Prandtl number is in valid range for the Gnielinski correlation
    if (pr < 0.5) or (pr > 2000.0):
        logger.error("Prandtl number out of range : [0.5-2000]. %s", pr)

    # Check that the Darcy friction factor is in valid range for the Gnielinski
    # correlation
    if f <= 0.0:
        logger.error("Negative Darcy friction factor (f). %s", f)

    return heat_transfer_coefficient

calculate_reynolds_number(den_coolant, vel_coolant, radius_channel, visc_coolant)

Calculate Reynolds number for flow in a pipe.

Parameters:

Name Type Description Default
den_coolant float

Coolant density (average of inlet and outlet) (kg/m³).

required
vel_coolant float

Coolant velocity in a single channel (m/s).

required
radius_channel float

Coolant pipe radius (m).

required
visc_coolant float

Coolant viscosity (average of inlet and outlet) (Pa.s).

required

Returns:

Type Description
float

Reynolds number.

Source code in process/models/engineering/pumping.py
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
def calculate_reynolds_number(
    den_coolant: float, vel_coolant: float, radius_channel: float, visc_coolant: float
) -> float:
    """Calculate Reynolds number for flow in a pipe.

    Parameters
    ----------
    den_coolant:
        Coolant density (average of inlet and outlet) (kg/m³).
    vel_coolant:
        Coolant velocity in a single channel (m/s).
    radius_channel:
        Coolant pipe radius (m).
    visc_coolant:
        Coolant viscosity (average of inlet and outlet) (Pa.s).

    Returns
    -------
    :
        Reynolds number.

    """
    # Calculate pipe diameter (m)
    diameter = 2 * radius_channel

    # Calculate Reynolds number
    return den_coolant * vel_coolant * diameter / visc_coolant