Further templatized sequential model and simulator classes.

Now the actual pressure and transport model classes are not specified,
but taken as template template parameters, also grid and well model
are templates for both the sequential model and the simulator class,
although at this point only StandardWells is expected to work with
the sequential model.
This commit is contained in:
Atgeirr Flø Rasmussen 2016-07-03 08:00:59 +02:00
parent 6e66d885fb
commit 1a3c1d3058
3 changed files with 24 additions and 14 deletions

View File

@ -25,6 +25,9 @@
#include <opm/core/grid.h> #include <opm/core/grid.h>
#include <opm/autodiff/SimulatorSequentialBlackoil.hpp> #include <opm/autodiff/SimulatorSequentialBlackoil.hpp>
#include <opm/autodiff/FlowMainSequential.hpp> #include <opm/autodiff/FlowMainSequential.hpp>
#include <opm/autodiff/BlackoilPressureModel.hpp>
#include <opm/autodiff/BlackoilTransportModel.hpp>
#include <opm/autodiff/StandardWells.hpp>
// ----------------- Main program ----------------- // ----------------- Main program -----------------
@ -32,7 +35,8 @@ int
main(int argc, char** argv) main(int argc, char** argv)
{ {
typedef UnstructuredGrid Grid; typedef UnstructuredGrid Grid;
typedef Opm::SimulatorSequentialBlackoil<Grid> Simulator; typedef Opm::StandardWells WellModel;
typedef Opm::SimulatorSequentialBlackoil<Grid, WellModel, Opm::BlackoilPressureModel, Opm::BlackoilTransportModel> Simulator;
Opm::FlowMainSequential<Grid, Simulator> mainfunc; Opm::FlowMainSequential<Grid, Simulator> mainfunc;
return mainfunc.execute(argc, argv); return mainfunc.execute(argc, argv);

View File

@ -23,8 +23,6 @@
#include <opm/autodiff/BlackoilModelBase.hpp> #include <opm/autodiff/BlackoilModelBase.hpp>
#include <opm/autodiff/BlackoilPressureModel.hpp>
#include <opm/autodiff/BlackoilTransportModel.hpp>
#include <opm/core/simulator/BlackoilState.hpp> #include <opm/core/simulator/BlackoilState.hpp>
#include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp> #include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp>
#include <opm/autodiff/BlackoilModelParameters.hpp> #include <opm/autodiff/BlackoilModelParameters.hpp>
@ -44,7 +42,9 @@ namespace Opm {
/// A sequential splitting model implementation for three-phase black oil. /// A sequential splitting model implementation for three-phase black oil.
template<class Grid, class WellModel> template<class Grid, class WellModel,
template <class G, class W> class PressureModelT,
template <class G, class W> class TransportModelT>
class BlackoilSequentialModel class BlackoilSequentialModel
{ {
public: public:
@ -297,6 +297,8 @@ namespace Opm {
{ return failureReport_; } { return failureReport_; }
protected: protected:
typedef PressureModelT<Grid, WellModel> PressureModel;
typedef TransportModelT<Grid, WellModel> TransportModel;
typedef NonlinearSolver<PressureModel> PressureSolver; typedef NonlinearSolver<PressureModel> PressureSolver;
typedef NonlinearSolver<TransportModel> TransportSolver; typedef NonlinearSolver<TransportModel> TransportSolver;

View File

@ -24,32 +24,36 @@
#include <opm/autodiff/SimulatorBase.hpp> #include <opm/autodiff/SimulatorBase.hpp>
#include <opm/autodiff/NonlinearSolver.hpp> #include <opm/autodiff/NonlinearSolver.hpp>
#include <opm/autodiff/BlackoilSequentialModel.hpp> #include <opm/autodiff/BlackoilSequentialModel.hpp>
#include <opm/autodiff/StandardWells.hpp>
namespace Opm { namespace Opm {
template <class GridT> template <class GridT, class WellModelT,
template <class G, class W> class PressureModel,
template <class G, class W> class TransportModel>
class SimulatorSequentialBlackoil; class SimulatorSequentialBlackoil;
class StandardWells;
template <class GridT> template <class GridT, class WellModelT,
struct SimulatorTraits<SimulatorSequentialBlackoil<GridT> > template <class G, class W> class PressureModel,
template <class G, class W> class TransportModel>
struct SimulatorTraits<SimulatorSequentialBlackoil<GridT, WellModelT, PressureModel, TransportModel> >
{ {
typedef WellStateFullyImplicitBlackoil WellState; typedef WellStateFullyImplicitBlackoil WellState;
typedef BlackoilState ReservoirState; typedef BlackoilState ReservoirState;
typedef BlackoilOutputWriter OutputWriter; typedef BlackoilOutputWriter OutputWriter;
typedef GridT Grid; typedef GridT Grid;
typedef BlackoilSequentialModel<Grid, StandardWells> Model; typedef BlackoilSequentialModel<Grid, StandardWells, PressureModel, TransportModel> Model;
typedef NonlinearSolver<Model> Solver; typedef NonlinearSolver<Model> Solver;
typedef StandardWells WellModel; typedef WellModelT WellModel;
}; };
/// a simulator for the blackoil model /// a simulator for the blackoil model
template <class GridT> template <class GridT, class WellModelT,
template <class G, class W> class PressureModel,
template <class G, class W> class TransportModel>
class SimulatorSequentialBlackoil class SimulatorSequentialBlackoil
: public SimulatorBase<SimulatorSequentialBlackoil<GridT> > : public SimulatorBase<SimulatorSequentialBlackoil<GridT, WellModelT, PressureModel, TransportModel> >
{ {
typedef SimulatorBase<SimulatorSequentialBlackoil<GridT> > Base; typedef SimulatorBase<SimulatorSequentialBlackoil<GridT, WellModelT, PressureModel, TransportModel> > Base;
public: public:
// forward the constructor to the base class // forward the constructor to the base class
SimulatorSequentialBlackoil(const ParameterGroup& param, SimulatorSequentialBlackoil(const ParameterGroup& param,