21 #ifndef OPM_SIMULATORBASE_HEADER_INCLUDED 22 #define OPM_SIMULATORBASE_HEADER_INCLUDED 24 #include <opm/material/densead/Math.hpp> 25 #include <opm/autodiff/DuneMatrix.hpp> 27 #include <opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp> 28 #include <opm/core/utility/parameters/ParameterGroup.hpp> 29 #include <opm/common/ErrorMacros.hpp> 31 #include <opm/autodiff/GeoProps.hpp> 32 #include <opm/autodiff/BlackoilModel.hpp> 33 #include <opm/autodiff/BlackoilPropsAdFromDeck.hpp> 34 #include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp> 37 #include <opm/core/grid.h> 38 #include <opm/core/wells.h> 39 #include <opm/core/well_controls.h> 40 #include <opm/core/pressure/flow_bc.h> 42 #include <opm/core/simulator/SimulatorReport.hpp> 43 #include <opm/simulators/timestepping/SimulatorTimer.hpp> 44 #include <opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp> 45 #include <opm/core/utility/StopWatch.hpp> 46 #include <opm/core/utility/miscUtilities.hpp> 47 #include <opm/core/utility/miscUtilitiesBlackoil.hpp> 49 #include <opm/core/props/rock/RockCompressibility.hpp> 51 #include <opm/core/simulator/BlackoilState.hpp> 52 #include <opm/simulators/timestepping/AdaptiveTimeStepping.hpp> 53 #include <opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp> 55 #include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp> 56 #include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp> 57 #include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp> 58 #include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp> 61 #include <boost/filesystem.hpp> 62 #include <boost/lexical_cast.hpp> 73 #include <unordered_map> 80 template <
class Simulator>
84 template <
class Implementation>
90 typedef typename Traits::ReservoirState ReservoirState;
91 typedef typename Traits::WellState WellState;
92 typedef typename Traits::OutputWriter OutputWriter;
93 typedef typename Traits::Grid Grid;
94 typedef typename Traits::Solver Solver;
95 typedef typename Traits::WellModel WellModel;
128 const RockCompressibility* rock_comp_props,
130 const double* gravity,
133 std::shared_ptr<EclipseState> eclipse_state,
134 OutputWriter& output_writer,
135 const std::vector<double>& threshold_pressures_by_face,
136 const std::unordered_set<std::string>& defunct_well_names);
145 ReservoirState& state);
148 Implementation& asImpl() {
return *
static_cast<Implementation*
>(
this); }
149 const Implementation& asImpl()
const {
return *
static_cast<const Implementation*
>(
this); }
152 WellsManager& wells_manager,
153 WellState& well_state,
156 std::unique_ptr<Solver> createSolver(
const WellModel& well_model);
159 computeRESV(
const std::size_t step,
161 const BlackoilState& x,
165 FIPUnitConvert(
const UnitSystem& units,
166 std::vector<std::vector<double> >& fip);
169 FIPUnitConvert(
const UnitSystem& units,
170 std::vector<double>& fip);
173 FIPTotals(
const std::vector<std::vector<double> >& fip,
const ReservoirState& state);
176 outputFluidInPlace(
const std::vector<double>& oip,
const std::vector<double>& cip,
const UnitSystem& units,
const int reg);
179 void updateListEconLimited(
const std::unique_ptr<Solver>& solver,
180 const Schedule& schedule,
181 const int current_step,
183 const WellState& well_state,
184 DynamicListEconLimited& list_econ_limited)
const;
186 void initHysteresisParams(ReservoirState& state);
189 typedef RateConverter::
190 SurfaceToReservoirVoidage< BlackoilPropsAdFromDeck::FluidSystem,
192 typedef typename Traits::Model Model;
193 typedef typename Model::ModelParameters ModelParameters;
194 typedef typename Solver::SolverParameters SolverParameters;
196 const ParameterGroup param_;
197 ModelParameters model_param_;
198 SolverParameters solver_param_;
203 const RockCompressibility* rock_comp_props_;
204 const double* gravity_;
209 std::vector<int> allcells_;
210 const bool has_disgas_;
211 const bool has_vapoil_;
212 bool terminal_output_;
214 std::shared_ptr<EclipseState> eclipse_state_;
216 OutputWriter& output_writer_;
219 std::vector<double> threshold_pressures_by_face_;
221 bool is_parallel_run_;
225 std::unordered_set<std::string> defunct_well_names_;
230 #include "SimulatorBase_impl.hpp" 231 #endif // OPM_SIMULATORBASE_HEADER_INCLUDED
Class collecting all necessary components for a two-phase simulation.
Definition: SimulatorBase.hpp:85
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: AdditionalObjectDeleter.hpp:22
Facility for converting component rates at surface conditions to phase (voidage) rates at reservoir c...
SimulatorBase(const ParameterGroup ¶m, const Grid &grid, DerivedGeology &geo, BlackoilPropsAdFromDeck &props, const RockCompressibility *rock_comp_props, NewtonIterationBlackoilInterface &linsolver, const double *gravity, const bool disgas, const bool vapoil, std::shared_ptr< EclipseState > eclipse_state, OutputWriter &output_writer, const std::vector< double > &threshold_pressures_by_face, const std::unordered_set< std::string > &defunct_well_names)
Initialise from parameters and objects to observe.
Definition: SimulatorBase_impl.hpp:36
Class containing static geological properties that are derived from grid and petrophysical properties...
Definition: GeoProps.hpp:59
SimulatorReport run(SimulatorTimer &timer, ReservoirState &state)
Run the simulation.
Definition: SimulatorBase_impl.hpp:87
Interface class for (linear) solvers for the fully implicit black-oil system.
Definition: NewtonIterationBlackoilInterface.hpp:31
This class implements the AD-adapted fluid interface for three-phase black-oil.
Definition: BlackoilPropsAdFromDeck.hpp:61
Definition: SimulatorBase.hpp:81
Definition: SimulatorTimer.hpp:34