rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Loading...
Searching...
No Matches
BoundaryConditions_test.cpp
Go to the documentation of this file.
1
9
11
12#include <gtest/gtest.h>
13
14#include <stdexcept>
15
16namespace
17{
18
19 using rizer::OuterBc;
21
23 TEST(ParseOuterBc, AcceptsTheTwoDocumentedModes)
24 {
25 EXPECT_EQ(parseOuterBc("ambient_ghost"), OuterBc::AmbientGhost);
26 EXPECT_EQ(parseOuterBc("pressure_outlet"), OuterBc::PressureOutlet);
27 }
28
33 TEST(ParseOuterBc, RejectsNearMisses)
34 {
35 for (const char *mode : {"ambient-ghost", "AmbientGhost", "Ambient_Ghost",
36 "ambient_ghost ", "pressure-outlet", "outflow", ""})
37 {
38 EXPECT_THROW(parseOuterBc(mode), std::invalid_argument) << "mode = " << mode;
39 }
40 }
41
44 TEST(ParseOuterBc, NamesTheRejectedValue)
45 {
46 try
47 {
48 parseOuterBc("transmissive");
49 FAIL() << "an unknown mode must throw";
50 }
51 catch (const std::invalid_argument &error)
52 {
53 EXPECT_NE(std::string(error.what()).find("transmissive"), std::string::npos);
54 }
55 }
56
57} // namespace
Outer-boundary vocabulary for the 1D radial channel: which treatment is applied, the primitive state ...
OuterBc parseOuterBc(const std::string &mode)
Map an outer_bc_mode config string onto the enum.
OuterBc
Outer-boundary treatment (NUMERICS.md section 7).