Hx

Overview

Heat exchangers are core equipment in process engineering, HVAC, power generation, and thermal management. This category focuses on heat-exchanger sizing and rating, where geometry, flow arrangement, and thermodynamic limits are combined to predict duty and required surface area. In practical design, engineers move iteratively between performance targets and mechanical constraints, so compact, reliable formulas are essential. These tools support that workflow from early estimates to detailed checks.

The unifying ideas are capacity-rate ratio (C_r=C_{min}/C_{max}), number of transfer units (NTU=UA/C_{min}), and effectiveness (\varepsilon=Q/Q_{max} or P-effectiveness for stream-specific formulations). Together, these concepts connect exchanger duty, approach temperatures, and hardware limits. For shell-and-tube and plate configurations, multiple pass arrangements introduce correction behavior and configuration-specific bounds, which is why both direct and inverse solvers are needed.

Implementation is based on the ht Python library, specifically ht.hx, which provides validated thermal-design utilities for exchanger rating and preliminary sizing. The library combines closed-form relations, standards-based correlations (for example TEMA-oriented checks), and numerical solvers where exact inverses are not available. This makes it suitable for spreadsheet-style what-if studies as well as scripted engineering calculations.

For mechanical and constructability checks, BAFFLE_THICKNESS, D_BAFFLE_HOLES, L_UNSUPPORTED_MAX, SHELL_CLEARANCE, CHECK_TUBING_TEMA, and DBUNDLE_MIN capture practical shell-and-tube constraints before detailed thermal optimization. They estimate support spacing limits, clearances, and fabrication-feasible dimensions from tube and shell choices. In early design, these functions prevent non-buildable geometries from propagating into later calculations. They are especially useful when screening many candidate layouts.

For tube-count geometry and inverse sizing, NTUBES, NTUBES_HEDH, NTUBES_PHADKEB, NTUBES_VDI, BUNDLE_FROM_TUBES, D_FOR_NTUBES_VDI, DBUNDLE_NT_HEDH, and DBUNDLE_NT_PHADK map between bundle diameter and tube population under different literature methods. The direct and inverse forms are paired so a designer can move from required area to count, then back to bundle diameter for mechanical fit checks. Method-specific options (for example Phadkeb, HEDH, and VDI styles) support different accuracy/speed tradeoffs. This group is central when layout, pass count, and pitch are active design variables.

For thermodynamic state variables and overall coefficients, CALC_CMIN, CALC_CMAX, CALC_CR, NTU_FROM_UA, and UA_FROM_NTU provide the bookkeeping layer that ties fluid properties and flow rates to exchanger performance. These are typically the first calculations in both rating and sizing studies. By standardizing C_{min}, C_{max}, C_r, NTU, and UA, they keep downstream effectiveness equations consistent. They also make model handoff between process simulation, spreadsheet checks, and detailed design tools more robust.

For effectiveness-NTU rating and correction-factor workflows, EFF_FROM_NTU, NTU_FROM_EFF, EFF_NTU_METHOD, and F_LMTD_FAKHERI handle forward and inverse thermal calculations across common exchanger subtypes. This supports both design modes: estimating outlet temperatures from a known exchanger and inferring required conductance from a target duty. The LMTD correction-factor path complements NTU workflows when temperature-program constraints drive the calculation basis. Together, these tools are widely used in feasibility studies and revamp evaluations.

For P-NTU and pass-arrangement-specific analysis, TEMP_EFF_BASIC, NTU_FROM_P_BASIC, TEMP_EFF_PLATE, NTU_FROM_P_PLATE, TEMP_EFF_TEMA_E, NTU_FROM_P_E, and P_NTU_METHOD provide stream-referenced formulations for basic, plate, and TEMA E configurations. These functions are valuable when side-specific effectiveness definitions, pass orientation, and mixed/unmixed assumptions materially affect predicted performance. They also support inverse design tasks where a target P must be met under configuration constraints. In practice, this group is often used for detailed comparison of candidate pass arrangements and for troubleshooting underperforming exchangers.

BAFFLE_THICKNESS

This function estimates shell-and-tube heat exchanger baffle or support plate thickness from shell diameter, unsupported tube span, and TEMA service class. It applies empirical TEMA guidance where required thickness increases with larger shell size and longer unsupported span.

In simplified form, the result follows a standard-based relation t = f(D_{shell}, L_{unsupported}, \text{service}).

Excel Usage

=BAFFLE_THICKNESS(Dshell, L_unsupported, service)
  • Dshell (float, required): Shell inner diameter (m).
  • L_unsupported (float, required): Unsupported tube length between baffles (m).
  • service (str, optional, default: “C”): TEMA service type (-).

Returns (float): Baffle or support plate thickness (m).

Example 1: Baffle thickness for refinery service

Inputs:

Dshell L_unsupported service
0.3 50 R

Excel formula:

=BAFFLE_THICKNESS(0.3, 50, "R")

Expected output:

0.0095

Example 2: Baffle thickness for class C service

Inputs:

Dshell L_unsupported service
0.6 40 C

Excel formula:

=BAFFLE_THICKNESS(0.6, 40, "C")

Expected output:

0.0127

Example 3: Baffle thickness for chemical service

Inputs:

Dshell L_unsupported service
0.45 30 B

Excel formula:

=BAFFLE_THICKNESS(0.45, 30, "B")

Expected output:

0.0127

Example 4: Baffle thickness for larger shell

Inputs:

Dshell L_unsupported service
1 60 C

Excel formula:

=BAFFLE_THICKNESS(1, 60, "C")

Expected output:

0.0159

Python Code

Show Code
from ht.hx import baffle_thickness as hx_baffle_thickness

def baffle_thickness(Dshell, L_unsupported, service='C'):
    """
    Compute baffle thickness from shell diameter and support spacing.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        Dshell (float): Shell inner diameter (m).
        L_unsupported (float): Unsupported tube length between baffles (m).
        service (str, optional): TEMA service type (-). Valid options: Class C, Class R, Class B. Default is 'C'.

    Returns:
        float: Baffle or support plate thickness (m).
    """
    try:
        result = hx_baffle_thickness(Dshell=Dshell, L_unsupported=L_unsupported, service=service)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Shell inner diameter (m).
Unsupported tube length between baffles (m).
TEMA service type (-).

BUNDLE_FROM_TUBES

This function calculates the bundle diameter needed to accommodate a target tube count for specified tube size, pitch, pass count, and layout angle. It supports multiple sizing methods consistent with tube-count routines.

The sizing relation is D_{bundle}=f(N, D_o, p, N_{tp}, \theta, \text{method}).

Excel Usage

=BUNDLE_FROM_TUBES(N, Do, pitch, Ntp, angle, bundle_meth)
  • N (int, required): Total number of tubes (-).
  • Do (float, required): Tube outer diameter (m).
  • pitch (float, required): Tube pitch (m).
  • Ntp (int, optional, default: 1): Number of tube passes (-).
  • angle (int, optional, default: 30): Tube layout angle (degrees).
  • bundle_meth (str, optional, default: null): Tube count method selection (-).

Returns (float): Outer diameter of tube bundle (m).

Example 1: Bundle size using default method

Inputs:

N Do pitch
1285 0.025 0.03125

Excel formula:

=BUNDLE_FROM_TUBES(1285, 0.025, 0.03125)

Expected output:

1.19857

Example 2: Bundle size using Phadkeb method

Inputs:

N Do pitch Ntp bundle_meth
782 0.028 0.036 2 Phadkeb

Excel formula:

=BUNDLE_FROM_TUBES(782, 0.028, 0.036, 2, "Phadkeb")

Expected output:

1.10319

Example 3: Bundle size using VDI method

Inputs:

N Do pitch Ntp bundle_meth
970 0.00735 0.015 2 VDI

Excel formula:

=BUNDLE_FROM_TUBES(970, 0.00735, 0.015, 2, "VDI")

Expected output:

0.50036

Example 4: Bundle size using HEDH method

Inputs:

N Do pitch bundle_meth
928 0.028 0.036 HEDH

Excel formula:

=BUNDLE_FROM_TUBES(928, 0.028, 0.036, "HEDH")

Expected output:

1.18399

Python Code

Show Code
from ht.hx import size_bundle_from_tubecount as hx_size_bundle_from_tubecount

def bundle_from_tubes(N, Do, pitch, Ntp=1, angle=30, bundle_meth=None):
    """
    Calculate bundle diameter required for a specified tube count.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        N (int): Total number of tubes (-).
        Do (float): Tube outer diameter (m).
        pitch (float): Tube pitch (m).
        Ntp (int, optional): Number of tube passes (-). Default is 1.
        angle (int, optional): Tube layout angle (degrees). Default is 30.
        bundle_meth (str, optional): Tube count method selection (-). Valid options: Phadkeb, HEDH, VDI, Perry. Default is None.

    Returns:
        float: Outer diameter of tube bundle (m).
    """
    try:
        result = hx_size_bundle_from_tubecount(N=N, Do=Do, pitch=pitch, Ntp=Ntp, angle=angle, Method=bundle_meth)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Total number of tubes (-).
Tube outer diameter (m).
Tube pitch (m).
Number of tube passes (-).
Tube layout angle (degrees).
Tube count method selection (-).

CALC_CMAX

This function computes the larger of the two stream heat-capacity rates in a heat exchanger using mass flow and specific heat for each stream. It is used in effectiveness-NTU and P-NTU analysis to normalize heat transfer performance.

The calculation is C_{max} = \max(m_h C_{p,h},\; m_c C_{p,c}).

Excel Usage

=CALC_CMAX(mh, mc, Cph, Cpc)
  • mh (float, required): Mass flow rate of hot stream (kg/s).
  • mc (float, required): Mass flow rate of cold stream (kg/s).
  • Cph (float, required): Heat capacity of hot stream (J/kg/K).
  • Cpc (float, required): Heat capacity of cold stream (J/kg/K).

Returns (float): Maximum heat capacity rate (W/K).

Example 1: Cmax for example flows

Inputs:

mh mc Cph Cpc
22 5.5 2200 4400

Excel formula:

=CALC_CMAX(22, 5.5, 2200, 4400)

Expected output:

48400

Example 2: Cmax for equal flow rates

Inputs:

mh mc Cph Cpc
3 3 2000 1800

Excel formula:

=CALC_CMAX(3, 3, 2000, 1800)

Expected output:

6000

Example 3: Cmax with larger hot stream

Inputs:

mh mc Cph Cpc
10 2 4200 3000

Excel formula:

=CALC_CMAX(10, 2, 4200, 3000)

Expected output:

42000

Example 4: Cmax with larger cold stream

Inputs:

mh mc Cph Cpc
2 8 3500 4200

Excel formula:

=CALC_CMAX(2, 8, 3500, 4200)

Expected output:

33600

Python Code

Show Code
from ht.hx import calc_Cmax as hx_calc_Cmax

def calc_Cmax(mh, mc, Cph, Cpc):
    """
    Calculate the maximum heat capacity rate of two streams.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        mh (float): Mass flow rate of hot stream (kg/s).
        mc (float): Mass flow rate of cold stream (kg/s).
        Cph (float): Heat capacity of hot stream (J/kg/K).
        Cpc (float): Heat capacity of cold stream (J/kg/K).

    Returns:
        float: Maximum heat capacity rate (W/K).
    """
    try:
        result = hx_calc_Cmax(mh=mh, mc=mc, Cph=Cph, Cpc=Cpc)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Mass flow rate of hot stream (kg/s).
Mass flow rate of cold stream (kg/s).
Heat capacity of hot stream (J/kg/K).
Heat capacity of cold stream (J/kg/K).

CALC_CMIN

This function computes the smaller of the two stream heat-capacity rates in a heat exchanger from each stream’s mass flow and specific heat. The minimum heat-capacity rate controls the maximum possible exchanger duty.

The calculation is C_{min} = \min(m_h C_{p,h},\; m_c C_{p,c}).

Excel Usage

=CALC_CMIN(mh, mc, Cph, Cpc)
  • mh (float, required): Mass flow rate of hot stream (kg/s).
  • mc (float, required): Mass flow rate of cold stream (kg/s).
  • Cph (float, required): Heat capacity of hot stream (J/kg/K).
  • Cpc (float, required): Heat capacity of cold stream (J/kg/K).

Returns (float): Minimum heat capacity rate (W/K).

Example 1: Cmin for example flows

Inputs:

mh mc Cph Cpc
22 5.5 2200 4400

Excel formula:

=CALC_CMIN(22, 5.5, 2200, 4400)

Expected output:

24200

Example 2: Cmin for equal flow rates

Inputs:

mh mc Cph Cpc
3 3 2000 1800

Excel formula:

=CALC_CMIN(3, 3, 2000, 1800)

Expected output:

5400

Example 3: Cmin with larger hot stream

Inputs:

mh mc Cph Cpc
10 2 4200 3000

Excel formula:

=CALC_CMIN(10, 2, 4200, 3000)

Expected output:

6000

Example 4: Cmin with larger cold stream

Inputs:

mh mc Cph Cpc
2 8 3500 4200

Excel formula:

=CALC_CMIN(2, 8, 3500, 4200)

Expected output:

7000

Python Code

Show Code
from ht.hx import calc_Cmin as hx_calc_Cmin

def calc_Cmin(mh, mc, Cph, Cpc):
    """
    Calculate the minimum heat capacity rate of two streams.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        mh (float): Mass flow rate of hot stream (kg/s).
        mc (float): Mass flow rate of cold stream (kg/s).
        Cph (float): Heat capacity of hot stream (J/kg/K).
        Cpc (float): Heat capacity of cold stream (J/kg/K).

    Returns:
        float: Minimum heat capacity rate (W/K).
    """
    try:
        result = hx_calc_Cmin(mh=mh, mc=mc, Cph=Cph, Cpc=Cpc)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Mass flow rate of hot stream (kg/s).
Mass flow rate of cold stream (kg/s).
Heat capacity of hot stream (J/kg/K).
Heat capacity of cold stream (J/kg/K).

CALC_CR

This function returns the dimensionless heat-capacity ratio between the smaller and larger stream heat-capacity rates. It is a key parameter in exchanger performance correlations.

The ratio is defined as C_r = \frac{C_{min}}{C_{max}}.

Excel Usage

=CALC_CR(mh, mc, Cph, Cpc)
  • mh (float, required): Mass flow rate of hot stream (kg/s).
  • mc (float, required): Mass flow rate of cold stream (kg/s).
  • Cph (float, required): Heat capacity of hot stream (J/kg/K).
  • Cpc (float, required): Heat capacity of cold stream (J/kg/K).

Returns (float): Heat capacity rate ratio Cmin/Cmax (-).

Example 1: Cr for example flows

Inputs:

mh mc Cph Cpc
22 5.5 2200 4400

Excel formula:

=CALC_CR(22, 5.5, 2200, 4400)

Expected output:

0.5

Example 2: Cr for equal flow rates

Inputs:

mh mc Cph Cpc
3 3 2000 1800

Excel formula:

=CALC_CR(3, 3, 2000, 1800)

Expected output:

0.9

Example 3: Cr with larger hot stream

Inputs:

mh mc Cph Cpc
10 2 4200 3000

Excel formula:

=CALC_CR(10, 2, 4200, 3000)

Expected output:

0.142857

Example 4: Cr with larger cold stream

Inputs:

mh mc Cph Cpc
2 8 3500 4200

Excel formula:

=CALC_CR(2, 8, 3500, 4200)

Expected output:

0.208333

Python Code

Show Code
from ht.hx import calc_Cr as hx_calc_Cr

def calc_Cr(mh, mc, Cph, Cpc):
    """
    Calculate the heat capacity rate ratio for two streams.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        mh (float): Mass flow rate of hot stream (kg/s).
        mc (float): Mass flow rate of cold stream (kg/s).
        Cph (float): Heat capacity of hot stream (J/kg/K).
        Cpc (float): Heat capacity of cold stream (J/kg/K).

    Returns:
        float: Heat capacity rate ratio Cmin/Cmax (-).
    """
    try:
        result = hx_calc_Cr(mh=mh, mc=mc, Cph=Cph, Cpc=Cpc)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Mass flow rate of hot stream (kg/s).
Mass flow rate of cold stream (kg/s).
Heat capacity of hot stream (J/kg/K).
Heat capacity of cold stream (J/kg/K).

CHECK_TUBING_TEMA

This function checks whether a nominal tube size and Birmingham Wire Gauge combination is listed as acceptable by TEMA tubing standards. It returns a boolean validity flag for quick design-rule validation.

Conceptually, it evaluates membership in an approved set: (\text{NPS}, \text{BWG}) \in \mathcal{S}_{\text{TEMA}}.

Excel Usage

=CHECK_TUBING_TEMA(NPS, BWG)
  • NPS (float, optional, default: null): Nominal pipe size (in).
  • BWG (int, optional, default: null): Birmingham wire gauge (-).

Returns (bool): True if the tubing combination is valid, otherwise false.

Example 1: Invalid tubing size and gauge

Inputs:

NPS BWG
2 22

Excel formula:

=CHECK_TUBING_TEMA(2, 22)

Expected output:

false

Example 2: Valid tubing size and gauge

Inputs:

NPS BWG
0.375 22

Excel formula:

=CHECK_TUBING_TEMA(0.375, 22)

Expected output:

true

Example 3: Invalid tubing size with thicker gauge

Inputs:

NPS BWG
0.5 14

Excel formula:

=CHECK_TUBING_TEMA(0.5, 14)

Expected output:

false

Example 4: Invalid small tubing size and gauge

Inputs:

NPS BWG
0.25 16

Excel formula:

=CHECK_TUBING_TEMA(0.25, 16)

Expected output:

false

Python Code

Show Code
from ht.hx import check_tubing_TEMA as hx_check_tubing_TEMA

def check_tubing_TEMA(NPS=None, BWG=None):
    """
    Check whether a tubing size and gauge are valid per TEMA.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        NPS (float, optional): Nominal pipe size (in). Default is None.
        BWG (int, optional): Birmingham wire gauge (-). Default is None.

    Returns:
        bool: True if the tubing combination is valid, otherwise false.
    """
    try:
        result = hx_check_tubing_TEMA(NPS=NPS, BWG=BWG)
        return bool(result)
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Nominal pipe size (in).
Birmingham wire gauge (-).

D_BAFFLE_HOLES

This function computes the recommended baffle hole diameter from tube outer diameter and unsupported span based on TEMA guidance. The hole diameter is set slightly above tube outside diameter to allow assembly and tolerance.

The relation is an empirical standard mapping d_b = f(D_o, L_{unsupported}).

Excel Usage

=D_BAFFLE_HOLES(Do, L_unsupported)
  • Do (float, required): Tube outer diameter (m).
  • L_unsupported (float, required): Unsupported tube length between baffles (m).

Returns (float): Baffle hole diameter (m).

Example 1: Baffle hole for large tube and long span

Inputs:

Do L_unsupported
0.0508 0.75

Excel formula:

=D_BAFFLE_HOLES(0.0508, 0.75)

Expected output:

0.0516

Example 2: Baffle hole for small tube and short span

Inputs:

Do L_unsupported
0.01905 0.3

Excel formula:

=D_BAFFLE_HOLES(0.01905, 0.3)

Expected output:

0.01985

Example 3: Baffle hole for small tube and long span

Inputs:

Do L_unsupported
0.01905 1.5

Excel formula:

=D_BAFFLE_HOLES(0.01905, 1.5)

Expected output:

0.01945

Example 4: Baffle hole for mid size tube

Inputs:

Do L_unsupported
0.025 0.6

Excel formula:

=D_BAFFLE_HOLES(0.025, 0.6)

Expected output:

0.0258

Python Code

Show Code
from ht.hx import D_baffle_holes as hx_D_baffle_holes

def D_baffle_holes(Do, L_unsupported):
    """
    Calculate baffle hole diameter for tubes using TEMA guidance.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        Do (float): Tube outer diameter (m).
        L_unsupported (float): Unsupported tube length between baffles (m).

    Returns:
        float: Baffle hole diameter (m).
    """
    try:
        result = hx_D_baffle_holes(Do=Do, L_unsupported=L_unsupported)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Tube outer diameter (m).
Unsupported tube length between baffles (m).

D_FOR_NTUBES_VDI

This function estimates tube bundle diameter from tube count with the VDI correlation, including tube pass count and layout angle effects. It is a practical approximate sizing model for exchanger bundle geometry.

The model can be expressed as D_{bundle} = f(N, N_{tp}, D_o, p, \theta) using VDI coefficients.

Excel Usage

=D_FOR_NTUBES_VDI(N, Ntp, Do, pitch, angle)
  • N (int, required): Number of tubes (-).
  • Ntp (int, required): Number of tube passes (-).
  • Do (float, required): Tube outer diameter (m).
  • pitch (float, required): Tube pitch (m).
  • angle (int, optional, default: 30): Tube layout angle (degrees).

Returns (float): Outer diameter of tube bundle (m).

Example 1: VDI bundle diameter example

Inputs:

N Ntp Do pitch angle
970 2 0.00735 0.015 30

Excel formula:

=D_FOR_NTUBES_VDI(970, 2, 0.00735, 0.015, 30)

Expected output:

0.50036

Example 2: VDI estimate with four passes

Inputs:

N Ntp Do pitch angle
450 4 0.01905 0.025 30

Excel formula:

=D_FOR_NTUBES_VDI(450, 4, 0.01905, 0.025, 30)

Expected output:

0.588657

Example 3: VDI estimate for square layout

Inputs:

N Ntp Do pitch angle
800 4 0.025 0.03125 90

Excel formula:

=D_FOR_NTUBES_VDI(800, 4, 0.025, 0.03125, 90)

Expected output:

1.03804

Example 4: VDI estimate for small bundle

Inputs:

N Ntp Do pitch angle
120 1 0.0127 0.016 45

Excel formula:

=D_FOR_NTUBES_VDI(120, 1, 0.0127, 0.016, 45)

Expected output:

0.199872

Python Code

Show Code
from ht.hx import D_for_Ntubes_VDI as hx_D_for_Ntubes_VDI

def D_for_Ntubes_VDI(N, Ntp, Do, pitch, angle=30):
    """
    Estimate tube bundle diameter from tube count using the VDI method.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        N (int): Number of tubes (-).
        Ntp (int): Number of tube passes (-).
        Do (float): Tube outer diameter (m).
        pitch (float): Tube pitch (m).
        angle (int, optional): Tube layout angle (degrees). Default is 30.

    Returns:
        float: Outer diameter of tube bundle (m).
    """
    try:
        result = hx_D_for_Ntubes_VDI(N=N, Ntp=Ntp, Do=Do, pitch=pitch, angle=angle)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Number of tubes (-).
Number of tube passes (-).
Tube outer diameter (m).
Tube pitch (m).
Tube layout angle (degrees).

DBUNDLE_MIN

This function returns a rough minimum shell or bundle diameter recommendation from tube outer diameter using handbook guidance. It is intended for early-stage exchanger sizing before detailed tube-count optimization.

The value follows a tabulated rule of thumb D_{bundle,\min} = g(D_o).

Excel Usage

=DBUNDLE_MIN(Do)
  • Do (float, required): Tube outer diameter (m).

Returns (float): Estimated minimum shell inner diameter (m).

Example 1: Minimum bundle diameter for 1 inch tube

Inputs:

Do
0.0254

Excel formula:

=DBUNDLE_MIN(0.0254)

Expected output:

1

Example 2: Minimum bundle diameter for 3/4 inch tube

Inputs:

Do
0.01905

Excel formula:

=DBUNDLE_MIN(0.01905)

Expected output:

0.5

Example 3: Minimum bundle diameter for 2 inch tube

Inputs:

Do
0.0508

Excel formula:

=DBUNDLE_MIN(0.0508)

Expected output:

1.5

Example 4: Minimum bundle diameter for 1/2 inch tube

Inputs:

Do
0.0127

Excel formula:

=DBUNDLE_MIN(0.0127)

Expected output:

0.3

Python Code

Show Code
from ht.hx import DBundle_min as hx_DBundle_min

def DBundle_min(Do):
    """
    Estimate a minimum bundle diameter for a given tube outer diameter.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        Do (float): Tube outer diameter (m).

    Returns:
        float: Estimated minimum shell inner diameter (m).
    """
    try:
        result = hx_DBundle_min(Do=Do)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Tube outer diameter (m).

DBUNDLE_NT_HEDH

This function estimates tube bundle diameter from a target tube count using the HEDH correlation and a specified tube layout angle. It provides a fast approximate geometry sizing relation for one-pass bundle arrangements.

In correlation form, D_{bundle} \approx D_o + p\,\sqrt{\frac{C_1 N}{0.78}}.

Excel Usage

=DBUNDLE_NT_HEDH(N, Do, pitch, angle)
  • N (int, required): Number of tubes (-).
  • Do (float, required): Tube outer diameter (m).
  • pitch (float, required): Tube pitch (m).
  • angle (int, optional, default: 30): Tube layout angle (degrees).

Returns (float): Outer diameter of tube bundle (m).

Example 1: HEDH example for 30 degree layout

Inputs:

N Do pitch angle
928 0.028 0.036 30

Excel formula:

=DBUNDLE_NT_HEDH(928, 0.028, 0.036, 30)

Expected output:

1.18399

Example 2: HEDH estimate with 45 degree layout

Inputs:

N Do pitch angle
500 0.025 0.03125 45

Excel formula:

=DBUNDLE_NT_HEDH(500, 0.025, 0.03125, 45)

Expected output:

0.816203

Example 3: HEDH estimate with 60 degree layout

Inputs:

N Do pitch angle
650 0.01905 0.025 60

Excel formula:

=DBUNDLE_NT_HEDH(650, 0.01905, 0.025, 60)

Expected output:

0.690905

Example 4: HEDH estimate with 90 degree layout

Inputs:

N Do pitch angle
320 0.01905 0.025 90

Excel formula:

=DBUNDLE_NT_HEDH(320, 0.01905, 0.025, 90)

Expected output:

0.52542

Python Code

Show Code
from ht.hx import DBundle_for_Ntubes_HEDH as hx_DBundle_for_Ntubes_HEDH

def DBundle_Nt_HEDH(N, Do, pitch, angle=30):
    """
    Estimate tube bundle diameter from tube count using the HEDH correlation.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        N (int): Number of tubes (-).
        Do (float): Tube outer diameter (m).
        pitch (float): Tube pitch (m).
        angle (int, optional): Tube layout angle (degrees). Default is 30.

    Returns:
        float: Outer diameter of tube bundle (m).
    """
    try:
        result = hx_DBundle_for_Ntubes_HEDH(N=N, Do=Do, pitch=pitch, angle=angle)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Number of tubes (-).
Tube outer diameter (m).
Tube pitch (m).
Tube layout angle (degrees).

DBUNDLE_NT_PHADK

This function computes the tube bundle diameter required to fit a specified number of tubes using the Phadke method, accounting for pitch, tube diameter, pass count, and layout angle. It is a reverse sizing operation of tube-count calculations.

The solver finds D_{bundle} such that N_{tubes}(D_{bundle}, D_o, p, N_{tp}, \theta) = N_{target}.

Excel Usage

=DBUNDLE_NT_PHADK(Ntubes, Do, pitch, Ntp, angle)
  • Ntubes (int, required): Total number of tubes (-).
  • Do (float, required): Tube outer diameter (m).
  • pitch (float, required): Tube pitch (m).
  • Ntp (int, required): Number of tube passes (-).
  • angle (int, optional, default: 30): Tube layout angle (degrees).

Returns (float): Outer diameter of tube bundle (m).

Example 1: Phadkeb bundle diameter example

Inputs:

Ntubes Do pitch Ntp angle
782 0.028 0.036 2 45

Excel formula:

=DBUNDLE_NT_PHADK(782, 0.028, 0.036, 2, 45)

Expected output:

1.18794

Example 2: Phadkeb estimate for smaller bundle

Inputs:

Ntubes Do pitch Ntp angle
300 0.01905 0.025 1 30

Excel formula:

=DBUNDLE_NT_PHADK(300, 0.01905, 0.025, 1, 30)

Expected output:

0.46905

Example 3: Phadkeb estimate with four passes

Inputs:

Ntubes Do pitch Ntp angle
900 0.025 0.03125 4 30

Excel formula:

=DBUNDLE_NT_PHADK(900, 0.025, 0.03125, 4, 30)

Expected output:

1.05767

Example 4: Phadkeb estimate with 90 degree layout

Inputs:

Ntubes Do pitch Ntp angle
600 0.022 0.028 2 90

Excel formula:

=DBUNDLE_NT_PHADK(600, 0.022, 0.028, 2, 90)

Expected output:

0.81396

Python Code

Show Code
from ht.hx import DBundle_for_Ntubes_Phadkeb as hx_DBundle_for_Ntubes_Phadkeb

def DBundle_Nt_Phadk(Ntubes, Do, pitch, Ntp, angle=30):
    """
    Calculate tube bundle diameter for a given tube count using Phadke's method.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        Ntubes (int): Total number of tubes (-).
        Do (float): Tube outer diameter (m).
        pitch (float): Tube pitch (m).
        Ntp (int): Number of tube passes (-).
        angle (int, optional): Tube layout angle (degrees). Default is 30.

    Returns:
        float: Outer diameter of tube bundle (m).
    """
    try:
        result = hx_DBundle_for_Ntubes_Phadkeb(Ntubes=Ntubes, Do=Do, pitch=pitch, Ntp=Ntp, angle=angle)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Total number of tubes (-).
Tube outer diameter (m).
Tube pitch (m).
Number of tube passes (-).
Tube layout angle (degrees).

EFF_FROM_NTU

This function computes exchanger thermal effectiveness from number of transfer units, heat-capacity ratio, and flow configuration. It supports standard configurations such as counterflow, parallel flow, crossflow variants, and shell-and-tube arrangements.

The governing concept is \varepsilon = f(\mathrm{NTU}, C_r, \text{subtype}).

Excel Usage

=EFF_FROM_NTU(NTU, Cr, eff_subtype, n_shell_tube)
  • NTU (float, required): Thermal number of transfer units (-).
  • Cr (float, required): Heat capacity rate ratio Cmin/Cmax (-).
  • eff_subtype (str, optional, default: “counterflow”): Exchanger configuration subtype (-).
  • n_shell_tube (int, optional, default: null): Number of shell and tube exchangers in series (-).

Returns (float): Thermal effectiveness of the exchanger (-).

Example 1: Effectiveness for parallel flow

Inputs:

NTU Cr eff_subtype
5 0.7 parallel

Excel formula:

=EFF_FROM_NTU(5, 0.7, "parallel")

Expected output:

0.588116

Example 2: Effectiveness for crossflow

Inputs:

NTU Cr eff_subtype
5 0.7 crossflow

Excel formula:

=EFF_FROM_NTU(5, 0.7, "crossflow")

Expected output:

0.844482

Example 3: Effectiveness for counterflow

Inputs:

NTU Cr eff_subtype
5 0.7 counterflow

Excel formula:

=EFF_FROM_NTU(5, 0.7, "counterflow")

Expected output:

0.92067

Example 4: Effectiveness for shell and tube series

Inputs:

NTU Cr eff_subtype n_shell_tube
5 0.7 S&T 50

Excel formula:

=EFF_FROM_NTU(5, 0.7, "S&T", 50)

Expected output:

0.920506

Python Code

Show Code
from ht.hx import effectiveness_from_NTU as hx_effectiveness_from_NTU

def eff_from_NTU(NTU, Cr, eff_subtype='counterflow', n_shell_tube=None):
    """
    Calculate effectiveness from NTU, capacity ratio, and configuration.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        NTU (float): Thermal number of transfer units (-).
        Cr (float): Heat capacity rate ratio Cmin/Cmax (-).
        eff_subtype (str, optional): Exchanger configuration subtype (-). Valid options: Counterflow, Parallel, Crossflow, Crossflow Approximate, Crossflow Mixed Cmin, Crossflow Mixed Cmax, Boiler, Condenser, Shell and Tube. Default is 'counterflow'.
        n_shell_tube (int, optional): Number of shell and tube exchangers in series (-). Default is None.

    Returns:
        float: Thermal effectiveness of the exchanger (-).
    """
    try:
      result = hx_effectiveness_from_NTU(NTU=NTU, Cr=Cr, subtype=eff_subtype, n_shell_tube=n_shell_tube)
      return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Thermal number of transfer units (-).
Heat capacity rate ratio Cmin/Cmax (-).
Exchanger configuration subtype (-).
Number of shell and tube exchangers in series (-).

EFF_NTU_METHOD

This function solves a heat exchanger state using the effectiveness-NTU framework from stream flow rates, heat capacities, exchanger subtype, and a valid temperature/UA input combination. It returns exchanger duty and derived thermodynamic properties as an Excel data type.

Core relations include \mathrm{NTU}=\frac{UA}{C_{min}} and Q=\varepsilon C_{min}(T_{h,i}-T_{c,i}).

Excel Usage

=EFF_NTU_METHOD(mh, mc, Cph, Cpc, eff_subtype, Thi, Tho, Tci, Tco, UA, n_shell_tube)
  • mh (float, required): Mass flow rate of hot stream (kg/s).
  • mc (float, required): Mass flow rate of cold stream (kg/s).
  • Cph (float, required): Heat capacity of hot stream (J/kg/K).
  • Cpc (float, required): Heat capacity of cold stream (J/kg/K).
  • eff_subtype (str, optional, default: “counterflow”): Exchanger configuration subtype (-).
  • Thi (float, optional, default: null): Hot inlet temperature (K).
  • Tho (float, optional, default: null): Hot outlet temperature (K).
  • Tci (float, optional, default: null): Cold inlet temperature (K).
  • Tco (float, optional, default: null): Cold outlet temperature (K).
  • UA (float, optional, default: null): Area heat transfer coefficient product (W/K).
  • n_shell_tube (int, optional, default: null): Number of shell and tube exchangers in series (-).

Returns (float): Heat exchanged, with additional properties for temperatures and ratios.

Example 1: Effectiveness-NTU with known cold outlet

Inputs:

mh mc Cph Cpc eff_subtype Tci Tco Thi
5.2 1.45 1860 1900 crossflow, mixed Cmax 15 85 130

Excel formula:

=EFF_NTU_METHOD(5.2, 1.45, 1860, 1900, "crossflow, mixed Cmax", 15, 85, 130)

Expected output:

{"type":"Double","basicValue":192850,"properties":{"Q":{"type":"Double","basicValue":192850},"UA":{"type":"Double","basicValue":3041.75},"Cr":{"type":"Double","basicValue":0.284843},"Cmin":{"type":"Double","basicValue":2755},"Cmax":{"type":"Double","basicValue":9672},"effectiveness":{"type":"Double","basicValue":0.608696},"NTU":{"type":"Double","basicValue":1.10408},"Thi":{"type":"Double","basicValue":130},"Tho":{"type":"Double","basicValue":110.061},"Tci":{"type":"Double","basicValue":15},"Tco":{"type":"Double","basicValue":85}}}

Example 2: Effectiveness-NTU with known UA and inlets

Inputs:

mh mc Cph Cpc eff_subtype Tci Thi UA
5.2 1.45 1860 1900 crossflow, mixed Cmax 15 130 3041.75

Excel formula:

=EFF_NTU_METHOD(5.2, 1.45, 1860, 1900, "crossflow, mixed Cmax", 15, 130, 3041.75)

Expected output:

{"type":"Double","basicValue":192850,"properties":{"Q":{"type":"Double","basicValue":192850},"UA":{"type":"Double","basicValue":3041.75},"Cr":{"type":"Double","basicValue":0.284843},"Cmin":{"type":"Double","basicValue":2755},"Cmax":{"type":"Double","basicValue":9672},"effectiveness":{"type":"Double","basicValue":0.608696},"NTU":{"type":"Double","basicValue":1.10408},"Thi":{"type":"Double","basicValue":130},"Tho":{"type":"Double","basicValue":110.061},"Tci":{"type":"Double","basicValue":15},"Tco":{"type":"Double","basicValue":85}}}

Example 3: Effectiveness-NTU for counterflow

Inputs:

mh mc Cph Cpc eff_subtype Tci Thi UA
4 2 2000 1800 counterflow 300 420 1500

Excel formula:

=EFF_NTU_METHOD(4, 2, 2000, 1800, "counterflow", 300, 420, 1500)

Expected output:

{"type":"Double","basicValue":137777,"properties":{"Q":{"type":"Double","basicValue":137777},"UA":{"type":"Double","basicValue":1500},"Cr":{"type":"Double","basicValue":0.45},"Cmin":{"type":"Double","basicValue":3600},"Cmax":{"type":"Double","basicValue":8000},"effectiveness":{"type":"Double","basicValue":0.318929},"NTU":{"type":"Double","basicValue":0.416667},"Thi":{"type":"Double","basicValue":420},"Tho":{"type":"Double","basicValue":402.778},"Tci":{"type":"Double","basicValue":300},"Tco":{"type":"Double","basicValue":338.271}}}

Example 4: Effectiveness-NTU for shell and tube series

Inputs:

mh mc Cph Cpc eff_subtype Tci Thi UA n_shell_tube
3.5 2.2 2100 1900 S&T 310 430 1800 3

Excel formula:

=EFF_NTU_METHOD(3.5, 2.2, 2100, 1900, "S&T", 310, 430, 1800, 3)

Expected output:

{"type":"Double","basicValue":160884,"properties":{"Q":{"type":"Double","basicValue":160884},"UA":{"type":"Double","basicValue":1800},"Cr":{"type":"Double","basicValue":0.568707},"Cmin":{"type":"Double","basicValue":4180},"Cmax":{"type":"Double","basicValue":7350},"effectiveness":{"type":"Double","basicValue":0.320742},"NTU":{"type":"Double","basicValue":0.430622},"Thi":{"type":"Double","basicValue":430},"Tho":{"type":"Double","basicValue":408.111},"Tci":{"type":"Double","basicValue":310},"Tco":{"type":"Double","basicValue":348.489}}}

Python Code

Show Code
from ht.hx import effectiveness_NTU_method as hx_effectiveness_NTU_method

def eff_NTU_method(mh, mc, Cph, Cpc, eff_subtype='counterflow', Thi=None, Tho=None, Tci=None, Tco=None, UA=None, n_shell_tube=None):
    """
    Solve a heat exchanger with the effectiveness-NTU method.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        mh (float): Mass flow rate of hot stream (kg/s).
        mc (float): Mass flow rate of cold stream (kg/s).
        Cph (float): Heat capacity of hot stream (J/kg/K).
        Cpc (float): Heat capacity of cold stream (J/kg/K).
        eff_subtype (str, optional): Exchanger configuration subtype (-). Valid options: Counterflow, Parallel, Crossflow, Crossflow Approximate, Crossflow Mixed Cmin, Crossflow Mixed Cmax, Boiler, Condenser, Shell and Tube. Default is 'counterflow'.
        Thi (float, optional): Hot inlet temperature (K). Default is None.
        Tho (float, optional): Hot outlet temperature (K). Default is None.
        Tci (float, optional): Cold inlet temperature (K). Default is None.
        Tco (float, optional): Cold outlet temperature (K). Default is None.
        UA (float, optional): Area heat transfer coefficient product (W/K). Default is None.
        n_shell_tube (int, optional): Number of shell and tube exchangers in series (-). Default is None.

    Returns:
        float: Heat exchanged, with additional properties for temperatures and ratios.
    """
    try:
        results = hx_effectiveness_NTU_method(mh=mh, mc=mc, Cph=Cph, Cpc=Cpc, subtype=eff_subtype, Thi=Thi, Tho=Tho, Tci=Tci, Tco=Tco, UA=UA, n_shell_tube=n_shell_tube)
        if not isinstance(results, dict):
            return "Error: Expected a result dictionary"

        def to_prop(value):
            return {"type": "Double", "basicValue": value}

        return {
            "type": "Double",
            "basicValue": results.get("Q"),
            "properties": {
                "Q": to_prop(results.get("Q")),
                "UA": to_prop(results.get("UA")),
                "Cr": to_prop(results.get("Cr")),
                "Cmin": to_prop(results.get("Cmin")),
                "Cmax": to_prop(results.get("Cmax")),
                "effectiveness": to_prop(results.get("effectiveness")),
                "NTU": to_prop(results.get("NTU")),
                "Thi": to_prop(results.get("Thi")),
                "Tho": to_prop(results.get("Tho")),
                "Tci": to_prop(results.get("Tci")),
                "Tco": to_prop(results.get("Tco"))
            }
        }
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Mass flow rate of hot stream (kg/s).
Mass flow rate of cold stream (kg/s).
Heat capacity of hot stream (J/kg/K).
Heat capacity of cold stream (J/kg/K).
Exchanger configuration subtype (-).
Hot inlet temperature (K).
Hot outlet temperature (K).
Cold inlet temperature (K).
Cold outlet temperature (K).
Area heat transfer coefficient product (W/K).
Number of shell and tube exchangers in series (-).

F_LMTD_FAKHERI

This function calculates the Fakheri correction factor for log-mean temperature difference in shell-and-tube heat exchangers with one or multiple shell passes. The factor adjusts ideal LMTD to account for exchanger pass arrangement.

The corrected driving force is \Delta T_{lm,\mathrm{corrected}} = F_t\,\Delta T_{lm}.

Excel Usage

=F_LMTD_FAKHERI(Thi, Tho, Tci, Tco, shells)
  • Thi (float, required): Hot inlet temperature (K).
  • Tho (float, required): Hot outlet temperature (K).
  • Tci (float, required): Cold inlet temperature (K).
  • Tco (float, required): Cold outlet temperature (K).
  • shells (int, optional, default: 1): Number of shell-side passes (-).

Returns (float): Log-mean temperature difference correction factor (-).

Example 1: Fakheri correction factor example

Inputs:

Tci Tco Thi Tho shells
15 85 130 110 1

Excel formula:

=F_LMTD_FAKHERI(15, 85, 130, 110, 1)

Expected output:

0.943836

Example 2: Fakheri correction factor with two shells

Inputs:

Tci Tco Thi Tho shells
20 80 140 100 2

Excel formula:

=F_LMTD_FAKHERI(20, 80, 140, 100, 2)

Expected output:

0.978933

Example 3: Fakheri correction factor with larger temperature span

Inputs:

Tci Tco Thi Tho shells
25 90 160 120 1

Excel formula:

=F_LMTD_FAKHERI(25, 90, 160, 120, 1)

Expected output:

0.931251

Example 4: Fakheri correction factor with smaller temperature span

Inputs:

Tci Tco Thi Tho shells
35 70 120 95 1

Excel formula:

=F_LMTD_FAKHERI(35, 70, 120, 95, 1)

Expected output:

0.949394

Python Code

Show Code
from ht.hx import F_LMTD_Fakheri as hx_F_LMTD_Fakheri

def F_LMTD_Fakheri(Thi, Tho, Tci, Tco, shells=1):
    """
    Compute the LMTD correction factor for shell-and-tube exchangers.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        Thi (float): Hot inlet temperature (K).
        Tho (float): Hot outlet temperature (K).
        Tci (float): Cold inlet temperature (K).
        Tco (float): Cold outlet temperature (K).
        shells (int, optional): Number of shell-side passes (-). Default is 1.

    Returns:
        float: Log-mean temperature difference correction factor (-).
    """
    try:
        result = hx_F_LMTD_Fakheri(Thi=Thi, Tho=Tho, Tci=Tci, Tco=Tco, shells=shells)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Hot inlet temperature (K).
Hot outlet temperature (K).
Cold inlet temperature (K).
Cold outlet temperature (K).
Number of shell-side passes (-).

L_UNSUPPORTED_MAX

This function returns the maximum allowable unsupported tube span for a given tube diameter and material category based on TEMA recommendations. It helps ensure mechanical integrity and vibration resistance in exchanger design.

The lookup relation is L_{unsupported,\max}=f(D_o, \text{material}).

Excel Usage

=L_UNSUPPORTED_MAX(Do, material)
  • Do (float, required): Tube outer diameter (m).
  • material (str, optional, default: “CS”): Tube material type (-).

Returns (float): Maximum unsupported tube length (m).

Example 1: Maximum unsupported length for carbon steel

Inputs:

Do material
0.0254 CS

Excel formula:

=L_UNSUPPORTED_MAX(0.0254, "CS")

Expected output:

1.88

Example 2: Maximum unsupported length for aluminium

Inputs:

Do material
0.01905 aluminium

Excel formula:

=L_UNSUPPORTED_MAX(0.01905, "aluminium")

Expected output:

1.321

Example 3: Maximum unsupported length for larger tube

Inputs:

Do material
0.0508 CS

Excel formula:

=L_UNSUPPORTED_MAX(0.0508, "CS")

Expected output:

3.175

Example 4: Maximum unsupported length for smaller tube

Inputs:

Do material
0.0127 aluminium

Excel formula:

=L_UNSUPPORTED_MAX(0.0127, "aluminium")

Expected output:

0.965

Python Code

Show Code
from ht.hx import L_unsupported_max as hx_L_unsupported_max

def L_unsupported_max(Do, material='CS'):
    """
    Get the maximum unsupported tube length from TEMA guidance.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        Do (float): Tube outer diameter (m).
        material (str, optional): Tube material type (-). Valid options: Carbon steel, Aluminium. Default is 'CS'.

    Returns:
        float: Maximum unsupported tube length (m).
    """
    try:
        result = hx_L_unsupported_max(Do=Do, material=material)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Tube outer diameter (m).
Tube material type (-).

NTU_FROM_EFF

This function determines the number of transfer units required to achieve a specified effectiveness at a given heat-capacity ratio and exchanger configuration. It inverts standard effectiveness-NTU relationships.

The inversion is \mathrm{NTU} = f^{-1}(\varepsilon, C_r, \text{subtype}).

Excel Usage

=NTU_FROM_EFF(effectiveness, Cr, eff_subtype, n_shell_tube)
  • effectiveness (float, required): Thermal effectiveness of the exchanger (-).
  • Cr (float, required): Heat capacity rate ratio Cmin/Cmax (-).
  • eff_subtype (str, optional, default: “counterflow”): Exchanger configuration subtype (-).
  • n_shell_tube (int, optional, default: null): Number of shell and tube exchangers in series (-).

Returns (float): Thermal number of transfer units (-).

Example 1: NTU from effectiveness for parallel flow

Inputs:

effectiveness Cr eff_subtype
0.5881156068417585 0.7 parallel

Excel formula:

=NTU_FROM_EFF(0.5881156068417585, 0.7, "parallel")

Expected output:

5

Example 2: NTU from effectiveness for crossflow

Inputs:

effectiveness Cr eff_subtype
0.8444821799748551 0.7 crossflow

Excel formula:

=NTU_FROM_EFF(0.8444821799748551, 0.7, "crossflow")

Expected output:

5

Example 3: NTU from effectiveness for counterflow

Inputs:

effectiveness Cr eff_subtype
0.9206703686051108 0.7 counterflow

Excel formula:

=NTU_FROM_EFF(0.9206703686051108, 0.7, "counterflow")

Expected output:

5

Example 4: NTU from effectiveness for shell and tube series

Inputs:

effectiveness Cr eff_subtype n_shell_tube
0.9205058702789254 0.7 S&T 50

Excel formula:

=NTU_FROM_EFF(0.9205058702789254, 0.7, "S&T", 50)

Expected output:

5

Python Code

Show Code
from ht.hx import NTU_from_effectiveness as hx_NTU_from_effectiveness

def NTU_from_eff(effectiveness, Cr, eff_subtype='counterflow', n_shell_tube=None):
    """
    Solve NTU from effectiveness, capacity ratio, and configuration.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        effectiveness (float): Thermal effectiveness of the exchanger (-).
        Cr (float): Heat capacity rate ratio Cmin/Cmax (-).
        eff_subtype (str, optional): Exchanger configuration subtype (-). Valid options: Counterflow, Parallel, Crossflow, Crossflow Approximate, Crossflow Mixed Cmin, Crossflow Mixed Cmax, Boiler, Condenser, Shell and Tube. Default is 'counterflow'.
        n_shell_tube (int, optional): Number of shell and tube exchangers in series (-). Default is None.

    Returns:
        float: Thermal number of transfer units (-).
    """
    try:
      result = hx_NTU_from_effectiveness(effectiveness=effectiveness, Cr=Cr, subtype=eff_subtype, n_shell_tube=n_shell_tube)
      return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Thermal effectiveness of the exchanger (-).
Heat capacity rate ratio Cmin/Cmax (-).
Exchanger configuration subtype (-).
Number of shell and tube exchangers in series (-).

NTU_FROM_P_BASIC

This function computes side-1 transfer units from side-1 temperature effectiveness and heat-capacity ratio for basic exchanger configurations. It supports analytical and numerical inversions depending on subtype.

The solved quantity is \mathrm{NTU}_1 = f^{-1}(P_1, R_1, \text{subtype}).

Excel Usage

=NTU_FROM_P_BASIC(p_one, r_one, basic_subtype)
  • p_one (float, required): Thermal effectiveness with respect to stream 1 (-).
  • r_one (float, required): Heat capacity ratio with respect to stream 1 (-).
  • basic_subtype (str, optional, default: “crossflow”): Basic exchanger subtype (-).

Returns (float): Thermal number of transfer units with respect to stream 1 (-).

Example 1: NTU for counterflow basic exchanger

Inputs:

p_one r_one basic_subtype
0.975 0.1 counterflow

Excel formula:

=NTU_FROM_P_BASIC(0.975, 0.1, "counterflow")

Expected output:

3.98477

Example 2: NTU for parallel flow basic exchanger

Inputs:

p_one r_one basic_subtype
0.55 0.5 parallel

Excel formula:

=NTU_FROM_P_BASIC(0.55, 0.5, "parallel")

Expected output:

1.16198

Example 3: NTU for crossflow basic exchanger

Inputs:

p_one r_one basic_subtype
0.85 0.7 crossflow

Excel formula:

=NTU_FROM_P_BASIC(0.85, 0.7, "crossflow")

Expected output:

5.20718

Example 4: NTU for crossflow mixed fluids

Inputs:

p_one r_one basic_subtype
0.65 0.3 crossflow, mixed 1&2

Excel formula:

=NTU_FROM_P_BASIC(0.65, 0.3, "crossflow, mixed 1&2")

Expected output:

1.29197

Python Code

Show Code
from ht.hx import NTU_from_P_basic as hx_NTU_from_P_basic

def NTU_from_P_basic(p_one, r_one, basic_subtype='crossflow'):
    """
    Solve NTU for a basic exchanger from effectiveness and capacity ratio.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        p_one (float): Thermal effectiveness with respect to stream 1 (-).
        r_one (float): Heat capacity ratio with respect to stream 1 (-).
        basic_subtype (str, optional): Basic exchanger subtype (-). Valid options: Counterflow, Parallel, Crossflow, Crossflow Approximate, Crossflow Mixed 1, Crossflow Mixed 2, Crossflow Mixed 1&2. Default is 'crossflow'.

    Returns:
        float: Thermal number of transfer units with respect to stream 1 (-).
    """
    try:
        result = hx_NTU_from_P_basic(P1=p_one, R1=r_one, subtype=basic_subtype)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Thermal effectiveness with respect to stream 1 (-).
Heat capacity ratio with respect to stream 1 (-).
Basic exchanger subtype (-).

NTU_FROM_P_E

This function computes side-1 transfer units for a TEMA E shell-and-tube exchanger from specified side-1 effectiveness, capacity ratio, and tube-pass configuration. It supports optimal and non-optimal pass arrangement where applicable.

The target is \mathrm{NTU}_1 = f^{-1}(P_1, R_1, N_{tp}, \text{optimal}).

Excel Usage

=NTU_FROM_P_E(p_one, r_one, ntp, optimal)
  • p_one (float, required): Thermal effectiveness with respect to stream 1 (-).
  • r_one (float, required): Heat capacity ratio with respect to stream 1 (-).
  • ntp (int, required): Number of tube passes (-).
  • optimal (bool, optional, default: true): Use optimal pass arrangement when applicable (-).

Returns (float): Thermal number of transfer units with respect to stream 1 (-).

Example 1: NTU for TEMA E with two passes

Inputs:

p_one r_one ntp
0.58 0.3333333333 2

Excel formula:

=NTU_FROM_P_E(0.58, 0.3333333333, 2)

Expected output:

1.0382

Example 2: NTU for TEMA E single pass

Inputs:

p_one r_one ntp
0.6 0.4 1

Excel formula:

=NTU_FROM_P_E(0.6, 0.4, 1)

Expected output:

1.06976

Example 3: NTU for TEMA E four passes

Inputs:

p_one r_one ntp
0.55 0.25 4

Excel formula:

=NTU_FROM_P_E(0.55, 0.25, 4)

Expected output:

0.897043

Example 4: NTU for TEMA E three passes inefficient

Inputs:

p_one r_one ntp optimal
0.52 0.5 3 false

Excel formula:

=NTU_FROM_P_E(0.52, 0.5, 3, FALSE)

Expected output:

0.919954

Python Code

Show Code
from ht.hx import NTU_from_P_E as hx_NTU_from_P_E

def NTU_from_P_E(p_one, r_one, ntp, optimal=True):
    """
    Solve NTU for a TEMA E exchanger from effectiveness and capacity ratio.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        p_one (float): Thermal effectiveness with respect to stream 1 (-).
        r_one (float): Heat capacity ratio with respect to stream 1 (-).
        ntp (int): Number of tube passes (-).
        optimal (bool, optional): Use optimal pass arrangement when applicable (-). Default is True.

    Returns:
        float: Thermal number of transfer units with respect to stream 1 (-).
    """
    try:
        result = hx_NTU_from_P_E(P1=p_one, R1=r_one, Ntp=ntp, optimal=optimal)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Thermal effectiveness with respect to stream 1 (-).
Heat capacity ratio with respect to stream 1 (-).
Number of tube passes (-).
Use optimal pass arrangement when applicable (-).

NTU_FROM_P_PLATE

This function solves side-1 transfer units for multipass plate exchangers from effectiveness, capacity ratio, and pass arrangement settings. It captures both overall flow direction and pass-level direction effects.

The inversion can be written as \mathrm{NTU}_1 = f^{-1}(P_1, R_1, N_{p1}, N_{p2}, \text{flow flags}).

Excel Usage

=NTU_FROM_P_PLATE(p_one, r_one, np_one, np_two, counterflow, passes_counterflow, reverse)
  • p_one (float, required): Thermal effectiveness with respect to stream 1 (-).
  • r_one (float, required): Heat capacity ratio with respect to stream 1 (-).
  • np_one (int, required): Number of passes on side 1 (-).
  • np_two (int, required): Number of passes on side 2 (-).
  • counterflow (bool, optional, default: true): Overall flow is counterflow when true (-).
  • passes_counterflow (bool, optional, default: true): Individual passes are counterflow when true (-).
  • reverse (bool, optional, default: false): Reverse pass order for internal compatibility (-).

Returns (float): Thermal number of transfer units with respect to stream 1 (-).

Example 1: NTU for 3 pass by 1 pass plate exchanger

Inputs:

p_one r_one np_one np_two
0.5743 0.3333333333 3 1

Excel formula:

=NTU_FROM_P_PLATE(0.5743, 0.3333333333, 3, 1)

Expected output:

0.999834

Example 2: NTU for 1 pass parallel plate exchanger

Inputs:

p_one r_one np_one np_two counterflow passes_counterflow
0.5 0.8 1 1 false false

Excel formula:

=NTU_FROM_P_PLATE(0.5, 0.8, 1, 1, FALSE, FALSE)

Expected output:

1.27921

Example 3: NTU for 2 pass by 2 pass counterflow

Inputs:

p_one r_one np_one np_two
0.6 0.4 2 2

Excel formula:

=NTU_FROM_P_PLATE(0.6, 0.4, 2, 2)

Expected output:

1.06976

Example 4: NTU for 1 pass by 2 pass plate exchanger

Inputs:

p_one r_one np_one np_two
0.55 0.6 1 2

Excel formula:

=NTU_FROM_P_PLATE(0.55, 0.6, 1, 2)

Expected output:

1.1016

Python Code

Show Code
from ht.hx import NTU_from_P_plate as hx_NTU_from_P_plate

def NTU_from_P_plate(p_one, r_one, np_one, np_two, counterflow=True, passes_counterflow=True, reverse=False):
    """
    Solve NTU for a plate exchanger from effectiveness and capacity ratio.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        p_one (float): Thermal effectiveness with respect to stream 1 (-).
        r_one (float): Heat capacity ratio with respect to stream 1 (-).
        np_one (int): Number of passes on side 1 (-).
        np_two (int): Number of passes on side 2 (-).
        counterflow (bool, optional): Overall flow is counterflow when true (-). Default is True.
        passes_counterflow (bool, optional): Individual passes are counterflow when true (-). Default is True.
        reverse (bool, optional): Reverse pass order for internal compatibility (-). Default is False.

    Returns:
        float: Thermal number of transfer units with respect to stream 1 (-).
    """
    try:
        result = hx_NTU_from_P_plate(P1=p_one, R1=r_one, Np1=np_one, Np2=np_two, counterflow=counterflow, passes_counterflow=passes_counterflow, reverse=reverse)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Thermal effectiveness with respect to stream 1 (-).
Heat capacity ratio with respect to stream 1 (-).
Number of passes on side 1 (-).
Number of passes on side 2 (-).
Overall flow is counterflow when true (-).
Individual passes are counterflow when true (-).
Reverse pass order for internal compatibility (-).

NTU_FROM_UA

This function converts overall conductance and minimum heat-capacity rate into exchanger transfer units. It is a core relation used in effectiveness-NTU calculations.

The formula is \mathrm{NTU}=\frac{UA}{C_{min}}.

Excel Usage

=NTU_FROM_UA(UA, Cmin)
  • UA (float, required): Area heat transfer coefficient product (W/K).
  • Cmin (float, required): Minimum heat capacity rate (W/K).

Returns (float): Thermal number of transfer units (-).

Example 1: NTU from UA example

Inputs:

UA Cmin
4400 22

Excel formula:

=NTU_FROM_UA(4400, 22)

Expected output:

200

Example 2: NTU for smaller UA

Inputs:

UA Cmin
1200 30

Excel formula:

=NTU_FROM_UA(1200, 30)

Expected output:

40

Example 3: NTU for larger UA

Inputs:

UA Cmin
10000 50

Excel formula:

=NTU_FROM_UA(10000, 50)

Expected output:

200

Example 4: NTU for high capacity rate

Inputs:

UA Cmin
5000 200

Excel formula:

=NTU_FROM_UA(5000, 200)

Expected output:

25

Python Code

Show Code
from ht.hx import NTU_from_UA as hx_NTU_from_UA

def NTU_from_UA(UA, Cmin):
    """
    Calculate NTU from UA and the minimum heat capacity rate.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        UA (float): Area heat transfer coefficient product (W/K).
        Cmin (float): Minimum heat capacity rate (W/K).

    Returns:
        float: Thermal number of transfer units (-).
    """
    try:
        result = hx_NTU_from_UA(UA=UA, Cmin=Cmin)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Area heat transfer coefficient product (W/K).
Minimum heat capacity rate (W/K).

NTUBES

This function estimates how many tubes fit inside a bundle diameter for a given tube diameter, pitch, pass count, and layout angle. It supports multiple counting methods and returns an integer tube count.

In abstract form, N = f(D_{bundle}, D_o, p, N_{tp}, \theta, \text{method}).

Excel Usage

=NTUBES(DBundle, Do, pitch, Ntp, angle, Ntubes_method)
  • DBundle (float, required): Outer diameter of tube bundle (m).
  • Do (float, required): Tube outer diameter (m).
  • pitch (float, required): Tube pitch (m).
  • Ntp (int, optional, default: 1): Number of tube passes (-).
  • angle (int, optional, default: 30): Tube layout angle (degrees).
  • Ntubes_method (str, optional, default: null): Tube count method selection (-).

Returns (int): Total number of tubes that fit in the bundle (-).

Example 1: Tube count with default method

Inputs:

DBundle Do pitch
1.2 0.025 0.03125

Excel formula:

=NTUBES(1.2, 0.025, 0.03125)

Expected output:

1285

Example 2: Tube count using Perry method

Inputs:

DBundle Do pitch Ntubes_method
1.2 0.025 0.03125 Perry

Excel formula:

=NTUBES(1.2, 0.025, 0.03125, "Perry")

Expected output:

1297

Example 3: Tube count using VDI method

Inputs:

DBundle Do pitch Ntubes_method
1.2 0.025 0.03125 VDI

Excel formula:

=NTUBES(1.2, 0.025, 0.03125, "VDI")

Expected output:

1340

Example 4: Tube count using HEDH method

Inputs:

DBundle Do pitch Ntubes_method
1.2 0.025 0.03125 HEDH

Excel formula:

=NTUBES(1.2, 0.025, 0.03125, "HEDH")

Expected output:

1272

Python Code

Show Code
from ht.hx import Ntubes as hx_Ntubes

def Ntubes(DBundle, Do, pitch, Ntp=1, angle=30, Ntubes_method=None):
    """
    Calculate the number of tubes that fit in a tube bundle.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        DBundle (float): Outer diameter of tube bundle (m).
        Do (float): Tube outer diameter (m).
        pitch (float): Tube pitch (m).
        Ntp (int, optional): Number of tube passes (-). Default is 1.
        angle (int, optional): Tube layout angle (degrees). Default is 30.
        Ntubes_method (str, optional): Tube count method selection (-). Valid options: Phadkeb, HEDH, VDI, Perry. Default is None.

    Returns:
        int: Total number of tubes that fit in the bundle (-).
    """
    try:
        result = hx_Ntubes(DBundle=DBundle, Do=Do, pitch=pitch, Ntp=Ntp, angle=angle, Method=Ntubes_method)
        return int(result)
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Outer diameter of tube bundle (m).
Tube outer diameter (m).
Tube pitch (m).
Number of tube passes (-).
Tube layout angle (degrees).
Tube count method selection (-).

NTUBES_HEDH

This function estimates tube count from bundle geometry using the HEDH approximation for standard layout angles. It provides a fast, approximate tube-count calculation for conceptual exchanger sizing.

The correlation is of the form N \approx \frac{0.78\,(D_{bundle}-D_o)^2}{C_1 p^2}.

Excel Usage

=NTUBES_HEDH(DBundle, Do, pitch, angle)
  • DBundle (float, required): Outer diameter of tube bundle (m).
  • Do (float, required): Tube outer diameter (m).
  • pitch (float, required): Tube pitch (m).
  • angle (int, optional, default: 30): Tube layout angle (degrees).

Returns (int): Estimated number of tubes (-).

Example 1: HEDH tube count example

Inputs:

DBundle Do pitch angle
1.184 0.028 0.036 30

Excel formula:

=NTUBES_HEDH(1.184, 0.028, 0.036, 30)

Expected output:

928

Example 2: HEDH tube count with 90 degree layout

Inputs:

DBundle Do pitch angle
1 0.025 0.03125 90

Excel formula:

=NTUBES_HEDH(1, 0.025, 0.03125, 90)

Expected output:

759

Example 3: HEDH tube count for small bundle

Inputs:

DBundle Do pitch angle
0.6 0.01905 0.025 45

Excel formula:

=NTUBES_HEDH(0.6, 0.01905, 0.025, 45)

Expected output:

421

Example 4: HEDH tube count for larger bundle

Inputs:

DBundle Do pitch angle
1.5 0.028 0.036 60

Excel formula:

=NTUBES_HEDH(1.5, 0.028, 0.036, 60)

Expected output:

1504

Python Code

Show Code
from ht.hx import Ntubes_HEDH as hx_Ntubes_HEDH

def Ntubes_HEDH(DBundle, Do, pitch, angle=30):
    """
    Estimate tube count from bundle diameter using the HEDH correlation.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        DBundle (float): Outer diameter of tube bundle (m).
        Do (float): Tube outer diameter (m).
        pitch (float): Tube pitch (m).
        angle (int, optional): Tube layout angle (degrees). Default is 30.

    Returns:
        int: Estimated number of tubes (-).
    """
    try:
        result = hx_Ntubes_HEDH(DBundle=DBundle, Do=Do, pitch=pitch, angle=angle)
        return int(result)
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Outer diameter of tube bundle (m).
Tube outer diameter (m).
Tube pitch (m).
Tube layout angle (degrees).

NTUBES_PHADKEB

This function computes tube count for a shell-and-tube bundle using Phadke’s method with pass correction behavior, pitch, tube size, and layout angle. It is a high-accuracy option for tube-count determination.

The method evaluates N = f(D_{bundle}, D_o, p, N_{tp}, \theta) and returns an integer count.

Excel Usage

=NTUBES_PHADKEB(DBundle, Do, pitch, Ntp, angle)
  • DBundle (float, required): Outer diameter of tube bundle (m).
  • Do (float, required): Tube outer diameter (m).
  • pitch (float, required): Tube pitch (m).
  • Ntp (int, required): Number of tube passes (-).
  • angle (int, optional, default: 30): Tube layout angle (degrees).

Returns (int): Total number of tubes that fit in the bundle (-).

Example 1: Phadkeb tube count example

Inputs:

DBundle Do pitch Ntp angle
1.184 0.028 0.036 2 45

Excel formula:

=NTUBES_PHADKEB(1.184, 0.028, 0.036, 2, 45)

Expected output:

782

Example 2: Phadkeb tube count with single pass

Inputs:

DBundle Do pitch Ntp angle
1.008 0.028 0.036 1 45

Excel formula:

=NTUBES_PHADKEB(1.008, 0.028, 0.036, 1, 45)

Expected output:

593

Example 3: Phadkeb tube count with four passes

Inputs:

DBundle Do pitch Ntp angle
1.2 0.025 0.03125 4 30

Excel formula:

=NTUBES_PHADKEB(1.2, 0.025, 0.03125, 4, 30)

Expected output:

1184

Example 4: Phadkeb tube count for smaller bundle

Inputs:

DBundle Do pitch Ntp angle
0.8 0.01905 0.025 2 30

Excel formula:

=NTUBES_PHADKEB(0.8, 0.01905, 0.025, 2, 30)

Expected output:

846

Python Code

Show Code
from ht.hx import Ntubes_Phadkeb as hx_Ntubes_Phadkeb

def Ntubes_Phadkeb(DBundle, Do, pitch, Ntp, angle=30):
    """
    Calculate tube count from bundle diameter using Phadke's method.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        DBundle (float): Outer diameter of tube bundle (m).
        Do (float): Tube outer diameter (m).
        pitch (float): Tube pitch (m).
        Ntp (int): Number of tube passes (-).
        angle (int, optional): Tube layout angle (degrees). Default is 30.

    Returns:
        int: Total number of tubes that fit in the bundle (-).
    """
    try:
        result = hx_Ntubes_Phadkeb(DBundle=DBundle, Do=Do, pitch=pitch, Ntp=Ntp, angle=angle)
        return int(result)
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Outer diameter of tube bundle (m).
Tube outer diameter (m).
Tube pitch (m).
Number of tube passes (-).
Tube layout angle (degrees).

NTUBES_VDI

This function estimates tube count from bundle diameter using VDI Heat Atlas correlations for specified pass count and tube layout. It is an approximate method useful for rapid sizing checks.

The calculation follows a correlation structure N = f(D_{bundle}, N_{tp}, D_o, p, \theta).

Excel Usage

=NTUBES_VDI(DBundle, Ntp, Do, pitch, angle)
  • DBundle (float, required): Outer diameter of tube bundle (m).
  • Ntp (int, required): Number of tube passes (-).
  • Do (float, required): Tube outer diameter (m).
  • pitch (float, required): Tube pitch (m).
  • angle (int, optional, default: 30): Tube layout angle (degrees).

Returns (int): Estimated number of tubes (-).

Example 1: VDI tube count example

Inputs:

DBundle Ntp Do pitch angle
1.184 2 0.028 0.036 30

Excel formula:

=NTUBES_VDI(1.184, 2, 0.028, 0.036, 30)

Expected output:

966

Example 2: VDI tube count with 90 degree layout

Inputs:

DBundle Ntp Do pitch angle
1.1 4 0.025 0.03125 90

Excel formula:

=NTUBES_VDI(1.1, 4, 0.025, 0.03125, 90)

Expected output:

901

Example 3: VDI tube count for small bundle

Inputs:

DBundle Ntp Do pitch angle
0.7 1 0.01905 0.025 45

Excel formula:

=NTUBES_VDI(0.7, 1, 0.01905, 0.025, 45)

Expected output:

603

Example 4: VDI tube count with six passes

Inputs:

DBundle Ntp Do pitch angle
1.3 6 0.025 0.03125 30

Excel formula:

=NTUBES_VDI(1.3, 6, 0.025, 0.03125, 30)

Expected output:

1472

Python Code

Show Code
from ht.hx import Ntubes_VDI as hx_Ntubes_VDI

def Ntubes_VDI(DBundle, Ntp, Do, pitch, angle=30):
    """
    Estimate tube count from bundle diameter using the VDI method.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        DBundle (float): Outer diameter of tube bundle (m).
        Ntp (int): Number of tube passes (-).
        Do (float): Tube outer diameter (m).
        pitch (float): Tube pitch (m).
        angle (int, optional): Tube layout angle (degrees). Default is 30.

    Returns:
        int: Estimated number of tubes (-).
    """
    try:
        result = hx_Ntubes_VDI(DBundle=DBundle, Ntp=Ntp, Do=Do, pitch=pitch, angle=angle)
        return int(result)
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Outer diameter of tube bundle (m).
Number of tube passes (-).
Tube outer diameter (m).
Tube pitch (m).
Tube layout angle (degrees).

P_NTU_METHOD

This function solves exchanger performance with the P-NTU method from stream flow, heat capacities, geometry subtype, and a valid temperature/UA specification set. It returns heat duty and related thermal state properties as an Excel data type.

Key definitions include \mathrm{NTU}_1=\frac{UA}{C_1} and Q=P_1 C_1\Delta T_{max}.

Excel Usage

=P_NTU_METHOD(m_one, m_two, cp_one, cp_two, UA, t_one_i, t_one_o, t_two_i, t_two_o, subtype, Ntp, optimal)
  • m_one (float, required): Mass flow rate of stream 1 (kg/s).
  • m_two (float, required): Mass flow rate of stream 2 (kg/s).
  • cp_one (float, required): Heat capacity of stream 1 (J/kg/K).
  • cp_two (float, required): Heat capacity of stream 2 (J/kg/K).
  • UA (float, optional, default: null): Area heat transfer coefficient product (W/K).
  • t_one_i (float, optional, default: null): Stream 1 inlet temperature (K).
  • t_one_o (float, optional, default: null): Stream 1 outlet temperature (K).
  • t_two_i (float, optional, default: null): Stream 2 inlet temperature (K).
  • t_two_o (float, optional, default: null): Stream 2 outlet temperature (K).
  • subtype (str, optional, default: “crossflow”): Exchanger configuration subtype (-).
  • Ntp (int, optional, default: 1): Number of tube passes for TEMA exchangers (-).
  • optimal (bool, optional, default: true): Use optimal pass arrangement when applicable (-).

Returns (float): Heat exchanged, with additional properties for temperatures and ratios.

Example 1: P-NTU with specified UA and inlet temperatures

Inputs:

m_one m_two cp_one cp_two UA t_two_i t_one_i subtype Ntp
5.2 1.45 1860 1900 3041.75 15 130 E 4

Excel formula:

=P_NTU_METHOD(5.2, 1.45, 1860, 1900, 3041.75, 15, 130, "E", 4)

Expected output:

{"type":"Double","basicValue":192515,"properties":{"Q":{"type":"Double","basicValue":192515},"UA":{"type":"Double","basicValue":3041.75},"T1i":{"type":"Double","basicValue":130},"T1o":{"type":"Double","basicValue":110.096},"T2i":{"type":"Double","basicValue":15},"T2o":{"type":"Double","basicValue":84.8783},"P1":{"type":"Double","basicValue":0.173081},"P2":{"type":"Double","basicValue":0.607637},"R1":{"type":"Double","basicValue":3.51071},"R2":{"type":"Double","basicValue":0.284843},"C1":{"type":"Double","basicValue":9672},"C2":{"type":"Double","basicValue":2755},"NTU1":{"type":"Double","basicValue":0.31449},"NTU2":{"type":"Double","basicValue":1.10408}}}

Example 2: P-NTU with unknown UA and known outlet temperature

Inputs:

m_one m_two cp_one cp_two t_one_i t_two_i t_two_o subtype Ntp
5.2 1.45 1860 1900 130 15 84.87829918042112 E 4

Excel formula:

=P_NTU_METHOD(5.2, 1.45, 1860, 1900, 130, 15, 84.87829918042112, "E", 4)

Expected output:

{"type":"Double","basicValue":192515,"properties":{"Q":{"type":"Double","basicValue":192515},"UA":{"type":"Double","basicValue":3041.75},"T1i":{"type":"Double","basicValue":130},"T1o":{"type":"Double","basicValue":110.096},"T2i":{"type":"Double","basicValue":15},"T2o":{"type":"Double","basicValue":84.8783},"P1":{"type":"Double","basicValue":0.173081},"P2":{"type":"Double","basicValue":0.607637},"R1":{"type":"Double","basicValue":3.51071},"R2":{"type":"Double","basicValue":0.284843},"C1":{"type":"Double","basicValue":9672},"C2":{"type":"Double","basicValue":2755},"NTU1":{"type":"Double","basicValue":0.31449},"NTU2":{"type":"Double","basicValue":1.10408}}}

Example 3: P-NTU plate exchanger with parallel flow

Inputs:

m_one m_two cp_one cp_two UA t_one_o t_two_o subtype optimal
5.2 1.45 1860 1900 300 126.7 26.7 2/2p false

Excel formula:

=P_NTU_METHOD(5.2, 1.45, 1860, 1900, 300, 126.7, 26.7, "2/2p", FALSE)

Expected output:

{"type":"Double","basicValue":32200.1,"properties":{"Q":{"type":"Double","basicValue":32200.1},"UA":{"type":"Double","basicValue":300},"T1i":{"type":"Double","basicValue":130.029},"T1o":{"type":"Double","basicValue":126.7},"T2i":{"type":"Double","basicValue":15.0121},"T2o":{"type":"Double","basicValue":26.7},"P1":{"type":"Double","basicValue":0.0289453},"P2":{"type":"Double","basicValue":0.101618},"R1":{"type":"Double","basicValue":3.51071},"R2":{"type":"Double","basicValue":0.284843},"C1":{"type":"Double","basicValue":9672},"C2":{"type":"Double","basicValue":2755},"NTU1":{"type":"Double","basicValue":0.0310174},"NTU2":{"type":"Double","basicValue":0.108893}}}

Example 4: P-NTU for basic crossflow configuration

Inputs:

m_one m_two cp_one cp_two UA t_one_i t_two_i subtype
4 2 2000 1800 1500 420 300 crossflow

Excel formula:

=P_NTU_METHOD(4, 2, 2000, 1800, 1500, 420, 300, "crossflow")

Expected output:

{"type":"Double","basicValue":136614,"properties":{"Q":{"type":"Double","basicValue":136614},"UA":{"type":"Double","basicValue":1500},"T1i":{"type":"Double","basicValue":420},"T1o":{"type":"Double","basicValue":402.923},"T2i":{"type":"Double","basicValue":300},"T2o":{"type":"Double","basicValue":337.948},"P1":{"type":"Double","basicValue":0.142307},"P2":{"type":"Double","basicValue":0.316237},"R1":{"type":"Double","basicValue":2.22222},"R2":{"type":"Double","basicValue":0.45},"C1":{"type":"Double","basicValue":8000},"C2":{"type":"Double","basicValue":3600},"NTU1":{"type":"Double","basicValue":0.1875},"NTU2":{"type":"Double","basicValue":0.416667}}}

Python Code

Show Code
from ht.hx import P_NTU_method as hx_P_NTU_method

def P_NTU_method(m_one, m_two, cp_one, cp_two, UA=None, t_one_i=None, t_one_o=None, t_two_i=None, t_two_o=None, subtype='crossflow', Ntp=1, optimal=True):
    """
    Solve a heat exchanger with the P-NTU method.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        m_one (float): Mass flow rate of stream 1 (kg/s).
        m_two (float): Mass flow rate of stream 2 (kg/s).
        cp_one (float): Heat capacity of stream 1 (J/kg/K).
        cp_two (float): Heat capacity of stream 2 (J/kg/K).
        UA (float, optional): Area heat transfer coefficient product (W/K). Default is None.
        t_one_i (float, optional): Stream 1 inlet temperature (K). Default is None.
        t_one_o (float, optional): Stream 1 outlet temperature (K). Default is None.
        t_two_i (float, optional): Stream 2 inlet temperature (K). Default is None.
        t_two_o (float, optional): Stream 2 outlet temperature (K). Default is None.
        subtype (str, optional): Exchanger configuration subtype (-). Default is 'crossflow'.
        Ntp (int, optional): Number of tube passes for TEMA exchangers (-). Default is 1.
        optimal (bool, optional): Use optimal pass arrangement when applicable (-). Default is True.

    Returns:
        float: Heat exchanged, with additional properties for temperatures and ratios.
    """
    try:
        results = hx_P_NTU_method(m1=m_one, m2=m_two, Cp1=cp_one, Cp2=cp_two, UA=UA, T1i=t_one_i, T1o=t_one_o, T2i=t_two_i, T2o=t_two_o, subtype=subtype, Ntp=Ntp, optimal=optimal)
        if not isinstance(results, dict):
            return "Error: Expected a result dictionary"

        def to_prop(value):
            return {"type": "Double", "basicValue": value}

        return {
            "type": "Double",
            "basicValue": results.get("Q"),
            "properties": {
                "Q": to_prop(results.get("Q")),
                "UA": to_prop(results.get("UA")),
                "T1i": to_prop(results.get("T1i")),
                "T1o": to_prop(results.get("T1o")),
                "T2i": to_prop(results.get("T2i")),
                "T2o": to_prop(results.get("T2o")),
                "P1": to_prop(results.get("P1")),
                "P2": to_prop(results.get("P2")),
                "R1": to_prop(results.get("R1")),
                "R2": to_prop(results.get("R2")),
                "C1": to_prop(results.get("C1")),
                "C2": to_prop(results.get("C2")),
                "NTU1": to_prop(results.get("NTU1")),
                "NTU2": to_prop(results.get("NTU2"))
            }
        }
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Mass flow rate of stream 1 (kg/s).
Mass flow rate of stream 2 (kg/s).
Heat capacity of stream 1 (J/kg/K).
Heat capacity of stream 2 (J/kg/K).
Area heat transfer coefficient product (W/K).
Stream 1 inlet temperature (K).
Stream 1 outlet temperature (K).
Stream 2 inlet temperature (K).
Stream 2 outlet temperature (K).
Exchanger configuration subtype (-).
Number of tube passes for TEMA exchangers (-).
Use optimal pass arrangement when applicable (-).

SHELL_CLEARANCE

This function looks up recommended clearance between exchanger shell and tube bundle from TEMA tabulated guidance using either bundle diameter or shell diameter. It supports mechanical fit checks in preliminary design.

The clearance is obtained from a standards lookup c = f(D_{bundle}\ \text{or}\ D_{shell}).

Excel Usage

=SHELL_CLEARANCE(DBundle, DShell)
  • DBundle (float, optional, default: null): Outer diameter of tube bundle (m).
  • DShell (float, optional, default: null): Shell inner diameter (m).

Returns (float): Shell-to-bundle clearance (m).

Example 1: Clearance from bundle diameter

Inputs:

DBundle
1.245

Excel formula:

=SHELL_CLEARANCE(1.245)

Expected output:

0.0064

Example 2: Clearance from shell diameter

Inputs:

DShell
1.3

Excel formula:

=SHELL_CLEARANCE(1.3)

Expected output:

0.0064

Example 3: Clearance for smaller bundle

Inputs:

DBundle
0.6

Excel formula:

=SHELL_CLEARANCE(0.6)

Expected output:

0.0048

Example 4: Clearance for medium shell

Inputs:

DShell
0.9

Excel formula:

=SHELL_CLEARANCE(0.9)

Expected output:

0.0048

Python Code

Show Code
from ht.hx import shell_clearance as hx_shell_clearance

def shell_clearance(DBundle=None, DShell=None):
    """
    Look up shell-to-bundle clearance from TEMA guidance.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        DBundle (float, optional): Outer diameter of tube bundle (m). Default is None.
        DShell (float, optional): Shell inner diameter (m). Default is None.

    Returns:
        float: Shell-to-bundle clearance (m).
    """
    try:
        result = hx_shell_clearance(DBundle=DBundle, DShell=DShell)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Outer diameter of tube bundle (m).
Shell inner diameter (m).

TEMP_EFF_BASIC

This function computes side-1 temperature effectiveness for basic exchanger configurations from heat-capacity ratio and side-1 transfer units. It supports counterflow, parallel flow, and crossflow variants.

The functional form is P_1=f(R_1, \mathrm{NTU}_1, \text{subtype}).

Excel Usage

=TEMP_EFF_BASIC(r_one, ntu_one, basic_subtype)
  • r_one (float, required): Heat capacity ratio with respect to stream 1 (-).
  • ntu_one (float, required): Thermal number of transfer units with respect to stream 1 (-).
  • basic_subtype (str, optional, default: “crossflow”): Basic exchanger subtype (-).

Returns (float): Temperature effectiveness with respect to stream 1 (-).

Example 1: Basic effectiveness for counterflow

Inputs:

r_one ntu_one basic_subtype
0.1 4 counterflow

Excel formula:

=TEMP_EFF_BASIC(0.1, 4, "counterflow")

Expected output:

0.975341

Example 2: Basic effectiveness for parallel flow

Inputs:

r_one ntu_one basic_subtype
0.4 1.5 parallel

Excel formula:

=TEMP_EFF_BASIC(0.4, 1.5, "parallel")

Expected output:

0.626817

Example 3: Basic effectiveness for crossflow

Inputs:

r_one ntu_one basic_subtype
0.7 2 crossflow

Excel formula:

=TEMP_EFF_BASIC(0.7, 2, "crossflow")

Expected output:

0.683005

Example 4: Basic effectiveness for mixed crossflow

Inputs:

r_one ntu_one basic_subtype
0.3 1.2 crossflow, mixed 1&2

Excel formula:

=TEMP_EFF_BASIC(0.3, 1.2, "crossflow, mixed 1&2")

Expected output:

0.628933

Python Code

Show Code
from ht.hx import temperature_effectiveness_basic as hx_temperature_effectiveness_basic

def temp_eff_basic(r_one, ntu_one, basic_subtype='crossflow'):
    """
    Compute temperature effectiveness for a basic exchanger type.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        r_one (float): Heat capacity ratio with respect to stream 1 (-).
        ntu_one (float): Thermal number of transfer units with respect to stream 1 (-).
        basic_subtype (str, optional): Basic exchanger subtype (-). Valid options: Counterflow, Parallel, Crossflow, Crossflow Approximate, Crossflow Mixed 1, Crossflow Mixed 2, Crossflow Mixed 1&2. Default is 'crossflow'.

    Returns:
        float: Temperature effectiveness with respect to stream 1 (-).
    """
    try:
      result = hx_temperature_effectiveness_basic(R1=r_one, NTU1=ntu_one, subtype=basic_subtype)
      return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Heat capacity ratio with respect to stream 1 (-).
Thermal number of transfer units with respect to stream 1 (-).
Basic exchanger subtype (-).

TEMP_EFF_PLATE

This function computes side-1 temperature effectiveness for multipass plate heat exchangers from capacity ratio, transfer units, pass counts, and flow-direction options. It supports many plate pass arrangements used in exchanger design.

The model evaluates P_1=f(R_1, \mathrm{NTU}_1, N_{p1}, N_{p2}, \text{flow flags}).

Excel Usage

=TEMP_EFF_PLATE(r_one, ntu_one, np_one, np_two, counterflow, passes_counterflow, reverse)
  • r_one (float, required): Heat capacity ratio with respect to stream 1 (-).
  • ntu_one (float, required): Thermal number of transfer units with respect to stream 1 (-).
  • np_one (int, required): Number of passes on side 1 (-).
  • np_two (int, required): Number of passes on side 2 (-).
  • counterflow (bool, optional, default: true): Overall flow is counterflow when true (-).
  • passes_counterflow (bool, optional, default: true): Individual passes are counterflow when true (-).
  • reverse (bool, optional, default: false): Reverse pass order for internal compatibility (-).

Returns (float): Temperature effectiveness with respect to stream 1 (-).

Example 1: Plate effectiveness for 3 pass by 1 pass

Inputs:

r_one ntu_one np_one np_two
0.3333333333 1 3 1

Excel formula:

=TEMP_EFF_PLATE(0.3333333333, 1, 3, 1)

Expected output:

0.574351

Example 2: Plate effectiveness with passes swapped

Inputs:

r_one ntu_one np_one np_two
0.3333333333 1 1 3

Excel formula:

=TEMP_EFF_PLATE(0.3333333333, 1, 1, 3)

Expected output:

0.571873

Example 3: Plate effectiveness for parallel flow

Inputs:

r_one ntu_one np_one np_two counterflow passes_counterflow
0.6 1.4 1 1 false false

Excel formula:

=TEMP_EFF_PLATE(0.6, 1.4, 1, 1, FALSE, FALSE)

Expected output:

0.558463

Example 4: Plate effectiveness for 2 pass by 2 pass counterflow

Inputs:

r_one ntu_one np_one np_two
0.4 1.8 2 2

Excel formula:

=TEMP_EFF_PLATE(0.4, 1.8, 2, 2)

Expected output:

0.764214

Python Code

Show Code
from ht.hx import temperature_effectiveness_plate as hx_temperature_effectiveness_plate

def temp_eff_plate(r_one, ntu_one, np_one, np_two, counterflow=True, passes_counterflow=True, reverse=False):
    """
    Compute temperature effectiveness for a plate exchanger.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        r_one (float): Heat capacity ratio with respect to stream 1 (-).
        ntu_one (float): Thermal number of transfer units with respect to stream 1 (-).
        np_one (int): Number of passes on side 1 (-).
        np_two (int): Number of passes on side 2 (-).
        counterflow (bool, optional): Overall flow is counterflow when true (-). Default is True.
        passes_counterflow (bool, optional): Individual passes are counterflow when true (-). Default is True.
        reverse (bool, optional): Reverse pass order for internal compatibility (-). Default is False.

    Returns:
        float: Temperature effectiveness with respect to stream 1 (-).
    """
    try:
        result = hx_temperature_effectiveness_plate(R1=r_one, NTU1=ntu_one, Np1=np_one, Np2=np_two, counterflow=counterflow, passes_counterflow=passes_counterflow, reverse=reverse)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Heat capacity ratio with respect to stream 1 (-).
Thermal number of transfer units with respect to stream 1 (-).
Number of passes on side 1 (-).
Number of passes on side 2 (-).
Overall flow is counterflow when true (-).
Individual passes are counterflow when true (-).
Reverse pass order for internal compatibility (-).

TEMP_EFF_TEMA_E

This function computes side-1 temperature effectiveness for TEMA E exchangers from side-1 capacity ratio, side-1 transfer units, pass count, and pass-arrangement mode. It is used in shell-and-tube P-NTU performance calculations.

The computed metric is P_1=f(R_1, \mathrm{NTU}_1, N_{tp}, \text{optimal}).

Excel Usage

=TEMP_EFF_TEMA_E(r_one, ntu_one, ntp, optimal)
  • r_one (float, required): Heat capacity ratio with respect to stream 1 (-).
  • ntu_one (float, required): Thermal number of transfer units with respect to stream 1 (-).
  • ntp (int, optional, default: 1): Number of tube passes (-).
  • optimal (bool, optional, default: true): Use optimal pass arrangement when applicable (-).

Returns (float): Temperature effectiveness with respect to stream 1 (-).

Example 1: TEMA E effectiveness example

Inputs:

r_one ntu_one ntp
0.3333333333 1 1

Excel formula:

=TEMP_EFF_TEMA_E(0.3333333333, 1, 1)

Expected output:

0.58705

Example 2: TEMA E effectiveness for two passes

Inputs:

r_one ntu_one ntp
0.4 1.2 2

Excel formula:

=TEMP_EFF_TEMA_E(0.4, 1.2, 2)

Expected output:

0.60745

Example 3: TEMA E effectiveness for four passes

Inputs:

r_one ntu_one ntp
0.25 1.5 4

Excel formula:

=TEMP_EFF_TEMA_E(0.25, 1.5, 4)

Expected output:

0.704287

Example 4: TEMA E effectiveness for inefficient three passes

Inputs:

r_one ntu_one ntp optimal
0.5 0.8 3 false

Excel formula:

=TEMP_EFF_TEMA_E(0.5, 0.8, 3, FALSE)

Expected output:

0.481904

Python Code

Show Code
from ht.hx import temperature_effectiveness_TEMA_E as hx_temperature_effectiveness_TEMA_E

def temp_eff_TEMA_E(r_one, ntu_one, ntp=1, optimal=True):
    """
    Compute temperature effectiveness for a TEMA E exchanger.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        r_one (float): Heat capacity ratio with respect to stream 1 (-).
        ntu_one (float): Thermal number of transfer units with respect to stream 1 (-).
        ntp (int, optional): Number of tube passes (-). Default is 1.
        optimal (bool, optional): Use optimal pass arrangement when applicable (-). Default is True.

    Returns:
        float: Temperature effectiveness with respect to stream 1 (-).
    """
    try:
        result = hx_temperature_effectiveness_TEMA_E(R1=r_one, NTU1=ntu_one, Ntp=ntp, optimal=optimal)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Heat capacity ratio with respect to stream 1 (-).
Thermal number of transfer units with respect to stream 1 (-).
Number of tube passes (-).
Use optimal pass arrangement when applicable (-).

UA_FROM_NTU

This function converts exchanger transfer units and minimum heat-capacity rate into overall conductance. It is the inverse of the standard NTU-from-UA relation.

The formula is UA=\mathrm{NTU}\,C_{min}.

Excel Usage

=UA_FROM_NTU(NTU, Cmin)
  • NTU (float, required): Thermal number of transfer units (-).
  • Cmin (float, required): Minimum heat capacity rate (W/K).

Returns (float): Area heat transfer coefficient product (W/K).

Example 1: UA from NTU example

Inputs:

NTU Cmin
200 22

Excel formula:

=UA_FROM_NTU(200, 22)

Expected output:

4400

Example 2: UA for smaller NTU

Inputs:

NTU Cmin
5 100

Excel formula:

=UA_FROM_NTU(5, 100)

Expected output:

500

Example 3: UA for larger NTU

Inputs:

NTU Cmin
50 250

Excel formula:

=UA_FROM_NTU(50, 250)

Expected output:

12500

Example 4: UA for high capacity rate

Inputs:

NTU Cmin
10 500

Excel formula:

=UA_FROM_NTU(10, 500)

Expected output:

5000

Python Code

Show Code
from ht.hx import UA_from_NTU as hx_UA_from_NTU

def UA_from_NTU(NTU, Cmin):
    """
    Calculate UA from NTU and the minimum heat capacity rate.

    See: https://ht.readthedocs.io/en/latest/ht.hx.html

    This example function is provided as-is without any representation of accuracy.

    Args:
        NTU (float): Thermal number of transfer units (-).
        Cmin (float): Minimum heat capacity rate (W/K).

    Returns:
        float: Area heat transfer coefficient product (W/K).
    """
    try:
        result = hx_UA_from_NTU(NTU=NTU, Cmin=Cmin)
        return result
    except Exception as e:
        return f"Error: {str(e)}"

Online Calculator

Thermal number of transfer units (-).
Minimum heat capacity rate (W/K).