My Project
BlackoilAquiferModel.hpp
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
24#ifndef OPM_BLACKOILAQUIFERMODEL_HEADER_INCLUDED
25#define OPM_BLACKOILAQUIFERMODEL_HEADER_INCLUDED
26
27#include <ebos/eclbaseaquifermodel.hh>
28
29#include <opm/input/eclipse/EclipseState/Aquifer/Aquancon.hpp>
30#include <opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp>
31#include <opm/input/eclipse/EclipseState/Aquifer/Aquifetp.hpp>
32
33#include <opm/output/data/Aquifer.hpp>
34
35#include <opm/simulators/aquifers/AquiferCarterTracy.hpp>
36#include <opm/simulators/aquifers/AquiferFetkovich.hpp>
37#include <opm/simulators/aquifers/AquiferNumerical.hpp>
38
39#include <opm/grid/CpGrid.hpp>
40#ifdef USE_POLYHEDRALGRID
41#include <opm/grid/polyhedralgrid.hh>
42#endif
43#if USE_ALUGRID
44#include <dune/alugrid/grid.hh>
45#endif
46
47#include <opm/material/densead/Math.hpp>
48
49#include <vector>
50#include <type_traits>
51#include <string_view>
52
53namespace Opm
54{
55
56template<class Grid>
58 : public std::bool_constant<false>
59{};
60
61
62template<>
63class SupportsFaceTag<Dune::CpGrid>
64 : public std::bool_constant<true>
65{};
66
67
68#ifdef USE_POLYHEDRALGRID
69template<>
70class SupportsFaceTag<Dune::PolyhedralGrid<3, 3>>
71 : public std::bool_constant<true>
72{};
73#endif
74
75#if USE_ALUGRID
76template<>
77class SupportsFaceTag<Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>>
78 : public std::bool_constant<true>
79{};
80#endif
81
82
84template <typename TypeTag>
86{
87 using Simulator = GetPropType<TypeTag, Properties::Simulator>;
88 using RateVector = GetPropType<TypeTag, Properties::RateVector>;
89
90
91public:
92 explicit BlackoilAquiferModel(Simulator& simulator);
93
94 void initialSolutionApplied();
95 void initFromRestart(const data::Aquifers& aquiferSoln);
96
97 void beginEpisode();
98 void beginTimeStep();
99 void beginIteration();
100 // add the water rate due to aquifers to the source term.
101 template <class Context>
102 void addToSource(RateVector& rates, const Context& context, unsigned spaceIdx, unsigned timeIdx) const;
103 void addToSource(RateVector& rates, unsigned globalSpaceIdx, unsigned timeIdx) const;
104 void endIteration();
105 void endTimeStep();
106 void endEpisode();
107
108 data::Aquifers aquiferData() const;
109
110 template <class Restarter>
111 void serialize(Restarter& res);
112
113 template <class Restarter>
114 void deserialize(Restarter& res);
115
116 template<class Serializer>
117 void serializeOp(Serializer& serializer);
118
119protected:
120 // --------- Types ---------
121 using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
122 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
123
124 Simulator& simulator_;
125
126 // TODO: possibly better to use unorder_map here for aquifers
127 std::vector<std::unique_ptr<AquiferInterface<TypeTag>>> aquifers;
128
129 // This initialization function is used to connect the parser objects
130 // with the ones needed by AquiferCarterTracy
131 void init();
132
133private:
134 void createDynamicAquifers(const int episode_index);
135
136 void initializeStaticAquifers();
137
138 template <typename AquiferType, typename AquiferData>
139 std::unique_ptr<AquiferType>
140 createAnalyticAquiferPointer(const AquiferData& aqData,
141 const int aquiferID,
142 std::string_view aqType) const;
143};
144
145
146} // namespace Opm
147
148#include "BlackoilAquiferModel_impl.hpp"
149
150#endif
Class for handling the blackoil well model.
Definition: BlackoilAquiferModel.hpp:86
Definition: BlackoilAquiferModel.hpp:59
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27