EFF_NTU
Excel Usage
=EFF_NTU(mh, mc, Cph, Cpc, subtype, Thi, Tho, Tci, Tco, UA)
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)subtype(str, optional, default: “counterflow”): Type of heat exchanger.Thi(float, optional, default: null): Hot inlet temperature (K). Optional.Tho(float, optional, default: null): Hot outlet temperature (K). Optional.Tci(float, optional, default: null): Cold inlet temperature (K). Optional.Tco(float, optional, default: null): Cold outlet temperature (K). Optional.UA(float, optional, default: null): Heat transfer coefficient times area (W/K). Optional.
Returns (list[list]): Table of results (Q, effectiveness, NTU, temperatures, UA).
Examples
Example 1: Solve for outlet temperatures
Inputs:
| mh | mc | Cph | Cpc | Thi | Tci | UA |
|---|---|---|---|---|---|---|
| 1 | 1 | 4180 | 4180 | 353.15 | 293.15 | 5000 |
Excel formula:
=EFF_NTU(1, 1, 4180, 4180, 353.15, 293.15, 5000)
Expected output:
| Result | |
|---|---|
| Q | 136601.30719 |
| UA | 5000 |
| Cr | 1 |
| Cmin | 4180 |
| Cmax | 4180 |
| effectiveness | 0.54466 |
| NTU | 1.19617 |
| Thi | 353.15 |
| Tho | 320.47026 |
| Tci | 293.15 |
| Tco | 325.82974 |
Example 2: Solve for UA
Inputs:
| mh | mc | Cph | Cpc | Thi | Tho | Tci |
|---|---|---|---|---|---|---|
| 0.5 | 0.8 | 2000 | 4200 | 400 | 350 | 300 |
Excel formula:
=EFF_NTU(0.5, 0.8, 2000, 4200, 400, 350, 300)
Expected output:
| Result | |
|---|---|
| Q | 50000 |
| UA | 757.46335 |
| Cr | 0.29762 |
| Cmin | 1000 |
| Cmax | 3360 |
| effectiveness | 0.5 |
| NTU | 0.75746 |
| Thi | 400 |
| Tho | 350 |
| Tci | 300 |
| Tco | 314.88095 |
Example 3: Boiler case
Inputs:
| mh | mc | Cph | Cpc | subtype | Thi | Tci | UA |
|---|---|---|---|---|---|---|---|
| 1 | 0.1 | 4000 | 2000 | boiler | 400 | 300 | 2000 |
Excel formula:
=EFF_NTU(1, 0.1, 4000, 2000, "boiler", 400, 300, 2000)
Expected output:
| Result | |
|---|---|
| Q | 19999.092 |
| UA | 2000 |
| Cr | 0.05 |
| Cmin | 200 |
| Cmax | 4000 |
| effectiveness | 0.99995 |
| NTU | 10 |
| Thi | 400 |
| Tho | 395.00023 |
| Tci | 300 |
| Tco | 399.99546 |
Example 4: Condenser case
Inputs:
| mh | mc | Cph | Cpc | subtype | Thi | Tci | UA |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 2000 | 4000 | condenser | 400 | 300 | 5000 |
Excel formula:
=EFF_NTU(1, 1, 2000, 4000, "condenser", 400, 300, 5000)
Expected output:
| Result | |
|---|---|
| Q | 183583.00028 |
| UA | 5000 |
| Cr | 0.5 |
| Cmin | 2000 |
| Cmax | 4000 |
| effectiveness | 0.91792 |
| NTU | 2.5 |
| Thi | 400 |
| Tho | 308.2085 |
| Tci | 300 |
| Tco | 345.89575 |
Python Code
from ht.hx import effectiveness_NTU_method
def eff_ntu(mh, mc, Cph, Cpc, subtype='counterflow', Thi=None, Tho=None, Tci=None, Tco=None, UA=None):
"""
Solve heat exchanger using the Effectiveness-NTU method.
See: https://ht.readthedocs.io/en/latest/ht.hx.html#ht.hx.effectiveness_NTU_method
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)
subtype (str, optional): Type of heat exchanger. Valid options: Counterflow, Parallel, Crossflow, Crossflow, mixed Cmin, Crossflow, mixed Cmax, Boiler, Condenser, Shell & Tube. Default is 'counterflow'.
Thi (float, optional): Hot inlet temperature (K). Optional. Default is None.
Tho (float, optional): Hot outlet temperature (K). Optional. Default is None.
Tci (float, optional): Cold inlet temperature (K). Optional. Default is None.
Tco (float, optional): Cold outlet temperature (K). Optional. Default is None.
UA (float, optional): Heat transfer coefficient times area (W/K). Optional. Default is None.
Returns:
list[list]: Table of results (Q, effectiveness, NTU, temperatures, UA).
"""
def f(x):
return float(x) if x is not None else None
try:
required = {"mh": mh, "mc": mc, "Cph": Cph, "Cpc": Cpc}
missing = [name for name, val in required.items() if val is None]
if missing:
return f"Error: Missing required inputs: {', '.join(missing)}"
res = effectiveness_NTU_method(mh=f(mh), mc=f(mc), Cph=f(Cph), Cpc=f(Cpc),
subtype=subtype, Thi=f(Thi), Tho=f(Tho),
Tci=f(Tci), Tco=f(Tco), UA=f(UA))
if isinstance(res, dict):
ordered_keys = ["Q", "UA", "Cr", "Cmin", "Cmax", "effectiveness", "NTU", "Thi", "Tho", "Tci", "Tco"]
output = []
for key in ordered_keys:
if key in res:
value = res.get(key)
value = "" if value is None else float(value)
output.append([key, value])
for key in sorted(k for k in res.keys() if k not in ordered_keys):
value = res.get(key)
value = "" if value is None else float(value)
output.append([key, value])
return output
return float(res)
except Exception as e:
return f"Error: {str(e)}"