BlackoilAquiferModel.hpp
Go to the documentation of this file.
1/*
2 File adapted from BlackoilWellModel.hpp
3
4 Copyright 2017 TNO - Heat Transfer & Fluid Dynamics, Modelling & Optimization of the Subsurface
5 Copyright 2017 Statoil ASA.
6
7 This file is part of the Open Porous Media project (OPM).
8
9 OPM is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 OPM is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with OPM. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23#ifndef OPM_BLACKOILAQUIFERMODEL_HEADER_INCLUDED
24#define OPM_BLACKOILAQUIFERMODEL_HEADER_INCLUDED
25
26#include <opm/input/eclipse/EclipseState/Aquifer/Aquancon.hpp>
27#include <opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp>
28#include <opm/input/eclipse/EclipseState/Aquifer/Aquifetp.hpp>
29
30#include <opm/output/data/Aquifer.hpp>
31
36
38
39#include <opm/material/densead/Math.hpp>
40
41#include <vector>
42#include <type_traits>
43#include <string_view>
44
45namespace Opm {
46
48template <typename TypeTag>
50{
54
55
56public:
57 explicit BlackoilAquiferModel(Simulator& simulator);
58
60 void initFromRestart(const data::Aquifers& aquiferSoln);
61
62 void beginEpisode();
63 void beginTimeStep();
64 void beginIteration();
65 // add the water rate due to aquifers to the source term.
66 template <class Context>
67 void addToSource(RateVector& rates, const Context& context, unsigned spaceIdx, unsigned timeIdx) const;
68 void addToSource(RateVector& rates, unsigned globalSpaceIdx, unsigned timeIdx) const;
69 Scalar cachedConnectionInfluxRate(unsigned globalSpaceIdx) const;
70 void endIteration();
71 void endTimeStep();
72 void endEpisode();
73
74 data::Aquifers aquiferData() const;
75
76 template <class Restarter>
77 void serialize(Restarter& res);
78
79 template <class Restarter>
80 void deserialize(Restarter& res);
81
82 template<class Serializer>
83 void serializeOp(Serializer& serializer);
84
85protected:
86 // --------- Types ---------
88
89 Simulator& simulator_;
90
91 // TODO: possibly better to use unorder_map here for aquifers
92 std::vector<std::unique_ptr<AquiferInterface<TypeTag>>> aquifers;
93
94 // This initialization function is used to connect the parser objects
95 // with the ones needed by AquiferCarterTracy
96 void init();
97
98private:
99 void createDynamicAquifers(const int episode_index);
100
101 void initializeStaticAquifers();
102 void initializeRestartDynamicAquifers();
103
104 bool needRestartDynamicAquifers() const;
105
106 template <typename AquiferType, typename AquiferData>
107 std::unique_ptr<AquiferType>
108 createAnalyticAquiferPointer(const AquiferData& aqData,
109 const int aquiferID,
110 std::string_view aqType) const;
111
112 void computeConnectionAreaFraction() const;
113};
114
115} // namespace Opm
116
118
119#endif
Class for handling the blackoil aquifer model.
Definition: BlackoilAquiferModel.hpp:50
void beginTimeStep()
Definition: BlackoilAquiferModel_impl.hpp:97
void initFromRestart(const data::Aquifers &aquiferSoln)
Definition: BlackoilAquiferModel_impl.hpp:67
BlackoilAquiferModel(Simulator &simulator)
Definition: BlackoilAquiferModel_impl.hpp:44
void init()
Definition: BlackoilAquiferModel_impl.hpp:184
Simulator & simulator_
Definition: BlackoilAquiferModel.hpp:89
void endEpisode()
Definition: BlackoilAquiferModel_impl.hpp:161
void endTimeStep()
Definition: BlackoilAquiferModel_impl.hpp:146
std::vector< std::unique_ptr< AquiferInterface< TypeTag > > > aquifers
Definition: BlackoilAquiferModel.hpp:92
GetPropType< TypeTag, Properties::ElementContext > ElementContext
Definition: BlackoilAquiferModel.hpp:87
void serializeOp(Serializer &serializer)
Definition: BlackoilAquiferModel_impl.hpp:209
void deserialize(Restarter &res)
Definition: BlackoilAquiferModel_impl.hpp:176
data::Aquifers aquiferData() const
Definition: BlackoilAquiferModel_impl.hpp:196
Scalar cachedConnectionInfluxRate(unsigned globalSpaceIdx) const
Definition: BlackoilAquiferModel_impl.hpp:130
void serialize(Restarter &res)
Definition: BlackoilAquiferModel_impl.hpp:167
void beginIteration()
Definition: BlackoilAquiferModel_impl.hpp:92
void addToSource(RateVector &rates, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: BlackoilAquiferModel_impl.hpp:107
void initialSolutionApplied()
Definition: BlackoilAquiferModel_impl.hpp:56
void endIteration()
Definition: BlackoilAquiferModel_impl.hpp:141
void beginEpisode()
Definition: BlackoilAquiferModel_impl.hpp:78
Definition: blackoilbioeffectsmodules.hh:45
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