Skip to content

Heat Exchanger Design

In this tutorial you will model a counter-current heat exchanger in DWSIM's Classic UI: a hot water stream cooled by a cold water stream. Unlike heaters and coolers (single-sided), a heat exchanger transfers energy between two streams simultaneously.

What you will learn

  • How to insert and configure a Heat Exchanger from the Object Palette
  • How to specify UA (overall heat transfer coefficient × area) and pressure drops
  • How to read LMTD, heat duty, and outlet temperatures from the Results tab
  • The difference between calculation modes (Pinch Point, UA, Outlet Temperature)

Prerequisites

  • Completed Heater and Cooler
  • Concept of LMTD: the logarithmic mean temperature difference drives heat transfer

Process Overview

A shell-and-tube heat exchanger is the workhorse of the process industry. One fluid flows through the tubes (tube side) while another flows around the tubes (shell side). Heat transfers from the hotter fluid to the cooler one.

In counter-current flow, the two fluids flow in opposite directions, which maximizes the temperature driving force and lets the cold outlet approach the hot inlet temperature.

The fundamental equation: Q = U * A * LMTD.

Process Flow Diagram

graph LR
    HI["Hot Inlet<br/>400 K, 3 atm<br/>1 kg/s Water"] --> HX["HX-1<br/>(Heat Exchanger)"]
    CI["Cold Inlet<br/>300 K, 1 atm<br/>2 kg/s Water"] --> HX
    HX -->|Hot out| HO["Hot Outlet<br/>(cooled)"]
    HX -->|Cold out| CO["Cold Outlet<br/>(heated)"]

Key Design Parameters

Parameter Hot Side Cold Side
Compound Water Water
Inlet temperature 400 K 300 K
Pressure 3 atm (304000 Pa) 1 atm (101325 Pa)
Mass flow 1.0 kg/s 2.0 kg/s
Pressure drop 10000 Pa 5000 Pa
HX Parameter Value
Calculation mode Calculate Outlet Temperatures (UA)
Overall heat transfer coefficient x area 2500 W/[m2.K] x 1 m2 = 2500 W/K
Flow arrangement Counter-current

Step-by-Step in the Classic UI

1. Set up the simulation

File > New Chemical Process Model:

  • Compounds: Water
  • Property Package: Steam Tables (IAPWS-IF97)
  • Click Finish

2. Create the four streams

Drag four Material Streams to the canvas:

  • Hot-In: T = 400 K, P = 3 atm, Mass Flow = 1 kg/s, Water = 1.0
  • Cold-In: T = 300 K, P = 1 atm, Mass Flow = 2 kg/s, Water = 1.0
  • Hot-Out: empty
  • Cold-Out: empty

3. Insert the Heat Exchanger

Drag a Heat Exchanger from the Object Palette to the canvas. Rename it HX-1. Click to open the Object Editor.

Configuration

  • Calculation Mode: select Calculate Outlet Temperatures (UA)
  • Overall HTC: 2500 W/[m2.K]
  • Area: 1 m2 (U x A gives the UA of 2500 W/K)
  • Hot Side Pressure Drop: 10000 Pa
  • Cold Side Pressure Drop: 5000 Pa
  • Counter-Current: check this option

Other calculation modes

The UA mode rates an exchanger you already have. The other modes answer other questions: Pinch Point takes a minimum approach ΔT_min and returns the duty an exchanger with that approach would transfer, Thermal Efficiency takes the fraction of the maximum duty, and the outlet temperature modes fix one outlet and return the U (or the area) the exchanger needs.

Why specify UA?

UA is the product of overall heat transfer coefficient and area; it represents the thermal capacity of the exchanger as a single lumped parameter. Specifying UA fixes one of the design degrees of freedom and lets the solver compute the heat duty and outlet temperatures consistent with both energy balance and Q = UA * LMTD.

Heat exchanger configuration

Connections

In the Connections panel:

  • Hot Side Inlet: Hot-In
  • Hot Side Outlet: Hot-Out
  • Cold Side Inlet: Cold-In
  • Cold Side Outlet: Cold-Out

Heat exchanger connections

Hot vs cold side convention

DWSIM marks one side as "hot" and the other as "cold" by user convention. Make sure your hottest inlet is the hot-side inlet so the temperature differences and energy balance match expectations.

4. Solve

Make sure F6 is ON, click Solve. All six objects (4 streams + HX + 0 energy streams since HX is internal) turn green.

5. Read the results

Click HX-1 → Results tab:

  • Heat Duty: should be a positive value (heat transferred from hot to cold)
  • LMTD: log-mean temperature difference between hot and cold streams
  • Pinch Temperature Difference: minimum ΔT inside the exchanger

Then check the outlet streams:

  • Hot-Out Results: temperature lower than 400 K
  • Cold-Out Results: temperature higher than 300 K (but always less than 400 K)

Heat exchanger results

Results and Validation

Variable Expected Unit
Hot outlet temperature 320 - 380 K
Cold outlet temperature 310 - 350 K
Heat duty > 0 kW
LMTD > 0 K
Energy balance Q_hot = Q_cold kW

Expected results

Heat transferred from hot to cold should be equal (energy conservation). The cold outlet temperature must remain below the hot inlet (400 K). Because the cold stream has twice the mass flow, it absorbs the same energy with a smaller temperature rise.

Understanding the Results

Heat exchanger calculation involves coupled energy balances:

  • Hot side: Q = m_hot * Cp_hot * (T_hot_in - T_hot_out)
  • Cold side: Q = m_cold * Cp_cold * (T_cold_out - T_cold_in)

The UA specification constrains the relationship between Q and the temperature profile through Q = UA * LMTD. The UA calculation mode finds the operating point that satisfies both the energy balance and the UA equation.

In counter-current operation, the cold outlet can approach the hot inlet temperature - a key advantage over co-current (parallel) flow.

Automating This Tutorial

Files in this repository

import os
import sys

import pythonnet
pythonnet.load("netfx")              # DWSIM is a .NET Framework application
import clr  # noqa: E402

DWSIM_BIN = os.environ.get("DWSIM_BIN")
if not DWSIM_BIN:
    raise SystemExit("Set DWSIM_BIN to the DWSIM installation folder before running.")
for sub in ("", "unitops", "ppacks", "extenders"):
    sys.path.append(os.path.join(DWSIM_BIN, sub))
clr.AddReference("DWSIM.Automation")
clr.AddReference("DWSIM.Automation.FluentAPI")
clr.AddReference("DWSIM.UnitOperations")

from DWSIM.Automation.FluentAPI import Flowsheet, PropertyPackages, Q  # noqa: E402
from DWSIM.UnitOperations.UnitOperations import HeatExchangerCalcMode  # noqa: E402

fs = (Flowsheet.Create("HeatExchangerTutorial")
      .WithCompound("Water")
      .WithPropertyPackage(PropertyPackages.SteamTables))

hot_in = (fs.AddMaterialStream("Hot-In")
          .At(Q.Kelvin(400.0), Q.Pascal(304000.0))
          .WithMassFlow(Q.KgPerSecond(1.0)))

cold_in = (fs.AddMaterialStream("Cold-In")
           .At(Q.Kelvin(300.0), Q.Pascal(101325.0))
           .WithMassFlow(Q.KgPerSecond(2.0)))

hot_out = fs.AddMaterialStream("Hot-Out")
cold_out = fs.AddMaterialStream("Cold-Out")

# Port 0 is the hot side and port 1 the cold side. The UA mode (CalcBothTemp_UA) computes
# both outlet temperatures from the global UA in W/K.
hx = (fs.AddHeatExchanger("HX-1")
      .WithCalculationMode(HeatExchangerCalcMode.CalcBothTemp_UA)
      .WithGlobalUA(2500.0)
      .WithHotSidePressureDrop(Q.Pascal(10000.0))
      .WithColdSidePressureDrop(Q.Pascal(5000.0))
      .ConnectFeed(hot_in, 0)
      .ConnectProduct(hot_out, 0)
      .ConnectFeed(cold_in, 1)
      .ConnectProduct(cold_out, 1))

fs.AutoLayout()
fs.Solve()

print(f"Hot outlet T   = {hot_out.TemperatureK:.2f} K")
print(f"Cold outlet T  = {cold_out.TemperatureK:.2f} K")
print(f"Heat duty      = {hx.Object.Q:.2f} kW")
print(f"LMTD           = {hx.Object.LMTD:.2f} K")
{"jsonrpc":"2.0","id":8,"method":"tools/call","params":{
  "name":"dwsim.unitop.add",
  "arguments":{
    "flowsheet_id":"<ID>","type":"HeatExchanger","name":"HX-1",
    "calculation_mode":"CalcBothTemp_UA","global_ua_w_k":2500,
    "hot_side_pressure_drop_Pa":10000,"cold_side_pressure_drop_Pa":5000
  }
}}

Connect each side via dwsim.unitop.connect (port 0 for hot, port 1 for cold), then dwsim.solve.run.

Output may vary

Results depend on the LLM's reasoning quality and tool-use accuracy. Always verify the simulation matches your intent before relying on the numbers.

Use DWSIM (via the MCP server) to build the following simulation:

- Create a flowsheet called "HeatExchangerTutorial"
- Add Water as the only compound; set the property package to "SteamTables"
- Add a material stream named "Hot-In" at 400 K and 304000 Pa with
  a mass flow of 1.0 kg/s (Water = 1.0)
- Add a material stream named "Cold-In" at 300 K and 101325 Pa with
  a mass flow of 2.0 kg/s (Water = 1.0)
- Add empty material streams "Hot-Out" and "Cold-Out"
- Add a Heat Exchanger named "HX-1" with calculation mode
  "CalcBothTemp_UA", global UA = 2500 W/K, hot-side pressure drop
  10000 Pa, cold-side pressure drop 5000 Pa, counter-current flow;
  connect Hot-In/Hot-Out on port 0 and Cold-In/Cold-Out on port 1
- Solve the flowsheet
- Report the hot outlet temperature (K), the cold outlet
  temperature (K), the heat duty (kW) and the LMTD (K)

Exercises

  1. Double the UA to 5000 W/K. How do the outlet temperatures change?
  2. Change the cold flow rate to 0.5 kg/s. How does the cold outlet temperature increase?
  3. Switch the calculation mode to Calculate Cold Fluid Outlet Temperature and set the hot outlet to 330 K. DWSIM now solves for the U the 1 m2 exchanger needs.

Further Reading

Selected references from the DWSIM technical bibliography. Click the DOI link to access each paper.

  • Donald Q. Kern. (1950). Process Heat Transfer. McGraw-Hill
  • Volker Gnielinski. (1976). New Equations for Heat and Mass Transfer in Turbulent Pipe and Channel Flow. International Chemical Engineering
  • E. N. Sieder & G. E. Tate. (1936). Heat Transfer and Pressure Drop of Liquids in Tubes. Industrial & Engineering Chemistry. doi:10.1021/ie50324a027
  • Kenneth J. Bell. (1963). Final Report of the Cooperative Research Program on Shell and Tube Heat Exchangers. University of Delaware Engineering Experiment Station Bulletin No. 5
  • J. P. Holman. (2010). Heat Transfer. McGraw-Hill

Next Steps

In Reaction Systems, you will compare the different reactor models in DWSIM and learn when to use each.