Skip to content

11. The Pressure-Flow Network Solver

DWSIM's dynamic mode decides flows valve by valve. That works while every valve sits between two things that know their pressure. Where two valves meet with nothing between them, the pressure in between has no owner and the flows disagree. The OTS solves those junctions every step.

What you will learn

  • Where the sequential dynamic model needs help
  • What the network solver does and what it writes
  • Reading its status and journal notes
  • Its limits

Prerequisites

  • Page 1: holdups set pressures, valves set flows

The problem

flowchart LR
    V1[Vessel A<br/>P known] --> XV1[XV-1<br/>Kv] --> J((stream<br/>P = ?)) --> XV2[XV-2<br/>Kv] --> V2[Vessel B<br/>P known]

XV-1 computes its flow from P_A and the pressure of the middle stream; XV-2 from that same pressure and P_B. In plain dynamic mode the middle stream's pressure is whatever was typed into it. The two flows are computed from different assumptions, and mass is not conserved between the valves. The same happens around a mixer fed by two valves and drained by a third, and around a splitter.

Physically the middle pressure is the one that makes the flows equal: that is a small algebraic problem, one unknown pressure per junction, one mass balance per junction.

What the solver does

Before every step, after malfunctions and interlocks have set the valve openings:

  1. Junctions are found once per session: the streams around each mixer and splitter, and each stream between two Kv valves, grouped into sets that share one pressure. A junction that touches a holdup or a pressure-specified boundary takes that pressure (it is anchored); the others are unknowns.
  2. For each unknown junction the mass balance is written with the valves' own flow equations (the same ISA/IEC 60534 forms the valves use in the step, called without side effects), plus any flow-specified feeds or draws as fixed terms.
  3. The pressures are solved by Newton's method with a numerical Jacobian, with a bisection sweep as a fallback; the balance is monotone in each junction's pressure, so the fallback always finds it.
  4. Two refinements: the holdup pressures at the fixed ends are extrapolated from the previous step (a valve upstream of a vessel would otherwise use the vessel's pressure from one step ago), and the junction streams are re-flashed at the solved pressure and the solve repeated once (a valve's flow depends on its inlet phase split, which a mixer's flash changes with pressure).
  5. The pressures are written to the junction streams. The step then runs as usual, and the valves reproduce the balanced flows from those pressures.

On the sample plant (valves between the separator and headers) there are no junctions and the solver does nothing.

Using it

  • The P-F network checkbox on the Instructor Station toolbar turns it on (default) or off.
  • The status line shows Network: no junctions, or Network: 2 junction(s), 7 it, 3 ms with NOT CONVERGED appended if the last solve failed.
  • At Start the journal lists what was found: Pressure-flow network: 1 junction(s) to solve, 3 valve(s) attached. MIX (solved): in FV-001, VB; out VC. Junctions that could not be solved (fed by nothing through a valve, or with two anchors) are listed with the reason and left as specified.
  • Failures to converge are journaled in the Solver category (the first three, then every hundredth); the last good pressures are kept.

One junction solved every step, listed in the journal

Try it

Modify the sample plant: add a valve V2 (Kv liquid, Kv 30, 60 % open) after LV-001, so stream 6 runs from LV-001 to V2 and a new stream 7 from V2 to the 1 atm header; set stream 6's pressure to 200 kPa. Save the file and start a session.

  • With the checkbox off, stream 6 stays at 200 kPa: LV-001 computes a flow from 330 kPa to 200 kPa, V2 from 200 kPa to 101 kPa, and the two disagree by a large factor.
  • With it on, the journal reports 6 (solved): in LV-001; out V2, stream 6 settles near 105 kPa, and both valves show the same flow.

Limits

  • Only valves in a Kv mode (Kv general, Kv liquid, Kv gas, Kv steam) are flow elements. Pipes, orifice plates and relief valves keep their own dynamic models and are treated as pressure holders.
  • No reverse flow: a valve whose outlet pressure exceeds its inlet passes nothing, as in the rest of DWSIM's dynamic mode.
  • A junction fed directly by a holdup with no valve has no equation for that flow and is left as specified; put a valve on every holdup outlet.
  • The solver runs on the instructor's session only; stations (page 10) receive the resulting pressures with the rest of the plant state.

The last page puts everything together into a course.