dbirch997 / cantera

Automatically exported from code.google.com/p/cantera
1 stars 0 forks source link

Multi-Phase Equilibria #160

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run a multi-phase equilibrium run with all constituents initially in the gas 
phase. (used Pb, O, C from nasa gas and PbO(yw), PbO(rd), PbCO3(s), Pb(s), 
Pb(l), PbO(l), and graphite from nasa condensed)
2. Re-run with constituents in a random mix of condensed and gas phases
3. Compare results

What is the expected output? What do you see instead?
They should yield the same result. Instead the equilibrium run where I start 
with a random mixture of phases causes the condensed phase species not to 
equilibrate with the gas. Equilibrating in this manner seems to always add to 
the condensed phases, but never takes away. 

If I instead start from the gas phase I always get more realistic results. How 
come the equilibrate does not re-arrange all phases?

What version of the product are you using? On what operating system?
Cantera 2.0.2, and python 2.7 on windows 7 x64.

Please provide any additional information below.

Original issue reported on code.google.com by jdemut...@gmail.com on 15 Apr 2013 at 8:47

GoogleCodeExporter commented 9 years ago
Can you provide an input file and script that demonstrates the observed 
behavior?

Original comment by yarmond on 15 Apr 2013 at 9:43

GoogleCodeExporter commented 9 years ago
Sure. Here is a simplified file with the two cases (you'll need to comment out 
the cases one at a time. See lines 64-78)

Original comment by jdemut...@gmail.com on 15 Apr 2013 at 11:11

Attachments:

GoogleCodeExporter commented 9 years ago
Attached is a version of the provided test case adapted for the Python 
interface, which demonstrates most of the same behavior. There are a few 
differences, which I think start to explain what's going on here.

Running the Python version, both of the 'equilibrate' calls result in 
exceptions. In the Matlab version, these exceptions are incorrectly being 
ignored, and the Matlab interface needs to be updated to show these errors.

For the first case, there is a convergence failure, although the resulting 
state of the mixture is apparently ok.

In the second case, the error message is:

    "condensed-phase speciesPbO_y_w is excluded since its thermo properties are not valid at this temperature, but it has non-zero moles in the initial state."

So the solver is aborting without modifying the mixture state. I don't know if 
there is a good fix for the MultiPhaseEquil solver in this case.

In the Python interface, there is another equilibrium solver available, which 
is referred to as the "VCSnonideal" solver in the C++ interface, and can be 
used with the vcs_equilibrate function. Unfortunately, I don't think there's 
any way to access this solver from Matlab.

Original comment by yarmond on 18 Apr 2013 at 10:04

Attachments: