All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 
35 namespace Ewoms {
42 template <class TypeTag>
44  : public ImmisciblePrimaryVariables<TypeTag>
45 {
46  typedef ImmisciblePrimaryVariables<TypeTag> ParentType;
47 
48  typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
49  typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
50  typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
51 
52  enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
53 
54 public:
59  {}
60 
66  DiscreteFracturePrimaryVariables(Scalar value) : ParentType(value)
67  {}
68 
75  DiscreteFracturePrimaryVariables& operator=(const DiscreteFracturePrimaryVariables& value) = default;
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 
100 private:
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 Ewoms
123 
124 #endif
Defines the properties required for the immiscible multi-phase model which considers discrete fractur...
DiscreteFracturePrimaryVariables(Scalar value)
Constructor with assignment from scalar.
Definition: discretefractureprimaryvariables.hh:66
void assignNaive(const FluidState &fluidState)
Directly retrieve the primary variables from an arbitrary fluid state.
Definition: immiscibleprimaryvariables.hh:196
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:469
Represents the primary variables used by the discrete fracture multi-phase model. ...
Definition: discretefractureprimaryvariables.hh:43
DiscreteFracturePrimaryVariables()
Default constructor.
Definition: discretefractureprimaryvariables.hh:58
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.
Represents the primary variables used by the immiscible multi-phase, model.
Definition: immiscibleprimaryvariables.hh:54