pass the DerivedGeology to the simulators

this was decided to be a good idea by [at]bska. (If I interpreted him
correctly, obviously.)
This commit is contained in:
Andreas Lauser 2014-07-04 16:38:24 +02:00
parent d2b529296f
commit 543d8d75b6
7 changed files with 28 additions and 7 deletions

View File

@ -45,6 +45,7 @@
#include <opm/core/simulator/BlackoilState.hpp>
#include <opm/core/simulator/WellState.hpp>
#include <opm/autodiff/SimulatorCompressibleAd.hpp>
#include <opm/autodiff/GeoProps.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
@ -208,11 +209,13 @@ try
std::cout << "\n\n================ Starting main simulation loop ===============\n";
SimulatorReport rep;
Opm::DerivedGeology geology(*grid->c_grid(), *props);
if (!use_deck) {
// Simple simulation without a deck.
WellsManager wells(simple_wells);
SimulatorCompressibleAd simulator(param,
*grid->c_grid(),
geology,
*props,
rock_comp->isActive() ? rock_comp.get() : 0,
wells,
@ -250,6 +253,7 @@ try
// Create and run simulator.
SimulatorCompressibleAd simulator(param,
*grid->c_grid(),
geology,
*props,
rock_comp->isActive() ? rock_comp.get() : 0,
wells,

View File

@ -193,6 +193,8 @@ try
// initialize variables
simtimer.init(timeMap);
Opm::DerivedGeology geology(*grid->c_grid(), *new_props);
SimulatorReport fullReport;
for (size_t reportStepIdx = 0; reportStepIdx < timeMap->numTimesteps(); ++reportStepIdx) {
// Report on start of a report step.
@ -224,6 +226,7 @@ try
// Create and run simulator.
SimulatorFullyImplicitBlackoil<UnstructuredGrid> simulator(param,
*grid->c_grid(),
geology,
*new_props,
rock_comp->isActive() ? rock_comp.get() : 0,
wells,

View File

@ -230,12 +230,14 @@ try
<< std::flush;
WellStateFullyImplicitBlackoil well_state;
Opm::TimeMapPtr timeMap(new Opm::TimeMap(deck));
Opm::TimeMapConstPtr timeMap(eclipseState->getSchedule()->getTimeMap());
SimulatorTimer simtimer;
// initialize variables
simtimer.init(timeMap);
Opm::DerivedGeology geology(*grid, *new_props);
SimulatorReport fullReport;
for (size_t reportStepIdx = 0; reportStepIdx < timeMap->numTimesteps(); ++reportStepIdx) {
// Report on start of a report step.
@ -271,6 +273,7 @@ try
SimulatorFullyImplicitBlackoil<Dune::CpGrid> simulator(param,
*grid,
geology,
*new_props,
rock_comp->isActive() ? rock_comp.get() : 0,
wells,

View File

@ -67,6 +67,7 @@ namespace Opm
public:
Impl(const parameter::ParameterGroup& param,
const UnstructuredGrid& grid,
const DerivedGeology& geo,
const BlackoilPropertiesInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
@ -100,7 +101,7 @@ namespace Opm
const double* gravity_;
// Solvers
BlackoilPropsAd fluid_;
DerivedGeology geo_;
const DerivedGeology& geo_;
ImpesTPFAAD psolver_;
TransportSolverCompressibleTwophaseReorder tsolver_;
// Needed by column-based gravity segregation solver.
@ -114,13 +115,14 @@ namespace Opm
SimulatorCompressibleAd::SimulatorCompressibleAd(const parameter::ParameterGroup& param,
const UnstructuredGrid& grid,
const DerivedGeology& geo,
const BlackoilPropertiesInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
LinearSolverInterface& linsolver,
const double* gravity)
{
pimpl_.reset(new Impl(param, grid, props, rock_comp_props, wells_manager, linsolver, gravity));
pimpl_.reset(new Impl(param, grid, geo, props, rock_comp_props, wells_manager, linsolver, gravity));
}
@ -232,6 +234,7 @@ namespace Opm
// \TODO: make CompressibleTpfa take bcs.
SimulatorCompressibleAd::Impl::Impl(const parameter::ParameterGroup& param,
const UnstructuredGrid& grid,
const DerivedGeology& geo,
const BlackoilPropertiesInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
@ -244,7 +247,7 @@ namespace Opm
wells_(wells_manager.c_wells()),
gravity_(gravity),
fluid_(props_),
geo_(grid_, fluid_, gravity_),
geo_(geo),
psolver_(grid_, fluid_, geo_, *wells_manager.c_wells(), linsolver),
/* param.getDefault("nl_pressure_residual_tolerance", 0.0),
param.getDefault("nl_pressure_change_tolerance", 1.0),

View File

@ -31,6 +31,7 @@ namespace Opm
{
namespace parameter { class ParameterGroup; }
class BlackoilPropertiesInterface;
class DerivedGeology;
class RockCompressibility;
class WellsManager;
class LinearSolverInterface;
@ -60,6 +61,7 @@ namespace Opm
/// segregation is ignored).
///
/// \param[in] grid grid data structure
/// \param[in] geo the "ready to use" geological properties of the reservoir
/// \param[in] props fluid and rock properties
/// \param[in] rock_comp_props if non-null, rock compressibility properties
/// \param[in] well_manager well manager
@ -67,6 +69,7 @@ namespace Opm
/// \param[in] gravity if non-null, gravity vector
SimulatorCompressibleAd(const parameter::ParameterGroup& param,
const UnstructuredGrid& grid,
const DerivedGeology& geo,
const BlackoilPropertiesInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,

View File

@ -32,6 +32,7 @@ namespace Opm
namespace parameter { class ParameterGroup; }
class BlackoilPropsAdInterface;
class RockCompressibility;
class DerivedGeology;
class WellsManager;
class NewtonIterationBlackoilInterface;
class SimulatorTimer;
@ -70,6 +71,7 @@ namespace Opm
/// \param[in] gravity if non-null, gravity vector
SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param,
const Grid& grid,
const DerivedGeology& geo,
BlackoilPropsAdInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,

View File

@ -62,6 +62,7 @@ namespace Opm
public:
Impl(const parameter::ParameterGroup& param,
const Grid& grid,
const DerivedGeology& geo,
BlackoilPropsAdInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
@ -93,7 +94,7 @@ namespace Opm
const Wells* wells_;
const double* gravity_;
// Solvers
DerivedGeology geo_;
const DerivedGeology &geo_;
FullyImplicitBlackoilSolver<Grid> solver_;
// Misc. data
std::vector<int> allcells_;
@ -105,6 +106,7 @@ namespace Opm
template<class T>
SimulatorFullyImplicitBlackoil<T>::SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param,
const Grid& grid,
const DerivedGeology& geo,
BlackoilPropsAdInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
@ -114,7 +116,7 @@ namespace Opm
const bool has_vapoil )
{
pimpl_.reset(new Impl(param, grid, props, rock_comp_props, wells_manager, linsolver, gravity, has_disgas, has_vapoil));
pimpl_.reset(new Impl(param, grid, geo, props, rock_comp_props, wells_manager, linsolver, gravity, has_disgas, has_vapoil));
}
@ -192,6 +194,7 @@ namespace Opm
template<class T>
SimulatorFullyImplicitBlackoil<T>::Impl::Impl(const parameter::ParameterGroup& param,
const Grid& grid,
const DerivedGeology& geo,
BlackoilPropsAdInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
@ -205,7 +208,7 @@ namespace Opm
wells_manager_(wells_manager),
wells_(wells_manager.c_wells()),
gravity_(gravity),
geo_(grid_, props_, gravity_),
geo_(geo),
solver_(param, grid_, props_, geo_, rock_comp_props, *wells_manager.c_wells(), linsolver, has_disgas, has_vapoil)
/* param.getDefault("nl_pressure_residual_tolerance", 0.0),
param.getDefault("nl_pressure_change_tolerance", 1.0),