20 #ifndef OPM_COMPOSITIONAL_WELL_MODEL_HPP 21 #define OPM_COMPOSITIONAL_WELL_MODEL_HPP 23 #include <opm/output/data/Wells.hpp> 26 #include <opm/input/eclipse/Schedule/Events.hpp> 27 #include <opm/input/eclipse/Schedule/Well/WellTestState.hpp> 28 #include <opm/input/eclipse/Schedule/Schedule.hpp> 30 #include <flowexperimental/comp/wells/CompWell.hpp> 31 #include <flowexperimental/comp/wells/CompWellState.hpp> 33 #include <opm/simulators/utils/ParallelCommunication.hpp> 35 #include <opm/simulators/wells/WellConnectionAuxiliaryModule.hpp> 37 #include <opm/simulators/wells/PerforationData.hpp> 39 #include <opm/simulators/timestepping/SimulatorReport.hpp> 48 struct NewtonIterationContext;
50 template<
typename TypeTag>
70 static const int numEq = Indices::numEq;
71 using VectorBlockType = Dune::FieldVector<Scalar, numEq>;
72 typedef Dune::BlockVector<VectorBlockType> BVector;
76 using CompWellPtr = std::shared_ptr<CompWell<TypeTag> >;
80 [[nodiscard]]
unsigned numDofs()
const override 90 template <
class Restarter>
91 void serialize(Restarter& )
94 template <
class Restarter>
95 void deserialize(Restarter& )
99 template<
class Serializer>
100 void serializeOp(Serializer& )
104 void beginEpisode() { beginReportStep(simulator_.episodeIndex()); }
105 void beginReportStep(
unsigned report_step);
106 void beginTimeStep();
107 void beginIteration();
108 void restoreLastValidState();
111 void endIteration()
const {}
115 void computeTotalRatesForDof(RateVector& ,
unsigned )
const;
117 [[nodiscard]] data::Wells wellData()
const;
119 [[nodiscard]] data::WellBlockAveragePressures wellBlockAveragePressures()
const {
120 return data::WellBlockAveragePressures{};
122 [[nodiscard]] data::GroupAndNetworkValues groupAndNetworkData(
const int&)
const {
123 return data::GroupAndNetworkValues{};
125 [[nodiscard]] WellTestState wellTestState()
const {
126 return WellTestState{};
131 void recoverWellSolutionAndUpdateWellState(
const BVector& x);
134 bool addMatrixContributions()
const {
return false; }
135 const Schedule& schedule()
const {
return schedule_; }
136 auto begin()
const {
return well_container_.begin(); }
137 auto end()
const {
return well_container_.end(); }
139 const SimulatorReportSingle& lastReport()
const {
return last_report_; }
140 void prepareDeserialize(
const int) {}
141 const std::map<std::string, double>& wellOpenTimes()
const {
return well_open_times_; }
142 const std::map<std::string, double>& wellCloseTimes()
const {
return well_close_times_; }
143 const WellGroupEvents& reportStepStartEvents()
const {
return report_step_start_events_; }
144 bool forceShutWellByName(
const std::string& well_name,
double simulation_time,
bool dont_shut_grup_wells);
146 template <
class ReservoirCouplingSlave>
147 void setReservoirCouplingSlave(ReservoirCouplingSlave*) {}
149 template <
class ReservoirCouplingMaster>
150 void setReservoirCouplingMaster(ReservoirCouplingMaster*) {}
152 bool getWellConvergence()
const;
155 std::size_t compressedIndexForInterior(std::size_t cartesian_cell_idx)
const;
157 std::vector<int> getCellsForConnections(
const Well& well)
const;
160 Simulator& simulator_;
161 const Schedule& schedule_;
162 const SummaryState& summary_state_;
163 const EclipseState& ecl_state_;
164 const Parallel::Communication& comm_;
167 const CompositionalConfig& comp_config_;
170 CompWellState<FluidSystem> comp_well_states_;
173 CompWellState<FluidSystem> last_valid_comp_well_states_;
176 std::vector<Well> wells_ecl_;
177 std::vector<std::vector<CompConnectionData> > well_connection_data_;
179 std::vector<CompWellPtr> well_container_;
181 mutable BVector x_local_;
183 std::size_t local_num_cells_{0};
184 SimulatorReportSingle last_report_{};
185 std::map<std::string, double> well_open_times_;
186 std::map<std::string, double> well_close_times_;
187 WellGroupEvents report_step_start_events_{};
189 void createWellContainer();
190 void initWellContainer();
192 void initWellConnectionData();
193 void initWellState();
195 void assemble(
const double dt);
197 void calculateExplicitQuantities();
202 #include "CompWellModel_impl.hpp" 204 #endif // OPM_COMPOSITIONAL_WELL_MODEL_HPP Context for iteration-dependent decisions in the Newton solver.
Definition: NewtonIterationContext.hpp:43
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(...))
Definition: propertysystem.hh:233
Base class for specifying auxiliary equations.
unsigned numDofs() const override
Returns the number of additional degrees of freedom required for the auxiliary module.
Definition: CompWellModel.hpp:80
Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that ...
Definition: blackoilbioeffectsmodules.hh:45
Static data associated with a well perforation.
Definition: BlackoilWellModelRestart.hpp:41
void applyInitial() override
Set the initial condition of the auxiliary module in the solution vector.
Definition: CompWellModel.hpp:86
Definition: WellConnectionAuxiliaryModule.hpp:38
Definition: CompWellModel.hpp:51