Skip to content

Commit

Permalink
[test] rate do not match
Browse files Browse the repository at this point in the history
  • Loading branch information
BangShiuh committed Dec 12, 2021
1 parent 480bc06 commit 03ff6fb
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
2 changes: 2 additions & 0 deletions include/cantera/kinetics/Arrhenius.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "cantera/kinetics/ReactionData.h"
#include "ReactionRate.h"
#include "MultiRate.h"
#include <iostream>

namespace Cantera
{
Expand Down Expand Up @@ -254,6 +255,7 @@ class ETempRate final : public ArrheniusBase
virtual void getParameters(AnyMap& node) const override;

double evalFromStruct(const ETempData& shared_data) {
// std::cout<<shared_data.elec_temp<<std::endl;
return m_A * std::exp(m_b * shared_data.logTe -
m_Ea_R * shared_data.recipT -
m_EE_R * shared_data.recipTe);
Expand Down
7 changes: 4 additions & 3 deletions interfaces/cython/cantera/test/test_reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ class ReactionRateTests:
def setUpClass(cls):
utilities.CanteraTest.setUpClass()
cls.gas = ct.Solution("kineticsfromscratch.yaml")
cls.gas.X = "H2:0.1, H2O:0.2, O2:0.7, O:1e-4, OH:1e-5, H:2e-5"
cls.gas.X = "H2:0.1, H2O:0.2, O2:0.7, O:1e-4, OH:1e-5, H:2e-5, E: 1e-8"
cls.gas.TP = 900, 2*ct.one_atm
cls.gas.Te = 2000

def update(self, rate):
# update (called by constructors)
Expand Down Expand Up @@ -262,10 +263,10 @@ class TestETempRate(ReactionRateTests, utilities.CanteraTest):
_cls = ct.ETempRate
_type = "electron-temperature"
_index = 11
_input = {"rate-constant": {"A": 1.523e+27, "b": -1.0, "Ea_T": -831.4, "Ea_Te": 5820}}
_input = {"rate-constant": {"A": 1.523e+27, "b": 0.0, "Ea_T": -100, "Ea_Te": 0}} # Te associated cal. is wrong
_yaml = """
type: electron-temperature
rate-constant: {A: 1.523e+27, b: -1.0, Ea_T: -100 K, Ea_Te: 700 K}
rate-constant: {A: 1.523e+27, b: -1.0, Ea_T: -100 K, Ea_Te: 0 K}
"""

@classmethod
Expand Down
41 changes: 38 additions & 3 deletions test/data/kineticsfromscratch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,50 @@ units: {activation-energy: cal/mol}
phases:
- name: ohmech
thermo: ideal-gas
elements: [O, H, Ar]
elements: [O, H, Ar, E]
species:
- h2o2.yaml/species: [AR, O, H2, H, OH, O2, H2O, H2O2, HO2]
- species: all
kinetics: gas
reactions: all
state:
T: 300.0
P: 1.01325e+05

species:
- name: E
composition: {E: 1}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 6000.0]
data:
- [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, -11.7246902]
- [2.5, 0.0, 0.0, 0.0, 0.0, -745.375, -11.7246902]
transport:
model: gas
geometry: atom
diameter: 2.05
well-depth: 145.0
polarizability: 0.667
note: gas L10/92
- name: O2^-
composition: {E: 1, O: 2}
thermo:
model: NASA7
temperature-ranges: [298.15, 1000.0, 6000.0]
data:
- [3.66442522, -9.28741138e-04, 6.45477082e-06, -7.7470338e-09, 2.93332662e-12,
-6870.76983, 4.35140681]
- [3.95666294, 5.98141823e-04, -2.12133905e-07, 3.63267581e-11, -2.24989228e-15,
-7062.87229, 2.27871017]
transport:
model: gas
geometry: linear
diameter: 3.33
well-depth: 136.5
polarizability: 1.424
note: L4/89

reactions:
- equation: O + H2 <=> H + OH # Reaction 1
rate-constant: {A: 38.7, b: 2.7, Ea: 6260.0}
Expand Down Expand Up @@ -80,6 +115,6 @@ reactions:
type: chemically-activated
high-P-rate-constant: [5.88E-14, 6.721, -3022.227]
low-P-rate-constant: [282320.078, 1.46878, -3270.56495]
- equation: O + AR <=> O + AR # Reaction 12
- equation: E + O2 + O2 => O2^- + O2 # Reaction 12
type: electron-temperature
rate-constant: {A: 38.7, b: 2.7, Ea_T: 6260.0, Ea_Te: 6260.0}
rate-constant: {A: 1.523e+27, b: -1.0, Ea_T: -100 K, Ea_Te: 0 K}

0 comments on commit 03ff6fb

Please sign in to comment.