SimulatorFullyImplicitBlackoilSolvent.hpp
Go to the documentation of this file.
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 
27 
28 #include <opm/core/utility/parameters/ParameterGroup.hpp>
29 #include <opm/common/ErrorMacros.hpp>
30 
37 
38 #include <opm/core/grid.h>
39 #include <opm/core/wells.h>
40 #include <opm/core/well_controls.h>
41 #include <opm/core/pressure/flow_bc.h>
42 
43 #include <opm/core/simulator/SimulatorReport.hpp>
44 #include <opm/core/simulator/SimulatorTimer.hpp>
45 //#include <opm/core/simulator/AdaptiveSimulatorTimer.hpp>
46 #include <opm/core/utility/StopWatch.hpp>
47 #include <opm/core/io/vtk/writeVtkData.hpp>
48 #include <opm/core/utility/miscUtilities.hpp>
49 #include <opm/core/utility/miscUtilitiesBlackoil.hpp>
50 
51 #include <opm/core/props/rock/RockCompressibility.hpp>
52 
53 //#include <opm/core/simulator/AdaptiveTimeStepping.hpp>
54 //#include <opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp>
55 
56 #include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
57 #include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
58 #include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
59 #include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp>
60 #include <opm/parser/eclipse/Deck/Deck.hpp>
61 
62 #include <boost/filesystem.hpp>
63 #include <boost/lexical_cast.hpp>
64 
65 #include <algorithm>
66 #include <cstddef>
67 #include <cassert>
68 #include <functional>
69 #include <memory>
70 #include <numeric>
71 #include <fstream>
72 #include <iostream>
73 #include <string>
74 #include <unordered_map>
75 #include <utility>
76 #include <vector>
77 
78 namespace Opm
79 {
80  template <class GridT>
82 
83  template<class GridT>
85  {
89  typedef GridT Grid;
92  };
93 
96  template <class GridT>
98  : public SimulatorBase<SimulatorFullyImplicitBlackoilSolvent<GridT> >
99  {
101  typedef SimulatorBase<ThisType> BaseType;
102 
103  typedef SimulatorTraits<ThisType> Traits;
104  typedef typename Traits::Solver Solver;
105 
106  public:
107  SimulatorFullyImplicitBlackoilSolvent(const parameter::ParameterGroup& param,
108  const GridT& grid,
109  const DerivedGeology& geo,
111  const SolventPropsAdFromDeck& solvent_props,
112  const RockCompressibility* rock_comp_props,
114  const double* gravity,
115  const bool disgas,
116  const bool vapoil,
117  std::shared_ptr<EclipseState> eclipse_state,
118  BlackoilOutputWriter& output_writer,
119  Opm::DeckConstPtr& deck,
120  const std::vector<double>& threshold_pressures_by_face,
121  const bool solvent);
122 
123  std::unique_ptr<Solver> createSolver(const Wells* wells);
124 
125  void handleAdditionalWellInflow(SimulatorTimer& timer,
126  WellsManager& wells_manager,
127  typename BaseType::WellState& well_state,
128  const Wells* wells);
129 
130  private:
131  bool has_solvent_;
132  DeckConstPtr deck_;
133  SolventPropsAdFromDeck solvent_props_;
134 
135  };
136 
137 } // namespace Opm
138 
140 
141 #endif // OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_HEADER_INCLUDED
Definition: GeoProps.hpp:53
Definition: BlackoilPropsAdInterface.hpp:38
Definition: AdditionalObjectDeleter.hpp:22
void handleAdditionalWellInflow(SimulatorTimer &timer, WellsManager &wells_manager, typename BaseType::WellState &well_state, const Wells *wells)
Definition: SimulatorFullyImplicitBlackoilSolvent_impl.hpp:94
Definition: BlackoilSolventState.hpp:33
A Newton solver class suitable for general fully-implicit models.
Definition: NewtonSolver.hpp:33
Class collecting all necessary components for a two-phase simulation.
Definition: SimulatorBase.hpp:84
Definition: BlackoilSolventModel.hpp:38
WellStateFullyImplicitBlackoilSolvent WellState
Definition: SimulatorFullyImplicitBlackoilSolvent.hpp:86
std::unique_ptr< Solver > createSolver(const Wells *wells)
Definition: SimulatorFullyImplicitBlackoilSolvent_impl.hpp:65
Interface class for (linear) solvers for the fully implicit black-oil system.
Definition: NewtonIterationBlackoilInterface.hpp:31
GridT Grid
Definition: SimulatorFullyImplicitBlackoilSolvent.hpp:89
BlackoilOutputWriter OutputWriter
Definition: SimulatorFullyImplicitBlackoilSolvent.hpp:88
SimulatorFullyImplicitBlackoilSolvent(const parameter::ParameterGroup &param, const GridT &grid, const DerivedGeology &geo, BlackoilPropsAdInterface &props, const SolventPropsAdFromDeck &solvent_props, const RockCompressibility *rock_comp_props, NewtonIterationBlackoilInterface &linsolver, const double *gravity, const bool disgas, const bool vapoil, std::shared_ptr< EclipseState > eclipse_state, BlackoilOutputWriter &output_writer, Opm::DeckConstPtr &deck, const std::vector< double > &threshold_pressures_by_face, const bool solvent)
Definition: SimulatorFullyImplicitBlackoilSolvent_impl.hpp:27
Definition: SimulatorBase.hpp:80
Definition: SolventPropsAdFromDeck.hpp:38
Definition: SimulatorFullyImplicitBlackoilSolvent.hpp:81
Wrapper class for VTK, Matlab, and ECL output.
Definition: SimulatorFullyImplicitBlackoilOutput.hpp:195
BlackoilSolventModel< Grid > Model
Definition: SimulatorFullyImplicitBlackoilSolvent.hpp:90
BlackoilSolventState ReservoirState
Definition: SimulatorFullyImplicitBlackoilSolvent.hpp:87
NewtonSolver< Model > Solver
Definition: SimulatorFullyImplicitBlackoilSolvent.hpp:91
Definition: WellStateFullyImplicitBlackoilSolvent.hpp:28
Traits::WellState WellState
Definition: SimulatorBase.hpp:90