From a1b1d884dddfadb03eef51bb3ce91ba40ee7418e Mon Sep 17 00:00:00 2001 From: Christoph Grueninger <christoph.grueninger@iws.uni-stuttgart.de> Date: Thu, 19 Apr 2012 10:05:31 +0000 Subject: [PATCH] Added support for Navier-Stokes in Stokes code. (reviewed by Klaus except documentation) git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@8086 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- dumux/freeflow/stokes/stokeslocalresidual.hh | 13 +++++++++++++ dumux/freeflow/stokes/stokesmodel.hh | 6 ++++++ dumux/freeflow/stokes/stokesproperties.hh | 1 + dumux/freeflow/stokes/stokespropertydefaults.hh | 3 ++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/dumux/freeflow/stokes/stokeslocalresidual.hh b/dumux/freeflow/stokes/stokeslocalresidual.hh index fdc3c85761..5ca0724bba 100644 --- a/dumux/freeflow/stokes/stokeslocalresidual.hh +++ b/dumux/freeflow/stokes/stokeslocalresidual.hh @@ -91,6 +91,8 @@ protected: typedef typename GridView::Intersection Intersection; typedef typename GridView::IntersectionIterator IntersectionIterator; typedef typename GET_PROP_TYPE(TypeTag, BoundaryTypes) BoundaryTypes; + + static const bool calculateNavierStokes = GET_PROP_VALUE(TypeTag, EnableNavierStokes); public: /*! @@ -241,6 +243,17 @@ protected: // gravityTerm; } + + // this term changes the Stokes equation to the Navier-Stokes equation + // rho v (v*n) + // rho and first v are upwinded, second v is evaluated at the face + if (calculateNavierStokes) + { + for (int dimIndex = 0; dimIndex < dim; ++dimIndex) + { + flux[momentumXIdx + dimIndex] += up.density() * up.velocity()[dimIndex] * fluxVars.normalVelocityAtIP(); + } + } } /*! diff --git a/dumux/freeflow/stokes/stokesmodel.hh b/dumux/freeflow/stokes/stokesmodel.hh index 88d9b84001..645c9a77c8 100644 --- a/dumux/freeflow/stokes/stokesmodel.hh +++ b/dumux/freeflow/stokes/stokesmodel.hh @@ -56,6 +56,12 @@ namespace Dumux \frac{\partial \varrho_g}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_g {\boldsymbol{v}}_g\right) - q_g = 0 * \f] * + * By setting the property <code>EnableNavierStokes</code> to <code>true</code> the Navier-Stokes + * equation can be solved. In this case an additional term is added to the momentum balance: + * \f[ +\varrho_g \left(\boldsymbol{v}_g \boldsymbol{\cdot} \boldsymbol{\nabla} \right) \boldsymbol{v}_g + * \f] + * * This is discretized by a fully-coupled vertex-centered finite volume * (box) scheme in space and by the implicit Euler method in time. */ diff --git a/dumux/freeflow/stokes/stokesproperties.hh b/dumux/freeflow/stokes/stokesproperties.hh index ba561cf07d..e2eaadbd38 100644 --- a/dumux/freeflow/stokes/stokesproperties.hh +++ b/dumux/freeflow/stokes/stokesproperties.hh @@ -60,6 +60,7 @@ NEW_PROP_TAG(FluidSystem); //!< The employed fluid system NEW_PROP_TAG(FluidState); NEW_PROP_TAG(StabilizationAlpha); //!< The parameter for the stabilization NEW_PROP_TAG(StabilizationBeta); //!< The parameter for the stabilization at boundaries +NEW_PROP_TAG(EnableNavierStokes); //!< Returns whether Navier-Stokes should be solved instead of plain Stokes NEW_PROP_TAG(PhaseIndex); //!< A phase index in case that a two-phase fluidsystem is used NEW_PROP_TAG(SpatialParameters); //!< The type of the spatial parameters diff --git a/dumux/freeflow/stokes/stokespropertydefaults.hh b/dumux/freeflow/stokes/stokespropertydefaults.hh index 19674c17cf..4896183ba5 100644 --- a/dumux/freeflow/stokes/stokespropertydefaults.hh +++ b/dumux/freeflow/stokes/stokespropertydefaults.hh @@ -137,7 +137,8 @@ public: //! Set the phaseIndex per default to zero (important for two-phase fluidsystems). SET_INT_PROP(BoxStokes, PhaseIndex, 0); -// +//! Set calculation to Stokes, not Navier-Stokes +SET_BOOL_PROP(BoxStokes, EnableNavierStokes, false); } } -- GitLab