opm-simulators
GenericThresholdPressure.hpp
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 OPM_GENERIC_THRESHOLD_PRESSURE_HPP
29 #define OPM_GENERIC_THRESHOLD_PRESSURE_HPP
30 
31 #include <opm/grid/common/CartesianIndexMapper.hpp>
32 #include <opm/grid/LookUpData.hh>
33 
34 #include <vector>
35 
36 namespace Opm {
37 
38 class EclipseState;
39 template<typename Grid, typename GridView> class LookUpData;
40 template<typename Grid, typename GridView> class LookUpCartesianData;
41 
42 template<class Grid, class GridView, class ElementMapper, class Scalar>
44 public:
48 
50  const GridView& gridView,
51  const ElementMapper& elementMapper,
52  const EclipseState& eclState);
53 
62  Scalar thresholdPressure(int elem1Idx, int elem2Idx) const;
63 
69  const std::vector<Scalar>& data() const
70  { return thpres_; }
71 
77  void setFromRestart(const std::vector<double>& values)
78  {
79  this->restart_ = true;
80  thpres_.assign(values.begin(), values.end());
81  thpresDefault_.assign(values.begin(), values.end());
82  }
83 
86  std::vector<Scalar> getRestartVector() const;
87 
88  bool enableThresholdPressure() const;
89 
90 protected:
94  void finishInit();
95 
96  // internalize the threshold pressures which where explicitly specified via the
97  // THPRES keyword.
98  void applyExplicitThresholdPressures_();
99 
100  void configureThpresft_();
101 
102  void logPressures();
103 
104  const CartesianIndexMapper& cartMapper_;
105  const GridView& gridView_;
106  const ElementMapper& elementMapper_;
107  const LookUpData lookUpData_;
108  const LookUpCartesianData lookUpCartesianData_;
109  const EclipseState& eclState_;
110  std::vector<Scalar> thpresDefault_;
111  std::vector<Scalar> thpres_;
112  unsigned numEquilRegions_{};
113  std::vector<unsigned short> elemEquilRegion_;
114 
115  // threshold pressure accross faults. EXPERIMENTAL!
116  std::vector<Scalar> thpresftValues_;
117  std::vector<int> cartElemFaultIdx_;
118 
119  bool enableThresholdPressure_ {false};
120  bool restart_ {false};
121 };
122 
123 } // namespace Opm
124 
125 #endif // OPM_GENERIC_THRESHOLD_PRESSURE_HPP
void setFromRestart(const std::vector< double > &values)
Set the threshold pressures from a raw array.
Definition: GenericThresholdPressure.hpp:77
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
void finishInit()
Actually compute the threshold pressures over a face as a pre-compute step.
Definition: GenericThresholdPressure_impl.hpp:103
Definition: FlowGenericProblem.hpp:51
std::vector< Scalar > getRestartVector() const
Returns a fully expanded vector for restart file writing.
Definition: GenericThresholdPressure_impl.hpp:234
const std::vector< Scalar > & data() const
Return the raw array with the threshold pressures.
Definition: GenericThresholdPressure.hpp:69
Definition: GenericThresholdPressure.hpp:40
Definition: CollectDataOnIORank.hpp:49
Scalar thresholdPressure(int elem1Idx, int elem2Idx) const
Returns the theshold pressure [Pa] for the intersection between two elements.
Definition: GenericThresholdPressure_impl.hpp:65
Definition: GenericThresholdPressure.hpp:43