Skip to content
Snippets Groups Projects
Commit 1da885fb authored by Sina Ackermann's avatar Sina Ackermann
Browse files

Merge branch 'fix/turbulenceModelInitialization' into 'master'

[rans] Catch not using or wrongl using the mandatory function for the RANS model

See merge request !1101
parents f0bb0b85 863d1d84
No related branches found
No related tags found
1 merge request!1101[rans] Catch not using or wrongl using the mandatory function for the RANS model
...@@ -89,6 +89,7 @@ public: ...@@ -89,6 +89,7 @@ public:
{ {
using std::abs; using std::abs;
std::cout << "Update static wall properties. "; std::cout << "Update static wall properties. ";
calledUpdateStaticWallProperties = true;
// update size and initial values of the global vectors // update size and initial values of the global vectors
wallElementID_.resize(this->fvGridGeometry().elementMapper().size()); wallElementID_.resize(this->fvGridGeometry().elementMapper().size());
...@@ -132,6 +133,10 @@ public: ...@@ -132,6 +133,10 @@ public:
} }
} }
std::cout << "NumWallIntersections=" << wallPositions.size() << std::endl; std::cout << "NumWallIntersections=" << wallPositions.size() << std::endl;
if (wallPositions.size() == 0)
DUNE_THROW(Dune::InvalidStateException,
"No wall intersections have been found. Make sure that the isOnWall(globalPos) is working properly.");
// search for shortest distance to wall for each element // search for shortest distance to wall for each element
for (const auto& element : elements(gridView)) for (const auto& element : elements(gridView))
...@@ -214,6 +219,9 @@ public: ...@@ -214,6 +219,9 @@ public:
using std::max; using std::max;
using std::min; using std::min;
std::cout << "Update dynamic wall properties." << std::endl; std::cout << "Update dynamic wall properties." << std::endl;
if (!calledUpdateStaticWallProperties)
DUNE_THROW(Dune::InvalidStateException,
"You have to call updateStaticWallProperties() once before you call updateDynamicWallProperties().");
static const int flowNormalAxis static const int flowNormalAxis
= getParamFromGroup<int>(this->paramGroup(), "RANS.FlowNormalAxis", -1); = getParamFromGroup<int>(this->paramGroup(), "RANS.FlowNormalAxis", -1);
...@@ -413,6 +421,7 @@ public: ...@@ -413,6 +421,7 @@ public:
} }
public: public:
bool calledUpdateStaticWallProperties = false;
std::vector<unsigned int> wallElementID_; std::vector<unsigned int> wallElementID_;
std::vector<Scalar> wallDistance_; std::vector<Scalar> wallDistance_;
std::vector<std::array<std::array<unsigned int, 2>, dim>> neighborID_; std::vector<std::array<std::array<unsigned int, 2>, dim>> neighborID_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment