extend BCType with dirichlet

This commit is contained in:
Tor Harald Sandve 2022-10-19 09:17:54 +02:00
parent cc81743dad
commit e9c93975cf
3 changed files with 28 additions and 3 deletions

View File

@ -33,7 +33,8 @@ class DeckRecord;
enum class BCType { enum class BCType {
RATE, RATE,
FREE FREE,
DIRICHLET
}; };
enum class BCComponent { enum class BCComponent {
@ -57,6 +58,8 @@ public:
FaceDir::DirEnum dir; FaceDir::DirEnum dir;
BCComponent component; BCComponent component;
double rate; double rate;
double pressure;
double temperature;
BCFace() = default; BCFace() = default;
explicit BCFace(const DeckRecord& record); explicit BCFace(const DeckRecord& record);
@ -78,6 +81,8 @@ public:
serializer(dir); serializer(dir);
serializer(component); serializer(component);
serializer(rate); serializer(rate);
serializer(pressure);
serializer(temperature);
} }
}; };

View File

@ -35,6 +35,9 @@ BCType bctype(const std::string& s) {
if (s == "FREE") if (s == "FREE")
return BCType::FREE; return BCType::FREE;
if (s == "DIRICHLET")
return BCType::DIRICHLET;
throw std::invalid_argument("Not recognized boundary condition type: " + s); throw std::invalid_argument("Not recognized boundary condition type: " + s);
} }
@ -74,7 +77,9 @@ BCConfig::BCFace::BCFace(const DeckRecord& record) :
bctype(fromstring::bctype(record.getItem("TYPE").get<std::string>(0))), bctype(fromstring::bctype(record.getItem("TYPE").get<std::string>(0))),
dir(FaceDir::FromString(record.getItem("DIRECTION").get<std::string>(0))), dir(FaceDir::FromString(record.getItem("DIRECTION").get<std::string>(0))),
component(fromstring::component(record.getItem("COMPONENT").get<std::string>(0))), component(fromstring::component(record.getItem("COMPONENT").get<std::string>(0))),
rate(record.getItem("RATE").getSIDouble(0)) rate(record.getItem("RATE").getSIDouble(0)),
pressure(record.getItem("PRESSURE").getSIDouble(0)),
temperature(record.getItem("TEMPERATURE").getSIDouble(0))
{ {
} }
@ -91,6 +96,8 @@ BCConfig::BCFace BCConfig::BCFace::serializationTestObject()
result.dir = FaceDir::XPlus; result.dir = FaceDir::XPlus;
result.component = BCComponent::GAS; result.component = BCComponent::GAS;
result.rate = 100.0; result.rate = 100.0;
result.pressure = 101.0;
result.temperature = 102.0;
return result; return result;
} }
@ -106,7 +113,9 @@ bool BCConfig::BCFace::operator==(const BCConfig::BCFace& other) const {
this->bctype == other.bctype && this->bctype == other.bctype &&
this->dir == other.dir && this->dir == other.dir &&
this->component == other.component && this->component == other.component &&
this->rate == other.rate; this->rate == other.rate &&
this->pressure == other.pressure &&
this->temperature == other.temperature;
} }

View File

@ -46,6 +46,17 @@
"value_type": "DOUBLE", "value_type": "DOUBLE",
"dimension": "Mass/Time*Length*Length", "dimension": "Mass/Time*Length*Length",
"default": 0 "default": 0
},
{
"name": "PRESSURE",
"value_type": "DOUBLE",
"dimension": "Pressure",
"default": 1
},
{
"name": "TEMPERATURE",
"value_type": "DOUBLE",
"dimension": "Temperature"
} }
] ]
} }