SimulatorFullyImplicitBlackoilSolvent.hpp
1 /*
2  Copyright 2015 IRIS AS.
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_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_HEADER_INCLUDED
21 #define OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_HEADER_INCLUDED
22 
23 #include <opm/autodiff/SimulatorBase.hpp>
24 #include <opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp>
25 #include <opm/autodiff/BlackoilSolventModel.hpp>
26 
27 #include <opm/core/utility/parameters/ParameterGroup.hpp>
28 #include <opm/common/ErrorMacros.hpp>
29 
30 #include <opm/autodiff/GeoProps.hpp>
31 #include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
32 #include <opm/autodiff/SolventPropsAdFromDeck.hpp>
34 #include <opm/autodiff/NonlinearSolver.hpp>
35 #include <opm/autodiff/WellStateFullyImplicitBlackoilSolvent.hpp>
36 
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>
41 
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>
48 
49 #include <opm/core/props/rock/RockCompressibility.hpp>
50 
51 //#include <opm/simulators/timestepping/AdaptiveTimeStepping.hpp>
52 //#include <opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp>
53 
54 #include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
55 #include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
56 #include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
57 #include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp>
58 #include <opm/parser/eclipse/Deck/Deck.hpp>
59 
60 #include <boost/filesystem.hpp>
61 #include <boost/lexical_cast.hpp>
62 
63 #include <algorithm>
64 #include <cstddef>
65 #include <cassert>
66 #include <functional>
67 #include <memory>
68 #include <numeric>
69 #include <fstream>
70 #include <iostream>
71 #include <string>
72 #include <unordered_map>
73 #include <utility>
74 #include <vector>
75 
76 namespace Opm
77 {
78  template <class GridT>
80 
82 
83  template<class GridT>
85  {
87  typedef BlackoilState ReservoirState;
89  typedef GridT Grid;
93 
94  };
95 
98  template <class GridT>
100  : public SimulatorBase<SimulatorFullyImplicitBlackoilSolvent<GridT> >
101  {
103  typedef SimulatorBase<ThisType> BaseType;
104 
105  typedef SimulatorTraits<ThisType> Traits;
106  typedef typename Traits::Solver Solver;
107  typedef typename Traits::WellModel WellModel;
108 
109  public:
110  SimulatorFullyImplicitBlackoilSolvent(const ParameterGroup& param,
111  const GridT& grid,
112  DerivedGeology& geo,
114  const SolventPropsAdFromDeck& solvent_props,
115  const RockCompressibility* rock_comp_props,
117  const double* gravity,
118  const bool disgas,
119  const bool vapoil,
120  std::shared_ptr<EclipseState> eclipse_state,
121  BlackoilOutputWriter& output_writer,
122  std::shared_ptr< Deck > deck,
123  const std::vector<double>& threshold_pressures_by_face,
124  const bool solvent);
125 
126  std::unique_ptr<Solver> createSolver(const WellModel& well_model);
127 
128  void handleAdditionalWellInflow(SimulatorTimer& timer,
129  WellsManager& wells_manager,
130  typename BaseType::WellState& well_state,
131  const Wells* wells);
132 
133  private:
134  bool has_solvent_;
135  std::shared_ptr< Deck > deck_;
136  SolventPropsAdFromDeck solvent_props_;
137  bool is_miscible_;
138 
139  };
140 
141 } // namespace Opm
142 
143 #include "SimulatorFullyImplicitBlackoilSolvent_impl.hpp"
144 
145 #endif // OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_HEADER_INCLUDED
A nonlinear solver class suitable for general fully-implicit models, as well as pressure, transport and sequential models.
Definition: NonlinearSolver.hpp:37
Definition: WellStateFullyImplicitBlackoilSolvent.hpp:28
Class collecting all necessary components for a two-phase simulation.
Definition: SimulatorBase.hpp:85
Class for handling the standard well model for solvent model.
Definition: StandardWellsSolvent.hpp:32
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...
Class collecting all necessary components for a blackoil simulation with polymer injection.
Definition: SimulatorFullyImplicitBlackoilSolvent.hpp:79
Class containing static geological properties that are derived from grid and petrophysical properties...
Definition: GeoProps.hpp:59
Wrapper class for VTK, Matlab, and ECL output.
Definition: SimulatorFullyImplicitBlackoilOutput.hpp:206
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: SolventPropsAdFromDeck.hpp:37
Definition: SimulatorBase.hpp:81
Definition: SimulatorTimer.hpp:34
A model implementation for three-phase black oil with one extra component.
Definition: BlackoilSolventModel.hpp:38