diff --git a/dumux/freeflow/stokes/stokesfluxvariables.hh b/dumux/freeflow/stokes/stokesfluxvariables.hh index d9ec717ab4fba415fef7168739858d89ab699782..6ad0bf1504eddd3c27e8ab4340b0b1cc259ced7d 100644 --- a/dumux/freeflow/stokes/stokesfluxvariables.hh +++ b/dumux/freeflow/stokes/stokesfluxvariables.hh @@ -22,10 +22,9 @@ * \file * * \brief This file contains the data which is required to calculate - * all fluxes of the fluid phase over a face of a finite volume. + * the fluxes of the fluid phase over a face of a finite volume. * - * This means pressure and temperature gradients, phase densities at - * the integration point, etc. + * This means pressure gradients, phase densities at the integration point, etc. */ #ifndef DUMUX_STOKES_FLUX_VARIABLES_HH #define DUMUX_STOKES_FLUX_VARIABLES_HH @@ -36,10 +35,11 @@ namespace Dumux { /*! - * \ingroup StokesModel + * \ingroup BoxStokesModel + * \ingroup BoxFluxVariables * \brief This template class contains the data which is required to - * calculate the fluxes of the fluid phases over a face of a - * finite volume for the stokes model. + * calculate the fluxes of the fluid phase over a face of a + * finite volume for the Stokes model. * * This means pressure and concentration gradients, phase densities at * the intergration point, etc. diff --git a/dumux/freeflow/stokes/stokesindices.hh b/dumux/freeflow/stokes/stokesindices.hh index f50133a1fde0ab9978df913ab857833643e4e120..33ef174290e98842460edbe66859ee7dfa5f4f35 100644 --- a/dumux/freeflow/stokes/stokesindices.hh +++ b/dumux/freeflow/stokes/stokesindices.hh @@ -32,6 +32,8 @@ namespace Dumux // \{ /*! + * \ingroup BoxStokesModel + * \ingroup BoxIndices * \brief The common indices for the isothermal stokes model. * * \tparam PVOffset The first index in a primary variable vector. diff --git a/dumux/freeflow/stokes/stokeslocaljacobian.hh b/dumux/freeflow/stokes/stokeslocaljacobian.hh index 39bb433c3e937d8593743e900ab34f4bdd5860b0..b37f62218ab191c277c1648916aa64770b94fd26 100644 --- a/dumux/freeflow/stokes/stokeslocaljacobian.hh +++ b/dumux/freeflow/stokes/stokeslocaljacobian.hh @@ -32,14 +32,12 @@ #include <dune/istl/matrix.hh> -//#include "boxelementboundarytypes.hh" - namespace Dumux { /*! - * \ingroup StokesModel + * \ingroup BoxStokesModel * \brief Element-wise calculation of the jacobian matrix for models - * based on the box scheme . + * based on the box scheme. * * \todo Please doc me more! */ @@ -57,15 +55,7 @@ private: }; public: - /*! - * \brief Returns the epsilon value which is added and removed - * from the current solution. - * - * \param elemSol The current solution on the element - * \param scvIdx The local index of the element's vertex for - * which the local derivative ought to be calculated. - * \param pvIdx The index of the primary variable which gets varied - */ + //! \copydoc BoxLocalJacobian::numericEpsilon_() Scalar numericEpsilon_(int scvIdx, int pvIdx) const { diff --git a/dumux/freeflow/stokes/stokeslocalresidual.hh b/dumux/freeflow/stokes/stokeslocalresidual.hh index ebde84996746c1c8993f61204240337d769e4534..268457f05eaadcfdf2bbb67bdeaa806b5afb6de8 100644 --- a/dumux/freeflow/stokes/stokeslocalresidual.hh +++ b/dumux/freeflow/stokes/stokeslocalresidual.hh @@ -44,7 +44,8 @@ namespace Dumux { /*! - * \ingroup StokesModel + * \ingroup BoxStokesModel + * \ingroup BoxLocalResidual * \brief Element-wise calculation of the Jacobian matrix for problems * using the stokes box model. * diff --git a/dumux/freeflow/stokes/stokesmodel.hh b/dumux/freeflow/stokes/stokesmodel.hh index 1d2de2eb2ffd917c6f6d0aabf5874e97879ec400..723bbc7cb03e919072f8f62867857ea3ce9ffe07 100644 --- a/dumux/freeflow/stokes/stokesmodel.hh +++ b/dumux/freeflow/stokes/stokesmodel.hh @@ -27,31 +27,34 @@ #define DUMUX_STOKES_MODEL_HH #include "stokeslocalresidual.hh" +#include "stokesnewtoncontroller.hh" #include "stokeslocaljacobian.hh" #include "stokesproblem.hh" #include "stokesproperties.hh" namespace Dumux { - /*! - * \ingroup BoxProblems - * \defgroup StokesBoxProblems Stokes box problems - */ - -/*! - * \ingroup BoxModels - * \defgroup StokesModel Stokes box model - */ - -/*! - * \ingroup StokesModel + * \ingroup BoxStokesModel * \brief Adaption of the BOX scheme to the stokes flow model. * - * This model implements stokes flow of a single fluid - * discretized by a fully-coupled vertex - * centered finite volume (box) scheme as spatial and - * the implicit Euler method as time discretization. + * This model implements laminar Stokes flow of a single fluid, solving a momentum balance: + * \f[ +\frac{\partial \left(\varrho_g {\boldsymbol{v}}_g\right)}{\partial t} ++ \boldsymbol{\nabla} \boldsymbol{\cdot} \left(p_g {\bf {I}} +- \mu_g \left(\boldsymbol{\nabla} \boldsymbol{v}_g ++ \boldsymbol{\nabla} \boldsymbol{v}_g^T\right)\right) +- \varrho_g {\bf g} = 0, + * \f] + * + * and the mass balance equation: + * \f[ +\frac{\partial \varrho_g}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_g {\boldsymbol{v}}_g\right) - q_g = 0 + * \f] + * + * This is discretized by a fully-coupled vertex- centered finite volume + * (box) scheme as spatial and the implicit Euler method + * as temporal discretization. */ template<class TypeTag > class StokesModel : public BoxModel<TypeTag> diff --git a/dumux/freeflow/stokes/stokesnewtoncontroller.hh b/dumux/freeflow/stokes/stokesnewtoncontroller.hh index f3bbec33762d8bc48df9a019447368e86ac25589..fde679b2bc1728672eb68ab64f170ba411615d31 100644 --- a/dumux/freeflow/stokes/stokesnewtoncontroller.hh +++ b/dumux/freeflow/stokes/stokesnewtoncontroller.hh @@ -29,7 +29,9 @@ namespace Dumux { /*! - * \brief A Stokes specific controller for the newton solver. + * \ingroup BoxStokesModel + * \ingroup Newton + * \brief A Stokes-specific controller for the newton solver. */ template <class TypeTag> class StokesNewtonController : public NewtonController<TypeTag> @@ -43,9 +45,9 @@ public: { Dune::FMatrixPrecision<>::set_singular_limit(1e-35); - this->setRelTolerance(1e-4); - this->setTargetSteps(15); - this->setMaxSteps(23); + this->setRelTolerance(1e-6); + this->setTargetSteps(10); + this->setMaxSteps(18); }; }; } diff --git a/dumux/freeflow/stokes/stokesproblem.hh b/dumux/freeflow/stokes/stokesproblem.hh index 3335a5968b675fe85ce04c28ff4ba0870e3cfd75..a8efab9652036d5a16b96da297948f3d922f42ae 100644 --- a/dumux/freeflow/stokes/stokesproblem.hh +++ b/dumux/freeflow/stokes/stokesproblem.hh @@ -25,15 +25,13 @@ #ifndef DUMUX_STOKES_PROBLEM_HH #define DUMUX_STOKES_PROBLEM_HH -#include "dumux/freeflow/stokes/stokesnewtoncontroller.hh" - #include <dumux/boxmodels/common/boxproblem.hh> namespace Dumux { /*! - * \ingroup StokesProblems + * \ingroup BoxStokesProblems * \brief Base class for all problems which use the stokes box model * * \todo Please doc me more! diff --git a/dumux/freeflow/stokes/stokesproperties.hh b/dumux/freeflow/stokes/stokesproperties.hh index 4f731c56b65b9f6621f42ff93ebbe134f7593746..a1a2de4a2f5184e3c65f25a23f3a51f48604575d 100644 --- a/dumux/freeflow/stokes/stokesproperties.hh +++ b/dumux/freeflow/stokes/stokesproperties.hh @@ -19,6 +19,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ /*! + * \ingroup Properties + * \ingroup BoxProperties + * \ingroup BoxStokesModel + * * \file * * \brief Defines the properties required for the Stokes BOX model. @@ -30,7 +34,8 @@ #include "stokesindices.hh" #include <dumux/boxmodels/common/boxproperties.hh> -#include <dumux/freeflow/stokes/stokeslocaljacobian.hh> +#include "stokeslocaljacobian.hh" +#include "stokesnewtoncontroller.hh" #include <dumux/material/fluidsystems/gasphase.hh> #include <dumux/material/fluidsystems/liquidphase.hh> @@ -43,10 +48,6 @@ namespace Dumux { -/*! - * \addtogroup StokesModel - */ -// \{ //////////////////////////////// // forward declarations @@ -75,7 +76,7 @@ namespace Properties { /*! - * \addtogroup StokesModel + * \addtogroup BoxStokesModel */ // \{ @@ -181,15 +182,6 @@ SET_INT_PROP(BoxStokes, PhaseIndex, 0); // \} -//// enable jacobian matrix recycling by default -//SET_BOOL_PROP(BoxStokes, EnableJacobianRecycling, false); -//// enable partial reassembling by default -//SET_BOOL_PROP(BoxStokes, EnablePartialReassemble, false); -//// set some Newton properties deviating from the default ones -// -//SET_SCALAR_PROP(BoxStokes, NewtonRelTolerance, 1e-4); -//SET_INT_PROP(BoxStokes, NewtonTargetSteps, 10); - } } diff --git a/dumux/freeflow/stokes/stokesvolumevariables.hh b/dumux/freeflow/stokes/stokesvolumevariables.hh index 7ab71e62591f06091103c1dc7bc333fbe36d73fb..65f33cd7537c75c5dfa019c8668cb9a93037453a 100644 --- a/dumux/freeflow/stokes/stokesvolumevariables.hh +++ b/dumux/freeflow/stokes/stokesvolumevariables.hh @@ -22,7 +22,7 @@ * \file * * \brief Contains the quantities which are constant within a - * finite volume in the stokes model. + * finite volume in the Stokes model. */ #ifndef DUMUX_STOKES_VOLUME_VARIABLES_HH #define DUMUX_STOKES_VOLUME_VARIABLES_HH @@ -32,15 +32,11 @@ #include <dumux/material/fluidstates/immisciblefluidstate.hh> -//#include <dumux/material/fluidstates/compositionalfluidstate.hh> -//#include <dumux/material/constraintsolvers/computefromreferencephase.hh> -//#include <dumux/material/constraintsolvers/misciblemultiphasecomposition.hh> - namespace Dumux { /*! - * \ingroup StokesModel + * \ingroup BoxStokesModel * \ingroup BoxVolumeVariables * \brief Contains the quantities which are are constant within a * finite volume in the Stokes model. diff --git a/dumux/freeflow/stokes2c/stokes2cfluxvariables.hh b/dumux/freeflow/stokes2c/stokes2cfluxvariables.hh index 4dda5ed9719449d7477687a146752f6443907d96..de7b047bf32f49410887cc0c69977db67977798e 100644 --- a/dumux/freeflow/stokes2c/stokes2cfluxvariables.hh +++ b/dumux/freeflow/stokes2c/stokes2cfluxvariables.hh @@ -31,6 +31,7 @@ #define DUMUX_STOKES2C_FLUX_VARIABLES_HH #include <dumux/common/math.hh> +#include <dumux/freeflow/stokes/stokesfluxvariables.hh> namespace Dumux { @@ -41,10 +42,11 @@ NEW_PROP_TAG(Stokes2cIndices); //!< Enumerations for the compositional stokes mo } /*! - * \ingroup Stokes2cModel + * \ingroup BoxStokes2cModel + * \ingroup BoxFluxVariables * \brief This template class contains data which is required to * calculate the component fluxes over a face of a finite - * volume for the compositional stokes model. + * volume for the compositional Stokes model. * * This means concentration gradients, diffusion coefficients, mass fractions, etc. * at the integration point. diff --git a/dumux/freeflow/stokes2c/stokes2cindices.hh b/dumux/freeflow/stokes2c/stokes2cindices.hh index 7a955a2dc658ee04fc51eaaf051404b013894b29..af70d4ccdf41d12f7329cc0257e6b9844cb3e030 100644 --- a/dumux/freeflow/stokes2c/stokes2cindices.hh +++ b/dumux/freeflow/stokes2c/stokes2cindices.hh @@ -34,6 +34,8 @@ namespace Dumux // \{ /*! + * \ingroup BoxStokes2cModel + * \ingroup BoxIndices * \brief The common indices for the compositional stokes model. * * \tparam PVOffset The first index in a primary variable vector. diff --git a/dumux/freeflow/stokes2c/stokes2clocalresidual.hh b/dumux/freeflow/stokes2c/stokes2clocalresidual.hh index 080558ca2c13c20d1e05260a9414b62444ae288f..089b6e267f969bfaa3cf6cc1e37a3d7485c20c2c 100644 --- a/dumux/freeflow/stokes2c/stokes2clocalresidual.hh +++ b/dumux/freeflow/stokes2c/stokes2clocalresidual.hh @@ -32,12 +32,12 @@ #include <dumux/freeflow/stokes2c/stokes2cvolumevariables.hh> #include <dumux/freeflow/stokes2c/stokes2cfluxvariables.hh> -#include <dumux/freeflow/stokes2c/stokes2cproperties.hh> namespace Dumux { /*! - * \ingroup Stokes2cModel + * \ingroup BoxStokes2cModel + * \ingroup BoxLocalResidual * \brief Element-wise calculation of the Jacobian matrix for problems * using the compositional stokes box model. This is derived * from the stokes box model. diff --git a/dumux/freeflow/stokes2c/stokes2cmodel.hh b/dumux/freeflow/stokes2c/stokes2cmodel.hh index 5f592701184ad0478320bdd7597c160e2550d729..023ea8e6f7e9291c6ff4e443885546fbdc03aa1c 100644 --- a/dumux/freeflow/stokes2c/stokes2cmodel.hh +++ b/dumux/freeflow/stokes2c/stokes2cmodel.hh @@ -30,38 +30,37 @@ #include "stokes2clocalresidual.hh" #include "stokes2cproperties.hh" -#include "stokes2cproblem.hh" namespace Dumux { - -/*! - * \ingroup BoxProblems - * \defgroup Stokes2cBoxProblems Compositional stokes problems - */ - -/*! - * \ingroup BoxModels - * \defgroup Stokes2cModel Compositional box stokes model - */ - /*! - * \ingroup Stokes2cModel + * \ingroup BoxStokes2cModel * \brief Adaption of the BOX scheme to the compositional stokes model. * - * This model implements a non-isothermal flow of a fluid - * \f$\alpha \in \{ w, n \}\f$. - * Using the standard Stokes approach a mass balance equation is - * solved: - * \f{eqnarray*} - && \phi \frac{\partial (\sum_\alpha \varrho_\alpha X_\alpha^\kappa S_\alpha )}{\partial t} - - \sum_\alpha \text{div} \left\{ \varrho_\alpha X_\alpha^\kappa - \frac{k_{r\alpha}}{\mu_\alpha} \mbox{\bf K} - (\text{grad} p_\alpha - \varrho_{\alpha} \mbox{\bf g}) \right\}\\ - &-& \sum_\alpha \text{div} \left\{{\bf D_{\alpha, pm}^\kappa} \varrho_{\alpha} \text{grad} X^\kappa_{\alpha} \right\} - - \sum_\alpha q_\alpha^\kappa = \quad 0 \qquad \kappa \in \{w, a\} \, , - \alpha \in \{w, n\} - * \f} - \f} + * This model implements a non-isothermal two-component Stokes flow of a fluid + * solving a momentum balance, a mass balance, a conservation equation for one component, + * and one balance quation for the energy. + * + * Momentum Balance: + * \f[ +\frac{\partial \left(\varrho_g {\boldsymbol{v}}_g\right)}{\partial t} ++ \boldsymbol{\nabla} \boldsymbol{\cdot} \left(p_g {\bf {I}} +- \mu_g \left(\boldsymbol{\nabla} \boldsymbol{v}_g ++ \boldsymbol{\nabla} \boldsymbol{v}_g^T\right)\right) +- \varrho_g {\bf g} = 0, + * \f] + * + * Mass balance equation: + * \f[ +\frac{\partial \varrho_g}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_g {\boldsymbol{v}}_g\right) - q_g = 0 + * \f] + * + * Component mass balance equation: + * \f[ + \frac{\partial \left(\varrho_g X_g^\kappa\right)}{\partial t} + + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_g {\boldsymbol{v}}_g X_g^\kappa + - D^\kappa_g \varrho_g \boldsymbol{\nabla} X_g^\kappa \right) + - q_g^\kappa = 0 + * \f] * * This is discretized using a fully-coupled vertex * centered finite volume (box) scheme as spatial and diff --git a/dumux/freeflow/stokes2c/stokes2cnewtoncontroller.hh b/dumux/freeflow/stokes2c/stokes2cnewtoncontroller.hh deleted file mode 100644 index d172c8ca7983d1d75176e640c31b1d9399818abe..0000000000000000000000000000000000000000 --- a/dumux/freeflow/stokes2c/stokes2cnewtoncontroller.hh +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************** - * Copyright (C) 2010 by Katherina Baber, Klaus Mosthaf * - * Copyright (C) 2008-2009 by Bernd Flemisch, Andreas Lauser * - * Institute of Hydraulic Engineering * - * University of Stuttgart, Germany * - * email: <givenname>.<name>@iws.uni-stuttgart.de * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \brief A stokes2c specific controller for the newton solver. - */ -#ifndef DUMUX_STOKES2C_NEWTON_CONTROLLER_HH -#define DUMUX_STOKES2C_NEWTON_CONTROLLER_HH - -#include <dumux/nonlinear/newtoncontroller.hh> - -namespace Dumux { -/*! - * \brief A Stokes2c specific controller for the newton solver. - * - * This controller 'knows' what a 'physically meaningful' solution is - * which allows the newton method to abort quicker if the solution is - * way out of bounds. - */ -template <class TypeTag> -class Stokes2cNewtonController : public NewtonController<TypeTag> -{ - typedef NewtonController<TypeTag> ParentType; - typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem; - -public: - Stokes2cNewtonController(const Problem &problem) - : ParentType(problem) - { - Dune::FMatrixPrecision<>::set_singular_limit(1e-35); - - this->setRelTolerance(1e-4); - this->setTargetSteps(15); - this->setMaxSteps(23); - }; -}; -} - -#endif diff --git a/dumux/freeflow/stokes2c/stokes2cproblem.hh b/dumux/freeflow/stokes2c/stokes2cproblem.hh deleted file mode 100644 index a61db6683b0ec39a7533915b3f9e2ef77dfe225d..0000000000000000000000000000000000000000 --- a/dumux/freeflow/stokes2c/stokes2cproblem.hh +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************** - * Copyright (C) 2009 by Andreas Lauser * - * Institute of Hydraulic Engineering * - * University of Stuttgart, Germany * - * email: <givenname>.<name>@iws.uni-stuttgart.de * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * - * \brief Base class for all problems which use the stokes transport model. - */ -#ifndef DUMUX_STOKESTRANSPORT_PROBLEM_HH -#define DUMUX_STOKESTRANSPORT_PROBLEM_HH - -#include "dumux/freeflow/stokes2c/stokes2cnewtoncontroller.hh" - -#include <dumux/freeflow/stokes/stokesproblem.hh> - -namespace Dumux -{ -/*! - * \ingroup Stokes2cProblems - * \brief Base class for all problems which use the - * stokes transport box model. - * - * \todo Please doc me more! - */ -template<class TypeTag> -class Stokes2cProblem : public StokesProblem<TypeTag> -{ - typedef StokesProblem<TypeTag> ParentType; - - typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; - typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; - typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - -public: - Stokes2cProblem(TimeManager &timeManager, const GridView &gridView) - : ParentType(timeManager, gridView) - { - } - - /*! - * \name Problem parameters - */ - // \{ -}; - -} - -#endif diff --git a/dumux/freeflow/stokes2c/stokes2cproperties.hh b/dumux/freeflow/stokes2c/stokes2cproperties.hh index 4f01f894ae2ba17b2ef7993a356f937f8dc4dfb9..5020c94694f1cf32f0164a9129a0dae19d1f897a 100644 --- a/dumux/freeflow/stokes2c/stokes2cproperties.hh +++ b/dumux/freeflow/stokes2c/stokes2cproperties.hh @@ -18,6 +18,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ /*! + * \ingroup Properties + * \ingroup BoxProperties + * \ingroup BoxStokes2cModel + * * \file * * \brief Defines the properties required for the compositional @@ -29,15 +33,14 @@ #include "stokes2cindices.hh" #include <dumux/freeflow/stokes/stokesproperties.hh> -#include "stokes2cvolumevariables.hh" -#include "stokes2cfluxvariables.hh" - #include <dumux/material/fluidstates/compositionalfluidstate.hh> +#include "stokes2clocalresidual.hh" + namespace Dumux { /*! - * \addtogroup Stokes2cModel + * \addtogroup BoxStokes2cModel */ // \{ //////////////////////////////// @@ -55,10 +58,6 @@ class Stokes2cVolumeVariables; template <class TypeTag> class Stokes2cFluxVariables; -template <class TypeTag> -class Stokes2cNewtonController; - - //////////////////////////////// // properties //////////////////////////////// @@ -96,12 +95,6 @@ SET_TYPE_PROP(BoxStokes2c, LocalResidual, Stokes2cLocalResidual<TypeTag>); -//! Use the stokes2c specific newton controller for the compositional stokes model -SET_PROP(BoxStokes2c, NewtonController) -{public: - typedef Stokes2cNewtonController<TypeTag> type; -}; - //! the Model property SET_TYPE_PROP(BoxStokes2c, Model, Stokes2cModel<TypeTag>); diff --git a/dumux/freeflow/stokes2c/stokes2cvolumevariables.hh b/dumux/freeflow/stokes2c/stokes2cvolumevariables.hh index d3c18e0a4d34c9e9c62e65e77a9ec965f2238d13..0e6b7f03f528435b7bba2eb83a4a032f7f72add7 100644 --- a/dumux/freeflow/stokes2c/stokes2cvolumevariables.hh +++ b/dumux/freeflow/stokes2c/stokes2cvolumevariables.hh @@ -33,9 +33,10 @@ namespace Dumux { /*! - * \ingroup Stokes2cModel + * \ingroup BoxStokes2cModel + * \ingroup BoxVolumeVariables * \brief Contains the quantities which are are constant within a - * finite volume in the compositional Stokes model. + * finite volume in the two-component Stokes model. */ template <class TypeTag> class Stokes2cVolumeVariables : public StokesVolumeVariables<TypeTag> diff --git a/dumux/freeflow/stokes2cni/stokes2cnifluxvariables.hh b/dumux/freeflow/stokes2cni/stokes2cnifluxvariables.hh index 4ca1382f7bec9f453ecf47ca4a146098090556c4..12a8637c1f34b67b9f286090461687b3fc9a1a4d 100644 --- a/dumux/freeflow/stokes2cni/stokes2cnifluxvariables.hh +++ b/dumux/freeflow/stokes2cni/stokes2cnifluxvariables.hh @@ -31,12 +31,14 @@ #define DUMUX_STOKES2CNI_FLUX_VARIABLES_HH #include <dumux/common/math.hh> +#include <dumux/freeflow/stokes2c/stokes2cfluxvariables.hh> namespace Dumux { /*! - * \ingroup Stokes2cniModel + * \ingroup BoxStokes2cniModel + * \ingroup BoxFluxVariables * \brief This template class contains data which is required to * calculate the energy fluxes over a face of a finite * volume for the non-isothermal compositional stokes model. diff --git a/dumux/freeflow/stokes2cni/stokes2cniindices.hh b/dumux/freeflow/stokes2cni/stokes2cniindices.hh index 055970eba6b36d1f6d4f4e5437164db579dcf6f8..8eccab6d1d1689f43ea65721237e2d45579e4c9e 100644 --- a/dumux/freeflow/stokes2cni/stokes2cniindices.hh +++ b/dumux/freeflow/stokes2cni/stokes2cniindices.hh @@ -34,6 +34,8 @@ namespace Dumux // \{ /*! + * \ingroup BoxStokes2cniModel + * \ingroup BoxIndices * \brief Enumerations for the non-isothermal compositional stokes model */ template <class TypeTag, int PVOffset=0> diff --git a/dumux/freeflow/stokes2cni/stokes2cnilocalresidual.hh b/dumux/freeflow/stokes2cni/stokes2cnilocalresidual.hh index b7735ea2b76788f3c3d0fb5a8ae46a14aab7e17c..71e49cb00a49b048a527b6947cb4c0edb85b95ad 100644 --- a/dumux/freeflow/stokes2cni/stokes2cnilocalresidual.hh +++ b/dumux/freeflow/stokes2cni/stokes2cnilocalresidual.hh @@ -30,13 +30,14 @@ #include <dumux/freeflow/stokes2c/stokes2clocalresidual.hh> -#include <dumux/freeflow/stokes2cni/stokes2cnivolumevariables.hh> -#include <dumux/freeflow/stokes2cni/stokes2cnifluxvariables.hh> +#include "stokes2cnivolumevariables.hh" +#include "stokes2cnifluxvariables.hh" namespace Dumux { /*! - * \ingroup Stokes2cniModel + * \ingroup BoxStokes2cniModel + * \ingroup BoxLocalResidual * \brief Element-wise calculation of the Jacobian matrix for problems * using the non-isothermal compositional stokes box model. This is derived * from the stokes2c box model. diff --git a/dumux/freeflow/stokes2cni/stokes2cnimodel.hh b/dumux/freeflow/stokes2cni/stokes2cnimodel.hh index 82a476040bf36af0943ac9ffbf9f6c340487cce6..0e92df28f22c7070ce11fa9963d17675c401549d 100644 --- a/dumux/freeflow/stokes2cni/stokes2cnimodel.hh +++ b/dumux/freeflow/stokes2cni/stokes2cnimodel.hh @@ -31,38 +31,44 @@ #include "stokes2cnilocalresidual.hh" #include "stokes2cniproperties.hh" -#include "stokes2cniproblem.hh" namespace Dumux { - -/*! - * \ingroup BoxProblems - * \defgroup Stokes2cniBoxProblems Non-isothermal compositional stokes problems - */ - /*! - * \ingroup BoxModels - * \defgroup Stokes2cniModel Non-isothermal compositional box stokes model - */ - -/*! - * \ingroup Stokes2cniModel - * \brief Adaption of the BOX scheme to the non-isothermal compositional stokes model. + * \ingroup BoxStokes2cniModel + * \brief Adaption of the BOX scheme to the non-isothermal compositional Stokes model. + * + * This model implements a non-isothermal two-component Stokes flow of a fluid + * solving a momentum balance, a mass balance, a conservation equation for one component, + * and one balance quation for the energy. + * + * Momentum Balance: + * \f[ +\frac{\partial \left(\varrho_g {\boldsymbol{v}}_g\right)}{\partial t} ++ \boldsymbol{\nabla} \boldsymbol{\cdot} \left(p_g {\bf {I}} +- \mu_g \left(\boldsymbol{\nabla} \boldsymbol{v}_g ++ \boldsymbol{\nabla} \boldsymbol{v}_g^T\right)\right) +- \varrho_g {\bf g} = 0, + * \f] + * + * Mass balance equation: + * \f[ +\frac{\partial \varrho_g}{\partial t} + \boldsymbol{\nabla}\boldsymbol{\cdot}\left(\varrho_g {\boldsymbol{v}}_g\right) - q_g = 0 + * \f] + * + * Component mass balance equation: + * \f[ + \frac{\partial \left(\varrho_g X_g^\kappa\right)}{\partial t} + + \boldsymbol{\nabla} \boldsymbol{\cdot} \left( \varrho_g {\boldsymbol{v}}_g X_g^\kappa + - D^\kappa_g \varrho_g \boldsymbol{\nabla} X_g^\kappa \right) + - q_g^\kappa = 0 + * \f] * - * This model implements a non-isothermal flow of a fluid - * \f$\alpha \in \{ w, n \}\f$. - * Using the standard Stokes approach a mass balance equation is - * solved: - * \f{eqnarray*} - && \phi \frac{\partial (\sum_\alpha \varrho_\alpha X_\alpha^\kappa S_\alpha )}{\partial t} - - \sum_\alpha \text{div} \left\{ \varrho_\alpha X_\alpha^\kappa - \frac{k_{r\alpha}}{\mu_\alpha} \mbox{\bf K} - (\text{grad} p_\alpha - \varrho_{\alpha} \mbox{\bf g}) \right\}\\ - &-& \sum_\alpha \text{div} \left\{{\bf D_{\alpha, pm}^\kappa} \varrho_{\alpha} \text{grad} X^\kappa_{\alpha} \right\} - - \sum_\alpha q_\alpha^\kappa = \quad 0 \qquad \kappa \in \{w, a\} \, , - \alpha \in \{w, n\} - * \f} - \f} + * Energy balance equation: + * \f[ +\frac{\partial (\varrho_g u_g)}{\partial t} ++ \boldsymbol{\nabla} \boldsymbol{\cdot} \varrho_g h_g {\boldsymbol{v}}_g +- \lambda_g \boldsymbol{\nabla} T - q_T = 0 + * \f] * * This is discretized using a fully-coupled vertex * centered finite volume (box) scheme as spatial and diff --git a/dumux/freeflow/stokes2cni/stokes2cninewtoncontroller.hh b/dumux/freeflow/stokes2cni/stokes2cninewtoncontroller.hh deleted file mode 100644 index 31406474d80e874a1e80d72f5612575bc908d277..0000000000000000000000000000000000000000 --- a/dumux/freeflow/stokes2cni/stokes2cninewtoncontroller.hh +++ /dev/null @@ -1,62 +0,0 @@ -/***************************************************************************** - * Copyright (C) 2008 by Bernd Flemisch, Andreas Lauser * - * Copyright (C) 2010 by Klaus Mosthaf * - * Institute of Hydraulic Engineering * - * University of Stuttgart, Germany * - * email: <givenname>.<name>@iws.uni-stuttgart.de * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \brief A stokes2cni specific controller for the newton solver. - * - * This controller 'knows' what a 'physically meaningful' solution is - * which allows the newton method to abort quicker if the solution is - * way out of bounds. - */ -#ifndef DUMUX_STOKES2CNI_NEWTON_CONTROLLER_HH -#define DUMUX_STOKES2CNI_NEWTON_CONTROLLER_HH - -#include <dumux/nonlinear/newtoncontroller.hh> - -namespace Dumux { -/*! - * \ingroup Stokes2cniModel - * \brief A stokes transport specific controller for the newton solver. - * - * This controller 'knows' what a 'physically meaningful' solution is - * which allows the newton method to abort quicker if the solution is - * way out of bounds. - */ -template <class TypeTag> -class Stokes2cniNewtonController : public NewtonController<TypeTag > -{ - typedef NewtonController<TypeTag> ParentType; - typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem; - -public: - Stokes2cniNewtonController(const Problem &problem) - : ParentType(problem) - { - Dune::FMatrixPrecision<>::set_singular_limit(1e-35); - - this->setRelTolerance(1e-6); - this->setTargetSteps(9); - this->setMaxSteps(18); - }; -}; -} - -#endif diff --git a/dumux/freeflow/stokes2cni/stokes2cniproblem.hh b/dumux/freeflow/stokes2cni/stokes2cniproblem.hh deleted file mode 100644 index 5dcf9301c44c0320e10bb165068e040ae9e2b180..0000000000000000000000000000000000000000 --- a/dumux/freeflow/stokes2cni/stokes2cniproblem.hh +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * Copyright (C) 2009 by Andreas Lauser * - * Institute of Hydraulic Engineering * - * University of Stuttgart, Germany * - * email: <givenname>.<name>@iws.uni-stuttgart.de * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * - * \brief Base class for all problems which use the stokes2cni model. - */ -#ifndef DUMUX_STOKES2CNI_PROBLEM_HH -#define DUMUX_STOKES2CNI_PROBLEM_HH - -#include "dumux/freeflow/stokes2cni/stokes2cninewtoncontroller.hh" - -#include <dumux/freeflow/stokes/stokesproblem.hh> - -namespace Dumux -{ -/*! - * \ingroup Stokes2cniProblems - * \brief Base class for all problems which use the - * stokes2cni box model. - * - * \todo Please doc me more! - */ -template<class TypeTag> -class Stokes2cniProblem : public StokesProblem<TypeTag> -{ - typedef StokesProblem<TypeTag> ParentType; - - typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; - typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; - -public: - Stokes2cniProblem(TimeManager &timeManager, const GridView &gridView) - : ParentType(timeManager, gridView) - { - } - - /*! - * \name Problem parameters - */ - // \{ -}; - -} - -#endif diff --git a/dumux/freeflow/stokes2cni/stokes2cniproperties.hh b/dumux/freeflow/stokes2cni/stokes2cniproperties.hh index 24743d089d41831952c25a408a9ed3a4283250d3..585068055fbf2c8aaa22ba73a5ab3578fa45782e 100644 --- a/dumux/freeflow/stokes2cni/stokes2cniproperties.hh +++ b/dumux/freeflow/stokes2cni/stokes2cniproperties.hh @@ -18,6 +18,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * *****************************************************************************/ /*! + * \ingroup Properties + * \ingroup BoxProperties + * \ingroup BoxStokes2cniModel + * * \file * * \brief Defines the properties required for the non-isothermal compositional @@ -29,13 +33,13 @@ #include "stokes2cniindices.hh" #include <dumux/freeflow/stokes2c/stokes2cproperties.hh> -#include "stokes2cnivolumevariables.hh" -#include "stokes2cnifluxvariables.hh" + +#include "stokes2cnilocalresidual.hh" namespace Dumux { /*! - * \addtogroup Stokes2cniModel + * \addtogroup BoxStokes2cniModel */ // \{ //////////////////////////////// @@ -54,8 +58,7 @@ template <class TypeTag> class Stokes2cniFluxVariables; template <class TypeTag> -class Stokes2cniNewtonController; - +class Stokes2cniIndices; //////////////////////////////// // properties @@ -94,12 +97,6 @@ SET_TYPE_PROP(BoxStokes2cni, LocalResidual, Stokes2cniLocalResidual<TypeTag>); -//! Use the stokes2cni specific newton controller for the compositional stokes model -SET_PROP(BoxStokes2cni, NewtonController) -{public: - typedef Stokes2cniNewtonController<TypeTag> type; -}; - //! the Model property SET_TYPE_PROP(BoxStokes2cni, Model, Stokes2cniModel<TypeTag>); diff --git a/dumux/freeflow/stokes2cni/stokes2cnivolumevariables.hh b/dumux/freeflow/stokes2cni/stokes2cnivolumevariables.hh index ab91d00a82f6325dc89ab8d86f0ebbabbd734417..76fde9b714b57628a999509ae8a8fc7e256e0214 100644 --- a/dumux/freeflow/stokes2cni/stokes2cnivolumevariables.hh +++ b/dumux/freeflow/stokes2cni/stokes2cnivolumevariables.hh @@ -33,9 +33,10 @@ namespace Dumux { /*! - * \ingroup Stokes2cniModel + * \ingroup BoxStokes2cniModel + * \ingroup BoxVolumeVariables * \brief Contains the quantities which are are constant within a - * finite volume in the non-isothermal compositional stokes + * finite volume in the non-isothermal two-component Stokes * model. */ template <class TypeTag> diff --git a/test/freeflow/stokes/grids/test_stokes.dgf b/test/freeflow/stokes/grids/test_stokes.dgf index 61b77ab1f6a0caf2314aace93e1d639a66e36e3f..789d9aadc34d77153de8330a9f92b208b4f85ad6 100644 --- a/test/freeflow/stokes/grids/test_stokes.dgf +++ b/test/freeflow/stokes/grids/test_stokes.dgf @@ -1,7 +1,7 @@ DGF Interval 0 0 % first corner -1.0 1.0 %6.0 4.0 % second corner +1.0 1.0 % second corner 32 32 %30 20 % 120 30 % 24 cells in x and 16 in y direction # #GridParameter diff --git a/test/freeflow/stokes/stokestestproblem.hh b/test/freeflow/stokes/stokestestproblem.hh index 2326a5ddefc552676fd434ac19b882103b9d6f8d..7271e581f8d8c249c5928828d235afca610bbc49 100644 --- a/test/freeflow/stokes/stokestestproblem.hh +++ b/test/freeflow/stokes/stokestestproblem.hh @@ -22,7 +22,6 @@ *****************************************************************************/ /** * @file - * \ingroup StokesProblems * @brief Definition of a simple Stokes problem * @author Klaus Mosthaf, Andreas Lauser, Bernd Flemisch */ @@ -92,17 +91,18 @@ SET_BOOL_PROP(StokesTestProblem, EnableGravity, false); } /*! - * \ingroup StokesBoxProblems - * \brief Stokes flow problem with air (N2) flowing + * \ingroup BoxStokesModel + * \ingroup BoxTestProblems + * \brief Stokes flow problem with nitrogen (N2) flowing * from the left to the right. * - * The domain is sized 6m times 4m. The boundary conditions for the momentum balances + * The domain is sized 1m times 1m. The boundary conditions for the momentum balances * are all set to Dirichlet. The mass balance receives * outflow bcs, which are replaced in the localresidual by the sum * of the two momentum balances. In the middle of the right boundary, * one vertex receives Dirichlet bcs, to set the pressure level. * - * This problem uses the \ref StokesModel. + * This problem uses the \ref BoxStokesModel. * * This problem is stationary and can be simulated until \f$t_{\text{end}} = * 1\;s\f$ is reached. A good choice for the initial time step size diff --git a/test/freeflow/stokes2c/stokes2ctestproblem.hh b/test/freeflow/stokes2c/stokes2ctestproblem.hh index 56919cd5ccdc3aa97bae6b34357ed3f05d260016..242aef9c7e015db5bcc9f270ec983db45e211b13 100644 --- a/test/freeflow/stokes2c/stokes2ctestproblem.hh +++ b/test/freeflow/stokes2c/stokes2ctestproblem.hh @@ -21,7 +21,6 @@ *****************************************************************************/ /** * @file - * \ingroup Stokes2cProblems * @brief Definition of a simple Stokes problem * @author Klaus Mosthaf, Andreas Lauser, Bernd Flemisch */ @@ -93,8 +92,9 @@ SET_BOOL_PROP(Stokes2cTestProblem, NewtonWriteConvergence, false); } /*! - * \ingroup Stokes2cBoxProblems - * \brief Stokes transport problem with air (N2) flowing + * \ingroup BoxStokes2cModel + * \ingroup BoxTestProblems + * \brief Stokes transport problem with nitrogen (N2) flowing * from the left to the right. * * The domain is sized 1m times 1m. The boundary conditions for the momentum balances @@ -103,7 +103,7 @@ SET_BOOL_PROP(Stokes2cTestProblem, NewtonWriteConvergence, false); * of the two momentum balances. In the middle of the right boundary, * one vertex receives Dirichlet bcs, to set the pressure level. * - * This problem uses the \ref Stokes2cModel. + * This problem uses the \ref BoxStokes2cModel. * * This problem is non-stationary and can be simulated until \f$t_{\text{end}} = * 1e5\;s\f$ is reached. A good choice for the initial time step size @@ -112,10 +112,10 @@ SET_BOOL_PROP(Stokes2cTestProblem, NewtonWriteConvergence, false); * <tt>./test_stokes2c grid/stokes.dgf 1e5 10</tt> */ template <class TypeTag> -class Stokes2cTestProblem : public Stokes2cProblem<TypeTag> +class Stokes2cTestProblem : public StokesProblem<TypeTag> { typedef Stokes2cTestProblem<TypeTag> ThisType; - typedef Stokes2cProblem<TypeTag> ParentType; + typedef StokesProblem<TypeTag> ParentType; typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager; diff --git a/test/freeflow/stokes2cni/stokes2cnitestproblem.hh b/test/freeflow/stokes2cni/stokes2cnitestproblem.hh index 6bec8ab6010c32879e5f77e0f8862ae8b58772a8..b237a5d4ef70044ca5fcfa4ba1eaf5e4d7bb7c41 100644 --- a/test/freeflow/stokes2cni/stokes2cnitestproblem.hh +++ b/test/freeflow/stokes2cni/stokes2cnitestproblem.hh @@ -21,7 +21,6 @@ *****************************************************************************/ /** * @file - * \ingroup Stokes2cniProblems * @brief Definition of a simple Stokes problem * @author Klaus Mosthaf, Andreas Lauser, Bernd Flemisch */ @@ -78,7 +77,8 @@ SET_BOOL_PROP(Stokes2cniTestProblem, EnableGravity, true); } /*! - * \ingroup Stokes2cniBoxProblems + * \ingroup BoxStokes2cniModel + * \ingroup BoxTestProblems * \brief Stokes2cni problem with air (N2) flowing * from the left to the right. * @@ -88,7 +88,7 @@ SET_BOOL_PROP(Stokes2cniTestProblem, EnableGravity, true); * of the two momentum balances. In the middle of the right boundary, * one vertex obtains Dirichlet bcs to fix the pressure at one point. * - * This problem uses the \ref Stokes2cniModel. + * This problem uses the \ref BoxStokes2cniModel. * * This problem is non-stationary and can be simulated until \f$t_{\text{end}} = * 100\;s\f$ is reached. A good choice for the initial time step size @@ -97,10 +97,10 @@ SET_BOOL_PROP(Stokes2cniTestProblem, EnableGravity, true); * <tt>./test_stokes2cni grids/test_stokes2cni.dgf 100 1</tt> */ template <class TypeTag> -class Stokes2cniTestProblem : public Stokes2cniProblem<TypeTag> +class Stokes2cniTestProblem : public StokesProblem<TypeTag> { typedef Stokes2cniTestProblem<TypeTag> ThisType; - typedef Stokes2cniProblem<TypeTag> ParentType; + typedef StokesProblem<TypeTag> ParentType; typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; typedef typename GET_PROP_TYPE(TypeTag, TimeManager) TimeManager;