dbirch997 / cantera

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

"equilibrate" fails when number of species is less than the number of elements #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cat > test.cti << EOR
ideal_gas(
    name = "test",
    elements = " C H O ",
    species = "gri30: O2 CH4",
    initial_state = state(temperature = 298.0, pressure = 100000.0))
EOR
2. python -c '
import Cantera
g = Cantera.importPhase("./test.cti")
g.equilibrate("TP",loglevel=1)'
3.

What is the expected output? What do you see instead?

Expected perhaps an exception: "number of species cannot be less than the 
number of elements." Instead, Cantera aborts with:

terminate called after throwing an instance of 'std::length_error'
  what():  vector::_M_fill_insert
Aborted

which is, I think, stdlib complaining about a string being longer than the 
maximum allowed.

What version of the product are you using? On what operating system?

1.8.0 from http://cantera.googlecode.com/svn/cantera18/branches/Revision_1.8.0/

RHEL5/x86_64/intel c++ 11.0

Please provide any additional information below.

It seems there was a check for this in ChemEquil.cpp (line 122-125), but it's 
commented out in 1.8. Can ChemEquil equilibrate a system with less species than 
elements (m_kk < m_mm)? If not, should the check be uncommented?

Thanks!

Original issue reported on code.google.com by igor.sch...@gmail.com on 17 Mar 2011 at 4:47

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 28 May 2011 at 1:15

GoogleCodeExporter commented 9 years ago
Fixed by the changes in r1410 and r1411.

Original comment by yarmond on 12 Apr 2012 at 9:45