transport - Heat and Mass Transfer
The transport module provides calculations for heat and mass transfer, including
dimensionless numbers, heat transfer coefficients, and mass flow rate calculations
for different valve types.
Heat and mass transfer correlations for vessel depressurization/pressurization.
This module provides functions for calculating: - Dimensionless numbers (Grashof, Prandtl, Nusselt, Rayleigh) - Heat transfer coefficients for natural and forced convection - Mass flow rates through orifices, control valves, and relief valves - Boiling heat transfer (pool boiling, film boiling)
The correlations are based on established literature including: - Geankoplis, Transport Processes and Unit Operations - API Standard 520/521 for relief valve sizing - Rohsenow pool boiling correlation
All functions use SI units unless otherwise specified. CoolProp is used as the thermodynamic backend for fluid property calculations.
- hyddown.transport.Gr(L, Tfluid, Tvessel, P, species)[source]
Calculation of Grasshof number. See eq. 4.7-4 in C. J. Geankoplis Transport Processes and Unit Operations, International Edition, Prentice-Hall, 1993
- hyddown.transport.Pr(T, P, species)[source]
Calculation of Prandtl number, eq. 4.5-6 in C. J. Geankoplis Transport Processes and Unit Operations, International Edition, Prentice-Hall, 1993
- hyddown.transport.Nu(Ra, Pr)[source]
Calculation of Nusselt number for natural convection. See eq. 4.7-4 and Table 4.7-1 in C. J. Geankoplis Transport Processes and Unit Operations, International Edition, Prentice-Hall, 1993
- hyddown.transport.h_inside(L, Tvessel, Tfluid, fluid)[source]
Calculation of internal natural convective heat transfer coefficient from Nusselt number and using the coolprop low level interface.
- hyddown.transport.h_inner(L, Tfluid, Tvessel, P, species)[source]
Calculation of internal natural convective heat transfer coefficient from Nusselt number and using the coolprop high level interface. Not currently in use.
- hyddown.transport.h_inside_mixed(L, Tvessel, Tfluid, fluid, mdot, D)[source]
Calculation of internal mixed natural/forced convective heat transfer coefficient from Nusselt number and using the coolprop low level interface.
- Parameters:
- Returns:
h_inner – Heat transfer coefficient
- Return type:
- hyddown.transport.h_inner_mixed(L, Tfluid, Tvessel, P, species, mdot, D)[source]
Calculation of internal mixed (nutural/forced convective) heat transfer coefficient from Nusselt number and using the coolprop high level interface. Not currently in use.
- Parameters:
- Returns:
h_inner – Heat transfer coefficient
- Return type:
- hyddown.transport.h_inside_liquid(L, Tvessel, Tfluid, fluid)[source]
Calculation of internal natural convective heat transfer coefficient from Nusselt number
- Parameters:
- Returns:
h_inner – Heat transfer coefficient (W/m2 K)
- Return type:
- hyddown.transport.h_inside_wetted(L, Tvessel, Tfluid, fluid, master_fluid)[source]
Calculation of internal heat transfer coefficient for boiling liquid
- hyddown.transport.hem_release_rate(P1, Pback, Cd, area, fluid)[source]
Fluid mass flow (kg/s) trough a hole at critical (sonic) or subcritical flow conditions calculated applying the HEM (Homogenous Equilibrium Model) assumption.
- hyddown.transport.gas_release_rate(P1, P2, rho, k, CD, area)[source]
Gas mass flow (kg/s) trough a hole at critical (sonic) or subcritical flow conditions. The formula is based on Yellow Book equation 2.22.
Methods for the calculation of physical effects, CPR 14E, van den Bosch and Weterings (Eds.), 1996
- hyddown.transport.relief_valve(P1, Pback, Pset, blowdown, k, CD, T1, Z, MW, area)[source]
Pop action relief valve model including hysteresis. The pressure shall rise above P_set to open and decrease below P_reseat (P_set*(1-blowdown)) to close
- Parameters:
P1 (float) – Upstream pressure
Pback (float) – Downstream / backpressure
Pset (float) – Set pressure of the PSV / relief valve
blowdown (float) – The percentage of the set pressure at which the valve reseats
k (float) – Ideal gas k (Cp/Cv)
CD (float) – Coefficient of discharge
T1 (float) – Upstream temperature
Z (float) – Compressibility
MW (float) – Molecular weight of the gas relieved
area (float) – PSV orifice area
- Returns:
: float Relief rate / mass flow
- hyddown.transport.api_psv_release_rate(P1, Pback, k, CD, T1, Z, MW, area)[source]
PSV vapour relief rate calculated according to API 520 Part I 2014 Eq. 5, 9, 15, 18
- Parameters:
- Returns:
: float Relief rate / mass flow
- hyddown.transport.cv_vs_time(Cv_max, t, time_constant=0, characteristic='linear')[source]
Control valve flow coefficient vs time / actuator postion assuming a linear rate of actuator for the three archetypes of characteristics: linear, equal percentage and fast/quick opening.
- hyddown.transport.control_valve(P1, P2, T, Z, MW, gamma, Cv, xT=0.75, FP=1)[source]
Flow calculated from ANSI/ISA control valve equations for single phase gas flow. Equation 19 pp. 132 in Control Valves / Guy Borden, editor; Paul Friedmann, style editor
- Parameters:
P1 (float) – Upstream pressure
P2 (float) – Downstream / backpressure
T (float) – Upstream temperature
Z (float) – Upstream compressibility
MW (float) – Molecular weight of the gas relieved
gamma (float) – Upstream Ideal gas k (Cp/Cv)
Cv (float) – Valve coefficient
xT (float) – Value of xT for valve fitting assembly, default value
FP (float) – Piping geometry factor
- Returns:
: float Mass flow
Dimensionless Numbers
The module calculates key dimensionless numbers for heat transfer correlations:
Grashof number (Gr)
Prandtl number (Pr)
Nusselt number (Nu)
Rayleigh number (Ra)
Heat Transfer Coefficients
Functions for calculating heat transfer coefficients for:
Natural convection
Forced convection
Pool boiling
Film boiling
Mass Flow Rate Calculations
The module provides mass flow rate functions for different valve types. These functions are called internally by the main HydDown class based on the valve type specified in the input file.
Valve Types
The valve.type parameter determines the mass flow calculation:
orifice: Compressible flow through orifice (requiresdiameter,discharge_coef)control_valve: Control valve sizing equation (requiresCv,N9)relief_valve: API 520/521 relief valve (requiresdiameter,set_pressure)mdot: Constant mass flow rate (requiresmass_flow)
Flow direction is set by valve.flow: "discharge" or "filling".