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
37#include <dune/common/fvector.hh>
38#include <dune/common/fmatrix.hh>
39
40namespace Opm {
41
47template<class TypeTag>
49 : public MultiPhaseBaseProblem<TypeTag>
50{
52
53 using Implementation = GetPropType<TypeTag, Properties::Problem>;
57
58 enum { dimWorld = GridView::dimensionworld };
59 using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
60
61public:
67 {}
68
78 template <class Context>
79 void fractureFaceIntrinsicPermeability(DimMatrix& result,
80 const Context& context,
81 unsigned localFaceIdx,
82 unsigned timeIdx) const
83 {
84 const auto& scvf = context.stencil(timeIdx).interiorFace(localFaceIdx);
85 unsigned interiorElemIdx = scvf.interiorIndex();
86 unsigned exteriorElemIdx = scvf.exteriorIndex();
87 const DimMatrix& K1 = asImp_().fractureIntrinsicPermeability(context, interiorElemIdx, timeIdx);
88 const DimMatrix& K2 = asImp_().fractureIntrinsicPermeability(context, exteriorElemIdx, timeIdx);
89
90 // entry-wise harmonic mean. this is almost certainly wrong if
91 // you have off-main diagonal entries in your permeabilities!
92 for (unsigned i = 0; i < dimWorld; ++i)
93 for (unsigned j = 0; j < dimWorld; ++j)
94 result[i][j] = Opm::harmonicMean(K1[i][j], K2[i][j]);
95 }
104 template <class Context>
105 const DimMatrix& fractureIntrinsicPermeability(const Context&,
106 unsigned,
107 unsigned) const
108 {
109 throw std::logic_error("Not implemented: Problem::fractureIntrinsicPermeability()");
110 }
111
120 template <class Context>
121 Scalar fracturePorosity(const Context&,
122 unsigned,
123 unsigned) const
124 {
125 throw std::logic_error("Not implemented: Problem::fracturePorosity()");
126 }
127
128private:
130 Implementation& asImp_()
131 { return *static_cast<Implementation *>(this); }
133 const Implementation& asImp_() const
134 { return *static_cast<const Implementation *>(this); }
135};
136
137} // namespace Opm
138
139#endif
The base class for the problems of ECFV discretizations which deal with a multi-phase flow through a ...
Definition: discretefractureproblem.hh:50
const DimMatrix & fractureIntrinsicPermeability(const Context &, unsigned, unsigned) const
Returns the intrinsic permeability tensor at a given position due to a fracture.
Definition: discretefractureproblem.hh:105
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:79
DiscreteFractureProblem(Simulator &simulator)
Definition: discretefractureproblem.hh:65
Scalar fracturePorosity(const Context &, unsigned, unsigned) const
Returns the porosity [] inside fractures for a given control volume.
Definition: discretefractureproblem.hh:121
Simulator & simulator()
Returns Simulator object used by the simulation.
Definition: fvbaseproblem.hh:686
The base class for the problems of ECFV discretizations which deal with a multi-phase flow through a ...
Definition: multiphasebaseproblem.hh:60
Defines the properties required for the immiscible multi-phase model which considers discrete fractur...
Definition: blackoilboundaryratevector.hh:37
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:235