All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
discretefractureproblem.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  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 2 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 
19  Consult the COPYING file in the top-level source directory of this
20  module for the precise wording of the license and the list of
21  copyright holders.
22 */
28 #ifndef EWOMS_DISCRETE_FRACTURE_PROBLEM_HH
29 #define EWOMS_DISCRETE_FRACTURE_PROBLEM_HH
30 
32 
34 
35 #include <opm/material/common/Means.hpp>
36 #include <opm/common/Unused.hpp>
37 #include <opm/common/ErrorMacros.hpp>
38 #include <opm/common/Exceptions.hpp>
39 
40 #include <dune/common/fvector.hh>
41 #include <dune/common/fmatrix.hh>
42 
43 namespace Ewoms {
44 namespace Properties {
45 NEW_PROP_TAG(HeatConductionLawParams);
46 NEW_PROP_TAG(EnableGravity);
47 NEW_PROP_TAG(FluxModule);
48 }
49 
55 template<class TypeTag>
57  : public MultiPhaseBaseProblem<TypeTag>
58 {
60 
61  typedef typename GET_PROP_TYPE(TypeTag, Problem) Implementation;
62  typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
63  typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
64  typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
65 
66  enum { dimWorld = GridView::dimensionworld };
67  typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
68 
69 public:
74  : ParentType(simulator)
75  {}
76 
86  template <class Context>
87  void fractureFaceIntrinsicPermeability(DimMatrix& result,
88  const Context& context,
89  unsigned localFaceIdx,
90  unsigned timeIdx) const
91  {
92  const auto& scvf = context.stencil(timeIdx).interiorFace(localFaceIdx);
93  unsigned interiorElemIdx = scvf.interiorIndex();
94  unsigned exteriorElemIdx = scvf.exteriorIndex();
95  const DimMatrix& K1 = asImp_().fractureIntrinsicPermeability(context, interiorElemIdx, timeIdx);
96  const DimMatrix& K2 = asImp_().fractureIntrinsicPermeability(context, exteriorElemIdx, timeIdx);
97 
98  // entry-wise harmonic mean. this is almost certainly wrong if
99  // you have off-main diagonal entries in your permeabilities!
100  for (unsigned i = 0; i < dimWorld; ++i)
101  for (unsigned j = 0; j < dimWorld; ++j)
102  result[i][j] = Opm::harmonicMean(K1[i][j], K2[i][j]);
103  }
112  template <class Context>
113  const DimMatrix& fractureIntrinsicPermeability(const Context& context OPM_UNUSED,
114  unsigned spaceIdx OPM_UNUSED,
115  unsigned timeIdx OPM_UNUSED) const
116  {
117  OPM_THROW(std::logic_error,
118  "Not implemented: Problem::fractureIntrinsicPermeability()");
119  }
120 
129  template <class Context>
130  Scalar fracturePorosity(const Context& context OPM_UNUSED,
131  unsigned spaceIdx OPM_UNUSED,
132  unsigned timeIdx OPM_UNUSED) const
133  {
134  OPM_THROW(std::logic_error,
135  "Not implemented: Problem::fracturePorosity()");
136  }
137 
138 private:
140  Implementation& asImp_()
141  { return *static_cast<Implementation *>(this); }
143  const Implementation& asImp_() const
144  { return *static_cast<const Implementation *>(this); }
145 };
146 
147 } // namespace Ewoms
148 
149 #endif
Defines the properties required for the immiscible multi-phase model which considers discrete fractur...
Scalar fracturePorosity(const Context &context OPM_UNUSED, unsigned spaceIdx OPM_UNUSED, unsigned timeIdx OPM_UNUSED) const
Returns the porosity [] inside fractures for a given control volume.
Definition: discretefractureproblem.hh:130
const DimMatrix & fractureIntrinsicPermeability(const Context &context OPM_UNUSED, unsigned spaceIdx OPM_UNUSED, unsigned timeIdx OPM_UNUSED) const
Returns the intrinsic permeability tensor at a given position due to a fracture. ...
Definition: discretefractureproblem.hh:113
void fractureFaceIntrinsicPermeability(DimMatrix &result, const Context &context, unsigned localFaceIdx, unsigned timeIdx) const
Returns the intrinsic permeability of a face due to a fracture.
Definition: discretefractureproblem.hh:87
The base class for the problems of ECFV discretizations which deal with a multi-phase flow through a ...
Definition: discretefractureproblem.hh:56
Simulator & simulator()
Returns Simulator object used by the simulation.
Definition: fvbaseproblem.hh:526
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:75
#define NEW_PROP_TAG(PTagName)
Define a property tag.
Definition: propertysystem.hh:247
The base class for the problems of ECFV discretizations which deal with a multi-phase flow through a ...
Definition: multiphasebaseproblem.hh:59
DiscreteFractureProblem(Simulator &simulator)
Definition: discretefractureproblem.hh:73
The base class for the problems of ECFV discretizations which deal with a multi-phase flow through a ...