LMTD
This function computes the log-mean temperature difference (LMTD) for ideal counterflow or co-current heat exchangers from inlet and outlet temperatures. LMTD is the effective driving force used in exchanger design equations.
\Delta T_{\mathrm{LMTD}}=\frac{\Delta T_1-\Delta T_2}{\ln(\Delta T_1/\Delta T_2)}
It correctly handles limiting cases where the terminal temperature differences become equal.
Excel Usage
=LMTD(Thi, Tho, Tci, Tco, counterflow)
Thi(float, required): Hot fluid inlet temperature (K).Tho(float, required): Hot fluid outlet temperature (K).Tci(float, required): Cold fluid inlet temperature (K).Tco(float, required): Cold fluid outlet temperature (K).counterflow(bool, optional, default: true): Whether the exchanger is counterflow (true) or co-current (false).
Returns (float): Log-mean temperature difference (K), or an error message if invalid.
Example 1: Counterflow temperature difference
Inputs:
| Thi | Tho | Tci | Tco | counterflow |
|---|---|---|---|---|
| 100 | 60 | 30 | 40.2 | true |
Excel formula:
=LMTD(100, 60, 30, 40.2, TRUE)
Expected output:
43.2004
Example 2: Co-current temperature difference
Inputs:
| Thi | Tho | Tci | Tco | counterflow |
|---|---|---|---|---|
| 100 | 60 | 30 | 40.2 | false |
Excel formula:
=LMTD(100, 60, 30, 40.2, FALSE)
Expected output:
39.7525
Example 3: Counterflow with equal temperature difference
Inputs:
| Thi | Tho | Tci | Tco | counterflow |
|---|---|---|---|---|
| 100 | 60 | 20 | 60 | true |
Excel formula:
=LMTD(100, 60, 20, 60, TRUE)
Expected output:
40
Example 4: Co-current with equal temperature difference
Inputs:
| Thi | Tho | Tci | Tco | counterflow |
|---|---|---|---|---|
| 100 | 60 | 20 | 60 | false |
Excel formula:
=LMTD(100, 60, 20, 60, FALSE)
Expected output:
0
Python Code
Show Code
from ht.air_cooler import LMTD as ht_LMTD
def LMTD(Thi, Tho, Tci, Tco, counterflow=True):
"""
Compute the log-mean temperature difference for a heat exchanger.
See: https://ht.readthedocs.io/en/latest/ht.air_cooler.html
This example function is provided as-is without any representation of accuracy.
Args:
Thi (float): Hot fluid inlet temperature (K).
Tho (float): Hot fluid outlet temperature (K).
Tci (float): Cold fluid inlet temperature (K).
Tco (float): Cold fluid outlet temperature (K).
counterflow (bool, optional): Whether the exchanger is counterflow (true) or co-current (false). Default is True.
Returns:
float: Log-mean temperature difference (K), or an error message if invalid.
"""
try:
return ht_LMTD(Thi=Thi, Tho=Tho, Tci=Tci, Tco=Tco, counterflow=counterflow)
except Exception as e:
return f"Error: {str(e)}"Online Calculator
Hot fluid inlet temperature (K).
Hot fluid outlet temperature (K).
Cold fluid inlet temperature (K).
Cold fluid outlet temperature (K).
Whether the exchanger is counterflow (true) or co-current (false).