by jasper » 24 September 2017, 19:59
Thank you for sending me this flowsheet. It allowed me to pinpoint a rather unpleasant bug: some errors in the solver where not reported to the solver process. The result was what you saw: the flowsheet says it solves, and then says it is done solving, while units remain not solved. This happened in the recycle analysis, and subsequent solver tasks are cancelled, but the error did not get reported.
The error is now properly indicated and is unrelated to the controller. The error is that flow constraints must be inside a closed recycle or on the start of a feed stream as the first unit. The reason for this is that if the flow constraint is not in a recycle but not the first unit in the stream, it must control its feed stream, which is also controlled by the upstream unit.
The controller is not the source of the trouble. The source of the trouble is the invalid flow constraint in one of the two feed streams, which has an upstream valve unit. But, you also delivered the same flowsheet without the controller, and concluded that it solved. It did not. It looked solved, as the same error in the flowsheet analysis did not get reported to the solver, but without the recycle the unit that showed the problem immediately got marked solved and the solver process finished. If you look at your case where the controllers is removed closely, you will see that it is not actually solved; the mass balance around the flow constraint is not satisfied.
Please find an update that fixes the error reporting issue, and now both samples will, correctly, not solve, and moreover indicate the cause. You can easily fix the setup by placing the flow constraint upstream of the valve.
As an aside, note that your measured variable is always equal to your controlled variable. Not sure if this was an actual example, but you can simply eliminate your controller and measure unit, and simply stick the ‘setpoint’ directly into the controlled stream.