A very simple unit operation loop was chosen for the first example in the development of the process simulation capability with Mathcad/Prode Physical Properties. The process consists of a cstr reactor and a partial condenser with total reflux of the liquid to the reactor. The flow diagram below shows the layout and the stream numbers.
Streams 1 and 2 are the known liquid hydrocarbon and hydrogen streams, respectively. I chose the reflux stream from the condenser as the tear stream. The computations start with a guess for stream 6. The reactor is computed, assuming adiabatic operation. The partial condenser is then computed with a specified outlet temperature and pressure. The liquid outlet stream from the condenser, 74, is then compared to the previous guess, stream 6. If not converged, a new stream 6 is computed as described below.
Recycle update methods
I built the loop to include both damped substitution and the Wegstein methods for updating the recycle stream. The Wegstein method actually needs two iterations of the substitution method before it can start.
Damped substitution computes the new stream from a fraction, r of the new stream and a fraction, (1-r) of the old stream. Thus, if r=1, direct substitution is used. The loop converged with r=1, but r=0.75 sped up the convergence slightly.
When using the Wegstein method, the composition of 74 was copied to 6, and then the total flow rate was computed by the Wegstein algorithm. This method will probably not be adequate for loops involving more unit operations and a large recycle stream. In those cases, the update method may require manipulation of the composition to accelerate convergence.
For this loop, both the substitution and Wegstein methods were satisfactory: they converged in about the same number of iterations (~ 5).
I used absolute tolerances for total flow rate, temperature, and mole fractions. Most simulators give the option of absolute or relative (or both) tolerances. Relative tolerances are not necessary in most cases and they can increase the computation time while trying to converge a trace component that may have little significance.
Relative tolerance might be useful for an overall material balance on a hazardous trace component. In that case, the objective function is the material balance, not a stream composition.