Skip to content

Phase Envelope (Feature Deep-Dive)

This tutorial explores DWSIM's phase envelope generation and lookup features in depth via the Classic UI. Beyond the intermediate Phase Envelope tutorial, here you will learn the lookup tools, multi-curve overlays, and integration with material streams.

What you will learn

  • How to attach a phase envelope to a material stream's editor
  • How to use the phase envelope lookup controls
  • How to overlay multiple envelopes for comparison
  • How to export envelope data for external analysis

Prerequisites

Overview

A phase envelope is computed from a stream's composition and the active property package. DWSIM caches the envelope on the stream object and exposes it in two ways:

  1. Programmatically via FluentAPI / MCP for automation
  2. Visually via the stream's Object Editor or the standalone Phase Envelope utility

Step-by-Step in the Classic UI

1. Set up

File > New Chemical Process Model:

  • Compounds: Methane, Ethane, Propane, N-butane, N-pentane
  • Property Package: Peng-Robinson

2. Create a natural gas stream

Drag a Material Stream NatGas and configure:

  • T = 300 K, P = 1 atm, Molar Flow = 1 mol/s
  • Mole fractions: Methane 0.80, Ethane 0.10, Propane 0.05, N-butane 0.03, N-pentane 0.02

Solve (F6 ON → Solve).

3. Open the Phase Envelope utility

Utilities > Phase Envelope opens the dedicated phase envelope viewer.

Select NatGas as the source stream and click Calculate. The chart shows:

  • Bubble curve (left)
  • Dew curve (right)
  • Critical point at the top
  • Cricondentherm and Cricondenbar markers

Phase envelope viewer

4. Use the lookup controls

Below the chart, the Lookup panel lets you query the envelope:

  • Enter T = 250 K → utility reports bubble P and dew P at that temperature
  • Enter P = 50 bar → utility reports bubble T and dew T at that pressure

Move the mouse over the chart to see live readouts of the curves at the cursor position.

5. Overlay multiple envelopes

To compare compositions:

  1. Add another Material Stream (e.g., RichGas) with different composition
  2. Solve
  3. In the Phase Envelope utility, click Add Series and select RichGas

Both envelopes now display in the same chart with different colors, making it easy to see how composition affects the two-phase region.

Multi-envelope overlay

6. Export envelope data

In the utility window, click Export Data to save the curve points as CSV. Click Save Image to export the chart as PNG/PDF for reports.

Engineering Applications

Use Case What to Look For
Pipeline design Operating point must lie outside the envelope (no liquid dropout)
Subsea hydrate prediction Compare hydrate curve with phase envelope
Reservoir characterization Cricondenbar and cricondentherm define operability bounds
Refrigeration cycle design Saturation curve guides compressor and condenser sizing

Automating This Tutorial

Files in this repository

See examples/features/phase_envelope_advanced.py in the DWSIM.Tutorials repository.

dwsim.stream.generate_phase_envelope, dwsim.stream.phase_envelope_lookup.

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 do the following:

- Create a flowsheet called "PhaseEnvelopeDemo"
- Add Methane, Ethane, Propane, N-butane and N-pentane as compounds;
  set the property package to "Peng-Robinson"
- Add a material stream "NatGas" at 300 K and 1 atm with molar flow
  = 1 mol/s and mole fractions Methane = 0.80, Ethane = 0.10,
  Propane = 0.05, N-butane = 0.03, N-pentane = 0.02
- Solve the flowsheet
- Generate the PT phase envelope of NatGas
- Use the envelope lookup to report:
    - bubble and dew pressures at T = 250 K
    - bubble and dew temperatures at P = 50 bar
    - the critical point, cricondentherm and cricondenbar of the mixture

Exercises

  1. Generate envelopes for three natural gas compositions (lean, mid, rich) and identify which has the highest cricondentherm.
  2. Add 5% CO2 to the natural gas. How does the envelope shift?
  3. Use the lookup to find the dew point at 280 K, then verify with a flash calculation: set the stream T=280 K, P=dew_P, and check that vapor fraction = 1.0.

Further Reading

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

  • Robert A. Heidemann & Ahmed M. Khalil. (1980). The calculation of critical points. AIChE Journal
  • B. Widom. (1965). Equation of State in the Neighborhood of the Critical Point. The Journal of Chemical Physics. doi:10.1063/1.1696618
  • G. G. Simeoni et al.. (2010). The Widom line as the crossover between liquid-like and gas-like behaviour in supercritical fluids. Nature Physics. doi:10.1038/nphys1683
  • Michael Michelsen & Jorgen Mollerup. (2007). Thermodynamic Models: Fundamentals and Computational Aspects. Tie-Line Publications

Next Steps

You have completed the Features track. Refer to the Property Packages Guide and Troubleshooting for ongoing reference.