WellConnectionAuxiliaryModule.hpp
Go to the documentation of this file.
1/*
2 Copyright 2017 Dr. Blatt - HPC-Simulation-Software & Services
3 Copyright 2017 Statoil ASA.
4
5 This file is part of the Open Porous Media project (OPM).
6
7 OPM is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 OPM is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with OPM. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#ifndef OPM_WELLCONNECTIONAUXILIARYMODULE_HEADER_INCLUDED
22#define OPM_WELLCONNECTIONAUXILIARYMODULE_HEADER_INCLUDED
23
24#include <opm/models/discretization/common/baseauxiliarymodule.hh>
25
26#include <vector>
27
28namespace Dune { class CpGrid; }
29
30namespace Opm
31{
32
33class Schedule;
34
36{
37protected:
38 WellConnectionAuxiliaryModuleGeneric(const Schedule& schedule,
39 const Dune::CpGrid& grid);
40
41 std::vector<std::vector<int> > wells_;
42};
43
44template<class TypeTag>
46 : public BaseAuxiliaryModule<TypeTag>
48{
49 using GlobalEqVector = GetPropType<TypeTag, Properties::GlobalEqVector>;
50 using SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>;
51
52public:
53
54 using NeighborSet = typename
55 ::Opm::BaseAuxiliaryModule<TypeTag>::NeighborSet;
56
57 WellConnectionAuxiliaryModule(const Schedule& schedule,
58 const Dune::CpGrid& grid)
60 {
61 }
62
63 unsigned numDofs() const
64 {
65 // No extra dofs are inserted for wells.
66 return 0;
67 }
68
69 void addNeighbors(std::vector<NeighborSet>& neighbors) const
70 {
71 for (const auto& well_perforations : wells_)
72 {
73 for (const auto& perforation : well_perforations)
74 neighbors[perforation].insert(well_perforations.begin(),
75 well_perforations.end());
76 }
77 }
78
80 {}
81
82 void linearize(SparseMatrixAdapter& , GlobalEqVector&)
83 {
84 // Linearization is done in StandardDenseWells
85 }
86
87 private:
88};
89
90} // end namespace OPM
91#endif
Definition: WellConnectionAuxiliaryModule.hpp:36
std::vector< std::vector< int > > wells_
Definition: WellConnectionAuxiliaryModule.hpp:41
WellConnectionAuxiliaryModuleGeneric(const Schedule &schedule, const Dune::CpGrid &grid)
Definition: WellConnectionAuxiliaryModule.hpp:48
void linearize(SparseMatrixAdapter &, GlobalEqVector &)
Definition: WellConnectionAuxiliaryModule.hpp:82
WellConnectionAuxiliaryModule(const Schedule &schedule, const Dune::CpGrid &grid)
Definition: WellConnectionAuxiliaryModule.hpp:57
void applyInitial()
Definition: WellConnectionAuxiliaryModule.hpp:79
unsigned numDofs() const
Definition: WellConnectionAuxiliaryModule.hpp:63
typename ::Opm::BaseAuxiliaryModule< TypeTag >::NeighborSet NeighborSet
Definition: WellConnectionAuxiliaryModule.hpp:55
void addNeighbors(std::vector< NeighborSet > &neighbors) const
Definition: WellConnectionAuxiliaryModule.hpp:69
Definition: SupportsFaceTag.hpp:27
Definition: BlackoilPhases.hpp:27