opm-simulators
CompWellState.hpp
1 /*
2  Copyright 2024, SINTEF Digital
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef OPM_COMP_WELL_STATES_HPP
21 #define OPM_COMP_WELL_STATES_HPP
22 
23 // TODO: evaluate whether we can continue use this phase usage
24 // if yes, we might want to rename it
25 // TODO: we also the informaton regarding the components
26 // #include <opm/simulators/utils/BlackoilPhases.hpp>
27 #include <opm/simulators/wells/WellContainer.hpp>
28 #include <opm/simulators/wells/PerforationData.hpp>
29 
30 #include <opm/output/data/Wells.hpp>
31 
32 
33 #include <flowexperimental/comp/wells/SingleCompWellState.hpp>
34 
35 
36 namespace Opm {
37 
38 template <typename FluidSystem>
40 {
41 public:
42  using Scalar = typename FluidSystem::Scalar;
45 
46  explicit CompWellState(const CompositionalConfig& comp_config);
47 
48  void init(const std::vector<Well>& wells_ecl,
49  const std::vector<Scalar>& cell_pressures,
50  const Scalar cell_temperature,
51  const std::vector<std::vector<Scalar>>& cell_mole_fractions,
52  const std::vector<std::vector<CompConnectionData> >& well_connection_data,
53  const SummaryState& sumary_state,
54  const CompWellState* prev_well_state = nullptr);
55 
56  const SingleWellState& operator[](const std::string& well_name) const;
57 
58  SingleWellState& operator[](const std::string& well_name);
59 
60  bool has(const std::string& well_name) const
61  { return wells_.has(well_name); }
62 
63  data::Wells report() const;
64 
65  // Copy dynamic well variables function for now copy all
66  void copyDynamicStateFrom(const CompWellState& other)
67  {
68  wells_ = other.wells_;
69  }
70 
71 private:
73 
74  const CompositionalConfig& comp_config_;
75 
76  void base_init(const std::vector<Well>& wells_ecl,
77  const std::vector<Scalar>& cell_pressures,
78  const Scalar temperature,
79  const std::vector<std::vector<Scalar>>& cell_mole_fractions,
80  const std::vector<std::vector<CompConnectionData> >& well_connection_data,
81  const SummaryState& summary_state);
82 
83  void initSingleWell(const Well& well,
84  const std::vector<Scalar>& cell_pressures,
85  const Scalar tempearture,
86  const std::vector<std::vector<Scalar>>& cell_mole_fractions,
87  const std::vector<CompConnectionData >& conn_data,
88  const SummaryState& summary_state);
89 
90  void initSingleInjector(const Well& well,
91  const std::vector<Scalar>& cell_pressures,
92  const Scalar temperature,
93  const std::vector<CompConnectionData>& conn_data,
94  const SummaryState& summary_state);
95 
96  void initSingleProducer(const Well& well,
97  const std::vector<Scalar>& cell_pressures,
98  const Scalar temperature,
99  const std::vector<std::vector<Scalar>>& cell_mole_fractions,
100  const std::vector<CompConnectionData>& conn_data,
101  const SummaryState& summary_state);
102 };
103 
104 } // end of namespace Opm
105 
106 #include "CompWellState_impl.hpp"
107 
108 #endif // OPM_COMP_WELL_STATES_HPP
Definition: CompWellPrimaryVariables.hpp:32
Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that ...
Definition: blackoilbioeffectsmodules.hh:45
Definition: CompWellState.hpp:39
Definition: WellContainer.hpp:46
Static data associated with a well perforation.
Definition: BlackoilWellModelRestart.hpp:41