Open GoogleCodeExporter opened 9 years ago
Note: this issue was originally reported in the Cantera User's Group:
https://groups.google.com/forum/?fromgroups=#!topic/cantera-users/7QUmPpNmRfA
Original comment by yarmond
on 29 Mar 2013 at 5:31
The changes in r2550 and r2551 eliminate the floating point exceptions.
However, there are still cases where the solver unexpectedly fails to converge.
The following script (for the 'new' Python module) which tests random (but
repeatable) mixture compositions has a failure rate of 5.8%:
import cantera
from random import random as rand
import random
random.seed(0)
gas = cantera.Solution('gri30.xml')
#gas = cantera.Solution('chemC2H4_100.xml')
fail_count = 0
def g():
a,b,c = rand(), 2*rand(), rand()
gas.TPX = 299.999, 100002, 'C2H4:%f, N2:%f, O2:%f' % (a,b,c)
h0,p0 = gas.HP
print a,b,c
try:
gas.equilibrate('HP', 0)
except:
print 'failed at', gas.TPX
global fail_count
fail_count += 1
h1,p1 = gas.HP
print ' ',h1-h0, p1-p0
for i in range(500):
print '======', i, '======'
g()
print 'Finished with %d failures.' % fail_count
Original comment by yarmond
on 30 Sep 2013 at 2:04
Original issue reported on code.google.com by
yarmond
on 29 Mar 2013 at 5:30Attachments: