opm-simulators
Toggle main menu visibility
Loading...
Searching...
No Matches
discretefractureprimaryvariables.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_PRIMARY_VARIABLES_HH
29
#define EWOMS_DISCRETE_FRACTURE_PRIMARY_VARIABLES_HH
30
31
#include <
opm/models/discretefracture/discretefractureproperties.hh
>
32
33
#include <
opm/models/immiscible/immiscibleprimaryvariables.hh
>
34
35
#include <array>
36
37
namespace
Opm
{
38
45
template
<
class
TypeTag>
46
class
DiscreteFracturePrimaryVariables
47
:
public
ImmisciblePrimaryVariables
<TypeTag>
48
{
49
using
ParentType =
ImmisciblePrimaryVariables<TypeTag>
;
50
51
using
Scalar =
GetPropType<TypeTag, Properties::Scalar>
;
52
using
MaterialLaw =
GetPropType<TypeTag, Properties::MaterialLaw>
;
53
using
MaterialLawParams =
GetPropType<TypeTag, Properties::MaterialLawParams>
;
54
55
enum
{ numPhases =
getPropValue<TypeTag, Properties::NumPhases>
() };
56
57
public
:
61
DiscreteFracturePrimaryVariables
() =
default
;
62
68
DiscreteFracturePrimaryVariables
(
const
DiscreteFracturePrimaryVariables
&) =
default
;
69
DiscreteFracturePrimaryVariables
& operator=(
const
DiscreteFracturePrimaryVariables
&) =
default
;
70
71
using
ParentType::operator=;
72
85
template
<
class
Flu
id
State>
86
void
assignNaiveFromFracture
(
const
FluidState& fractureFluidState,
87
const
MaterialLawParams& matParams)
88
{
89
FluidState matrixFluidState;
90
fractureToMatrixFluidState_(matrixFluidState, fractureFluidState,
91
matParams);
92
93
ParentType::assignNaive
(matrixFluidState);
94
}
95
96
private
:
97
template
<
class
Flu
id
State>
98
void
fractureToMatrixFluidState_(FluidState& matrixFluidState,
99
const
FluidState& fractureFluidState,
100
const
MaterialLawParams& matParams)
const
101
{
102
// start with the same fluid state as in the fracture
103
matrixFluidState.assign(fractureFluidState);
104
105
// the condition for the equilibrium is that the pressures are
106
// the same in the fracture and in the matrix. This means that
107
// we have to find saturations for the matrix which result in
108
// the same pressures as in the fracture. this can be done by
109
// inverting the capillary pressure-saturation curve.
110
std::array<Scalar, numPhases> saturations;
111
MaterialLaw::saturations(saturations, matParams, matrixFluidState);
112
113
for
(
unsigned
phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
114
matrixFluidState.setSaturation(phaseIdx, saturations[phaseIdx]);
115
}
116
}
117
};
118
119
}
// namespace Opm
120
121
#endif
Opm::DiscreteFracturePrimaryVariables::DiscreteFracturePrimaryVariables
DiscreteFracturePrimaryVariables()=default
Default constructor.
Opm::DiscreteFracturePrimaryVariables::DiscreteFracturePrimaryVariables
DiscreteFracturePrimaryVariables(const DiscreteFracturePrimaryVariables &)=default
Copy constructor.
Opm::DiscreteFracturePrimaryVariables::assignNaiveFromFracture
void assignNaiveFromFracture(const FluidState &fractureFluidState, const MaterialLawParams &matParams)
< Import base class assignment operators.
Definition
discretefractureprimaryvariables.hh:86
Opm::ImmisciblePrimaryVariables::assignNaive
void assignNaive(const FluidState &fluidState)
Directly retrieve the primary variables from an arbitrary fluid state.
Definition
immiscibleprimaryvariables.hh:189
Opm::ImmisciblePrimaryVariables::ImmisciblePrimaryVariables
ImmisciblePrimaryVariables()
Default constructor.
Definition
immiscibleprimaryvariables.hh:82
discretefractureproperties.hh
Defines the properties required for the immiscible multi-phase model which considers discrete fractur...
immiscibleprimaryvariables.hh
Represents the primary variables used by the immiscible multi-phase, model.
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
opm
models
discretefracture
discretefractureprimaryvariables.hh
Generated by
1.17.0