Heater and Cooler¶
In this tutorial you will heat a water stream from 25 °C to 80 °C using a Heater, then cool it back down using a Cooler. You will learn about energy streams and how DWSIM calculates heat duty.
What you will learn
- How to insert and configure Heater and Cooler unit operations from the Classic UI
- How to specify an outlet temperature in the Object Editor
- How to read heat duty from the Results tab
- How to verify the energy balance against a hand calculation
Prerequisites
- Completed Mixer Basics
- Concept of heat duty: Q = m * Cp * ΔT
Process Overview¶
Heaters and coolers are the simplest heat-transfer operations. You specify the desired outlet temperature (or heat duty), and DWSIM calculates the other. In a real plant, a heater might be a fired furnace or a steam-heated exchanger; a cooler might be a water-cooled condenser or an air fin cooler. In DWSIM, both are modeled as single-sided energy balances.
The expected heat duty for water from 25 °C to 80 °C is approximately:
Q = m * Cp * ΔT = 1.0 * 4.18 * 55 = 230 kW
Process Flow Diagram¶
graph LR
COLD["Cold Water<br/>298.15 K, 1 atm<br/>1 kg/s"] --> H["H-1<br/>(Heater)"]
H --> HOT["Hot Water<br/>353.15 K"]
HOT --> C["C-1<br/>(Cooler)"]
C --> COOLED["Cooled Water<br/>298.15 K"]
Key Design Parameters¶
| Parameter | Value | Unit |
|---|---|---|
| Compound | Water | - |
| Property Package | Steam Tables (IAPWS-IF97) | - |
| Inlet temperature | 298.15 (25 °C) | K |
| Heater outlet temperature | 353.15 (80 °C) | K |
| Cooler outlet temperature | 298.15 (25 °C) | K |
| Mass flow | 1.0 | kg/s |
| Pressure drop | 0 | Pa |
Step-by-Step in the Classic UI¶
1. Create a new simulation¶
File > New Chemical Process Model → wizard opens.
- Compounds page: add
Water - Property Packages page: add
Steam Tables (IAPWS-IF97) - Accept defaults on remaining pages, click Finish
2. Add the cold-water inlet stream¶
Drag a Material Stream to the canvas, rename it Cold-Water, and in its Object Editor enter:
- Temperature:
25 °C(DWSIM converts to 298.15 K internally) - Pressure:
1 atm - Mass Flow:
1 kg/s - Composition: Water = 1.0
3. Insert the Heater¶
Drag a Heater from the Object Palette to the canvas, rename it H-1. Double-click to open the Object Editor.
Set the calculation parameters:
- Calculation Mode: select
Outlet Temperature - Outlet Temperature:
80 °C - Pressure Drop:
0 Pa - Efficiency:
100 %

4. Add the hot-water outlet stream and connect it¶
Drag a second Material Stream, rename it Hot-Water, leave it empty.
In the Heater's Object Editor → Connections panel:
- Inlet:
Cold-Water - Outlet:
Hot-Water
DWSIM also requires an Energy Stream for the duty. Click the dropdown next to Energy in the Connections panel; if there is no energy stream yet, the dropdown shows [Click here to create] - select that option, and DWSIM creates ES-1 (or similar) automatically.
Why an energy stream?
Heaters and coolers expose Q (heat duty) as an energy stream. Connecting one lets the solver report Q automatically without you needing to compute it from H_out - H_in by hand, and it lets you couple the duty later to other equipment (for example, a fired heater or a refrigeration loop).

5. Insert the Cooler¶
Drag a Cooler to the canvas, rename it C-1. Double-click to open the editor and set:
- Calculation Mode:
Outlet Temperature - Outlet Temperature:
25 °C - Pressure Drop:
0 Pa - Efficiency:
100 %
6. Add the cooled-water outlet and connect¶
Drag another Material Stream, rename Cooled-Water, leave empty.
In the Cooler's Connections panel:
- Inlet:
Hot-Water - Outlet:
Cooled-Water - Energy: select
[Click here to create]to spawn another energy stream

7. Solve¶
Make sure F6 (Calculator Active) is ON, then click Solve.
All six objects (3 streams + 2 unit ops + 2 energy streams) turn green.
8. Read the heat duties¶
Double-click the Heater H-1 and switch to the Results tab. Look for Heat Added (or similar) - it should be approximately 230 kW.
Repeat for the Cooler C-1: the Heat Removed value should also be approximately 230 kW, with opposite sign convention.
You can also click each energy stream and check its Energy Flow value.

Results and Validation¶
| Variable | Expected | Unit |
|---|---|---|
| Hot-Water temperature | 353.15 | K |
| Heater heat duty | ~230 | kW |
| Cooled-Water temperature | 298.15 | K |
| Cooler heat removed | ~230 | kW |
Expected results
Both duties should be approximately equal (~230 kW), confirming energy conservation. The hand calculation Q = 1.0 * 4.18 * 55 = 229.9 kW agrees closely with the rigorous Steam Tables calculation. Small differences (< 1 kW) arise because Cp varies slightly over the 25-80 °C range.
Understanding the Results¶
The heat duty is calculated rigorously as:
Q = m * (H_out - H_in)
where H_out and H_in are the specific enthalpies at the outlet and inlet conditions. For liquid water far from the boiling point, this is very close to Q = m * Cp * ΔT, but DWSIM always uses the exact enthalpy difference.
The cooler duty should match the heater duty because we are returning the water to the same temperature. This is a useful sanity check: if you heat and then cool the same stream back to its original state, the net energy exchange should be zero.
Automating This Tutorial¶
Files in this repository
- Python script:
examples/beginner/03_heater_cooler.py - Pre-built flowsheet:
examples/saved/heater_cooler.dwxmz
from DWSIM.Automation.FluentAPI import Flowsheet, PropertyPackages, Q
fs = (Flowsheet.Create("HeaterCoolerTutorial")
.WithCompound("Water")
.WithPropertyPackage(PropertyPackages.SteamTables))
cold = (fs.AddMaterialStream("Cold-Water")
.At(Q.Kelvin(298.15), Q.Pascal(101325.0))
.WithMassFlow(Q.KgPerSecond(1.0)))
hot = fs.AddMaterialStream("Hot-Water")
heater = (fs.AddHeater("H-1")
.WithOutletTemperature(353.15.Kelvin())
.WithPressureDrop(0.0.Pascal())
.WithEfficiencyPercent(100.0)
.ConnectFeed(cold, 0)
.ConnectProduct(hot, 0))
cooled = fs.AddMaterialStream("Cooled-Water")
cooler = (fs.AddCooler("C-1")
.WithOutletTemperature(298.15.Kelvin())
.WithPressureDrop(0.0.Pascal())
.WithEfficiencyPercent(100.0)
.ConnectFeed(hot, 0)
.ConnectProduct(cooled, 0))
fs.AutoLayout()
fs.Solve()
print(f"Heater duty = {heater.HeatDutyKW:.2f} kW")
print(f"Cooler duty = {cooler.HeatRemovedKW:.2f} kW")
Standard sequence: dwsim.flowsheet.create, dwsim.thermo.add_compounds (Water),
dwsim.thermo.set_property_package (SteamTables), then create the streams and
add Heater and Cooler unit operations:
{"jsonrpc":"2.0","id":6,"method":"tools/call","params":{
"name":"dwsim.unitop.add",
"arguments":{
"flowsheet_id":"<ID>","type":"Heater","name":"H-1",
"outlet_temperature_K":353.15,"pressure_drop_Pa":0,
"efficiency_percent":100
}
}}
{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{
"name":"dwsim.unitop.add",
"arguments":{
"flowsheet_id":"<ID>","type":"Cooler","name":"C-1",
"outlet_temperature_K":298.15,"pressure_drop_Pa":0,
"efficiency_percent":100
}
}}
Connect each via dwsim.unitop.connect, 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 "HeaterCoolerTutorial"
- Add Water as the only compound; set the property package to "SteamTables"
- Add a material stream named "Cold-Water" at 298.15 K and 101325 Pa
with a mass flow of 1.0 kg/s (Water = 1.0)
- Add a Heater named "H-1" with outlet temperature 353.15 K,
pressure drop 0 Pa and efficiency 100 %; feed it from Cold-Water
and let it produce a stream named "Hot-Water"
- Add a Cooler named "C-1" with outlet temperature 298.15 K,
pressure drop 0 Pa and efficiency 100 %; feed it from Hot-Water
and let it produce a stream named "Cooled-Water"
- Solve the flowsheet
- Report the heater duty (kW) and the cooler duty (kW)
Exercises
- Change the heater outlet to
100 °C(water reaches its boiling point at 1 atm). What happens to the vapor fraction in the Hot-Water stream's Results? Does the duty increase linearly? - Set the heater outlet to
200 °C. The water becomes steam. Compare the duty - the latent heat of vaporization makes it dramatically larger. - Add a pressure drop of
50000 Pato the heater. How does this affect the outlet conditions?
Further Reading¶
Selected references from the DWSIM technical bibliography. Click the DOI link to access each paper.
- J. P. Holman. (2010). Heat Transfer. McGraw-Hill
- W.L. McCabe, J. Smith & P. Harriott. (2005). Unit Operations of Chemical Engineering. McGraw-Hill Education
- Joseph Smith. (1996). Intro to Chemical Engineering Thermodynamics. McGraw-Hill Companies
Next Steps¶
Now you understand heaters, coolers, and energy balances. In Simple Flash Drum, you will separate a two-phase mixture into vapor and liquid products.