Skip to content
Snippets Groups Projects
Commit 9b4fb967 authored by Klaus Mosthaf's avatar Klaus Mosthaf
Browse files

Included time-dependent Dirichlet conditions in stokestestproblem.hh:Ä

The inflow velocity is varied sinusoidally. Updated reference solution.


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@10858 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent a686abdb
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ add_test(test_stokes ...@@ -5,7 +5,7 @@ add_test(test_stokes
${CMAKE_SOURCE_DIR}/bin/runTest.sh ${CMAKE_SOURCE_DIR}/bin/runTest.sh
${CMAKE_SOURCE_DIR}/bin/fuzzycomparevtu.py ${CMAKE_SOURCE_DIR}/bin/fuzzycomparevtu.py
${CMAKE_SOURCE_DIR}/test/references/stokes-reference.vtu ${CMAKE_SOURCE_DIR}/test/references/stokes-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/stokes-00013.vtu ${CMAKE_CURRENT_BINARY_DIR}/stokes-00014.vtu
${CMAKE_CURRENT_BINARY_DIR}/test_stokes ${CMAKE_CURRENT_BINARY_DIR}/test_stokes
-ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_stokes.input -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_stokes.input
-Grid.File ${CMAKE_CURRENT_SOURCE_DIR}/grids/test_stokes.dgf) -Grid.File ${CMAKE_CURRENT_SOURCE_DIR}/grids/test_stokes.dgf)
......
...@@ -82,6 +82,8 @@ SET_BOOL_PROP(StokesTestProblem, ProblemEnableGravity, false); ...@@ -82,6 +82,8 @@ SET_BOOL_PROP(StokesTestProblem, ProblemEnableGravity, false);
* outflow bcs, which are replaced in the localresidual by the sum * outflow bcs, which are replaced in the localresidual by the sum
* of the momentum balance equations in case of Dirichlet bcs for the momentum balance. * of the momentum balance equations in case of Dirichlet bcs for the momentum balance.
* In the middle of the right boundary, one vertex receives Dirichlet bcs to set the pressure level. * In the middle of the right boundary, one vertex receives Dirichlet bcs to set the pressure level.
* The flow velocity starts with 0 m/s. A flow field evolves with a maximum velocity, which is
* varied time-dependently using a sinus function and a period of 3000s.
* *
* This problem uses the \ref BoxStokesModel. * This problem uses the \ref BoxStokesModel.
* To run the simulation execute the following line in shell: * To run the simulation execute the following line in shell:
...@@ -101,10 +103,15 @@ class StokesTestProblem : public StokesProblem<TypeTag> ...@@ -101,10 +103,15 @@ class StokesTestProblem : public StokesProblem<TypeTag>
dim = GridView::dimension, dim = GridView::dimension,
// copy some indices for convenience // copy some indices for convenience
massBalanceIdx = Indices::massBalanceIdx, massBalanceIdx = Indices::massBalanceIdx, //!< Index of the mass balance
momentumXIdx = Indices::momentumXIdx, //!< Index of the x-component of the momentum balance momentumXIdx = Indices::momentumXIdx, //!< Index of the x-component of the momentum balance
momentumYIdx = Indices::momentumYIdx //!< Index of the y-component of the momentum balance momentumYIdx = Indices::momentumYIdx //!< Index of the y-component of the momentum balance
}; };
enum { // indices of the primary variables
velocityXIdx = Indices::velocityXIdx, //!< Index of the x-velocity
velocityYIdx = Indices::velocityYIdx, //!< Index of the y-velocity
pressureIdx = Indices::pressureIdx //!< Index of the pressure
};
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes; typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes;
...@@ -181,12 +188,16 @@ public: ...@@ -181,12 +188,16 @@ public:
void dirichlet(PrimaryVariables &values, const Vertex &vertex) const void dirichlet(PrimaryVariables &values, const Vertex &vertex) const
{ {
const GlobalPosition globalPos = vertex.geometry().center(); const GlobalPosition globalPos = vertex.geometry().center();
const Scalar time = this->timeManager().time() + this->timeManager().timeStepSize();
const Scalar velocityVariation = 0.2;
initial_(values, globalPos); initial_(values, globalPos);
const Scalar v0 = 1.0; // sinusoidal variation of the maximum velocity in time
const Scalar v0 = 1.0 + std::sin(2*M_PI*time/3000) * velocityVariation;
// parabolic velocity profile // parabolic velocity profile
values[momentumXIdx] = v0*(globalPos[1] - this->bBoxMin()[1])*(this->bBoxMax()[1] - globalPos[1]) values[velocityXIdx] = v0*(globalPos[1] - this->bBoxMin()[1])*(this->bBoxMax()[1] - globalPos[1])
/ (0.25*(this->bBoxMax()[1] - this->bBoxMin()[1])*(this->bBoxMax()[1] - this->bBoxMin()[1])); / (0.25*(this->bBoxMax()[1] - this->bBoxMin()[1])*(this->bBoxMax()[1] - this->bBoxMin()[1]));
} }
...@@ -256,7 +267,7 @@ private: ...@@ -256,7 +267,7 @@ private:
const GlobalPosition &globalPos) const const GlobalPosition &globalPos) const
{ {
values = 0.0; values = 0.0;
values[massBalanceIdx] = 1e5; values[pressureIdx] = 1e5;
} }
bool onLeftBoundary_(const GlobalPosition &globalPos) const bool onLeftBoundary_(const GlobalPosition &globalPos) const
......
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