Streams, State and Balances¶
A process simulator is a machine for closing balances. Every unit operation takes streams in, conserves mass and (in most cases) energy, and produces streams out whose state it computes from a thermodynamic model. Everything else in DWSIM rests on the three ideas in this page.
What you will learn
- What a material stream carries, and the four things that fix its state
- What a unit operation conserves, and what it is allowed to change
- What an enthalpy value means, and why only differences matter
- How to read the balance of a solved unit with Explain Result
1. A stream is a state¶
A material stream in DWSIM is a point in the flowsheet where the matter is fully described. To describe it, the simulator needs:
| What | Why it is needed |
|---|---|
| Composition | Which compounds, in what proportion (mole or mass fractions that sum to 1) |
| Flow | How much passes per unit time (mass, molar or volumetric; the others follow) |
| Two intensive variables | Temperature and pressure, or pressure and vapour fraction, or pressure and enthalpy, and so on |
Given these, the property package performs a flash: it decides how many phases exist, how much of each, and what is in each, then computes every property (enthalpy, entropy, density, viscosity, K values). The stream's specification is the pair of intensive variables you gave. A stream specified by temperature and pressure is a PT flash; one specified by pressure and enthalpy is a PH flash, which is what every heater, valve and mixer solves for its outlet.
Try it
Open Tutorial 03 - Simple Flash Drum, select the feed stream and open Flowsheet Analysis > Explain Result. The report tells you where the temperature sits against the bubble and dew points at that pressure, lists the K value of each compound, and draws the Rachford-Rice function whose root is the vapour fraction. Change the feed temperature by a few degrees, solve, and explain again: the root moves.
Phases¶
A stream carries up to four phases (vapour, two liquids, solid) plus the mixture, which is the
overall composition before the split. When only one phase exists the split is trivial; the
interesting case is two or more, where the compositions of the phases differ and the K values
K_i = y_i / x_i say by how much. A compound with K > 1 prefers the vapour.
2. A unit operation conserves¶
Every unit closes a mass balance per compound (what enters leaves, unless a reaction converts it) and an energy balance (enthalpy in plus heat and work added equals enthalpy out). The unit's own equations only decide how the outlet state is reached:
| Unit | Conserves | Its own rule |
|---|---|---|
| Mixer | mass of each compound, enthalpy | outlet pressure from the inlets (lowest, by default) |
| Heater, cooler | mass of each compound | adds or removes the duty; the outlet is a PH flash |
| Valve | mass, enthalpy | isenthalpic: the outlet is the PH flash at the lower pressure |
| Compressor, pump | mass | adds shaft work; the ideal path is isentropic, the efficiency says how far the real one is |
| Separator (flash drum) | mass of each compound, enthalpy | one flash; the vapour goes up, the liquid down |
| Heat exchanger | mass on each side | heat released by the hot side equals heat taken by the cold side |
| Reactor | mass of each element, enthalpy | the stoichiometry moves mass between compounds |
| Column | mass of each compound, enthalpy | equilibrium on every stage |
The balance is what makes the answer unique. A mixer with two water streams at 300 K and 348 K gives one outlet temperature, and it is the one where the outlet enthalpy equals the sum of the inlet enthalpies. The weighted mean of the temperatures is a good approximation when the heat capacity is constant; the simulator solves the exact equation.
Try it
Open Tutorial 01 - Mixer Basics, select the mixer and run Explain Result. The report
writes the balance with the numbers in it: sum(m_i H_i) = m_out H_out, then the pressure
rule, then a table of the molar flow of each compound in every stream.
3. Enthalpy is a difference¶
A stream's enthalpy in DWSIM is referenced to the ideal gas of formation at 25 C: a compound
in that state has H = 0, a liquid below its boiling point has a negative value (it released its
heat of vaporisation), a hot vapour has a positive one. This is why you will see negative
enthalpies everywhere. They are not wrong; only differences carry meaning:
- A heater's duty is
m (H_out - H_in): the sign ofH_inalone says nothing. - Two enthalpies from different property packages are not comparable, because each package computes its own departure from the ideal gas.
- A reaction's heat effect appears through the heats of formation folded into that reference.
Try it
Open Tutorial 02 - Heater and Cooler, explain the heater. The line
Q = m (H_out - H_in) shows both enthalpies, often both negative, and the positive duty that is
their difference. The heating curve below it shows the temperature climbing as heat is added,
with a flat stretch where the liquid boils.
4. What the solver does¶
DWSIM is a sequential modular simulator. It walks the flowsheet from the feeds forward: a unit is solved as soon as every inlet stream is known, its outlet streams become known, and the next unit can go. Every stream is therefore either a feed (you specify it) or a computed stream (a unit specifies it), and this is why you cannot type a temperature on a stream that leaves a heater: the heater owns that number.
When the flowsheet has a loop, the walk cannot start; the Recycles and Convergence page explains what happens then.
Exercises¶
- On Tutorial 01, change the second inlet from 348 K to 373 K and solve. Before looking, estimate the outlet temperature with the weighted mean. Then compare with Explain Result: how far off was the approximation, and why?
- On Tutorial 03, set the feed to 1 atm and 380 K. Explain the feed stream: what does the report say about the dew point, and how many phases does the flash produce?
- Explain the valve of Tutorial 08 - Refrigeration Cycle. Why does the temperature fall across a device that exchanges no heat? Where did the energy go?