Skip to content
Snippets Groups Projects
Commit 385c36c6 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[NavierStokesNC][test] Improve densitydrivenFlowProblem

* setting fixed pressure cells everywhere at the bottom
  is a bad idea, as it prohibits advective horizontal flow at the bottom
parent e545f49a
No related branches found
No related tags found
3 merge requests!617[WIP] Next,!576Feature/port staggered ff to next next,!571Cleanup/next
...@@ -5,7 +5,7 @@ dune_add_test(NAME test_densitydrivenflow ...@@ -5,7 +5,7 @@ dune_add_test(NAME test_densitydrivenflow
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/stokes2c-densitydriven-reference.vtu --files ${CMAKE_SOURCE_DIR}/test/references/stokes2c-densitydriven-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_densitydrivenflow-00025.vtu ${CMAKE_CURRENT_BINARY_DIR}/test_densitydrivenflow-00029.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_densitydrivenflow") --command "${CMAKE_CURRENT_BINARY_DIR}/test_densitydrivenflow")
add_executable(test_stokes2c test_channel.cc) add_executable(test_stokes2c test_channel.cc)
......
...@@ -140,6 +140,10 @@ public: ...@@ -140,6 +140,10 @@ public:
useWholeLength_ = getParam<bool>("Problem.UseWholeLength"); useWholeLength_ = getParam<bool>("Problem.UseWholeLength");
FluidSystem::init(); FluidSystem::init();
deltaRho_.resize(this->fvGridGeometry().numCellCenterDofs()); deltaRho_.resize(this->fvGridGeometry().numCellCenterDofs());
using CellArray = std::array<unsigned int, dimWorld>;
const CellArray numCells = getParam<CellArray>("Grid.Cells");
cellSizeX_ = this->fvGridGeometry().bBoxMax()[0] / numCells[0];
} }
/*! /*!
...@@ -190,7 +194,7 @@ public: ...@@ -190,7 +194,7 @@ public:
values.setOutflow(transportEqIdx); values.setOutflow(transportEqIdx);
values.setOutflow(massBalanceIdx); values.setOutflow(massBalanceIdx);
if(globalPos[1] < eps_) if(isLowerLeftCell_(globalPos))
values.setDirichletCell(massBalanceIdx); values.setDirichletCell(massBalanceIdx);
if(globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_) if(globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_)
...@@ -270,12 +274,19 @@ public: ...@@ -270,12 +274,19 @@ public:
auto& getDeltaRho() const auto& getDeltaRho() const
{ return deltaRho_; } { return deltaRho_; }
bool isLowerLeftCell_(const GlobalPosition& globalPos) const
{
return globalPos[0] < (0.5*cellSizeX_ + eps_) && globalPos[1] < eps_;
}
// \} // \}
private: private:
const Scalar eps_; const Scalar eps_;
bool useWholeLength_; bool useWholeLength_;
std::vector<Scalar> deltaRho_; std::vector<Scalar> deltaRho_;
Scalar cellSizeX_;
}; };
} //end namespace } //end namespace
......
[TimeLoop] [TimeLoop]
DtInitial = 1e-2 # [s] DtInitial = 1e-2 # [s]
# MaxTimeStepSize = 1e1 # MaxTimeStepSize = 1e1
TEnd = 1.5e3 # [s] TEnd = 5e3 # [s]
[Grid] [Grid]
UpperRight = 1 1 UpperRight = 1 1
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
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