RESV: Prepare for dynamic rate distribution calculation

This commit changes the API of class SimulatorFullyImplicitBlackoil<>
in order to support wells controlled by (total) reservoir voidage
volume rates.  Specifically, we switch to holding a mutable Wells
object (backed by a std::shared_ptr<>) in class Impl rather than a
reference to a WellsManager.  This allows dynamically updating rate
distributions and targets of individual well controls.  That, in
turn, is a prerequisite to supporting ECL-style "RESV" control
modes--be it in prediction or history matching capacity.

While in the process of API changes, also prepare for the second
stage of "WCONHIST/RESV" support: Accept a ScheduleConstPtr that
holds the input deck's notion of the history matching vs. prediction
controls.  We need to distinguish the two in order to support the
exact semantics of "WCONHIST/RESV".

Update SimFIBO<> clients accordingly.
This commit is contained in:
Bård Skaflestad 2014-07-03 15:09:50 +02:00
parent 91567a9857
commit 23520be41a
4 changed files with 26 additions and 17 deletions

View File

@ -226,11 +226,12 @@ try
// Create and run simulator.
SimulatorFullyImplicitBlackoil<UnstructuredGrid> simulator(param,
eclipseState->getSchedule(),
*grid->c_grid(),
geology,
*new_props,
rock_comp->isActive() ? rock_comp.get() : 0,
wells,
wells.c_wells(),
*fis_solver,
grav,
deck->hasKeyword("DISGAS"),

View File

@ -272,11 +272,12 @@ try
}
SimulatorFullyImplicitBlackoil<Dune::CpGrid> simulator(param,
eclipseState->getSchedule(),
*grid,
geology,
*new_props,
rock_comp->isActive() ? rock_comp.get() : 0,
wells,
wells.c_wells(),
*fis_solver,
grav,
deck->hasKeyword("DISGAS"),

View File

@ -33,13 +33,15 @@ namespace Opm
class BlackoilPropsAdInterface;
class RockCompressibility;
class DerivedGeology;
class WellsManager;
class NewtonIterationBlackoilInterface;
class SimulatorTimer;
class BlackoilState;
class WellStateFullyImplicitBlackoil;
struct SimulatorReport;
class Schedule;
typedef std::shared_ptr<const Schedule> ScheduleConstPtr;
/// Class collecting all necessary components for a two-phase simulation.
template<class T>
class SimulatorFullyImplicitBlackoil
@ -63,18 +65,20 @@ namespace Opm
/// use_segregation_split (false) solve for gravity segregation (if false,
/// segregation is ignored).
///
/// \param[in] schedule Simulation schedule
/// \param[in] grid grid data structure
/// \param[in] props fluid and rock properties
/// \param[in] rock_comp_props if non-null, rock compressibility properties
/// \param[in] well_manager well manager, may manage no (null) wells
/// \param[in] wells Collection of wells. Null if no wells.
/// \param[in] linsolver linear solver
/// \param[in] gravity if non-null, gravity vector
SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param,
ScheduleConstPtr schedule,
const Grid& grid,
const DerivedGeology& geo,
BlackoilPropsAdInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
const Wells* wells,
NewtonIterationBlackoilInterface& linsolver,
const double* gravity,
const bool disgas,

View File

@ -37,13 +37,13 @@
#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/simulator/BlackoilState.hpp>
#include <opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
@ -60,11 +60,12 @@ namespace Opm
{
public:
Impl(const parameter::ParameterGroup& param,
ScheduleConstPtr schedule,
const Grid& grid,
const DerivedGeology& geo,
BlackoilPropsAdInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
const Wells* wells,
NewtonIterationBlackoilInterface& linsolver,
const double* gravity,
bool has_disgas,
@ -83,11 +84,11 @@ namespace Opm
std::string output_dir_;
int output_interval_;
// Observed objects.
ScheduleConstPtr schedule_;
const Grid& grid_;
BlackoilPropsAdInterface& props_;
const RockCompressibility* rock_comp_props_;
WellsManager& wells_manager_;
const Wells* wells_;
std::shared_ptr<Wells> wells_;
const double* gravity_;
// Solvers
const DerivedGeology &geo_;
@ -101,18 +102,19 @@ namespace Opm
template<class T>
SimulatorFullyImplicitBlackoil<T>::SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param,
ScheduleConstPtr schedule,
const Grid& grid,
const DerivedGeology& geo,
BlackoilPropsAdInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
const Wells* wells,
NewtonIterationBlackoilInterface& linsolver,
const double* gravity,
const bool has_disgas,
const bool has_vapoil )
{
pimpl_.reset(new Impl(param, grid, geo, props, rock_comp_props, wells_manager, linsolver, gravity, has_disgas, has_vapoil));
pimpl_.reset(new Impl(param, schedule, grid, geo, props, rock_comp_props, wells, linsolver, gravity, has_disgas, has_vapoil));
}
@ -189,23 +191,24 @@ namespace Opm
// \TODO: Treat bcs.
template<class T>
SimulatorFullyImplicitBlackoil<T>::Impl::Impl(const parameter::ParameterGroup& param,
ScheduleConstPtr schedule,
const Grid& grid,
const DerivedGeology& geo,
BlackoilPropsAdInterface& props,
const RockCompressibility* rock_comp_props,
WellsManager& wells_manager,
const Wells* wells,
NewtonIterationBlackoilInterface& linsolver,
const double* gravity,
const bool has_disgas,
const bool has_vapoil)
: grid_(grid),
: schedule_(schedule)
, grid_(grid),
props_(props),
rock_comp_props_(rock_comp_props),
wells_manager_(wells_manager),
wells_(wells_manager.c_wells()),
wells_(clone_wells(wells), & destroy_wells),
gravity_(gravity),
geo_(geo),
solver_(param, grid_, props_, geo_, rock_comp_props, *wells_manager.c_wells(), linsolver, has_disgas, has_vapoil)
solver_(param, grid_, props_, geo_, rock_comp_props, *wells_, linsolver, has_disgas, has_vapoil)
{
// For output.
output_ = param.getDefault("output", true);