What are you working on?

Find a calculator, explore a formula, or learn the method.

THE ENGINEERING REFERENCE / GUIDE

Setting Up a Recycle Loop in DWSIM: Tear Streams and Convergence Checks

Short Answer

A recycle loop in DWSIM is closed with the Recycle logical operation, which breaks the loop at a tear stream and iterates until the assumed and calculated stream values agree within tolerance. Build the loop with a Mixer, a process unit, and a Splitter, then verify convergence by watching the temperature, pressure, and component-flow errors in the Console Output. If the loop oscillates or diverges, improve the estimate and damping — and check the flowsheet before loosening tolerances.

Most real processes send material back on itself: unreacted feed returns to the reactor, solvent returns to the absorber, catalyst returns to the bed. In flowsheet terms this is a recycle loop, and it improves efficiency by reusing material that would otherwise leave the process unused. Closing such a loop in DWSIM, however, requires more than drawing a stream backwards, because the simulator solves units one at a time. This article explains how DWSIM breaks the loop at a tear stream, how to build a simple closed loop from a Mixer, a process unit, a Splitter, and the Recycle logical operation, and how to read the convergence checks that tell you whether the loop has settled — and what to do when it will not.

Why a Recycle Loop Needs Iteration

DWSIM is a sequential modular simulator: it calculates one unit operation at a time, feeding the computed outlet of each unit into the next. A loop defeats that ordering. 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 remedy is to tear the loop: cut it at one chosen stream, guess that stream’s temperature, pressure, and composition, solve every unit forward from the guess, and compare the stream that comes back with the one that was assumed. If the two disagree, revise the guess and repeat. The cut point is the tear stream, and the repetition is the iteration that eventually closes the loop.

How the Recycle Logical Operation Works

In DWSIM the loop is closed with the Recycle logical operation. It sits on one stream of the loop — the tear stream — and splits it in two: an assumed outlet that the downstream units read, and an actual inlet that the upstream units produce. Each pass of the solver then follows the same pattern: take the assumed values (the estimate) for the tear stream, solve every unit in the loop, and let the Recycle block compare the newly calculated inlet against the assumed outlet. When the differences fall below the tolerances, the loop is converged and the flowsheet result is final.

The block’s three main settings map directly onto that process. The estimate is the starting guess the downstream units read on the first pass. The tolerances define how small each difference must be before the loop counts as solved. The acceleration setting controls how the next guess is formed from the iteration history, which governs how quickly — and how stably — the iteration settles.

The Convergence Checks

At each iteration, the Recycle block reads the inlet stream properties (coming from downstream) and compares them with the outlet stream properties (going upstream), as described in the DWSIM Logical Operations guide. Three errors are tracked, and convergence is achieved only when all of them fall below their respective tolerances simultaneously:

CheckWhat it comparesConverged when
Temperature error (εT)Inlet temperature minus outlet temperatureAbsolute error within its tolerance
Pressure error (εP)Inlet pressure minus outlet pressureAbsolute error within its tolerance
Flow error (εW)Sum of absolute mass-flow differences, taken component by componentSummed error within its tolerance

The component-wise flow check deserves emphasis: two streams can carry the same total mass yet hold different materials, and a loop closed on total flow alone would hide that mismatch. Tracking it per component is what makes a converged result chemically meaningful, not just numerically quiet.

Damping and Acceleration

When Legacy Mode is disabled, the Recycle block applies a smoothing factor α to dampen oscillations. Instead of passing the latest inlet value along unchanged, the block blends the current and previous values — for temperature, the next outlet is α times the current inlet plus (1 − α) times the previous inlet — so the estimate moves toward the answer in smaller, steadier steps rather than jumping to whatever the last iteration produced. Acceleration settings generalize this idea: aggressive updates can converge in few iterations when the loop behaves nearly linearly, but can overshoot and oscillate when it does not.

Building a Closed Loop in DWSIM

The intermediate DWSIM tutorial builds a minimal closed loop in the Classic UI from four connected objects; the same pattern transfers to almost any recycle problem, with the middle unit replaced by whatever your process needs. The tutorial uses a Heater purely as a stand-in for any processing step.

  1. Define the fresh feed completely. The tutorial example feeds water at 300 K, 1 atm, and 1 kg/s. Every feed needs temperature, pressure, flow, and composition before anything downstream can be solved.
  2. Add a Mixer and connect the fresh feed to it. The mixer’s second inlet is where the recycle will eventually arrive.
  3. Connect the Mixer to the process unit — the Heater in the tutorial — so the combined stream is processed.
  4. Add a Splitter on the processed stream and set the split ratio: one branch leaves the flowsheet as product, the other returns as recycle.
  5. Place the Recycle logical operation on the recycle branch and connect its output to the Mixer’s second inlet. Closing the loop this way also tells the solver to run the tear-and-iterate procedure described above.
  6. Run the flowsheet and watch the Console Output, where DWSIM reports the iteration history and the convergence errors as it works toward the tolerances.

The split ratio is a process decision, not a solver setting: it fixes how much material returns. Loops that recycle most of what they process tend to be harder to converge, because each iteration carries nearly all of its information around the loop again. Providing a sensible estimate for the tear stream — one you would believe from a rough material balance — usually does more for convergence speed than any tuning of solver settings.

Reading Solver Behaviour: Convergence, Oscillation, Divergence

The errors printed at each iteration distinguish situations that call for different responses:

  • Slow convergence. Errors shrink, but too slowly. The documented remedy is to give the solver a better starting point — an estimate for the tear stream close to its real conditions — rather than loosening the tolerances first.
  • Oscillation. Errors swing between values instead of shrinking. Damping is the fix: keep Legacy Mode off so the smoothing factor blends successive estimates, and adjust the acceleration settings toward gentler updates.
  • Divergence. Errors grow from iteration to iteration. This often indicates a problem in the flowsheet itself — an infeasible specification, a broken connection, or an incomplete feed — so audit the setup before tuning the solver further.

Tolerances also involve a trade-off: tighter tolerances give a more precisely converged loop at the cost of more iterations, and each of the three checks carries its own tolerance, so the strictest one effectively sets the workload.

Common Mistakes the Flowsheet Check Catches

Some apparent convergence problems are actually setup errors that stop a valid solve from starting. DWSIM’s documentation lists a small set of mistakes that account for most user questions, and since version 10.2.9 the Flowsheet Check names each finding explicitly:

MistakeSymptomFinding codesFix
A stream that goes nowhere‘Object not connected’; a unit is never calculatedSTREAM_DANGLING, UNIT_UNCONNECTED, UNIT_NO_FEEDOpen the unit’s Connections panel; every inlet and outlet has a named port
A feed with a hole in it‘Temperature not defined’; a flash error on the first unitFEED_NO_TEMPERATURE, FEED_NO_PRESSURE, FEED_NO_FLOW, FEED_NO_COMPOSITIONSupply all four feed quantities before solving

The second group matters especially in recycle problems, because the Recycle block’s estimate must be a complete stream specification for downstream units to compute at all. Running the Flowsheet Check takes moments and rules out this entire class of error before you start interpreting iteration histories.

Practical Takeaways

  • Close every loop with the Recycle logical operation, which acts as both the tear point and the convergence monitor.
  • Give the solver a physically sensible estimate for the tear stream; a good starting point usually beats elaborate tuning.
  • Convergence requires all three checks to pass — temperature, pressure, and component mass flows — so read them together.
  • Match the symptom to the response: a better estimate for slow convergence, smoothing for oscillation, a flowsheet audit for divergence.
  • Run the Flowsheet Check (version 10.2.9 or later names the findings) before deep solver troubleshooting.

FAQ

What is a tear stream in DWSIM?

The stream on which a recycle loop is broken. The Recycle block splits it into two halves: an assumed outlet that downstream units read, and an actual inlet produced by the upstream units. The solver iterates until the two halves agree within the configured tolerances.

How does DWSIM decide that a recycle loop has converged?

The Recycle block compares the inlet and outlet sides of the tear stream on three errors: temperature difference, pressure difference, and the sum of absolute mass-flow differences taken component by component. Convergence is achieved only when all three fall below their respective tolerances simultaneously.

Why is my DWSIM recycle loop not converging?

Match the behaviour of the iteration errors to the response. Slowly shrinking errors call for a better starting estimate for the tear stream. Oscillating errors call for damping, such as the smoothing factor available when Legacy Mode is off. Growing errors often point to a flowsheet problem — an infeasible specification, a dangling stream, or an incomplete feed — so run the Flowsheet Check before tuning the solver.

What does the smoothing factor α do in the Recycle block?

In non-legacy mode it damps oscillations by blending the current and previous iteration values instead of passing the newest one along unchanged; for temperature, the next outlet is α times the current inlet plus (1 − α) times the previous inlet. Legacy Mode does not apply this smoothing.

References

  1. DWSIM Tutorials — 'Recycles and Convergence' (Fundamentals). https://dwsim.org/tutorials/en/fundamentals/03-recycles-and-convergence.html
  2. DWSIM Tutorials — 'Recycle Loops' (Intermediate). https://dwsim.org/tutorials/en/intermediate/04-recycle-loops.html
  3. DWSIM User Guide — 'Logical Operations'. https://dwsim.org/help/main/28-logical-operations.html
  4. DWSIM Tutorials — 'Common Mistakes' (Fundamentals). https://dwsim.org/tutorials/en/fundamentals/06-common-mistakes.html

Related Terms

Leave a Reply

Your email address will not be published. Required fields are marked *