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)}"