CVodes error encountered. Error code: -3

66 views
Skip to first unread message

junfeng bai

unread,
Sep 25, 2021, 6:19:41 AM9/25/21
to Cantera Users' Group
Hello everyone, 

I got error message when I run a simple CH4/O2/H2O reactor as below:

CanteraError thrown by CVodesIntegrator::step:
CVodes error encountered. Error code: -3

At t = 0.0360421 and h = 2.78419e-10, the error test failed repeatedly or with |h| = hmin.
Components with largest weighted error estimates:
24: 28.692318112061425
22: -8.029918980116443
6: 1.437750950083966
20: -0.4254972058861584
21: -0.11142008342470497
16: 0.07109609893413864
38: -0.04408107403003456
2: 0.026583024432490516
19: 0.023232697130210336
44: -0.00450484642134545
***********************************************************************

I guess this problem involves forward and reverse reaction rate? The calculation have run 1009 steps and 0.036s. It seems normal before this error according to tempertures, pressures and volumes I outputted. I have tried to change bath gas to N2, it could terminate normally, but occurs same error in CO2 and AR atmosphere. Could anyone help me? Thank you very much. Python code and yaml file is also attached. 

import pandas as pd
import numpy as np
import time
import cantera as ct
import matplotlib.pyplot as plt


ct.add_directory('../../')
mech = 'HPMech'


print('Importing %s.yaml...'%mech)
gas = ct.Solution('%s.yaml'%mech, 'gas')
print('Done.')

gas.TPX = 900, 100*ct.one_atm, 'CH4:2.9,O2:4.24,H2O:92.86'

r = ct.ConstPressureReactor(contents=gas)
reactorNetwork = ct.ReactorNet([r])

#columnNames = [r.component_name(item) for item in range(r.n_vars)]
#timeHistory = pd.DataFrame(columns=columnNames)
timeHistory = ct.SolutionArray(gas,extra=['t'])

################################################ run sim

tic = time.time()

tau_est = 295*0.6/900       # s

t = 0
counter = 1
while(t < tau_est):
t = reactorNetwork.step()
if (counter%1 == 0):
#timeHistory.loc[t] = reactorNetwork.get_state()
timeHistory.append(r.thermo.state,t=t)
#timeHistory.append(reactorNetwork.get_state(),t=t)
print('step %i done, t = %.3e...'%(counter,t))
counter += 1
toc = time.time()
print('Took {:3.2f} s'.format(toc-tic))
timeHistory.write_csv('adiabatic900-100-VirialCH4wrong.csv',cols=('t','T','P','volume_mole','X'))

###########################################################################

HPmech.yaml
Reply all
Reply to author
Forward
0 new messages