Skip to content

Recycles and Convergence

Most real processes send something back: unreacted feed, solvent, a purge. In a sequential modular simulator a loop has no place to start, so it is broken, guessed and iterated. This page explains that iteration, what the numbers on a Recycle block mean, and what to do when it will not settle.

What you will learn

  • Why a loop cannot be solved in one pass, and what a tear stream is
  • What the Recycle block's estimate, tolerance and acceleration do
  • How to recognise slow convergence, oscillation and divergence
  • How to give the solver a good starting point

1. Tearing the loop

Take a reactor with a separator after it, the separator's liquid going back to the reactor feed. To solve the reactor, DWSIM needs its inlet; the inlet needs the separator's liquid; the liquid needs the reactor. Nothing can go first.

The Recycle block breaks the loop. It sits on one stream of the loop (the tear stream) and splits it in two: an assumed outlet the downstream units read, and an actual inlet the upstream units produce. The solve then goes:

  1. Take the assumed values (the estimate) for the tear stream.
  2. Solve every unit around the loop, ending with the stream that enters the Recycle block.
  3. Compare the actual inlet with the assumed outlet, property by property (temperature, pressure, mass flow, composition).
  4. If they agree within the tolerance, stop. Otherwise take the actual values (or an accelerated blend of them) as the new estimate and go to 2.

Each pass through step 2 is one iteration. A well-posed loop with a decent estimate converges in 5 to 20 iterations.

Try it

Open Tutorial 07 - Recycle Loops, select the Recycle block and look at its results: the number of iterations taken and the final errors in temperature, pressure and flow. Then open Flowsheet Analysis > Scenario Comparison, capture A, change the split fraction that sets the recycle ratio, solve, capture B: the whole loop moves, and the table shows how much the tear stream changed.

2. The numbers on the block

Setting Meaning Advice
Estimate (initial values) The tear stream state used on the first pass Give one. With none, DWSIM starts from a zero-flow stream and the first pass sees a loop that returns nothing
Tolerances The largest allowed difference between assumed and actual, per variable Keep the defaults while building; tighten when the answer matters
Maximum iterations Where the solver gives up Raise it only after you understand why it needs so many
Acceleration How the next estimate is formed: direct substitution takes the actual values as they are; Wegstein extrapolates from the last two passes Direct substitution is safer; Wegstein is faster on smooth loops and can overshoot on non-linear ones

The Flowsheet Check reports RECYCLE_NO_ESTIMATE when a Recycle block has no initial values, and a loop with no Recycle block at all as a blocker: the solver would never find a unit whose inlets are all known.

3. Reading a convergence history

The messages in the log after a solve tell you how the loop behaved:

  • Errors shrinking by a similar factor each pass (say by 3 every iteration): healthy convergence. The loop's gain is below 1.
  • Errors shrinking slowly (by a few percent per pass): the loop's gain is close to 1. This is common when a large fraction is recycled with a small purge. Wegstein helps; so does a better estimate.
  • Errors alternating in sign and growing or holding: oscillation. Something in the loop responds too strongly. Switch off acceleration, or damp it; check for a unit whose output jumps (a flash changing phase, a column at its limit).
  • Errors growing every pass: divergence. The estimate is far from any solution, or the loop has no solution with the current specifications (a purge too small to remove an inert that accumulates, for instance).

4. A good starting point

The estimate is the single biggest lever. Ways to get one:

  1. Solve the open loop first. Delete or disconnect the recycle, solve the once-through flowsheet, read the stream that would be recycled, and type its state as the estimate.
  2. Ramp the recycle. Start with a small split fraction to the recycle, solve, increase it, solve again. Each converged solution is the estimate for the next.
  3. Use the last solution. A Recycle block keeps its converged values; once a flowsheet has solved, later changes start from a solution nearby. This is why small changes solve quickly and large ones sometimes fail.

5. Where to put the tear

Any stream of the loop will do mathematically; some are better in practice. A stream with few compounds and no phase change (a liquid recycle at fixed conditions) converges faster than one whose phase split changes with every pass (a vapour recycle out of a flash). When a loop contains a column, tear the stream entering the column when you can, so the column sees a stable feed.

Exercises

  1. On Tutorial 07, clear the Recycle block's estimate and solve. Count the iterations. Restore the estimate (type the converged values) and solve again: how many now?
  2. Change the split fraction that sets the recycle from its tutorial value to 0.9. What happens to the iteration count and to the error history? Explain in terms of the loop's gain.
  3. Switch acceleration between direct substitution and Wegstein and repeat exercise 2. Which converges faster, and does either oscillate?
  4. In Tutorial 13 - Methanol Synthesis (syngas loop with a purge), halve the purge and solve. If it fails, explain what accumulates and why a purge exists.