00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_HEADER_INCLUDED
00021 #define OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_HEADER_INCLUDED
00022
00023 #include <opm/autodiff/SimulatorBase.hpp>
00024 #include <opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp>
00025 #include <opm/autodiff/BlackoilSolventModel.hpp>
00026
00027 #include <opm/core/utility/parameters/ParameterGroup.hpp>
00028 #include <opm/common/ErrorMacros.hpp>
00029
00030 #include <opm/autodiff/GeoProps.hpp>
00031 #include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
00032 #include <opm/autodiff/SolventPropsAdFromDeck.hpp>
00033 #include <opm/autodiff/RateConverter.hpp>
00034 #include <opm/autodiff/NonlinearSolver.hpp>
00035 #include <opm/autodiff/WellStateFullyImplicitBlackoilSolvent.hpp>
00036
00037 #include <opm/core/grid.h>
00038 #include <opm/core/wells.h>
00039 #include <opm/core/well_controls.h>
00040 #include <opm/core/pressure/flow_bc.h>
00041
00042 #include <opm/core/simulator/SimulatorReport.hpp>
00043 #include <opm/simulators/timestepping/SimulatorTimer.hpp>
00044
00045 #include <opm/core/utility/StopWatch.hpp>
00046 #include <opm/core/utility/miscUtilities.hpp>
00047 #include <opm/core/utility/miscUtilitiesBlackoil.hpp>
00048
00049 #include <opm/core/props/rock/RockCompressibility.hpp>
00050
00051
00052
00053
00054 #include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
00055 #include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
00056 #include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
00057 #include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp>
00058 #include <opm/parser/eclipse/Deck/Deck.hpp>
00059
00060 #include <boost/filesystem.hpp>
00061 #include <boost/lexical_cast.hpp>
00062
00063 #include <algorithm>
00064 #include <cstddef>
00065 #include <cassert>
00066 #include <functional>
00067 #include <memory>
00068 #include <numeric>
00069 #include <fstream>
00070 #include <iostream>
00071 #include <string>
00072 #include <unordered_map>
00073 #include <utility>
00074 #include <vector>
00075
00076 namespace Opm
00077 {
00078 template <class GridT>
00079 class SimulatorFullyImplicitBlackoilSolvent;
00080
00081 class StandardWellsSolvent;
00082
00083 template<class GridT>
00084 struct SimulatorTraits<SimulatorFullyImplicitBlackoilSolvent<GridT> >
00085 {
00086 typedef WellStateFullyImplicitBlackoilSolvent WellState;
00087 typedef BlackoilState ReservoirState;
00088 typedef BlackoilOutputWriter OutputWriter;
00089 typedef GridT Grid;
00090 typedef BlackoilSolventModel<Grid> Model;
00091 typedef NonlinearSolver<Model> Solver;
00092 typedef StandardWellsSolvent WellModel;
00093
00094 };
00095
00098 template <class GridT>
00099 class SimulatorFullyImplicitBlackoilSolvent
00100 : public SimulatorBase<SimulatorFullyImplicitBlackoilSolvent<GridT> >
00101 {
00102 typedef SimulatorFullyImplicitBlackoilSolvent<GridT> ThisType;
00103 typedef SimulatorBase<ThisType> BaseType;
00104
00105 typedef SimulatorTraits<ThisType> Traits;
00106 typedef typename Traits::Solver Solver;
00107 typedef typename Traits::WellModel WellModel;
00108
00109 public:
00110 SimulatorFullyImplicitBlackoilSolvent(const ParameterGroup& param,
00111 const GridT& grid,
00112 DerivedGeology& geo,
00113 BlackoilPropsAdFromDeck& props,
00114 const SolventPropsAdFromDeck& solvent_props,
00115 const RockCompressibility* rock_comp_props,
00116 NewtonIterationBlackoilInterface& linsolver,
00117 const double* gravity,
00118 const bool disgas,
00119 const bool vapoil,
00120 std::shared_ptr<EclipseState> eclipse_state,
00121 BlackoilOutputWriter& output_writer,
00122 std::shared_ptr< Deck > deck,
00123 const std::vector<double>& threshold_pressures_by_face,
00124 const bool solvent);
00125
00126 std::unique_ptr<Solver> createSolver(const WellModel& well_model);
00127
00128 void handleAdditionalWellInflow(SimulatorTimer& timer,
00129 WellsManager& wells_manager,
00130 typename BaseType::WellState& well_state,
00131 const Wells* wells);
00132
00133 private:
00134 bool has_solvent_;
00135 std::shared_ptr< Deck > deck_;
00136 SolventPropsAdFromDeck solvent_props_;
00137 bool is_miscible_;
00138
00139 };
00140
00141 }
00142
00143 #include "SimulatorFullyImplicitBlackoilSolvent_impl.hpp"
00144
00145 #endif // OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_HEADER_INCLUDED