Skip to content

Commit

Permalink
[UnitTests] Addition third-body collider tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Jul 21, 2022
1 parent 33e04ff commit c68e3a5
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/kinetics/kineticsFromScratch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,42 @@ TEST_F(KineticsFromScratch, multiple_third_bodies6)
EXPECT_EQ(input["default-efficiency"].asDouble(), 0.);
}

TEST_F(KineticsFromScratch, multiple_third_bodies7)
{
std::string equation = "CH2OCH + M <=> CH2CHO + M";
auto rate = make_shared<ArrheniusRate>(1.2e11, -1.0, 0.0);
auto tbody = make_shared<ThirdBody>("O2");
auto R = make_shared<Reaction>(equation, rate, tbody);

AnyMap input = R->parameters();
EXPECT_FALSE(input.hasKey("type"));
EXPECT_TRUE(input.hasKey("efficiencies"));
auto efficiencies = input["efficiencies"].asMap<double>();
EXPECT_EQ(efficiencies.size(), 1);
EXPECT_EQ(efficiencies.begin()->first, "O2");
EXPECT_TRUE(input.hasKey("default-efficiency"));
EXPECT_EQ(input["default-efficiency"].asDouble(), 0.);
}

TEST_F(KineticsFromScratch, multiple_third_bodies8)
{
std::string equation = "CH2OCH + M <=> CH2CHO + M";
auto rate = make_shared<ArrheniusRate>(1.2e11, -1.0, 0.0);
auto tbody = make_shared<ThirdBody>();
tbody->efficiencies = parseCompString("O2:1");
tbody->default_efficiency = 0.;
auto R = make_shared<Reaction>(equation, rate, tbody);

AnyMap input = R->parameters();
EXPECT_FALSE(input.hasKey("type"));
EXPECT_TRUE(input.hasKey("efficiencies"));
auto efficiencies = input["efficiencies"].asMap<double>();
EXPECT_EQ(efficiencies.size(), 1);
EXPECT_EQ(efficiencies.begin()->first, "O2");
EXPECT_TRUE(input.hasKey("default-efficiency"));
EXPECT_EQ(input["default-efficiency"].asDouble(), 0.);
}

TEST_F(KineticsFromScratch, add_two_temperature_plasma)
{
std::string equation = "O + H => O + H";
Expand Down

0 comments on commit c68e3a5

Please sign in to comment.