rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Toggle main menu visibility
Loading...
Searching...
No Matches
BoundaryConditions_test.cpp
Go to the documentation of this file.
1
9
10
#include "
models/nrp/BoundaryConditions.h
"
11
12
#include <gtest/gtest.h>
13
14
#include <stdexcept>
15
16
namespace
17
{
18
19
using
rizer::OuterBc
;
20
using
rizer::parseOuterBc
;
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
BoundaryConditions.h
Outer-boundary vocabulary for the 1D radial channel: which treatment is applied, the primitive state ...
rizer::parseOuterBc
OuterBc parseOuterBc(const std::string &mode)
Map an outer_bc_mode config string onto the enum.
Definition
BoundaryConditions.cpp:13
rizer::OuterBc
OuterBc
Outer-boundary treatment (NUMERICS.md section 7).
Definition
BoundaryConditions.h:38
rizer
cantera_ext
test
models
nrp
BoundaryConditions_test.cpp
Generated by
1.18.0