Files
opm-simulators/opm/polymer/fullyimplicit/SimulatorFullyImplicitCompressiblePolymer.hpp

139 lines
5.6 KiB
C++
Raw Normal View History

/*
2014-02-25 09:52:10 +08:00
Copyright 2014 SINTEF ICT, Applied Mathematics.
2014-03-17 10:54:29 +08:00
Copyright 2014 STATOIL ASA.
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 <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_SIMULATORFULLYIMPLICITCOMPRESSIBLEPOLYMER_HEADER_INCLUDED
#define OPM_SIMULATORFULLYIMPLICITCOMPRESSIBLEPOLYMER_HEADER_INCLUDED
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
#include <opm/core/utility/parameters/ParameterGroup.hpp>
2015-10-12 15:24:59 +02:00
#include <opm/common/ErrorMacros.hpp>
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
#include <opm/autodiff/GeoProps.hpp>
#include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
#include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp>
#include <opm/autodiff/SimulatorBase.hpp>
#include <opm/polymer/fullyimplicit/FullyImplicitCompressiblePolymerSolver.hpp>
#include <opm/polymer/fullyimplicit/BlackoilPolymerModel.hpp>
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
#include <opm/core/grid.h>
#include <opm/core/wells.h>
#include <opm/core/pressure/flow_bc.h>
#include <opm/core/simulator/SimulatorReport.hpp>
#include <opm/simulators/timestepping/SimulatorTimer.hpp>
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
#include <opm/core/utility/StopWatch.hpp>
#include <opm/output/eclipse/EclipseIO.hpp>
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
#include <opm/core/utility/miscUtilities.hpp>
#include <opm/core/utility/miscUtilitiesBlackoil.hpp>
#include <opm/core/wells/WellsManager.hpp>
#include <opm/core/props/rock/RockCompressibility.hpp>
#include <opm/core/grid/ColumnExtract.hpp>
#include <opm/polymer/PolymerBlackoilState.hpp>
#include <opm/polymer/PolymerInflow.hpp>
#include <opm/core/simulator/WellState.hpp>
#include <opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
#include <boost/filesystem.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
#include <numeric>
#include <fstream>
#include <iostream>
namespace Opm
{
template <class GridT>
class SimulatorFullyImplicitCompressiblePolymer;
class StandardWells;
template <class GridT>
struct SimulatorTraits<SimulatorFullyImplicitCompressiblePolymer<GridT> >
{
typedef PolymerBlackoilState ReservoirState;
typedef WellStateFullyImplicitBlackoilPolymer WellState;
typedef BlackoilOutputWriter OutputWriter;
typedef GridT Grid;
typedef FullyImplicitCompressiblePolymerSolver Solver;
typedef StandardWells WellModel;
/// Dummy class, this Solver does not use a Model.
struct Model
{
typedef parameter::ParameterGroup ModelParameters;
};
};
/// Class collecting all necessary components for a two-phase simulation.
template <class GridT>
class SimulatorFullyImplicitCompressiblePolymer
: public SimulatorBase<SimulatorFullyImplicitCompressiblePolymer<GridT> >
{
typedef SimulatorFullyImplicitCompressiblePolymer ThisType;
typedef SimulatorBase<ThisType> BaseType;
typedef typename BaseType::Solver Solver;
typedef typename BaseType::WellModel WellModel;
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
public:
/// Initialise from parameters and objects to observe.
SimulatorFullyImplicitCompressiblePolymer(const parameter::ParameterGroup& param,
2015-05-29 16:31:32 +02:00
const GridT& grid,
DerivedGeology& geo,
BlackoilPropsAdFromDeck& props,
2015-05-29 16:31:32 +02:00
const PolymerPropsAd& polymer_props,
const RockCompressibility* rock_comp_props,
std::shared_ptr<EclipseState> eclipse_state,
BlackoilOutputWriter& output_writer,
const Deck& deck,
2015-05-29 16:31:32 +02:00
NewtonIterationBlackoilInterface& linsolver,
const double* gravity);
std::unique_ptr<Solver> createSolver(const WellModel& well_model);
void handleAdditionalWellInflow(SimulatorTimer& timer,
WellsManager& wells_manager,
typename BaseType::WellState& well_state,
const Wells* wells);
void updateListEconLimited(const std::unique_ptr<Solver>& solver,
const Schedule& schedule,
const int current_step,
const Wells* wells,
const WellState& well_state,
DynamicListEconLimited& list_econ_limited) const;
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
private:
const Deck& deck_;
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
const PolymerPropsAd& polymer_props_;
};
} // namespace Opm
start to use the SimulatorBase class for SimulatorFullyImplicitCompressiblePolymer since SimulatorFullyImplicitCompressiblePolymer is now a template, the opaque pointer stuff is also removed and the contents of the .cpp file basically became _impl.hpp. for SimulatorFullyImplicitBlackoilPolymer, the opaque pointer stuff was removed for the same reasons as for SimulatorFullyImplicitBlackoil. the actual unification of code is not yet done, but this patch points out the direction of where this will go. Also note that some synchronization with the ordinary blackoil simulator (FLOW) was necessary to make it compile. Finnally, the parser currently likes to throw an exception (also for the opm-polymer master) when eating the opm-data polymer test case. This prevented me from properly testing this patch: ``` and@heuristix:~/src/opm-polymer|simplify_simulator > ./bin/flow_polymer deck_filename=/home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA ================ Test program for fully implicit three-phase black-oil flow =============== --------------- Reading parameters --------------- deck_filename found at /, value is /home/and/src/opm-data/polymer_test_suit/simple2D/2D_THREEPHASE_POLY_HETER.DATA output not found. Using default value 'true'. output_dir not found. Using default value 'output'. Program threw an exception: IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported terminate called after throwing an instance of 'std::runtime_error' what(): IOConfig: Reading GRIDFILE keyword from GRID section: Output of GRID file is not supported Aborted ```
2015-05-27 15:41:01 +02:00
#include "SimulatorFullyImplicitCompressiblePolymer_impl.hpp"
#endif // OPM_SIMULATORFULLYIMPLICITCOMPRESSIBLEPOLYMER_HEADER_INCLUDED