Skip to content

Units and Numbers

Half of the wrong answers in a first course come from a unit. This page is about how DWSIM stores, displays and reads numbers, so that the value you type is the value the solver uses.

What you will learn

  • What the simulator stores inside and what it shows you
  • How to change the unit system and what changes with it
  • Mole against mass: fractions, flows, and the conversions between them
  • Reference states, number formats and the decimal separator

1. SI inside, your units outside

DWSIM keeps every value in SI: kelvin, pascal, kg/s, mol/s, kJ/kg, m3. The unit system selected in the flowsheet settings only changes what the editors and tables display and how they read what you type. Change the system from SI to English and every temperature is redrawn in Fahrenheit; nothing in the solution moves.

This has two practical consequences:

  • A value typed as 25 into a temperature box is 25 in the box's unit, which is written next to it. If the unit is K, you specified a stream at 25 K.
  • Scripts and the MCP server talk SI unless told otherwise; the FluentAPI Quantity type carries its unit explicitly (Q(25, "C")).

Try it

Open any tutorial, note a stream temperature, then Settings > Unit System and switch to a different set. The number changes, the state does not. Explain Result on a heater shows the balance both in the flowsheet's units and in SI so the arithmetic can be checked by hand.

2. Mole, mass, volume

A stream carries one composition vector and one flow, and every other basis follows from the molecular weights:

Basis Fractions Flow Converts through
Molar x_i, sum to 1 mol/s, kmol/h w_i = x_i M_i / sum(x_j M_j)
Mass w_i, sum to 1 kg/s, kg/h x_i = (w_i / M_i) / sum(w_j / M_j)
Volumetric (liquid volume fractions, rarely used) m3/h, at the stream's own density the density, which the flash provides

Three habits that save trouble:

  1. Decide the basis before typing a composition. The editor has a selector; a composition typed as mass fractions into a molar box is a different mixture.
  2. Molar flows are what balances are written in; mass flows are what pumps and pipes see. Explain Result writes the mass balance in the flowsheet's molar flow unit and the energy balance in kg/s and kJ/kg.
  3. A volumetric flow is only meaningful with a density, which depends on T and P. "100 m3/h of gas" means nothing until you say at what conditions; the standard and normal volumetric flows in the stream results are evaluated at fixed reference conditions for exactly this reason.

3. Reference states

  • Enthalpy and entropy are relative to the ideal gas of formation at 25 C. Only differences carry meaning; see Streams, State and Balances.
  • Heats of reaction are the difference of heats of formation at 25 C, so a reactor's duty in isothermal mode includes bringing the products back to the inlet temperature.
  • Gauge and absolute pressure: DWSIM works in absolute pressure. A gauge reading needs the atmospheric pressure added; the unit systems include barg and psig, which do that for you.
  • Temperature differences carry their own unit (C. or K.), because a difference of 20 C is 20 K and never 293 K.

4. Number formats and the decimal separator

The number format in the flowsheet settings (G6, F2, N4) sets how many digits the editors and tables show; it does not round the stored value. A result that reads 0.00 may be 0.0032; widen the format before concluding it is zero.

DWSIM reads typed numbers with the operating system's regional format. On a Portuguese or German Windows the decimal separator is the comma and 1.5 is read as fifteen; on an English one the comma is a thousands separator. Type numbers the way your system writes them, or switch the system's format if you share files with a colleague who writes them differently. Case and data files are stored in an invariant format, so they open the same everywhere.

5. Sanity checks that catch unit errors

  • A liquid water stream with a density of 1 kg/m3, or a gas with 1000 kg/m3: a pressure or a temperature is off by a factor of a thousand (kPa typed as Pa, or the other way).
  • A duty of a few watts on a stream of tonnes per hour, or of megawatts on a laboratory flow.
  • A composition that sums to 0.98: fractions typed in one basis, read in another, or a compound forgotten.
  • A temperature of 25 K in a box that wanted 25 C. The Flowsheet Check flags freezing-point and implausible-temperature findings for this.

Exercises

  1. Type the composition of Tutorial 10's feed as mass fractions with the same numbers it uses as mole fractions. Solve, and compare the column results with Scenario Comparison. Which product changed more, and why?
  2. Set your flowsheet to display pressure in barg, read a stream at 1 atm, and explain the number you see.
  3. Change the number format to F1 and look at a trace compound in the products of Tutorial 12. Then change it to E3. Which number is the solver using?