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<Scalar>& values)
78 { thpres_ = values; }
79
82 std::vector<Scalar> getRestartVector() const;
83
84protected:
88 void finishInit();
89
90 // internalize the threshold pressures which where explicitly specified via the
91 // THPRES keyword.
93
94 void configureThpresft_();
95
96 void logPressures();
97
99 const GridView& gridView_;
100 const ElementMapper& elementMapper_;
103 const EclipseState& eclState_;
104 std::vector<Scalar> thpresDefault_;
105 std::vector<Scalar> thpres_;
107 std::vector<unsigned short> elemEquilRegion_;
108
109 // threshold pressure accross faults. EXPERIMENTAL!
110 std::vector<Scalar> thpresftValues_;
111 std::vector<int> cartElemFaultIdx_;
112
114};
115
116} // namespace Opm
117
118#endif // OPM_GENERIC_THRESHOLD_PRESSURE_HPP
Definition: CollectDataOnIORank.hpp:49
Definition: GenericThresholdPressure.hpp:43
const ElementMapper & elementMapper_
Definition: GenericThresholdPressure.hpp:100
void configureThpresft_()
Definition: GenericThresholdPressure_impl.hpp:198
bool enableThresholdPressure_
Definition: GenericThresholdPressure.hpp:113
void logPressures()
Definition: GenericThresholdPressure_impl.hpp:252
void finishInit()
Actually compute the threshold pressures over a face as a pre-compute step.
Definition: GenericThresholdPressure_impl.hpp:101
const EclipseState & eclState_
Definition: GenericThresholdPressure.hpp:103
std::vector< unsigned short > elemEquilRegion_
Definition: GenericThresholdPressure.hpp:107
GenericThresholdPressure(const CartesianIndexMapper &cartMapper, const GridView &gridView, const ElementMapper &elementMapper, const EclipseState &eclState)
Definition: GenericThresholdPressure_impl.hpp:50
void setFromRestart(const std::vector< Scalar > &values)
Set the threshold pressures from a raw array.
Definition: GenericThresholdPressure.hpp:77
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:106
std::vector< Scalar > getRestartVector() const
Returns a fully expanded vector for restart file writing.
Definition: GenericThresholdPressure_impl.hpp:224
std::vector< Scalar > thpresDefault_
Definition: GenericThresholdPressure.hpp:104
const GridView & gridView_
Definition: GenericThresholdPressure.hpp:99
const LookUpCartesianData lookUpCartesianData_
Definition: GenericThresholdPressure.hpp:102
std::vector< int > cartElemFaultIdx_
Definition: GenericThresholdPressure.hpp:111
std::vector< Scalar > thpres_
Definition: GenericThresholdPressure.hpp:105
const LookUpData lookUpData_
Definition: GenericThresholdPressure.hpp:101
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:110
void applyExplicitThresholdPressures_()
Definition: GenericThresholdPressure_impl.hpp:150
const CartesianIndexMapper & cartMapper_
Definition: GenericThresholdPressure.hpp:98
Definition: GenericThresholdPressure.hpp:40
Definition: FlowGenericProblem.hpp:54
Definition: BlackoilPhases.hpp:27