wrapper.hpp
Go to the documentation of this file.
1#ifndef OPM_VERTEQ_WRAPPER_HPP_INCLUDED
2#define OPM_VERTEQ_WRAPPER_HPP_INCLUDED
3
4// Copyright (C) 2013 Uni Research AS
5// This file is licensed under the GNU General Public License v3.0
6
7#include <vector>
8#include <memory> // unique_ptr
9
10#ifndef OPM_VERTEQ_VISIBILITY_HPP_INCLUDED
12#endif /* OPM_VERTEQ_VISIBILITY_HPP_INCLUDED */
13
14#ifndef OPM_VERTEQ_OPMFWD_HPP_INCLUDED
15#include <opm/verteq/opmfwd.hpp>
16#endif /* OPM_VERTEQ_OPMFWD_HPP_INCLUDED */
17
18#ifndef OPM_VERTEQ_SIMULATOR_HPP_INCLUDED
20#endif /* OPM_VERTEQ_SIMULATOR_HPP_INCLUDED */
21
22namespace Opm {
23
24// forward declaration
25class VertEq;
26
40protected:
58 std::unique_ptr <Simulator> underlaying,
59 const parameter::ParameterGroup& param,
60 const UnstructuredGrid& grid,
61 const IncompPropertiesInterface& props,
62 const RockCompressibility* rock_comp_props,
63 WellsManager& wells_manager,
64 const std::vector<double>& src,
65 const FlowBoundaryConditions* bcs,
66 LinearSolverInterface& linsolver,
67 const double* gravity);
68public:
73
85 virtual SimulatorReport run(
86 SimulatorTimer& timer,
87 TwophaseState& state,
88 WellState& well_state);
89
99
108 void sync ();
109
110private:
111 // underlaying simulator to use for 2D
112 std::unique_ptr <Simulator> sim;
113
114 // vertical equilibrium model
115 VertEq* ve;
116
117 // list of translated wells
118 WellsManager* wells_mgr;
119
120 // list of handlers for timestep notifications
121 std::unique_ptr <EventSource> timestep_callbacks;
122
123 // current state of any simulation we are doing
124 TwophaseState* fineState;
125 TwophaseState* coarseState;
126
127 // flag that determines whether we have synced or not
128 bool syncDone;
129 void resetSyncFlag ();
130};
131
144template <typename SimulatorType>
159 VertEqWrapper (const parameter::ParameterGroup& param,
160 const UnstructuredGrid& grid,
161 const IncompPropertiesInterface& props,
162 const RockCompressibility* rock_comp_props,
163 WellsManager& wells_manager,
164 const std::vector<double>& src,
165 const FlowBoundaryConditions* bcs,
166 LinearSolverInterface& linsolver,
167 const double* gravity)
168 : VertEqWrapperBase (std::unique_ptr <Simulator> (
169 new SimulatorAdapter <SimulatorType> ()),
170 param, grid, props, rock_comp_props, wells_manager,
171 src, bcs, linsolver, gravity) {
172 }
173};
174
175} /* namespace Opm */
176
177#endif /* OPM_VERTEQ_WRAPPER_HPP_INCLUDED */
Vertical Equilibrium Upscaling.
Definition: verteq.hpp:46
#define OPM_VERTEQ_PUBLIC
Definition: exc.hpp:19
Definition: opmfwd.hpp:15
Definition: simulator.hpp:107
Definition: simulator.hpp:31
Definition: wrapper.hpp:39
Event & timestep_completed()
virtual SimulatorReport run(SimulatorTimer &timer, TwophaseState &state, WellState &well_state)
virtual ~VertEqWrapperBase()
VertEqWrapperBase(std::unique_ptr< Simulator > underlaying, const parameter::ParameterGroup &param, const UnstructuredGrid &grid, const IncompPropertiesInterface &props, const RockCompressibility *rock_comp_props, WellsManager &wells_manager, const std::vector< double > &src, const FlowBoundaryConditions *bcs, LinearSolverInterface &linsolver, const double *gravity)
Definition: wrapper.hpp:145
VertEqWrapper(const parameter::ParameterGroup &param, const UnstructuredGrid &grid, const IncompPropertiesInterface &props, const RockCompressibility *rock_comp_props, WellsManager &wells_manager, const std::vector< double > &src, const FlowBoundaryConditions *bcs, LinearSolverInterface &linsolver, const double *gravity)
Definition: wrapper.hpp:159