Skip to content
Snippets Groups Projects
Commit 6a24fe94 authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Timo Koch
Browse files

[staggeredGrid][test] Improve densitydriven flow test

* Update ref solution
* Add input file parameter "UseWholeLenght" to apply concentration BC
  over whole length of domain
* add output of delRho to identify influence of composition on density
parent 0091ac3d
No related branches found
No related tags found
2 merge requests!617[WIP] Next,!390Feature/staggered components
......@@ -4,7 +4,7 @@ add_dumux_test(test_densitydrivenflow test_densitydrivenflow test_densitydrivenf
python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
--script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/stokes2c-densitydriven-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_densitydrivenflow-00012.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_densitydrivenflow-00024.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_densitydrivenflow")
add_dumux_test(test_purediffusion test_channel test_channel.cc
......
......@@ -145,6 +145,11 @@ public:
Problem,
Name);
useWholeLength_ = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag,
bool,
Problem,
UseWholeLength);
FluidSystem::init();
}
......@@ -203,15 +208,19 @@ public:
// set Dirichlet values for the velocity everywhere
values.setDirichlet(momentumBalanceIdx);
values.setNeumann(transportEqIdx);
values.setNeumann(massBalanceIdx);
values.setOutflow(transportEqIdx);
values.setOutflow(massBalanceIdx);
if(globalPos[1] < eps_)
values.setDirichlet(massBalanceIdx);
if(globalPos[1] > this->bBoxMax()[1] - eps_ && globalPos[0] > 0.4 && globalPos[0] < 0.6)
if(globalPos[1] > this->bBoxMax()[1] - eps_)
{
values.setDirichlet(transportEqIdx);
if(useWholeLength_)
values.setDirichlet(transportEqIdx);
else
if(globalPos[0] > 0.4 && globalPos[0] < 0.6)
values.setDirichlet(transportEqIdx);
}
return values;
......@@ -258,11 +267,36 @@ public:
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& delRho = outputModule.createScalarField("delRho", 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());
delRho[ccDofIdx] = elemVolVars[scv].density() - 999.694;
}
}
}
// \}
private:
const Scalar eps_{1e-6};
std::string name_;
bool useWholeLength_;
};
} //end namespace
......
[TimeManager]
DtInitial = 1e2 # [s]
TEnd = 1e4 # [s]
DtInitial = 1e-2 # [s]
# MaxTimeStepSize = 1e1
TEnd = 1.5e3 # [s]
[Grid]
UpperRight = 1 1
......@@ -8,12 +9,12 @@ Cells = 20 20
[Problem]
Name = test_densitydrivenflow # name passed to the output routines
InletVelocity = 1
EnableGravity = true
UseWholeLength = false
[ Newton ]
MaxSteps = 10
MaxRelativeShift = 1e-5
MaxRelativeShift = 1e-8
[Vtk]
WriteFaceData = false
This diff is collapsed.
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