diff --git a/Makefile.am b/Makefile.am index db4a48f5..259f03bd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -109,6 +109,7 @@ opm/core/pressure/ifsh.c \ opm/core/pressure/mimetic/mimetic.c \ opm/core/pressure/mimetic/hybsys_global.c \ opm/core/pressure/mimetic/hybsys.c \ +opm/core/simulator/SimulatorTwophase.cpp \ opm/core/transport/spu_explicit.c \ opm/core/transport/spu_implicit.c \ opm/core/transport/transport_source.c \ @@ -201,9 +202,6 @@ opm/core/wells/InjectionSpecification.hpp \ opm/core/wells/ProductionSpecification.hpp \ opm/core/GridAdapter.hpp \ opm/core/GridManager.hpp \ -opm/core/simulator/BlackoilState.hpp \ -opm/core/simulator/TwophaseState.hpp \ -opm/core/simulator/WellState.hpp \ opm/core/pressure/fsh.h \ opm/core/pressure/HybridPressureSolver.hpp \ opm/core/pressure/IncompTpfa.hpp \ @@ -230,6 +228,10 @@ opm/core/pressure/fsh_common_impl.h \ opm/core/pressure/mimetic/hybsys_global.h \ opm/core/pressure/mimetic/hybsys.h \ opm/core/pressure/mimetic/mimetic.h \ +opm/core/simulator/BlackoilState.hpp \ +opm/core/simulator/SimulatorTwophase.hpp \ +opm/core/simulator/TwophaseState.hpp \ +opm/core/simulator/WellState.hpp \ opm/core/transport/ImplicitTransport.hpp \ opm/core/transport/CSRMatrixUmfpackSolver.hpp \ opm/core/transport/CSRMatrixBlockAssembler.hpp \ diff --git a/opm/core/simulator/SimulatorTwophase.cpp b/opm/core/simulator/SimulatorTwophase.cpp new file mode 100644 index 00000000..a83b57b7 --- /dev/null +++ b/opm/core/simulator/SimulatorTwophase.cpp @@ -0,0 +1,112 @@ +/* + Copyright 2012 SINTEF ICT, Applied Mathematics. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#include +#include + +namespace Opm +{ + + class SimulatorTwophase::Impl + { + public: + Impl() {} + void init(const parameter::ParameterGroup& param); + void run(const SimulatorTimer& timer, const Wells& wells, TwophaseState& state, WellState& well_state); + private: +#if 0 + bool output_; + std::string output_dir_; + int output_interval; + int num_transport_substeps_; + double gravity_[3]; + bool use_gravity_; + bool use_segregation_split = false; // + int nl_pressure_maxiter = 0; + double nl_pressure_tolerance = 0.0; + const double nl_tolerance = param.getDefault("nl_tolerance", 1e-9); + const int nl_maxiter = param.getDefault("nl_maxiter", 30); + + // boost::scoped_ptr grid_; + // boost::scoped_ptr props_; + // boost::scoped_ptr wells_; + // boost::scoped_ptr rock_comp_; + // Opm::SimulatorTimer simtimer_; + // Opm::TwophaseState state_; + // std::vector src(num_cells, 0.0); + // Opm::FlowBCManager bcs; + // Opm::LinearSolverFactory linsolver(param); + + + + + std::vector totmob; + std::vector omega; // Will remain empty if no gravity. + std::vector rc; // Will remain empty if no rock compressibility. + std::vector porevol; + double tot_porevol_init = std::accumulate(porevol.begin(), porevol.end(), 0.0); + std::vector transport_src; + + Opm::IncompTpfa psolver(*grid->c_grid(), props->permeability(), grav, linsolver); + + Opm::TransportModelTwophase tsolver(*grid->c_grid(), *props, nl_tolerance, nl_maxiter); + + typedef std::pair, std::vector > > ColMap; + ColMap columns; + + std::vector allcells(num_cells); +#endif + }; + + SimulatorTwophase::SimulatorTwophase() + { + pimpl_.reset(new Impl); + } + + + + void SimulatorTwophase::init(const parameter::ParameterGroup& param) + { + pimpl_->init(param); + } + + + + void SimulatorTwophase::run(const SimulatorTimer& timer, const Wells& wells, TwophaseState& state, WellState& well_state) + { + pimpl_->run(timer, wells, state, well_state); + } + + + + void SimulatorTwophase::Impl::init(const parameter::ParameterGroup& /*param*/) + { + } + + + + void SimulatorTwophase::Impl::run(const SimulatorTimer& timer, const Wells& wells, TwophaseState& state, WellState& well_state) + { + (void) timer; + (void) wells; + (void) state; + (void) well_state; + } + +} // namespace Opm diff --git a/opm/core/simulator/SimulatorTwophase.hpp b/opm/core/simulator/SimulatorTwophase.hpp new file mode 100644 index 00000000..636d4f94 --- /dev/null +++ b/opm/core/simulator/SimulatorTwophase.hpp @@ -0,0 +1,62 @@ +/* + Copyright 2012 SINTEF ICT, Applied Mathematics. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#ifndef OPM_SIMULATORTWOPHASE_HEADER_INCLUDED +#define OPM_SIMULATORTWOPHASE_HEADER_INCLUDED + +#include + +struct UnstructuredGrid; +struct Wells; + +namespace Opm +{ + namespace parameter { class ParameterGroup; } + class SimulatorTimer; + class TwophaseState; + class WellState; + + /// Class collecting all necessary components for a two-phase simulation. + class SimulatorTwophase + { + public: + /// Default constructor. + SimulatorTwophase(); + + /// Initialise from parameters. + void init(const parameter::ParameterGroup& param); + + /// Run the simulation. + /// \param[in] timer governs the requested reporting timesteps + /// \param[in] wells data structure for wells + /// \param[out] state state of reservoir: pressure, fluxes + /// \param[out] well_state state of wells: bhp, perforation rates + void run(const SimulatorTimer& timer, + const Wells& wells, + TwophaseState& state, + WellState& well_state); + + private: + class Impl; + boost::scoped_ptr pimpl_; + }; + +} // namespace Opm + +#endif // OPM_SIMULATORTWOPHASE_HEADER_INCLUDED