opm-simulators
Toggle main menu visibility
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
29
#include <
opm/models/common/multiphasebaseproperties.hh
>
30
#include <
opm/models/discretization/common/fvbaseproperties.hh
>
31
#include <
opm/models/utils/propertysystem.hh
>
32
33
#include <array>
34
#include <stdexcept>
35
#include <string>
36
#include <utility>
37
38
namespace
Opm
{
39
40
template
<
class
TypeTag>
41
class
DirectionalMobility
42
{
43
enum
{ numPhases =
getPropValue<TypeTag, Properties::NumPhases>
() };
44
using
Evaluation =
GetPropType<TypeTag, Properties::Evaluation>
;
45
46
public
:
47
using
array_type = std::array<Evaluation,numPhases>;
48
49
DirectionalMobility() =
default
;
50
51
DirectionalMobility(
const
array_type& mX,
52
const
array_type& mY,
53
const
array_type& mZ)
54
: mobility_{mX, mY, mZ}
55
{}
56
57
const
array_type& getArray(
unsigned
index)
const
58
{
59
if
(index > 2) {
60
throw
std::runtime_error(
"Unexpected mobility array index "
+ std::to_string(index));
61
}
62
63
return
mobility_[index];
64
}
65
66
array_type& getArray(
unsigned
index)
67
{
68
return
const_cast<
array_type&
>
(std::as_const(*this).getArray(index));
69
}
70
71
private
:
72
std::array<array_type,3> mobility_{};
73
};
74
75
}
// namespace Opm
76
77
#endif
fvbaseproperties.hh
Declare the properties used by the infrastructure code of the finite volume discretizations.
multiphasebaseproperties.hh
Defines the common properties required by the porous medium multi-phase models.
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition
blackoilbioeffectsmodules.hh:43
Opm::GetPropType
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:233
Opm::getPropValue
constexpr auto getPropValue()
get the value data member of a property
Definition
propertysystem.hh:240
propertysystem.hh
The Opm property system, traits with inheritance.
opm
models
common
directionalmobility.hh
Generated by
1.17.0