hkmoffat / cantera

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

Crash when calling equilibrate('TP') #130

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Import the attached .cti
2. Set temperature to 300K, pressure to 1e5Pa, moleFractions to "CO2:1"
3. use equilibrate('TP') 

What is the expected output? What do you see instead?
I expect the equilibrium composition of the gas to be computed. Instead, I get 
a platform-dependent error message:

Windows:
Traceback (most recent call last):
  File "C:\...\thermo_error.py", line 39, in <module>
    gas.equilibrate('TP')
  File "C:\Python27\lib\site-packages\Cantera\ThermoPhase.py", line 317, in equilibrate
    rtol, maxsteps, maxiter, loglevel)
error: Error in thermo_equil

Linux:
Segmentation fault (core dumped)

What version of the product are you using? On what operating system?
svn r1924 on linux , python 2.7.3
svn r1906 on windows, python 2.7.2

Please provide any additional information below.
The attached script triggers the error. This of course depends on the content 
of the phase and more generally on the values of T,P. For example, the script 
runs fine if T=3000K is used instead of T=300K.

Original issue reported on code.google.com by chdoi...@gmail.com on 14 Nov 2012 at 10:21

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 14 Nov 2012 at 4:20

GoogleCodeExporter commented 9 years ago
The crash can be avoided by compiling with the scons option 
'with_html_log_files=n'.  As noted in Issue 129, I'm inclined to just remove 
the HTML log file option.

However, the equilibrium calculation still fails for the specified conditions, 
with the output:

    Traceback (most recent call last):
      File "issue129/thermo_error.py", line 40, in <module>
        gas.equilibrate('TP')
      File "/home/speth/.local/lib/python2.7/site-packages/Cantera/ThermoPhase.py", line 317, in equilibrate
        rtol, maxsteps, maxiter, loglevel)
    cantera.error:

    ************************************************
                    Cantera Error!
    ************************************************

    Procedure: MultiPhaseEquil::equilibrate
    Error:   no convergence in 1000 iterations. Error = 339.829

Trying the last case with 'solver=0' gives the error:

    Traceback (most recent call last):
      File "issue129/thermo_error.py", line 41, in <module>
        gas.equilibrate('TP', solver=0) #also fails.
      File "/home/speth/.local/lib/python2.7/site-packages/Cantera/ThermoPhase.py", line 317, in equilibrate
        rtol, maxsteps, maxiter, loglevel)
    cantera.error:

    ************************************************
                    Cantera Error!
    ************************************************

    Procedure: equilibrate
    Error:   Jacobian is singular.
    Try adding more species, changing the elemental composition slightly,
    or removing unused elements.

Original comment by yarmond on 3 Mar 2013 at 1:44

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 8 Nov 2014 at 4:16