Niemeyer-Research-Group / pyMARS

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

New .cti files missing the 'negative_A' option on reactions. #67

Open ajuluc opened 5 years ago

ajuluc commented 5 years ago

My input cti file has this pair of reactions

reaction('O(5) + CH2CHO(68) <=> CHO(22) + CH2O(9)', [5.000000e+13, 0.0, 0.0],
         options='duplicate')
reaction('O(5) + CH2CHO(68) <=> CHO(22) + CH2O(9)', [-2.993000e+23, -2.473, 19.927],
         options=['negative_A', 'duplicate'])

When outputting cti files within pymars the 'duplicate' option is added here https://github.com/Niemeyer-Research-Group/pyMARS/blob/06dafae43e99ce61fc34fd2c6b414c06de06e7ca/pymars/soln2cti.py#L435

but the 'negative_A' option is lost.

This then causes a crash like this:

raceback (most recent call last):
  File "/home/ajulu.c/anaconda3/envs/flame_env/bin/pymars", line 12, in <module>
    sys.exit(main())
  File "/home/ajulu.c/anaconda3/envs/flame_env/lib/python3.7/site-packages/pymars/__main__.py", line 10, in main
    pymars(args)
  File "/home/ajulu.c/anaconda3/envs/flame_env/lib/python3.7/site-packages/pymars/pymars.py", line 319, in pymars
    path=args.path, num_threads=args.num_threads
  File "/home/ajulu.c/anaconda3/envs/flame_env/lib/python3.7/site-packages/pymars/pymars.py", line 186, in main
    threshold_upper=upper_threshold, num_threads=num_threads, path=path
  File "/home/ajulu.c/anaconda3/envs/flame_env/lib/python3.7/site-packages/pymars/drgep.py", line 416, in run_drgep
    num_threads=num_threads, path=path
  File "/home/ajulu.c/anaconda3/envs/flame_env/lib/python3.7/site-packages/pymars/drgep.py", line 331, in reduce_drgep
    num_threads=num_threads, path=path
  File "/home/ajulu.c/anaconda3/envs/flame_env/lib/python3.7/site-packages/pymars/sampling.py", line 208, in sample_metrics
    results.append(ignition_worker(job))
  File "/home/ajulu.c/anaconda3/envs/flame_env/lib/python3.7/site-packages/pymars/sampling.py", line 85, in ignition_worker
    sim.setup_case()
  File "/home/ajulu.c/anaconda3/envs/flame_env/lib/python3.7/site-packages/pymars/simulation.py", line 45, in setup_case
    self.gas = ct.Solution(self.model, self.phase_name)
  File "interfaces/cython/cantera/base.pyx", line 29, in cantera._cantera._SolutionBase.__cinit__
  File "interfaces/cython/cantera/base.pyx", line 78, in cantera._cantera._SolutionBase._init_cti_xml
cantera._cantera.CanteraError: 
***********************************************************************
CanteraError thrown by ElementaryReaction::validate:
Undeclared negative pre-exponential factor found in reaction 'CH2CHO(68) + O(5) <=> CH2O(9) + CHO(22)'
***********************************************************************