From ce1ec0433e4ade49d299b3cc78d52cdce782b92c Mon Sep 17 00:00:00 2001 From: Klaus Mosthaf <klmos@env.dtu.dk> Date: Mon, 23 Jan 2012 15:04:07 +0000 Subject: [PATCH] mainly worked on documentation of stokes models removed stokes2c(ni)newtoncontroller and stokes2c(ni)problem, they are not neccessary git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7495 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- dumux/freeflow/stokes/stokesfluxvariables.hh | 12 ++-- dumux/freeflow/stokes/stokesindices.hh | 2 + dumux/freeflow/stokes/stokeslocaljacobian.hh | 16 +---- dumux/freeflow/stokes/stokeslocalresidual.hh | 3 +- dumux/freeflow/stokes/stokesmodel.hh | 35 +++++----- .../freeflow/stokes/stokesnewtoncontroller.hh | 10 +-- dumux/freeflow/stokes/stokesproblem.hh | 4 +- dumux/freeflow/stokes/stokesproperties.hh | 22 ++----- .../freeflow/stokes/stokesvolumevariables.hh | 8 +-- .../stokes2c/stokes2cfluxvariables.hh | 6 +- dumux/freeflow/stokes2c/stokes2cindices.hh | 2 + .../stokes2c/stokes2clocalresidual.hh | 4 +- dumux/freeflow/stokes2c/stokes2cmodel.hh | 53 ++++++++------- .../stokes2c/stokes2cnewtoncontroller.hh | 57 ----------------- dumux/freeflow/stokes2c/stokes2cproblem.hh | 64 ------------------- dumux/freeflow/stokes2c/stokes2cproperties.hh | 21 ++---- .../stokes2c/stokes2cvolumevariables.hh | 5 +- .../stokes2cni/stokes2cnifluxvariables.hh | 4 +- .../freeflow/stokes2cni/stokes2cniindices.hh | 2 + .../stokes2cni/stokes2cnilocalresidual.hh | 7 +- dumux/freeflow/stokes2cni/stokes2cnimodel.hh | 62 ++++++++++-------- .../stokes2cni/stokes2cninewtoncontroller.hh | 62 ------------------ .../freeflow/stokes2cni/stokes2cniproblem.hh | 63 ------------------ .../stokes2cni/stokes2cniproperties.hh | 19 +++--- .../stokes2cni/stokes2cnivolumevariables.hh | 5 +- test/freeflow/stokes/grids/test_stokes.dgf | 2 +- test/freeflow/stokes/stokestestproblem.hh | 10 +-- test/freeflow/stokes2c/stokes2ctestproblem.hh | 12 ++-- .../stokes2cni/stokes2cnitestproblem.hh | 10 +-- 29 files changed, 163 insertions(+), 419 deletions(-) delete mode 100644 dumux/freeflow/stokes2c/stokes2cnewtoncontroller.hh delete mode 100644 dumux/freeflow/stokes2c/stokes2cproblem.hh delete mode 100644 dumux/freeflow/stokes2cni/stokes2cninewtoncontroller.hh delete mode 100644 dumux/freeflow/stokes2cni/stokes2cniproblem.hh diff --git a/dumux/freeflow/stokes/stokesfluxvariables.hh b/dumux/freeflow/stokes/stokesfluxvariables.hh index d9ec717ab4..6ad0bf1504 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 f50133a1fd..33ef174290 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 39bb433c3e..b37f62218a 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 ebde849967..268457f05e 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 1d2de2eb2f..723bbc7cb0 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 f3bbec3376..fde679b2bc 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 3335a5968b..a8efab9652 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 4f731c56b6..a1a2de4a2f 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 7ab71e6259..65f33cd753 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 4dda5ed971..de7b047bf3 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 7a955a2dc6..af70d4ccdf 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 080558ca2c..089b6e267f 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 5f59270118..023ea8e6f7 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 d172c8ca79..0000000000 --- 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 a61db6683b..0000000000 --- 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 4f01f894ae..5020c94694 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 d3c18e0a4d..0e6b7f03f5 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 4ca1382f7b..12a8637c1f 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 055970eba6..8eccab6d1d 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 b7735ea2b7..71e49cb00a 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 82a476040b..0e92df28f2 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 31406474d8..0000000000 --- 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 5dcf9301c4..0000000000 --- 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 24743d089d..585068055f 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 ab91d00a82..76fde9b714 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 61b77ab1f6..789d9aadc3 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 2326a5ddef..7271e581f8 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 56919cd5cc..242aef9c7e 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 6bec8ab601..b237a5d4ef 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; -- GitLab