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  Copyright (C) 2011-2013 by Andreas Lauser
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 2 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 EWOMS_DISCRETE_FRACTURE_PRIMARY_VARIABLES_HH
27 #define EWOMS_DISCRETE_FRACTURE_PRIMARY_VARIABLES_HH
28 
30 
32 
33 namespace Ewoms {
40 template <class TypeTag>
42  : public ImmisciblePrimaryVariables<TypeTag>
43 {
44  typedef ImmisciblePrimaryVariables<TypeTag> ParentType;
45 
46  typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
47  typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
48  typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
49 
50  enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
51 
52 public:
57  {}
58 
64  DiscreteFracturePrimaryVariables(Scalar value) : ParentType(value)
65  {}
66 
73  : ParentType(value)
74  {}
75 
88  template <class FluidState>
89  void assignNaiveFromFracture(const FluidState &fractureFluidState,
90  const MaterialLawParams &matParams)
91  {
92  FluidState matrixFluidState;
93  fractureToMatrixFluidState_(matrixFluidState, fractureFluidState,
94  matParams);
95 
96  ParentType::assignNaive(matrixFluidState);
97  }
98 
99 private:
100  template <class FluidState>
101  void fractureToMatrixFluidState_(FluidState &matrixFluidState,
102  const FluidState &fractureFluidState,
103  const MaterialLawParams &matParams) const
104  {
105  // start with the same fluid state as in the fracture
106  matrixFluidState.assign(fractureFluidState);
107 
108  // the condition for the equilibrium is that the pressures are
109  // the same in the fracture and in the matrix. This means that
110  // we have to find saturations for the matrix which result in
111  // the same pressures as in the fracture. this can be done by
112  // inverting the capillary pressure-saturation curve.
113  Scalar saturations[numPhases];
114  MaterialLaw::saturations(saturations, matParams, matrixFluidState);
115 
116  for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
117  matrixFluidState.setSaturation(phaseIdx, saturations[phaseIdx]);
118  }
119 };
120 
121 } // namespace Ewoms
122 
123 #endif
DiscreteFracturePrimaryVariables(const DiscreteFracturePrimaryVariables &value)
Copy constructor.
Definition: discretefractureprimaryvariables.hh:72
Represents the primary variables used by the immiscible multi-phase, model.
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:468
void assignNaiveFromFracture(const FluidState &fractureFluidState, const MaterialLawParams &matParams)
Directly retrieve the primary variables from an arbitrary fluid state of the fractures.
Definition: discretefractureprimaryvariables.hh:89
DiscreteFracturePrimaryVariables()
Default constructor.
Definition: discretefractureprimaryvariables.hh:56
Represents the primary variables used by the discrete fracture multi-phase model. ...
Definition: discretefractureprimaryvariables.hh:41
DiscreteFracturePrimaryVariables(Scalar value)
Constructor with assignment from scalar.
Definition: discretefractureprimaryvariables.hh:64
Definition: baseauxiliarymodule.hh:35
Defines the properties required for the immiscible multi-phase model which considers discrete fractur...
void assignNaive(const FluidState &fluidState)
Directly retrieve the primary variables from an arbitrary fluid state.
Definition: immiscibleprimaryvariables.hh:161
Represents the primary variables used by the immiscible multi-phase, model.
Definition: immiscibleprimaryvariables.hh:51