hkmoffat / cantera

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

Possibly overspecifying reaction mechanism leads to Cantera Error #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
*****************What steps will reproduce the problem?
1.Use this mechanism (cti) file:

units(length = "cm", time = "s", quantity = "mol", act_energy = "cal/mol")
ideal_gas(name = "gas",
      elements = " Ar  H  N  O  Cl ",
      species = """ HNO  NH3  NH2  NO """,
      reactions = "all",
      transport = "Mix",
      initial_state = state(temperature = 300.0,
                        pressure = OneAtm)    )
species(name = "HNO",
    atoms = " H:1  N:1  O:1 ",
    thermo = (
       NASA( [  200.00,  1000.00], [  4.533491600E+00,  -5.669617100E-03,
                1.847320700E-05,  -1.713709400E-08,   5.545457300E-12,
                1.154829700E+04,   1.749841700E+00] ),
       NASA( [ 1000.00,  6000.00], [  2.979250900E+00,   3.494405900E-03,
               -7.854977800E-07,   5.747959400E-11,  -1.933591600E-16,
                1.175058200E+04,   8.606372800E+00] )
             ),
    transport = gas_transport(
                     geom = "nonlinear",
                     diam =     3.49,
                     well_depth =   116.70,
                     rot_relax =     1.00),
    note = "And93"
       )
species(name = "NH3",
    atoms = " N:1  H:3 ",
    thermo = (
       NASA( [  200.00,  1000.00], [  4.286027400E+00,  -4.660523000E-03,
                2.171851300E-05,  -2.280888700E-08,   8.263804600E-12,
               -6.741728500E+03,  -6.253727700E-01] ),
       NASA( [ 1000.00,  6000.00], [  2.634452100E+00,   5.666256000E-03,
               -1.727867600E-06,   2.386716100E-10,  -1.257878600E-14,
               -6.544695800E+03,   6.566292800E+00] )
             ),
    transport = gas_transport(
                     geom = "nonlinear",
                     diam =     2.92,
                     well_depth =   481.00,
                     dipole =     1.47,
                     rot_relax =    10.00),
    note = "J 6/77"
       )
species(name = "NH2",
    atoms = " N:1  H:2 ",
    thermo = (
       NASA( [  200.00,  1000.00], [  4.204002900E+00,  -2.106138500E-03,
                7.106834800E-06,  -5.611519700E-09,   1.644071700E-12,
                2.188591000E+04,  -1.418424800E-01] ),
       NASA( [ 1000.00,  6000.00], [  2.834742100E+00,   3.207308200E-03,
               -9.339080400E-07,   1.370295300E-10,  -7.920614400E-15,
                2.217195700E+04,   6.520416300E+00] )
             ),
    transport = gas_transport(
                     geom = "nonlinear",
                     diam =     2.65,
                     well_depth =    80.00,
                     polar =     2.26,
                     rot_relax =     4.00),
    note = "And89"
       )
species(name = "NO",
    atoms = " N:1  O:1 ",
    thermo = (
       NASA( [  200.00,  1000.00], [  4.218476300E+00,  -4.638976000E-03,
                1.104102200E-05,  -9.336135400E-09,   2.803577000E-12,
                9.844623000E+03,   2.280846400E+00] ),
       NASA( [ 1000.00,  6000.00], [  3.260605600E+00,   1.191104300E-03,
               -4.291704800E-07,   6.945766900E-11,  -4.033609900E-15,
                9.920974600E+03,   6.369302700E+00] )
             ),
    transport = gas_transport(
                     geom = "linear",
                     diam =     3.62,
                     well_depth =    97.53,
                     polar =     1.76,
                     rot_relax =     4.00),
    note = "RUS 78"
       )
reaction(  "NH2 + HNO => NH3 + NO",  [5.87000E+02, 2.95, -3469.3],
         options = ["duplicate"])
reaction(  "NH3 + NO => NH2 + HNO",  [1.46000E+03, 3.12, 54404.1])
reaction(  "NH2 + HNO <=> NH3 + NO",  [7.83000E-08, 5.29, -468.9],
         options = ["duplicate"])
reaction(  "NH2 + HNO <=> NH3 + NO",  [1.49000E-12, 6.41, -1818.1],
         options = ["duplicate"])
falloff_reaction( "NH2 + HNO (+ M) <=> NH3 + NO (+ M)",
         kf = [8.37000E+13, 0.22, 51.7],
         kf0   = [2.32000E+53, -8.13, 2859.3])

2.  Calling from a C subroutine (not sure where exactly it dies):
      gas= new IdealGasMix(string(mechfile));
      tr= newTransportMgr("Mix", &*gas, 1);

*****************************What do you see?

terminate called after throwing an instance of 'Cantera::CanteraError'

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

Cantera-1.7.0, on Linux operating system

**************************Please provide any additional information below.

Removing the reaction:

reaction(  "NH3 + NO => NH2 + HNO",  [1.46000E+03, 3.12, 54404.1])

from the above mechanism makes it work fine.  This reaction set (5 reactions) 
is just part of a much larger mechanism, but this reaction sequence is where 
the problem comes up.  I converted the entire mechanism from Chemkin format via 
ck2cti.  During that process, ck2cti had me declare 3 of the 4 normal reactions 
as duplicates, but not the reaction in question (fall off reactions are 
obviously handled separately as I get no warnings/errors from Cantera/ck2cti 
about it).  I'm guessing that I'm over-specifying something here, but not sure 
exactly what is happening with Cantera in the background and what would fix it. 
 I  tried to declare the reaction in question as a duplicate as well, but that 
doesn't seem to make any difference.  Cantera still throws the same error.  For 
anything else, I'd probably just delete the single reaction and continue on, 
but I know that this is still a package in development and it took me a good 
three hours to track the problem down, so I thought I'd let you know about it 
and possibly save someone some time in the future.

Original issue reported on code.google.com by dan.and....@gmail.com on 5 Aug 2010 at 7:32

GoogleCodeExporter commented 9 years ago
Unable to duplicate after marking the indicated reaction as "duplicate".

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