Skip to content

Commit

Permalink
[test] add ETempFromYaml
Browse files Browse the repository at this point in the history
  • Loading branch information
BangShiuh committed Dec 21, 2021
1 parent 242611c commit 76ab2aa
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/kinetics/kineticsFromYaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,27 @@ TEST(Reaction, BlowersMaselFromYaml)
EXPECT_FALSE(R->allow_negative_orders);
}

TEST(Reaction, ETempFromYaml)
{
auto sol = newSolution("ET_test.yaml");
AnyMap rxn = AnyMap::fromYamlString(
"{equation: E + O2 + O2 => O2^- + O2,"
" type: electron-temperature,"
" rate-constant: [1.523e+27 cm^6/mol^2/s, -1.0, -100 K, 700 K]}");

auto R = newReaction(rxn, *(sol->kinetics()));
EXPECT_EQ(R->reactants.at("O2"), 2);
EXPECT_EQ(R->reactants.at("E"), 1);
EXPECT_EQ(R->products.at("O2^-"), 1);
EXPECT_EQ(R->products.at("O2"), 1);

const auto rate = std::dynamic_pointer_cast<ETempRate>(R->rate());
EXPECT_DOUBLE_EQ(rate->preExponentialFactor(), 1.523e21);
EXPECT_DOUBLE_EQ(rate->temperatureExponent(), -1.0);
EXPECT_DOUBLE_EQ(rate->activationEnergy_R(), -100);
EXPECT_DOUBLE_EQ(rate->activationElectronEnergy_R(), 700);
}

TEST(Kinetics, GasKineticsFromYaml1)
{
AnyMap infile = AnyMap::fromYamlFile("ideal-gas.yaml");
Expand Down

0 comments on commit 76ab2aa

Please sign in to comment.