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

Parameters:
  • L (float) – Vessel length

  • Tfluid (float) – Temperature of the bulk fluid inventory

  • Tvessel (float) – Temperature of the vessel wall (bulk)

  • P (float) – Pressure of fluid inventory

Returns:

Gr – Grasshof number

Return type:

float

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

Parameters:
  • T (float) – Temperature of the fluid film interface

  • P (float) – Pressure of fluid inventory

Returns:

Pr – Prantdl number

Return type:

float

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

Parameters:
  • Ra (float) – Raleigh number

  • Pr (float) – Prandtl number

Returns:

Nu – Nusselt numebr

Return type:

float

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.

Parameters:
  • L (float) – Vessel length

  • Tfluid (float) – Temperature of the bulk fluid inventory

  • Tvessel (float) – Temperature of the vessel wall (bulk)

  • fluid (obj) – Coolprop fluid object

Returns:

h_inner – Heat transfer coefficient

Return type:

float

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.

Parameters:
  • L (float) – Vessel length

  • Tfluid (float) – Temperature of the bulk fluid inventory

  • Tvessel (float) – Temperature of the vessel wall (bulk)

  • species (str) – Fluid definition string

Returns:

h_inner – Heat transfer coefficient

Return type:

float

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:
  • L (float) – Vessel length

  • Tfluid (float) – Temperature of the bulk fluid inventory

  • Tvessel (float) – Temperature of the vessel wall (bulk)

  • fluid (obj) – Coolprop fluid object

  • mdot (float) – Mass flow

  • D (float) – Characteristic diameter for Reynolds number estimation

Returns:

h_inner – Heat transfer coefficient

Return type:

float

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:
  • L (float) – Vessel length

  • Tfluid (float) – Temperature of the bulk fluid inventory

  • Tvessel (float) – Temperature of the vessel wall (bulk)

  • P (float) – Fluid pressure

  • species (str) – Fluid definition string

  • mdot (float) – Mass flow

  • D (float) – Characteristic diameter for Reynolds number estimation

Returns:

h_inner – Heat transfer coefficient

Return type:

float

hyddown.transport.h_inside_liquid(L, Tvessel, Tfluid, fluid)[source]

Calculation of internal natural convective heat transfer coefficient from Nusselt number

Parameters:
  • L (float) – Vessel length

  • Tfluid (float) – Temperature of the bulk fluid inventory

  • Tvessel (float) – Temperature of the vessel wall (bulk)

  • fluid (obj) – Liquid Fluid object equilibrated at film temperature

  • master_fluid (obj) – Master Fluid object (used for surface tension etc.)

Returns:

h_inner – Heat transfer coefficient (W/m2 K)

Return type:

float

hyddown.transport.h_inside_wetted(L, Tvessel, Tfluid, fluid, master_fluid)[source]

Calculation of internal heat transfer coefficient for boiling liquid

Parameters:
  • L (float) – Vessel length

  • Tfluid (float) – Temperature of the bulk fluid inventory

  • Tvessel (float) – Temperature of the vessel wall (bulk)

  • fluid (obj) – Gas object equilibrated at film temperature

Returns:

h_inner – Heat transfer coefficient (W/m2 K)

Return type:

float

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.

Parameters:
  • P1 (float) – Upstream pressure

  • Pback (float) – Back/downstream pressure

  • Cd (float) – Coefficient of discharge

  • area (float) – Orifice area

  • fluid (obj) – Fluid object

Returns:

: float Gas release rate / mass flow of discharge

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

Parameters:
  • P1 (float) – Upstream pressure

  • P2 (float) – Downstream pressure

  • rho (float) – Fluid density

  • k (float) – Ideal gas k (Cp/Cv)

  • CD (float) – Coefficient of discharge

  • area (float) – Orifice area

Returns:

: float Gas release rate / mass flow of discharge

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:
  • P1 (float) – Upstream pressure

  • Pback (float) – Downstream / backpressure

  • 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.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.

Parameters:
  • Cv_max (float) – Valve flow coefficient at full open position

  • t (float) – Time

  • time_constant (float (optional)) – The time required for the actuator to fully open. Default to instant open

  • characteristic (string (optional)) – Valve characteristic Default to linear.

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 (requires diameter, discharge_coef)

  • control_valve: Control valve sizing equation (requires Cv, N9)

  • relief_valve: API 520/521 relief valve (requires diameter, set_pressure)

  • mdot: Constant mass flow rate (requires mass_flow)

Flow direction is set by valve.flow: "discharge" or "filling".