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
36namespace Opm {
37
38class EclipseState;
39template<typename Grid, typename GridView> class LookUpData;
40template<typename Grid, typename GridView> class LookUpCartesianData;
41
42template<class Grid, class GridView, class ElementMapper, class Scalar>
44public:
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
90protected:
94 void finishInit();
95
96 // internalize the threshold pressures which where explicitly specified via the
97 // THPRES keyword.
99
100 void configureThpresft_();
101
102 void logPressures();
103
105 const GridView& gridView_;
106 const ElementMapper& elementMapper_;
109 const EclipseState& eclState_;
110 std::vector<Scalar> thpresDefault_;
111 std::vector<Scalar> thpres_;
113 std::vector<unsigned short> elemEquilRegion_;
114
115 // threshold pressure accross faults. EXPERIMENTAL!
116 std::vector<Scalar> thpresftValues_;
117 std::vector<int> cartElemFaultIdx_;
118
120 bool restart_ {false};
121};
122
123} // namespace Opm
124
125#endif // OPM_GENERIC_THRESHOLD_PRESSURE_HPP
Definition: CollectDataOnIORank.hpp:49
Definition: GenericThresholdPressure.hpp:43
const ElementMapper & elementMapper_
Definition: GenericThresholdPressure.hpp:106
void setFromRestart(const std::vector< double > &values)
Set the threshold pressures from a raw array.
Definition: GenericThresholdPressure.hpp:77
void configureThpresft_()
Definition: GenericThresholdPressure_impl.hpp:206
bool enableThresholdPressure_
Definition: GenericThresholdPressure.hpp:119
void logPressures()
Definition: GenericThresholdPressure_impl.hpp:255
void finishInit()
Actually compute the threshold pressures over a face as a pre-compute step.
Definition: GenericThresholdPressure_impl.hpp:103
const EclipseState & eclState_
Definition: GenericThresholdPressure.hpp:109
std::vector< unsigned short > elemEquilRegion_
Definition: GenericThresholdPressure.hpp:113
GenericThresholdPressure(const CartesianIndexMapper &cartMapper, const GridView &gridView, const ElementMapper &elementMapper, const EclipseState &eclState)
Definition: GenericThresholdPressure_impl.hpp:50
bool enableThresholdPressure() const
Definition: GenericThresholdPressure_impl.hpp:246
Scalar thresholdPressure(int elem1Idx, int elem2Idx) const
Returns the theshold pressure [Pa] for the intersection between two elements.
Definition: GenericThresholdPressure_impl.hpp:65
unsigned numEquilRegions_
Definition: GenericThresholdPressure.hpp:112
std::vector< Scalar > getRestartVector() const
Returns a fully expanded vector for restart file writing.
Definition: GenericThresholdPressure_impl.hpp:234
std::vector< Scalar > thpresDefault_
Definition: GenericThresholdPressure.hpp:110
const GridView & gridView_
Definition: GenericThresholdPressure.hpp:105
const LookUpCartesianData lookUpCartesianData_
Definition: GenericThresholdPressure.hpp:108
std::vector< int > cartElemFaultIdx_
Definition: GenericThresholdPressure.hpp:117
std::vector< Scalar > thpres_
Definition: GenericThresholdPressure.hpp:111
const LookUpData lookUpData_
Definition: GenericThresholdPressure.hpp:107
const std::vector< Scalar > & data() const
Return the raw array with the threshold pressures.
Definition: GenericThresholdPressure.hpp:69
std::vector< Scalar > thpresftValues_
Definition: GenericThresholdPressure.hpp:116
void applyExplicitThresholdPressures_()
Definition: GenericThresholdPressure_impl.hpp:155
bool restart_
Definition: GenericThresholdPressure.hpp:120
const CartesianIndexMapper & cartMapper_
Definition: GenericThresholdPressure.hpp:104
Definition: GenericThresholdPressure.hpp:40
Definition: FlowGenericProblem.hpp:51
Definition: blackoilboundaryratevector.hh:39