diff --git a/src/compute/chemistry/chem_C2H4_Air_Skeletal.cpp b/src/compute/chemistry/chem_C2H4_Air_Skeletal.cpp index 45d9979..1fed542 100644 --- a/src/compute/chemistry/chem_C2H4_Air_Skeletal.cpp +++ b/src/compute/chemistry/chem_C2H4_Air_Skeletal.cpp @@ -201,7 +201,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[3] = q_f + q_b; // Reaction #4 - k_f = exp(log(1000000000000.0002) - 1.0 * logT); + k_f = 1000000000000.0002 * Tinv; dG = gbs[0] - 2.0 * gbs[1]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #4 @@ -238,7 +238,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[6] = q_f + q_b; // Reaction #7 - k_f = exp(log(550000000000000.1) - 2.0 * logT); + k_f = 550000000000000.1 * Tinv * Tinv; dG = gbs[0] - 2.0 * gbs[1]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #7 @@ -249,7 +249,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[7] = q_f + q_b; // Reaction #8 - k_f = exp(log(2.2000000000000004e+16) - 2.0 * logT); + k_f = 2.2000000000000004e+16 * Tinv * Tinv; dG = -gbs[1] - gbs[4] + gbs[5]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #8 @@ -265,7 +265,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[8] = q_f + q_b; // Reaction #9 - k_f = exp(log(500000000000.0001) - 1.0 * logT); + k_f = 500000000000.0001 * Tinv; dG = -gbs[1] - gbs[2] + gbs[4]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #9 @@ -281,7 +281,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[9] = q_f + q_b; // Reaction #10 - k_f = exp(log(120000000000.00002) - 1.0 * logT); + k_f = 120000000000.00002 * Tinv; dG = -2.0 * gbs[2] + gbs[3]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #10 @@ -429,7 +429,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[22] = q_f + q_b; // Reaction #23 - k_f = exp(log(12100.000000000002) + 2.0 * logT - + k_f = exp(log(12100.000000000002) + 2 * logT - (2616.741574193582 * Tinv)); dG = gbs[0] - gbs[1] + gbs[6] - gbs[7]; K_c = exp(-dG); @@ -446,7 +446,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[24] = q_f + q_b; // Reaction #25 - k_f = exp(log(9630.0) + 2.0 * logT - (2012.8781339950629 * Tinv)); + k_f = exp(log(9630.0) + 2 * logT - (2012.8781339950629 * Tinv)); dG = -gbs[2] + gbs[4] + gbs[6] - gbs[7]; K_c = exp(-dG); q_f = k_f * cs[2] * cs[7]; @@ -677,7 +677,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[44] = q_f + q_b; // Reaction #45 - k_f = exp(log(187000000000000.03) - 1.0 * logT - + k_f = exp(log(187000000000000.03) - 1 * logT - (8554.732069479018 * Tinv)); dG = gbs[1] + gbs[13] - gbs[15]; K_c = prefRuT * exp(-dG); @@ -730,7 +730,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[47] = q_f + q_b; // Reaction #48 - k_f = exp(log(500.0000000000001) + 2.0 * logT - + k_f = exp(log(500.0000000000001) + 2 * logT - (3638.277227196076 * Tinv)); dG = -gbs[0] + gbs[1] - gbs[9] + gbs[11]; K_c = exp(-dG); @@ -771,7 +771,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[52] = q_f + q_b; // Reaction #53 - k_f = exp(log(11300.000000000002) + 2.0 * logT - + k_f = exp(log(11300.000000000002) + 2 * logT - (1509.6586004962971 * Tinv)); dG = -gbs[4] + gbs[5] + gbs[8] - gbs[9]; K_c = exp(-dG); @@ -1302,7 +1302,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[104] = q_f + q_b; // Reaction #105 - k_f = exp(log(2460.0000000000005) + 2.0 * logT - + k_f = exp(log(2460.0000000000005) + 2 * logT - (4161.6255420347925 * Tinv)); dG = -gbs[9] + 2.0 * gbs[11] - gbs[12]; K_c = exp(-dG); @@ -1418,7 +1418,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[114] = q_f + q_b; // Reaction #115 - k_f = exp(log(16320.000000000004) + 2.0 * logT - + k_f = exp(log(16320.000000000004) + 2 * logT - (956.117113647655 * Tinv)); dG = gbs[1] - gbs[2] - gbs[18] + gbs[24]; K_c = exp(-dG); @@ -1427,7 +1427,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[115] = q_f + q_b; // Reaction #116 - k_f = exp(log(4080.000000000001) + 2.0 * logT - + k_f = exp(log(4080.000000000001) + 2 * logT - (956.117113647655 * Tinv)); dG = -gbs[2] + gbs[9] + gbs[13] - gbs[18]; K_c = exp(-dG); @@ -1445,7 +1445,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[117] = q_f + q_b; // Reaction #118 - k_f = exp(log(4.830000000000001e-07) + 4.0 * logT - + k_f = exp(log(4.830000000000001e-07) + 4 * logT - (-1006.4390669975314 * Tinv)); dG = -gbs[4] + gbs[11] + gbs[13] - gbs[18]; K_c = exp(-dG); @@ -1454,7 +1454,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[118] = q_f + q_b; // Reaction #119 - k_f = exp(log(10000.000000000002) + 2.0 * logT - + k_f = exp(log(10000.000000000002) + 2 * logT - (3019.3172009925943 * Tinv)); dG = gbs[13] - gbs[15] - gbs[18] + gbs[20]; K_c = exp(-dG); @@ -1926,7 +1926,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[159] = q_f + q_b; // Reaction #160 - k_f = exp(log(3600.0000000000005) + 2.0 * logT - + k_f = exp(log(3600.0000000000005) + 2 * logT - (1258.0488337469144 * Tinv)); dG = -gbs[4] + gbs[5] + gbs[20] - gbs[21]; K_c = exp(-dG); @@ -1951,7 +1951,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[162] = q_f + q_b; // Reaction #163 - k_f = exp(log(10000.000000000002) + 2.0 * logT - + k_f = exp(log(10000.000000000002) + 2 * logT - (4025.7562679901257 * Tinv)); dG = gbs[13] - gbs[15] - gbs[21] + gbs[22]; K_c = exp(-dG); @@ -1984,7 +1984,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[166] = q_f + q_b; // Reaction #167 - k_f = exp(log(227.00000000000003) + 2.0 * logT - + k_f = exp(log(227.00000000000003) + 2 * logT - (4629.619708188645 * Tinv)); dG = -gbs[11] + gbs[12] + gbs[20] - gbs[21]; K_c = exp(-dG); @@ -2161,7 +2161,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, (0.02) * exp(-T / (1096.6)) + exp(-(6859.5) * Tinv); C = -0.4 - 0.67 * log10(Fcent); N = 0.75 - 1.27 * log10(Fcent); - k0 = exp(log(1.3300000000000002e+54) - 12.0 * logT - + k0 = exp(log(1.3300000000000002e+54) - 12 * logT - (3003.113532013934 * Tinv)); Pr = cTBC * k0 / k_f; A = log10(Pr) + C; @@ -2279,7 +2279,7 @@ void chem_C2H4_Air_Skeletal(block_ &b, const thtrdat_ &th, q[194] = q_f + q_b; // Reaction #195 - k_f = exp(log(3100.0000000000005) + 2.0 * logT - + k_f = exp(log(3100.0000000000005) + 2 * logT - (-149.9594209826322 * Tinv)); dG = -gbs[4] + gbs[5] + gbs[28] - gbs[29]; K_c = exp(-dG); diff --git a/src/compute/chemistry/chem_CH4_O2_FFCMY.cpp b/src/compute/chemistry/chem_CH4_O2_FFCMY.cpp index 7ddfb74..d11cdf3 100644 --- a/src/compute/chemistry/chem_CH4_O2_FFCMY.cpp +++ b/src/compute/chemistry/chem_CH4_O2_FFCMY.cpp @@ -203,7 +203,7 @@ void chem_CH4_O2_FFCMY(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[5] = q_f + q_b; // Reaction #6 - k_f = exp(log(4710000000000.001) - 1.0 * logT); + k_f = 4710000000000.001 * Tinv; dG = -gbs[1] - gbs[3] + gbs[4]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #6 @@ -613,4 +613,4 @@ void chem_CH4_O2_FFCMY(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, } b.omega(i, j, k, 0) = dTdt; }); -} +} \ No newline at end of file diff --git a/src/compute/chemistry/chem_GRI30.cpp b/src/compute/chemistry/chem_GRI30.cpp index b9363aa..4c88681 100644 --- a/src/compute/chemistry/chem_GRI30.cpp +++ b/src/compute/chemistry/chem_GRI30.cpp @@ -184,7 +184,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, double Tinv = 1.0 / T; double prefRuT = 101325.0 / (th.Ru * T); // Reaction #0 - k_f = exp(log(120000000000.00002) - 1.0 * logT); + k_f = 120000000000.00002 * Tinv; dG = -2.0 * gbs[2] + gbs[3]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #0 @@ -203,7 +203,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[0] = q_f + q_b; // Reaction #1 - k_f = exp(log(500000000000.0001) - 1.0 * logT); + k_f = 500000000000.0001 * Tinv; dG = -gbs[1] - gbs[2] + gbs[4]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #1 @@ -238,7 +238,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[3] = q_f + q_b; // Reaction #4 - k_f = exp(log(9630.0) + 2.0 * logT - (2012.8781339950629 * Tinv)); + k_f = exp(log(9630.0) + 2 * logT - (2012.8781339950629 * Tinv)); dG = -gbs[2] + gbs[4] + gbs[6] - gbs[7]; K_c = exp(-dG); q_f = k_f * cs[2] * cs[7]; @@ -386,7 +386,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[19] = q_f + q_b; // Reaction #20 - k_f = exp(log(13500.000000000002) + 2.0 * logT - + k_f = exp(log(13500.000000000002) + 2 * logT - (956.117113647655 * Tinv)); dG = gbs[1] - gbs[2] - gbs[22] + gbs[27]; K_c = exp(-dG); @@ -404,7 +404,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[21] = q_f + q_b; // Reaction #22 - k_f = exp(log(6940.000000000001) + 2.0 * logT - + k_f = exp(log(6940.000000000001) + 2 * logT - (956.117113647655 * Tinv)); dG = -gbs[2] + gbs[10] + gbs[14] - gbs[22]; K_c = exp(-dG); @@ -558,7 +558,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[37] = q_f + q_b; // Reaction #38 - k_f = exp(log(1000000000000.0002) - 1.0 * logT); + k_f = 1000000000000.0002 * Tinv; dG = gbs[0] - 2.0 * gbs[1]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #38 @@ -599,7 +599,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[40] = q_f + q_b; // Reaction #41 - k_f = exp(log(550000000000000.1) - 2.0 * logT); + k_f = 550000000000000.1 * Tinv * Tinv; dG = gbs[0] - 2.0 * gbs[1]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #41 @@ -610,7 +610,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[41] = q_f + q_b; // Reaction #42 - k_f = exp(log(2.2000000000000004e+16) - 2.0 * logT); + k_f = 2.2000000000000004e+16 * Tinv * Tinv; dG = -gbs[1] - gbs[4] + gbs[5]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #42 @@ -653,7 +653,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[45] = q_f + q_b; // Reaction #46 - k_f = exp(log(12100.000000000002) + 2.0 * logT - + k_f = exp(log(12100.000000000002) + 2 * logT - (2616.741574193582 * Tinv)); dG = gbs[0] - gbs[1] + gbs[6] - gbs[7]; K_c = exp(-dG); @@ -1014,7 +1014,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[68] = q_f + q_b; // Reaction #69 - k_f = exp(log(100000000000000.02) - 1.0 * logT); + k_f = 100000000000000.02 * Tinv; dG = -gbs[1] - gbs[21] + gbs[22]; K_c = exp(-dG) / prefRuT; // Three Body Reaction #69 @@ -1366,7 +1366,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[91] = q_f + q_b; // Reaction #92 - k_f = exp(log(11300.000000000002) + 2.0 * logT - + k_f = exp(log(11300.000000000002) + 2 * logT - (1509.6586004962971 * Tinv)); dG = -gbs[4] + gbs[5] + gbs[9] - gbs[10]; K_c = exp(-dG); @@ -1484,7 +1484,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[102] = q_f + q_b; // Reaction #103 - k_f = exp(log(1440.0000000000002) + 2.0 * logT - + k_f = exp(log(1440.0000000000002) + 2 * logT - (-422.70440813896323 * Tinv)); dG = -gbs[4] + gbs[5] + gbs[18] - gbs[20]; K_c = exp(-dG); @@ -1493,7 +1493,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[103] = q_f + q_b; // Reaction #104 - k_f = exp(log(6300.000000000001) + 2.0 * logT - + k_f = exp(log(6300.000000000001) + 2 * logT - (754.8293002481486 * Tinv)); dG = -gbs[4] + gbs[5] + gbs[19] - gbs[20]; K_c = exp(-dG); @@ -1528,7 +1528,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[107] = q_f + q_b; // Reaction #108 - k_f = exp(log(33700.0) + 2.0 * logT - (7045.07346898272 * Tinv)); + k_f = exp(log(33700.0) + 2 * logT - (7045.07346898272 * Tinv)); dG = -gbs[4] + gbs[5] + gbs[21] - gbs[22]; K_c = exp(-dG); q_f = k_f * cs[4] * cs[22]; @@ -1536,7 +1536,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[108] = q_f + q_b; // Reaction #109 - k_f = exp(log(4.830000000000001e-07) + 4.0 * logT - + k_f = exp(log(4.830000000000001e-07) + 4 * logT - (-1006.4390669975314 * Tinv)); dG = -gbs[4] + gbs[12] + gbs[14] - gbs[22]; K_c = exp(-dG); @@ -1553,7 +1553,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[110] = q_f + q_b; // Reaction #111 - k_f = exp(log(3600.0000000000005) + 2.0 * logT - + k_f = exp(log(3600.0000000000005) + 2 * logT - (1258.0488337469144 * Tinv)); dG = -gbs[4] + gbs[5] + gbs[23] - gbs[24]; K_c = exp(-dG); @@ -1627,7 +1627,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[119] = q_f + q_b; // Reaction #120 - k_f = exp(log(5600.000000000001) + 2.0 * logT - + k_f = exp(log(5600.000000000001) + 2 * logT - (6038.634401985189 * Tinv)); dG = -gbs[6] + gbs[7] + gbs[16] - gbs[17]; K_c = exp(-dG); @@ -1771,7 +1771,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[134] = q_f; // Reaction #135 - k_f = exp(log(500.0000000000001) + 2.0 * logT - + k_f = exp(log(500.0000000000001) + 2 * logT - (3638.277227196076 * Tinv)); dG = -gbs[0] + gbs[1] - gbs[10] + gbs[12]; K_c = exp(-dG); @@ -1796,7 +1796,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[137] = q_f + q_b; // Reaction #138 - k_f = exp(log(2460.0000000000005) + 2.0 * logT - + k_f = exp(log(2460.0000000000005) + 2 * logT - (4161.6255420347925 * Tinv)); dG = -gbs[10] + 2.0 * gbs[12] - gbs[13]; K_c = exp(-dG); @@ -2074,7 +2074,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[162] = q_f + q_b; // Reaction #163 - k_f = exp(log(227.00000000000003) + 2.0 * logT - + k_f = exp(log(227.00000000000003) + 2 * logT - (4629.619708188645 * Tinv)); dG = -gbs[12] + gbs[13] + gbs[23] - gbs[24]; K_c = exp(-dG); @@ -2092,7 +2092,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[164] = q_f + q_b; // Reaction #165 - k_f = exp(log(1500000000000000.2) - 1.0 * logT - + k_f = exp(log(1500000000000000.2) - 1 * logT - (8554.732069479018 * Tinv)); dG = gbs[1] + gbs[14] - gbs[16]; K_c = prefRuT * exp(-dG); @@ -2104,7 +2104,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[165] = q_f + q_b; // Reaction #166 - k_f = exp(log(187000000000000.03) - 1.0 * logT - + k_f = exp(log(187000000000000.03) - 1 * logT - (8554.732069479018 * Tinv)); dG = gbs[1] + gbs[14] - gbs[16]; K_c = prefRuT * exp(-dG); @@ -2239,7 +2239,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[177] = q_f + q_b; // Reaction #178 - k_f = exp(log(9000000.000000002) + 1.0 * logT - + k_f = exp(log(9000000.000000002) + 1 * logT - (3270.9269677419775 * Tinv)); dG = gbs[2] - gbs[3] - gbs[30] + gbs[35]; K_c = exp(-dG); @@ -2387,7 +2387,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[192] = q_f + q_b; // Reaction #193 - k_f = exp(log(461.00000000000006) + 2.0 * logT - + k_f = exp(log(461.00000000000006) + 2 * logT - (3270.9269677419775 * Tinv)); dG = gbs[2] - gbs[3] - gbs[31] + gbs[38]; K_c = exp(-dG); @@ -2709,7 +2709,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[227] = q_f + q_b; // Reaction #228 - k_f = exp(log(3800000000000000.5) - 2.0 * logT - + k_f = exp(log(3800000000000000.5) - 2 * logT - (402.5756267990126 * Tinv)); dG = gbs[15] - gbs[35] - gbs[46] + gbs[47]; K_c = exp(-dG); @@ -3144,7 +3144,7 @@ void chem_GRI30(block_ &b, const thtrdat_ &th, const int &rface /*=0*/, q[271] = q_f + q_b; // Reaction #272 - k_f = exp(log(20000.000000000004) + 2.0 * logT - + k_f = exp(log(20000.000000000004) + 2 * logT - (1006.4390669975314 * Tinv)); dG = -gbs[44] + gbs[45]; K_c = exp(-dG); diff --git a/utilities/ct2pgChem.py b/utilities/ct2pgChem.py index c5f3460..acd8215 100755 --- a/utilities/ct2pgChem.py +++ b/utilities/ct2pgChem.py @@ -53,7 +53,7 @@ def rateConstString(A, m, Ea): string = f"exp(log({A}){ m:+}*logT)" elif isinstance(m, int) and Ea == 0.0: if m < 0: - string = f"{A}" + "".join("*Tinv" for _ in range(m)) + string = f"{A}" + "".join("*Tinv" for _ in range(abs(m))) elif m > 0: string = f"{A}" + "".join("*T" for _ in range(m)) else: @@ -107,7 +107,7 @@ def ct2pgChem(ctyaml, cpp): A_o[i] = 0.0 elif r.reaction_type == "Arrhenius": Ea_f[i] = rate.activation_energy / Ru - m_f[i] = intOrFloat(rate.temperature_exponent) + m_f[i] = rate.temperature_exponent A_f[i] = rate.pre_exponential_factor else: raise UnknownReactionType(r.reaction_type, i, r.equation) @@ -121,7 +121,9 @@ def ct2pgChem(ctyaml, cpp): for line in gas.input_header["description"].split("\n"): pgMech.write("// " + line + "\n") pgMech.write("") - pgMech.write("// ========================================================== //\n") + pgMech.write( + "// ========================================================== //\n" + ) for i, sp in enumerate(gas.species_names): pgMech.write(f"// Y({i:>3d}) = {sp}\n") pgMech.write( @@ -285,7 +287,11 @@ def ct2pgChem(ctyaml, cpp): for i in range(nr): pgMech.write(f" // Reaction #{i}\n") - outString = " k_f = " + rateConstString(A_f[i], m_f[i], Ea_f[i]) + ";\n" + outString = ( + " k_f = " + + rateConstString(A_f[i], intOrFloat(m_f[i]), Ea_f[i]) + + ";\n" + ) pgMech.write(outString) nu_sum = nu_b[:, i] - nu_f[:, i] @@ -343,9 +349,15 @@ def ct2pgChem(ctyaml, cpp): elif r.reaction_type == "falloff-Lindemann": pgMech.write(f" // Lindeman Reaction #{i}\n") pgMech.write(" Fcent = 1.0;\n") - pgMech.write(" k0 = " + rateConstString(A_o[i], m_o[i], Ea_o[i]) + ";\n") + pgMech.write( + " k0 = " + + rateConstString(A_o[i], intOrFloat(m_o[i]), Ea_o[i]) + + ";\n" + ) outString = ( - " Pr = cTBC*k0/k_f;\n" " pmod = Pr/(1.0 + Pr);\n" " k_f *= pmod;\n" + " Pr = cTBC*k0/k_f;\n" + " pmod = Pr/(1.0 + Pr);\n" + " k_f *= pmod;\n" ) pgMech.write(outString) @@ -368,7 +380,11 @@ def ct2pgChem(ctyaml, cpp): " N = 0.75 - 1.27*log10(Fcent);\n" ) pgMech.write(outString) - pgMech.write(" k0 = " + rateConstString(A_o[i], m_o[i], Ea_o[i]) + ";\n") + pgMech.write( + " k0 = " + + rateConstString(A_o[i], intOrFloat(m_o[i]), Ea_o[i]) + + ";\n" + ) outString = ( " Pr = cTBC*k0/k_f;\n" " A = log10(Pr) + C;\n" @@ -508,7 +524,9 @@ def ct2pgChem(ctyaml, cpp): ctFileName = args.ctFileName - cppFileName = f'chem_{ctFileName.replace(".yaml",".cpp")}'.replace("-", "_") + cppFileName = f'chem_{ctFileName.replace(".yaml",".cpp")}'.replace( + "-", "_" + ) ct2pgChem(ctFileName, cppFileName)