Page 1 of 1

Questions on CSTR & Equilibrium

Posted: 17 May 2013, 23:34
by nrgeng
With your past help, I have found that the Equilibrium Reactor and CSTR (equilibrium) Units can duplicate results taken from the Gibbs (specify components) or Gibbs (reaction package) Units.

One of several reactions with which I am working does perform well as explained above, but another reaction cannot be solved by either the Equilibrium or CSTR (equilibrium) Units. This is puzzling to me since both reactions solve in the Gibbs Units. Have you seen any cases such as this? Are certain reactions beyond the solution space for the Equilibrium or CSTR (equilibrium) Units?

The problematic reaction is the partial oxidation of methane: CH4 + 0.5 O2 ↔ CO + 2 H2. The Keq (Gibbs) is 1.299E+13 (mol/m3)^1.5. From my own file, I found a comparable value of Keq of 8.673E+12 so I am comfortable with these results for Keq. The problem arises when the Keq value is inserted into the the Reaction Package used by the Equilibrium or CSTR (equilibrium) Units. The flowsheet will not solve. The message is :
error: calculate failed for unit CSTR (or unit Equilibrium): Solution failed: Maximum number of iterations exceeded
What is the problem here? I set the iterations to 500 up from the usual 100. This technique has worked before as well as with the first reaction as I described above.

Re: Questions on CSTR & Equilibrium

Posted: 18 May 2013, 09:25
by jasper
This looks like a numerical problem. Not surprising if the magnitude of the K value is that high....

Can you send an example fsd so that I can check what exactly is happening?

Re: Questions on CSTR & Equilibrium 1.1

Posted: 18 May 2013, 16:39
by nrgeng
I e-mailed a flowsheet that exhibits the described problem. Hope you can find a solution.

Re: Questions on CSTR & Equilibrium

Posted: 18 May 2013, 19:19
by jasper
I do not think that for this one I will find a ready made solution. As you can see from the Gibbs reactor, the conversion of the reaction is about 100%*(1-1.2e-8), or 99.9999988%. The Gibbs reactor converges because it is looking for a minimum and terminates where it can no longer get the value smaller, so chances are there is a pretty big relative error on your calculated equilibrium constant. The Equilibrium and CSTR reactors however want to converge on a relative tolerance of the given equilibrium constant, by variation of reaction extent. It has an error tolerance of 1e-4 by default, so this means you need to converge the reaction extent to a relative precision of about 1e-12 or so. This is not feasible. The errors in the underlying thermo routines are several orders of magnitude larger to begin with.

Are you really interested in the exact remaining concentrations of oxygen and methane? As a good approximation, it all burns. Why do you not model this as a reaction with a fixed conversion of 100%?

Re: Questions on CSTR & Equilibrium 1.2

Posted: 19 May 2013, 01:21
by nrgeng
You have just given me a glimpse of the difference between the Real world and the world of COCO simulation. In the Real world, I would use this partial oxidation reaction to provide energy to an endothermic reaction in the same reactor. Here in the world of COCO simulation I will have to use two reactors, one (Equilibrium) and another (Fixed Conversion) with an energy stream connecting them.

OK, I can do it! Thanks for the explanation. :P

Re: Questions on CSTR & Equilibrium

Posted: 19 May 2013, 06:49
by jasper
This would be one way to do it. This is of course not a restriction of the flowsheeter, but rather because there is no unit operation available that mixes equilibrium reactions with reactions that are irreversible and instantaneous. Partly this is because there is no way yet to indicate in a CAPE-OPEN reaction package that are reaction is indeed irreversible and instantaneous (it is not quite equivalent to an equilibrium reaction with a zero or infinite equilibrium constant). The next version of the reaction specification should fix this, it is in the making. Perhaps at this point COUSCOUS will contain a reactor that handles it properly.

In the mean time of course it is not so difficult to put in something that is equivalent. Your suggestion is good as long as the reactions are not coupled (e.g. there is not another reaction that produces methane). Otherwise you could think of a custom unit operation that does the calculations, e.g. in Excel using the solver or in Matlab or Scilab, using root finders.

Re: Questions on CSTR & Equilibrium

Posted: 21 May 2013, 21:52
by colancto
I think this discussion shows that it is indeed worth being able to describe a reaction as irreversible-instantaneous. There is also the issue of convergence criteria at each level of the model that ought to be tighter and tighter when going deeper in the system. We have missed somehow this one when designing the thermo interfaces. Not sure it would be safe to have such a numerical criteria defined as a Parameter with a specific name. The nice thing with a Parameter is that everything is already in place and there is no need to define a new interface.

Re: Questions on CSTR & Equilibrium

Posted: 22 May 2013, 07:33
by jasper
Tigher thermo tolerance would in this particular case likely not help. We are at the limit of what can be represented by a double precision number.