My Project
Loading...
Searching...
No Matches
directionalmobility.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 2022 Equinor ASA.
5
6 This file is part of the Open Porous Media project (OPM).
7
8 OPM is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 OPM is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with OPM. If not, see <http://www.gnu.org/licenses/>.
20*/
26#ifndef OPM_MODELS_DIRECTIONAL_MOBILITY_HH
27#define OPM_MODELS_DIRECTIONAL_MOBILITY_HH
28
31#include <opm/material/densead/Evaluation.hpp>
32
33#include <array>
34#include <stdexcept>
35
36namespace Opm {
37template <class TypeTag, class Evaluation>
40 // TODO: This (line below) did not work. I get error: ‘Evaluation’ is not a member of ‘Opm::Properties’
41 // when compiling the tracer model (eclgenerictracermodel.cc).
42 // QuickFix: I am adding Evaluation as a class template parameter..
43 //using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
44
45 using array_type = std::array<Evaluation,numPhases>;
47 : mobilityX_{other.mobilityX_}, mobilityY_{other.mobilityY_}, mobilityZ_{other.mobilityZ_} {}
48 DirectionalMobility(const array_type& mX, const array_type& mY, const array_type& mZ)
49 : mobilityX_{mX}, mobilityY_{mY}, mobilityZ_{mZ} {}
50 DirectionalMobility() : mobilityX_{}, mobilityY_{}, mobilityZ_{} {}
51 array_type& getArray(int index) {
52 switch(index) {
53 case 0:
54 return mobilityX_;
55 case 1:
56 return mobilityY_;
57 case 2:
58 return mobilityZ_;
59 default:
60 throw std::runtime_error("Unexpected mobility array index");
61 }
62 }
63 array_type mobilityX_;
64 array_type mobilityY_;
65 array_type mobilityZ_;
66};
67} // namespace Opm
68#endif
Defines the common properties required by the porous medium multi-phase models.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
The Opm property system, traits with inheritance.
Definition directionalmobility.hh:38