opm-simulators
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 #include <array>
36 
37 namespace Opm {
38 
45 template <class TypeTag>
47  : public ImmisciblePrimaryVariables<TypeTag>
48 {
50 
54 
55  enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
56 
57 public:
62 
70 
71  using ParentType::operator=;
72 
85  template <class FluidState>
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 FluidState>
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
Defines the properties required for the immiscible multi-phase model which considers discrete fractur...
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
Represents the primary variables used by the discrete fracture multi-phase model. ...
Definition: discretefractureprimaryvariables.hh:46
void assignNaive(const FluidState &fluidState)
Directly retrieve the primary variables from an arbitrary fluid state.
Definition: immiscibleprimaryvariables.hh:189
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
void assignNaiveFromFracture(const FluidState &fractureFluidState, const MaterialLawParams &matParams)
< Import base class assignment operators.
Definition: discretefractureprimaryvariables.hh:86
Represents the primary variables used by the immiscible multi-phase, model.
Definition: immiscibleprimaryvariables.hh:53
Represents the primary variables used by the immiscible multi-phase, model.
DiscreteFracturePrimaryVariables()=default
Default constructor.