Niemeyer-Research-Group / pyMARS

Python-based (chemical kinetic) Model Automatic Reduction Software
https://niemeyer-research-group.github.io/pyMARS/
MIT License
58 stars 45 forks source link

sensitivity analysis got "CVodes error encountered. Error code: -10" #69

Open shenghuiqin opened 5 years ago

shenghuiqin commented 5 years ago

I use the input script selecting sensitivity analysis =True.

targets:
  - CH4
  - O2
retained-species:
  - N2
method: DRGEP
error: 10.0
sensitivity-analysis: True
sensitivity-type: initial
upper-threshold: 0.2
autoignition-conditions:
  - kind: constant volume
    pressure: 1.0
    temperature: 1000.0
    fuel:
      CH4: 1.0
    oxidizer:
      O2: 1.0
      N2: 3.76
    equivalence-ratio: 1.0

  - kind: constant volume
    pressure: 1.0
    temperature: 1200.0
    fuel:
      CH4: 1.0
    oxidizer:
      O2: 1.0
      N2: 3.76
    equivalence-ratio: 0.5

which is the same from pyamrs documentation. model reduction part works fine, but when starting SA, got the error:

  File "/home/shenghuiqin/anaconda2/envs/spam/bin/pymars", line 12, in <module>
    sys.exit(main())
  File "/home/shenghuiqin/anaconda2/envs/spam/lib/python3.7/site-packages/pymars/__main__.py", line 10, in main
    pymars(args)
  File "/home/shenghuiqin/anaconda2/envs/spam/lib/python3.7/site-packages/pymars/pymars.py", line 319, in pymars
    path=args.path, num_threads=args.num_threads
  File "/home/shenghuiqin/anaconda2/envs/spam/lib/python3.7/site-packages/pymars/pymars.py", line 210, in main
    num_threads=num_threads, path=path
  File "/home/shenghuiqin/anaconda2/envs/spam/lib/python3.7/site-packages/pymars/sensitivity_analysis.py", line 150, in run_sa
    phase_name=phase_name, num_threads=num_threads
  File "/home/shenghuiqin/anaconda2/envs/spam/lib/python3.7/site-packages/pymars/sensitivity_analysis.py", line 76, in evaluate_species_errors
    num_threads=num_threads
  File "/home/shenghuiqin/anaconda2/envs/spam/lib/python3.7/site-packages/pymars/sampling.py", line 208, in sample_metrics
    results.append(ignition_worker(job))
  File "/home/shenghuiqin/anaconda2/envs/spam/lib/python3.7/site-packages/pymars/sampling.py", line 86, in ignition_worker
    ignition_delay = sim.calculate_ignition()
  File "/home/shenghuiqin/anaconda2/envs/spam/lib/python3.7/site-packages/pymars/simulation.py", line 247, in calculate_ignition
    self.sim.step()
  File "interfaces/cython/cantera/reactor.pyx", line 862, in cantera._cantera.ReactorNet.step
cantera._cantera.CanteraError:
***********************************************************************
CanteraError thrown by CVodesIntegrator::step:
CVodes error encountered. Error code: -10
Exceptions caught during RHS evaluation:

***********************************************************************
CanteraError thrown by checkFinite:
ydot contains non-finite elements:

ydot[2] = -nan
ydot[3] = -nan
ydot[4] = -nan
ydot[5] = -nan
ydot[6] = -nan
ydot[7] = -nan
ydot[8] = -nan
ydot[9] = -nan
ydot[11] = -nan
ydot[13] = -nan
ydot[14] = -nan
ydot[16] = -nan
ydot[17] = -nan
ydot[21] = -nan
***********************************************************************