stokesproblem.hh
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  Copyright (C) 2009-2013 by Andreas Lauser
5  Copyright (C) 2010-2011 by Markus Wolff
6 
7  This file is part of the Open Porous Media project (OPM).
8 
9  OPM is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 2 of the License, or
12  (at your option) any later version.
13 
14  OPM is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OPM. If not, see <http://www.gnu.org/licenses/>.
21 */
27 #ifndef EWOMS_STOKES_PROBLEM_HH
28 #define EWOMS_STOKES_PROBLEM_HH
29 
30 #include "stokesproperties.hh"
32 
33 #include <dune/common/fvector.hh>
34 
35 namespace Ewoms {
36 
45 template <class TypeTag>
46 class StokesProblem : public Ewoms::FvBaseProblem<TypeTag>
47 {
49  typedef typename GET_PROP_TYPE(TypeTag, Problem) Implementation;
50  typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
51  typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
52  typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
53  typedef typename GET_PROP_TYPE(TypeTag, HeatConductionLawParams)
54  HeatConductionLawParams;
55 
56  enum { dim = GridView::dimension };
57  enum { dimWorld = GridView::dimensionworld };
58 
59  typedef Dune::FieldVector<Scalar, dimWorld> DimVector;
60 
61 public:
66  : ParentType(simulator)
67  , gravity_(0)
68  {
69  if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity))
70  gravity_[dim - 1] = -9.81;
71  }
72 
76  static void registerParameters()
77  {
79 
80  EWOMS_REGISTER_PARAM(TypeTag, bool, EnableGravity,
81  "Use the gravity correction for the pressure "
82  "gradients.");
83  }
84 
88  // \{
89 
96  template <class Context>
97  Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
98  { return asImp_().temperature(); }
99 
105  Scalar temperature() const
106  {
107  OPM_THROW(std::logic_error, "Not implemented:Problem does not provide "
108  "a temperature() method");
109  }
110 
116  template <class Context>
117  Scalar heatCapacitySolid(const Context &context, int spaceIdx,
118  int timeIdx) const
119  { return 0; }
120 
127  template <class Context>
128  const HeatConductionLawParams &
129  heatConductionParams(const Context &context, int spaceIdx, int timeIdx) const
130  {
131  static const HeatConductionLawParams dummy;
132  return dummy;
133  }
134 
144  template <class Context>
145  const DimVector &gravity(const Context &context, int spaceIdx,
146  int timeIdx) const
147  { return asImp_().gravity(); }
148 
157  const DimVector &gravity() const
158  { return gravity_; }
159 
160  // \}
161 
162 private:
164  Implementation &asImp_()
165  { return *static_cast<Implementation *>(this); }
166 
168  const Implementation &asImp_() const
169  { return *static_cast<const Implementation *>(this); }
170 
171  DimVector gravity_;
172 };
173 
174 } // namespace Ewoms
175 
176 #endif
static void registerParameters()
Register all run-time parameters for the problem.
Definition: stokesproblem.hh:76
Declares the properties required by the Stokes model.
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Returns the temperature at a spatial and temporal position within the domain.
Definition: stokesproblem.hh:97
Base class for all problems which use a finite volume spatial discretization.
Simulator & simulator()
Returns Simulator object used by the simulation.
Definition: fvbaseproblem.hh:504
Base class for all problems which use a finite volume spatial discretization.
Definition: fvbaseproblem.hh:52
Scalar temperature() const
Returns the temperature within the domain.
Definition: stokesproblem.hh:105
const DimVector & gravity(const Context &context, int spaceIdx, int timeIdx) const
Returns the acceleration due to gravity.
Definition: stokesproblem.hh:145
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:73
Definition: baseauxiliarymodule.hh:35
const DimVector & gravity() const
Returns the acceleration due to gravity.
Definition: stokesproblem.hh:157
#define EWOMS_REGISTER_PARAM(TypeTag, ParamType, ParamName, Description)
Register a run-time parameter.
Definition: parametersystem.hh:64
Base class for all problems which use the Stokes model.
Definition: stokesproblem.hh:46
StokesProblem(Simulator &simulator)
Definition: stokesproblem.hh:65
const HeatConductionLawParams & heatConductionParams(const Context &context, int spaceIdx, int timeIdx) const
Returns the parameter object for the heat conductivity law in a sub-control volume.
Definition: stokesproblem.hh:129
Scalar heatCapacitySolid(const Context &context, int spaceIdx, int timeIdx) const
Returns the heat capacity [J/(K m^3)] of the solid phase disconsidering pores.
Definition: stokesproblem.hh:117
static void registerParameters()
Registers all available parameters for the problem and the model.
Definition: fvbaseproblem.hh:131
#define EWOMS_GET_PARAM(TypeTag, ParamType, ParamName)
Retrieve a runtime parameter.
Definition: parametersystem.hh:95