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