diff --git a/dumux/freeflow/stokes/stokeslocalresidual.hh b/dumux/freeflow/stokes/stokeslocalresidual.hh index fdc3c85761763259828dfaa5957e5814457b1fcd..5ca0724bba43881c0bb943f0b0359bae5869661d 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 88d9b8400101742a5be662f86f488f99b63e536f..645c9a77c870c67fcdc7565196d3fef564b540f5 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 ba561cf07d5db3e3a943067e5d8c817b8a237bbb..e2eaadbd381d695ab06286f8052f11e333333c99 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 19674c17cf132166577e9a1100aec75f636ef30a..4896183ba5b53282afeae22f9ad9597202a30266 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); } }