enex_analysis.heat_transfer¶
Heat transfer and fluid dynamics calculations.
Functions
|
Solve tridiagonal matrix system using Thomas algorithm. |
|
Calculate Log-Mean Temperature Difference for counter-flow heat exchanger. |
|
Calculate Log-Mean Temperature Difference for parallel-flow heat exchanger. |
|
Calculate thermal conductance (UA) of a multi-layer cylindrical tank. |
|
Calculate natural convection heat transfer coefficient for a vertical plate. |
|
Calculate simple tank UA value. |
|
Calculate the Darcy friction factor. |
- enex_analysis.heat_transfer.darcy_friction_factor(Re, e, d, is_active=True)[source]¶
Calculate the Darcy friction factor.
Uses Haaland equation.
- Parameters:
Re (float) – Reynolds number.
e (float) – Surface roughness [m].
d (float) – Diameter [m].
is_active (bool, optional) – If False, returns np.nan.
- Returns:
Friction factor.
- Return type:
float
- enex_analysis.heat_transfer.calc_h_vertical_plate(T_s, T_inf, L, fluid='Air', is_active=True)[source]¶
Calculate natural convection heat transfer coefficient for a vertical plate.
- Parameters:
T_s (float) – Surface temperature [K].
T_inf (float) – Fluid temperature [K].
L (float) – Characteristic length [m].
fluid (str, optional) – Fluid name. Default is ‘Air’.
is_active (bool, optional) – If False, returns np.nan.
- Returns:
Heat transfer coefficient [W/m2K].
- Return type:
float
- enex_analysis.heat_transfer.calc_UA_tank_arr(arr_D_in, arr_D_out, arr_L, arr_k, h_in, h_out)[source]¶
Calculate thermal conductance (UA) of a multi-layer cylindrical tank.
- Parameters:
arr_D_in (array_like or list) – Inner diameters of layers [m].
arr_D_out (array_like or list) – Outer diameters of layers [m].
arr_L (array_like or list) – Lengths of layers [m].
arr_k (array_like or list) – Thermal conductivities of layers [W/mK].
h_in (float) – Inner convection coefficient [W/m2K].
h_out (float) – Outer convection coefficient [W/m2K].
- Returns:
Thermal conductance [W/K].
- Return type:
float
- enex_analysis.heat_transfer.calc_simple_tank_UA(r0=0.2, H=0.8, x_shell=0.01, x_ins=0.1, k_shell=25.0, k_ins=0.03, h_o=10.0)[source]¶
Calculate simple tank UA value.
- Parameters:
r0 (float) – Tank radius [m]
H (float) – Tank height [m]
x_shell (float) – Shell thickness [m]
x_ins (float) – Insulation thickness [m]
k_shell (float) – Shell thermal conductivity [W/mK]
k_ins (float) – Insulation thermal conductivity [W/mK]
h_o (float) – External convective heat transfer coefficient [W/m²K]
- Returns:
Tank UA value [W/K]
- Return type:
float
- enex_analysis.heat_transfer.calc_LMTD_counter_flow(Th_in, Th_out, Tc_in, Tc_out)[source]¶
Calculate Log-Mean Temperature Difference for counter-flow heat exchanger.
- Parameters:
Th_in (float) – Hot stream inlet temp [K].
Th_out (float) – Hot stream outlet temp [K].
Tc_in (float) – Cold stream inlet temp [K].
Tc_out (float) – Cold stream outlet temp [K].
- Returns:
LMTD [K].
- Return type:
float
- enex_analysis.heat_transfer.calc_LMTD_parallel_flow(Th_in, Th_out, Tc_in, Tc_out)[source]¶
Calculate Log-Mean Temperature Difference for parallel-flow heat exchanger.
- Parameters:
Th_in (float) – Hot stream inlet temp [K].
Th_out (float) – Hot stream outlet temp [K].
Tc_in (float) – Cold stream inlet temp [K].
Tc_out (float) – Cold stream outlet temp [K].
- Returns:
LMTD [K].
- Return type:
float
- enex_analysis.heat_transfer.TRIDIAG_MATRIX_ALGORITHM(a_M, a_P, a_E, a_W, b_P)[source]¶
Solve tridiagonal matrix system using Thomas algorithm.
- Parameters:
a_M (list[float]) – Main diagonal (a_P in standard notation).
a_P (list[float]) – Not used directly, maintained for signature compatibility.
a_E (list[float]) – Upper diagonal.
a_W (list[float]) – Lower diagonal.
b_P (list[float]) – RHS vector.
- Returns:
Solution vector.
- Return type:
list[float]