UpscalerBase.hpp
Go to the documentation of this file.
1//===========================================================================
2//
3// File: UpscalerBase.hpp
4//
5// Created: Thu Apr 29 10:20:22 2010
6//
7// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
8//
9// $Date$
10//
11// $Revision$
12//
13//===========================================================================
14
15/*
16 Copyright 2010 SINTEF ICT, Applied Mathematics.
17 Copyright 2010 Statoil ASA.
18
19 This file is part of The Open Reservoir Simulator Project (OpenRS).
20
21 OpenRS is free software: you can redistribute it and/or modify
22 it under the terms of the GNU General Public License as published by
23 the Free Software Foundation, either version 3 of the License, or
24 (at your option) any later version.
25
26 OpenRS is distributed in the hope that it will be useful,
27 but WITHOUT ANY WARRANTY; without even the implied warranty of
28 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 GNU General Public License for more details.
30
31 You should have received a copy of the GNU General Public License
32 along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
33*/
34
35#ifndef OPM_UPSCALERBASE_HEADER
36#define OPM_UPSCALERBASE_HEADER
37
38#include <opm/input/eclipse/Deck/Deck.hpp>
39
40#include <opm/common/utility/parameters/ParameterGroup.hpp>
41
42#include <opm/grid/CpGrid.hpp>
43
46
47
48namespace Opm
49{
54 template <class Traits>
56 {
57 protected:
58 public:
59 // ------- Typedefs -------
60 typedef Dune::CpGrid GridType;
61 enum { Dimension = GridType::dimension };
63 typedef typename Traits::template ResProp<Dimension>::Type ResProp;
64
66 typedef typename ResProp::MutablePermTensor permtensor_t;
67
69
70 // ------- Methods -------
71
74
75 virtual ~UpscalerBase() {;} ;
76
78 void init(const Opm::ParameterGroup& param);
79
81 void init(const Opm::Deck& deck,
83 double perm_threshold,
84 double residual_tolerance = 1e-8,
85 int linsolver_verbosity = 0,
86 int linsolver_type = 3,
87 bool twodim_hack = false,
88 int linsolver_maxit = 0,
89 double linsolver_prolongate_factor = 1.0,
90 int linsolver_smooth_steps = 1,
91 const double gravity = 0.0);
92
94 const GridType& grid() const;
95
100
103 void setPermeability(const int cell_index, const permtensor_t& k);
104
108
111 double upscalePorosity() const;
112
115 double upscaleNetPorosity() const;
116
119 double upscaleNTG() const;
120
123 double upscaleSWCR(const bool NTG) const;
124
127 double upscaleSOWCR(const bool NTG) const;
128
129 protected:
130 // ------- Typedefs and enums -------
134 typedef typename Traits::template FlowSolver<GridInterface, BCs>::Type FlowSolver;
135
136 // ------- Methods -------
137 template <class FlowSol>
138 double computeAverageVelocity(const FlowSol& flow_solution,
139 const int flow_dir,
140 const int pdrop_dir) const;
141
142 double computeDelta(const int flow_dir) const;
143
144 template <class FluidInterface>
145 permtensor_t upscaleEffectivePerm(const FluidInterface& fluid);
146
147 virtual void initImpl(const Opm::ParameterGroup& param);
148
149 virtual void initFinal(const Opm::ParameterGroup& param);
150
151 // ------- Data members -------
160 double gravity_;
161
167 };
168
169} // namespace Opm
170
171#include "UpscalerBase_impl.hpp"
172
173
174
175
176#endif // OPM_UPSCALERBASE_HEADER
Definition: GridInterfaceEuler.hpp:368
Intersection (face) iterator for solver-near grid interface.
Definition: GridInterfaceEuler.hpp:241
A base class for upscaling.
Definition: UpscalerBase.hpp:56
@ Dimension
Definition: UpscalerBase.hpp:61
double computeDelta(const int flow_dir) const
Definition: UpscalerBase_impl.hpp:342
virtual ~UpscalerBase()
Definition: UpscalerBase.hpp:75
permtensor_t upscaleSinglePhase()
Definition: UpscalerBase_impl.hpp:219
Traits::template FlowSolver< GridInterface, BCs >::Type FlowSolver
Definition: UpscalerBase.hpp:134
GridInterfaceEuler< GridType > GridInterface
Definition: UpscalerBase.hpp:62
bool twodim_hack_
Definition: UpscalerBase.hpp:153
GridInterface::CellIterator CellIter
Definition: UpscalerBase.hpp:131
void setPermeability(const int cell_index, const permtensor_t &k)
Definition: UpscalerBase_impl.hpp:209
int linsolver_maxit_
Definition: UpscalerBase.hpp:155
double computeAverageVelocity(const FlowSol &flow_solution, const int flow_dir, const int pdrop_dir) const
Definition: UpscalerBase_impl.hpp:290
BasicBoundaryConditions< true, true > BCs
Definition: UpscalerBase.hpp:133
double upscalePorosity() const
Definition: UpscalerBase_impl.hpp:374
double gravity_
Definition: UpscalerBase.hpp:160
ResProp::MutablePermTensor permtensor_t
A type for the upscaled permeability.
Definition: UpscalerBase.hpp:66
ResProp res_prop_
Definition: UpscalerBase.hpp:164
const GridType & grid() const
Access the grid.
Definition: UpscalerBase_impl.hpp:178
int linsolver_verbosity_
Definition: UpscalerBase.hpp:157
double upscaleNTG() const
Definition: UpscalerBase_impl.hpp:400
Traits::template ResProp< Dimension >::Type ResProp
Definition: UpscalerBase.hpp:63
double residual_tolerance_
Definition: UpscalerBase.hpp:154
GridType grid_
Definition: UpscalerBase.hpp:162
GridInterface ginterf_
Definition: UpscalerBase.hpp:163
virtual void initFinal(const Opm::ParameterGroup &param)
Definition: UpscalerBase_impl.hpp:124
BoundaryConditionType
Definition: UpscalerBase.hpp:68
@ Periodic
Definition: UpscalerBase.hpp:68
@ Fixed
Definition: UpscalerBase.hpp:68
@ Linear
Definition: UpscalerBase.hpp:68
permtensor_t upscaleEffectivePerm(const FluidInterface &fluid)
Definition: UpscalerBase_impl.hpp:231
Dune::CpGrid GridType
Definition: UpscalerBase.hpp:60
CellIter::FaceIterator FaceIter
Definition: UpscalerBase.hpp:132
BCs bcond_
Definition: UpscalerBase.hpp:165
double upscaleSOWCR(const bool NTG) const
Definition: UpscalerBase_impl.hpp:432
virtual void initImpl(const Opm::ParameterGroup &param)
Definition: UpscalerBase_impl.hpp:75
void init(const Opm::ParameterGroup &param)
Initializes the upscaler from parameters.
Definition: UpscalerBase_impl.hpp:65
int linsolver_type_
Definition: UpscalerBase.hpp:158
void setBoundaryConditionType(BoundaryConditionType type)
Definition: UpscalerBase_impl.hpp:188
double upscaleNetPorosity() const
Definition: UpscalerBase_impl.hpp:387
int linsolver_smooth_steps_
Definition: UpscalerBase.hpp:159
double linsolver_prolongate_factor_
Definition: UpscalerBase.hpp:156
double upscaleSWCR(const bool NTG) const
Definition: UpscalerBase_impl.hpp:412
FlowSolver flow_solver_
Definition: UpscalerBase.hpp:166
UpscalerBase()
Default constructor.
Definition: UpscalerBase_impl.hpp:48
BoundaryConditionType bctype_
Definition: UpscalerBase.hpp:152
auto deck
Definition: elasticity_upscale_impl.hpp:590
Definition: ImplicitAssembly.hpp:43