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

[staggerednc][test] Fix tests and update ref solution

* Old test used parabolic velocity profile as initital and boundary condition
  although Re was way over 1000. This led to some strange behaviour regarding
  the pressure gradient

* We now give the system some additional time so that the "right" pressure gradient
  can evolve before injecting the tracer

* Add output of deltaP
parent 8dd406b9
No related branches found
No related tags found
Loading
...@@ -19,7 +19,7 @@ add_dumux_test(test_advection test_channel test_channel.cc ...@@ -19,7 +19,7 @@ add_dumux_test(test_advection test_channel test_channel.cc
python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
--script fuzzy --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/stokes2c-advection.vtu --files ${CMAKE_SOURCE_DIR}/test/references/stokes2c-advection.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_advection-00002.vtu ${CMAKE_CURRENT_BINARY_DIR}/test_advection-00009.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_channel test_advection.input") --command "${CMAKE_CURRENT_BINARY_DIR}/test_channel test_advection.input")
......
...@@ -239,7 +239,10 @@ public: ...@@ -239,7 +239,10 @@ public:
{ {
BoundaryValues values = initialAtPos(globalPos); BoundaryValues values = initialAtPos(globalPos);
if(isInlet(globalPos)) const Scalar time = this->timeManager().time() + this->timeManager().timeStepSize();
// give the system some time so that the pressure can equilibrate, then start the injection of the tracer
if(isInlet(globalPos) && time > 20.0)
values[transportCompIdx] = 1e-3; values[transportCompIdx] = 1e-3;
return values; return values;
...@@ -272,6 +275,30 @@ public: ...@@ -272,6 +275,30 @@ public:
return values; return values;
} }
/*!
* \brief Adds additional VTK output data to the VTKWriter. Function is called by the output module on every write.
*/
template<class VtkOutputModule>
void addVtkOutputFields(VtkOutputModule& outputModule) const
{
auto& deltaP = outputModule.createScalarField("deltaP", 0);
for (const auto& element : elements(this->gridView()))
{
auto fvGeometry = localView(this->model().globalFvGeometry());
fvGeometry.bindElement(element);
for (auto&& scv : scvs(fvGeometry))
{
auto ccDofIdx = scv.dofIndex();
auto elemVolVars = localView(this->model().curGlobalVolVars());
elemVolVars.bind(element, fvGeometry, this->model().curSol());
deltaP[ccDofIdx] = elemVolVars[scv].pressure() - 1.1e5;
}
}
}
// \} // \}
private: private:
......
[TimeManager] [TimeManager]
DtInitial = 5e-3 # [s] DtInitial = 5 # [s]
TEnd = 1e-2 # [s] TEnd = 400 # [s]
[Grid] [Grid]
UpperRight = 5 1 UpperRight = 5 1
...@@ -8,7 +8,7 @@ Cells = 50 25 ...@@ -8,7 +8,7 @@ Cells = 50 25
[Problem] [Problem]
Name = test_advection # name passed to the output routines Name = test_advection # name passed to the output routines
InletVelocity = 1000 InletVelocity = 1e-2
EnableGravity = false EnableGravity = false
[ Newton ] [ Newton ]
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -482,6 +482,50 @@ ...@@ -482,6 +482,50 @@
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
</DataArray> </DataArray>
<DataArray type="Float32" Name="deltaP" NumberOfComponents="1" format="ascii">
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
</DataArray>
</CellData> </CellData>
<Points> <Points>
<DataArray type="Float32" Name="Coordinates" NumberOfComponents="3" format="ascii"> <DataArray type="Float32" Name="Coordinates" NumberOfComponents="3" format="ascii">
......
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