My Project
ImplicitCapillarity.hpp
1 //===========================================================================
2 //
3 // File: ImplicitCapillarity.hpp
4 //
5 // Created: Thu May 6 15:29:51 2010
6 //
7 // Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
8 // Jostein R Natvig <jostein.r.natvig@sintef.no>
9 //
10 // $Date$
11 //
12 // $Revision$
13 //
14 //===========================================================================
15 
16 /*
17  Copyright 2010 SINTEF ICT, Applied Mathematics.
18  Copyright 2010 Statoil ASA.
19 
20  This file is part of The Open Reservoir Simulator Project (OpenRS).
21 
22  OpenRS is free software: you can redistribute it and/or modify
23  it under the terms of the GNU General Public License as published by
24  the Free Software Foundation, either version 3 of the License, or
25  (at your option) any later version.
26 
27  OpenRS is distributed in the hope that it will be useful,
28  but WITHOUT ANY WARRANTY; without even the implied warranty of
29  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  GNU General Public License for more details.
31 
32  You should have received a copy of the GNU General Public License
33  along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
34 */
35 
36 #ifndef OPENRS_IMPLICITCAPILLARITY_HEADER
37 #define OPENRS_IMPLICITCAPILLARITY_HEADER
38 
39 
40 #include <opm/porsol/euler/EulerUpstreamResidual.hpp>
41 #include <opm/common/utility/parameters/ParameterGroup.hpp>
42 #include <opm/common/utility/numeric/SparseVector.hpp>
43 #include <opm/porsol/mimetic/IncompFlowSolverHybrid.hpp>
44 #include <opm/porsol/mimetic/MimeticIPEvaluator.hpp>
45 
46 namespace Opm {
47 
50  template <class GridInterface, class ReservoirProperties, class BoundaryConditions,
51  template <class, class> class InnerProd = MimeticIPEvaluator>
53  {
54  public:
55  typedef IncompFlowSolverHybrid<GridInterface,
56  ReservoirProperties,
57  BoundaryConditions,
58  InnerProd> PressureSolver;
59 
66  ImplicitCapillarity(const GridInterface& grid,
67  const ReservoirProperties& resprop,
68  const BoundaryConditions& boundary);
72  void init(const Opm::ParameterGroup& param);
76  void init(const Opm::ParameterGroup& param,
77  const GridInterface& grid,
78  const ReservoirProperties& resprop,
79  const BoundaryConditions& boundary);
83  void initObj(const GridInterface& grid,
84  const ReservoirProperties& resprop,
85  const BoundaryConditions& boundary);
86 
87 
94  template <class PressureSolution>
95  void transportSolve(std::vector<double>& saturation,
96  const double time,
97  const typename GridInterface::Vector& gravity,
98  const PressureSolution& pressure_sol,
99  const Opm::SparseVector<double>& injection_rates) const;
100 
101  protected:
102  typedef typename GridInterface::CellIterator CIt;
103  typedef typename CIt::FaceIterator FIt;
104  typedef typename FIt::Vector Vector;
105 
106  mutable PressureSolver psolver_;
107 
108  void checkAndPossiblyClampSat(std::vector<double>& s) const;
109 
110  EulerUpstreamResidual<GridInterface,
111  ReservoirProperties,
112  BoundaryConditions> residual_;
113 
114  bool method_viscous_;
115  bool method_gravity_;
116  bool check_sat_;
117  bool clamp_sat_;
118  double residual_tolerance_;
119  int linsolver_verbosity_;
120  int linsolver_type_;
121  double update_relaxation_;
122 
123  };
124 
125 } // namespace Opm
126 
127 
128 #include "ImplicitCapillarity_impl.hpp"
129 
130 
131 
132 #endif // OPENRS_IMPLICITCAPILLARITY_HEADER
Class for doing simple transport by explicit Euler upstream method for general grid.
Definition: EulerUpstreamResidual.hpp:58
Class for doing simple transport by explicit Euler upstream method for general grid.
Definition: ImplicitCapillarity.hpp:53
void initObj(const GridInterface &grid, const ReservoirProperties &resprop, const BoundaryConditions &boundary)
Definition: ImplicitCapillarity_impl.hpp:111
ImplicitCapillarity()
Definition: ImplicitCapillarity_impl.hpp:58
void init(const Opm::ParameterGroup &param, const GridInterface &grid, const ReservoirProperties &resprop, const BoundaryConditions &boundary)
void init(const Opm::ParameterGroup &param)
Definition: ImplicitCapillarity_impl.hpp:89
ImplicitCapillarity(const GridInterface &grid, const ReservoirProperties &resprop, const BoundaryConditions &boundary)
void transportSolve(std::vector< double > &saturation, const double time, const typename GridInterface::Vector &gravity, const PressureSolution &pressure_sol, const Opm::SparseVector< double > &injection_rates) const
Solve transport equation, evolving.
Solve mixed formulation of incompressible flow modelled by Darcy's law.
Definition: IncompFlowSolverHybrid.hpp:365
Inverting small matrices.
Definition: ImplicitAssembly.hpp:43