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
32
34
35namespace Opm {
42template <class TypeTag>
44 : public ImmisciblePrimaryVariables<TypeTag>
45{
47
51
52 enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
53
54public:
59 {}
60
67 {}
68
76
89 template <class FluidState>
90 void assignNaiveFromFracture(const FluidState& fractureFluidState,
91 const MaterialLawParams& matParams)
92 {
93 FluidState matrixFluidState;
94 fractureToMatrixFluidState_(matrixFluidState, fractureFluidState,
95 matParams);
96
97 ParentType::assignNaive(matrixFluidState);
98 }
99
100private:
101 template <class FluidState>
102 void fractureToMatrixFluidState_(FluidState& matrixFluidState,
103 const FluidState& fractureFluidState,
104 const MaterialLawParams& matParams) const
105 {
106 // start with the same fluid state as in the fracture
107 matrixFluidState.assign(fractureFluidState);
108
109 // the condition for the equilibrium is that the pressures are
110 // the same in the fracture and in the matrix. This means that
111 // we have to find saturations for the matrix which result in
112 // the same pressures as in the fracture. this can be done by
113 // inverting the capillary pressure-saturation curve.
114 Scalar saturations[numPhases];
115 MaterialLaw::saturations(saturations, matParams, matrixFluidState);
116
117 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
118 matrixFluidState.setSaturation(phaseIdx, saturations[phaseIdx]);
119 }
120};
121
122} // namespace Opm
123
124#endif
Represents the primary variables used by the discrete fracture multi-phase model.
Definition: discretefractureprimaryvariables.hh:45
DiscreteFracturePrimaryVariables()
Default constructor.
Definition: discretefractureprimaryvariables.hh:58
DiscreteFracturePrimaryVariables & operator=(const DiscreteFracturePrimaryVariables &value)=default
DiscreteFracturePrimaryVariables(Scalar value)
Constructor with assignment from scalar.
Definition: discretefractureprimaryvariables.hh:66
DiscreteFracturePrimaryVariables(const DiscreteFracturePrimaryVariables &value)=default
Copy constructor.
void assignNaiveFromFracture(const FluidState &fractureFluidState, const MaterialLawParams &matParams)
Directly retrieve the primary variables from an arbitrary fluid state of the fractures.
Definition: discretefractureprimaryvariables.hh:90
Represents the primary variables used by the immiscible multi-phase, model.
Definition: immiscibleprimaryvariables.hh:55
void assignNaive(const FluidState &fluidState)
Directly retrieve the primary variables from an arbitrary fluid state.
Definition: immiscibleprimaryvariables.hh:196
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