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{
51 using Simulator = GetPropType<TypeTag, Properties::Simulator>;
52 using RateVector = GetPropType<TypeTag, Properties::RateVector>;
53
54
55public:
56 explicit BlackoilAquiferModel(Simulator& simulator);
57
59 void initFromRestart(const data::Aquifers& aquiferSoln);
60
61 void beginEpisode();
62 void beginTimeStep();
63 void beginIteration();
64 // add the water rate due to aquifers to the source term.
65 template <class Context>
66 void addToSource(RateVector& rates, const Context& context, unsigned spaceIdx, unsigned timeIdx) const;
67 void addToSource(RateVector& rates, unsigned globalSpaceIdx, unsigned timeIdx) const;
68 void endIteration();
69 void endTimeStep();
70 void endEpisode();
71
72 data::Aquifers aquiferData() const;
73
74 template <class Restarter>
75 void serialize(Restarter& res);
76
77 template <class Restarter>
78 void deserialize(Restarter& res);
79
80 template<class Serializer>
81 void serializeOp(Serializer& serializer);
82
83protected:
84 // --------- Types ---------
85 using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
86 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
87
88 Simulator& simulator_;
89
90 // TODO: possibly better to use unorder_map here for aquifers
91 std::vector<std::unique_ptr<AquiferInterface<TypeTag>>> aquifers;
92
93 // This initialization function is used to connect the parser objects
94 // with the ones needed by AquiferCarterTracy
95 void init();
96
97private:
98 void createDynamicAquifers(const int episode_index);
99
100 void initializeStaticAquifers();
101 void initializeRestartDynamicAquifers();
102
103 bool needRestartDynamicAquifers() const;
104
105 template <typename AquiferType, typename AquiferData>
106 std::unique_ptr<AquiferType>
107 createAnalyticAquiferPointer(const AquiferData& aqData,
108 const int aquiferID,
109 std::string_view aqType) const;
110
111 void computeConnectionAreaFraction() const;
112};
113
114} // namespace Opm
115
116#ifndef OPM_BLACKOILAQUIFERMODEL_IMPL_HEADER_INCLUDED
118#endif
119
120#endif
Class for handling the blackoil aquifer model.
Definition: BlackoilAquiferModel.hpp:50
void beginTimeStep()
Definition: BlackoilAquiferModel_impl.hpp:96
void initFromRestart(const data::Aquifers &aquiferSoln)
Definition: BlackoilAquiferModel_impl.hpp:66
BlackoilAquiferModel(Simulator &simulator)
Definition: BlackoilAquiferModel_impl.hpp:43
void init()
Definition: BlackoilAquiferModel_impl.hpp:171
Simulator & simulator_
Definition: BlackoilAquiferModel.hpp:88
void endEpisode()
Definition: BlackoilAquiferModel_impl.hpp:148
void endTimeStep()
Definition: BlackoilAquiferModel_impl.hpp:134
std::vector< std::unique_ptr< AquiferInterface< TypeTag > > > aquifers
Definition: BlackoilAquiferModel.hpp:91
GetPropType< TypeTag, Properties::ElementContext > ElementContext
Definition: BlackoilAquiferModel.hpp:85
void serializeOp(Serializer &serializer)
Definition: BlackoilAquiferModel_impl.hpp:196
void deserialize(Restarter &res)
Definition: BlackoilAquiferModel_impl.hpp:163
data::Aquifers aquiferData() const
Definition: BlackoilAquiferModel_impl.hpp:183
void serialize(Restarter &res)
Definition: BlackoilAquiferModel_impl.hpp:154
void beginIteration()
Definition: BlackoilAquiferModel_impl.hpp:91
void addToSource(RateVector &rates, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: BlackoilAquiferModel_impl.hpp:106
void initialSolutionApplied()
Definition: BlackoilAquiferModel_impl.hpp:55
void endIteration()
Definition: BlackoilAquiferModel_impl.hpp:129
void beginEpisode()
Definition: BlackoilAquiferModel_impl.hpp:77
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: BlackoilAquiferModel.hpp:86
Definition: BlackoilPhases.hpp:27