by jasper » 28 July 2014, 08:32
Why this will not solve is a discussion we have had before.
The equilibrium reactions are solved in terms of reaction extent. You choose an equilibrium constant of 1.3e10, so the reaction is nearly instantaneous. If you are actually interested in the amount of unreacted material (which will be, considering the reaction order, somewhere in the sqtr(1.3E+010) concentration range), I think you will need to set up a specifialized solver and formulate the problem solving specifically for the amount of material that remains unreacted. The equilibrium reactor is not formulated that way, and such a problem is perhaps a bit too specific for the equilibrium reactor to change its formulation.
The reaction is
H2O + CH3OH -> 3 H2 + CO
The error, formulated as
f(X) = 3*ln(C[H2]) + ln(C[CO]) - ln(C[H2O]) - ln(C[CH3OH]) - ln(K)
and the degree of freedom is the normalized reaction extent, such that
f(H20) / fTot0 = f0(H2)/fTot0 + 3*X
f(CO) / fTot0 = f0(CO)/fTot0 + X
f(H2O) / fTot0 = f0(H2O)/fTot0 - X
f(CH3OH) / fTot0 = f0(CH3OH)/fTot0 - X
Now we need to find X such that f(X) is small, which requires solving X with a very high accuraty (do the math: fill out the above and differentiate w.r.t. X).
A new reaction standard specification is being formulated, that allows for completely instantaneous reactions. At that point, the reaction implementations in COUSCOUS will probably be revised to cater for this.
Remains the question why you see a crash. You should be seeing a convergence problem like I do:
error: calculate failed for unit Equilibrium 550: Solution failed: maximum number of iterations exceeded
For the one outside the loop this happens rather quickly. For the one inside the loop all iterations fail, which takes a bit longer. But if you are solving in a back ground thread, you should simply be able to abort the calculation. It takes about 10 - 12 seconds for me to abort, as the current reactor needs to finish not converging.
I cannot reproduce the crash. Can you give more info on how to make it crash?