mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
91567a9857
commit
23520be41a
@ -226,11 +226,12 @@ try
|
|||||||
|
|
||||||
// Create and run simulator.
|
// Create and run simulator.
|
||||||
SimulatorFullyImplicitBlackoil<UnstructuredGrid> simulator(param,
|
SimulatorFullyImplicitBlackoil<UnstructuredGrid> simulator(param,
|
||||||
|
eclipseState->getSchedule(),
|
||||||
*grid->c_grid(),
|
*grid->c_grid(),
|
||||||
geology,
|
geology,
|
||||||
*new_props,
|
*new_props,
|
||||||
rock_comp->isActive() ? rock_comp.get() : 0,
|
rock_comp->isActive() ? rock_comp.get() : 0,
|
||||||
wells,
|
wells.c_wells(),
|
||||||
*fis_solver,
|
*fis_solver,
|
||||||
grav,
|
grav,
|
||||||
deck->hasKeyword("DISGAS"),
|
deck->hasKeyword("DISGAS"),
|
||||||
|
@ -272,11 +272,12 @@ try
|
|||||||
}
|
}
|
||||||
|
|
||||||
SimulatorFullyImplicitBlackoil<Dune::CpGrid> simulator(param,
|
SimulatorFullyImplicitBlackoil<Dune::CpGrid> simulator(param,
|
||||||
|
eclipseState->getSchedule(),
|
||||||
*grid,
|
*grid,
|
||||||
geology,
|
geology,
|
||||||
*new_props,
|
*new_props,
|
||||||
rock_comp->isActive() ? rock_comp.get() : 0,
|
rock_comp->isActive() ? rock_comp.get() : 0,
|
||||||
wells,
|
wells.c_wells(),
|
||||||
*fis_solver,
|
*fis_solver,
|
||||||
grav,
|
grav,
|
||||||
deck->hasKeyword("DISGAS"),
|
deck->hasKeyword("DISGAS"),
|
||||||
|
@ -33,13 +33,15 @@ namespace Opm
|
|||||||
class BlackoilPropsAdInterface;
|
class BlackoilPropsAdInterface;
|
||||||
class RockCompressibility;
|
class RockCompressibility;
|
||||||
class DerivedGeology;
|
class DerivedGeology;
|
||||||
class WellsManager;
|
|
||||||
class NewtonIterationBlackoilInterface;
|
class NewtonIterationBlackoilInterface;
|
||||||
class SimulatorTimer;
|
class SimulatorTimer;
|
||||||
class BlackoilState;
|
class BlackoilState;
|
||||||
class WellStateFullyImplicitBlackoil;
|
class WellStateFullyImplicitBlackoil;
|
||||||
struct SimulatorReport;
|
struct SimulatorReport;
|
||||||
|
|
||||||
|
class Schedule;
|
||||||
|
typedef std::shared_ptr<const Schedule> ScheduleConstPtr;
|
||||||
|
|
||||||
/// Class collecting all necessary components for a two-phase simulation.
|
/// Class collecting all necessary components for a two-phase simulation.
|
||||||
template<class T>
|
template<class T>
|
||||||
class SimulatorFullyImplicitBlackoil
|
class SimulatorFullyImplicitBlackoil
|
||||||
@ -63,18 +65,20 @@ namespace Opm
|
|||||||
/// use_segregation_split (false) solve for gravity segregation (if false,
|
/// use_segregation_split (false) solve for gravity segregation (if false,
|
||||||
/// segregation is ignored).
|
/// segregation is ignored).
|
||||||
///
|
///
|
||||||
|
/// \param[in] schedule Simulation schedule
|
||||||
/// \param[in] grid grid data structure
|
/// \param[in] grid grid data structure
|
||||||
/// \param[in] props fluid and rock properties
|
/// \param[in] props fluid and rock properties
|
||||||
/// \param[in] rock_comp_props if non-null, rock compressibility 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] linsolver linear solver
|
||||||
/// \param[in] gravity if non-null, gravity vector
|
/// \param[in] gravity if non-null, gravity vector
|
||||||
SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param,
|
SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param,
|
||||||
|
ScheduleConstPtr schedule,
|
||||||
const Grid& grid,
|
const Grid& grid,
|
||||||
const DerivedGeology& geo,
|
const DerivedGeology& geo,
|
||||||
BlackoilPropsAdInterface& props,
|
BlackoilPropsAdInterface& props,
|
||||||
const RockCompressibility* rock_comp_props,
|
const RockCompressibility* rock_comp_props,
|
||||||
WellsManager& wells_manager,
|
const Wells* wells,
|
||||||
NewtonIterationBlackoilInterface& linsolver,
|
NewtonIterationBlackoilInterface& linsolver,
|
||||||
const double* gravity,
|
const double* gravity,
|
||||||
const bool disgas,
|
const bool disgas,
|
||||||
|
@ -37,13 +37,13 @@
|
|||||||
#include <opm/core/utility/miscUtilities.hpp>
|
#include <opm/core/utility/miscUtilities.hpp>
|
||||||
#include <opm/core/utility/miscUtilitiesBlackoil.hpp>
|
#include <opm/core/utility/miscUtilitiesBlackoil.hpp>
|
||||||
|
|
||||||
#include <opm/core/wells/WellsManager.hpp>
|
|
||||||
|
|
||||||
#include <opm/core/props/rock/RockCompressibility.hpp>
|
#include <opm/core/props/rock/RockCompressibility.hpp>
|
||||||
|
|
||||||
#include <opm/core/simulator/BlackoilState.hpp>
|
#include <opm/core/simulator/BlackoilState.hpp>
|
||||||
#include <opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp>
|
#include <opm/core/transport/reorder/TransportSolverCompressibleTwophaseReorder.hpp>
|
||||||
|
|
||||||
|
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||||
|
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
@ -60,11 +60,12 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Impl(const parameter::ParameterGroup& param,
|
Impl(const parameter::ParameterGroup& param,
|
||||||
|
ScheduleConstPtr schedule,
|
||||||
const Grid& grid,
|
const Grid& grid,
|
||||||
const DerivedGeology& geo,
|
const DerivedGeology& geo,
|
||||||
BlackoilPropsAdInterface& props,
|
BlackoilPropsAdInterface& props,
|
||||||
const RockCompressibility* rock_comp_props,
|
const RockCompressibility* rock_comp_props,
|
||||||
WellsManager& wells_manager,
|
const Wells* wells,
|
||||||
NewtonIterationBlackoilInterface& linsolver,
|
NewtonIterationBlackoilInterface& linsolver,
|
||||||
const double* gravity,
|
const double* gravity,
|
||||||
bool has_disgas,
|
bool has_disgas,
|
||||||
@ -83,11 +84,11 @@ namespace Opm
|
|||||||
std::string output_dir_;
|
std::string output_dir_;
|
||||||
int output_interval_;
|
int output_interval_;
|
||||||
// Observed objects.
|
// Observed objects.
|
||||||
|
ScheduleConstPtr schedule_;
|
||||||
const Grid& grid_;
|
const Grid& grid_;
|
||||||
BlackoilPropsAdInterface& props_;
|
BlackoilPropsAdInterface& props_;
|
||||||
const RockCompressibility* rock_comp_props_;
|
const RockCompressibility* rock_comp_props_;
|
||||||
WellsManager& wells_manager_;
|
std::shared_ptr<Wells> wells_;
|
||||||
const Wells* wells_;
|
|
||||||
const double* gravity_;
|
const double* gravity_;
|
||||||
// Solvers
|
// Solvers
|
||||||
const DerivedGeology &geo_;
|
const DerivedGeology &geo_;
|
||||||
@ -101,18 +102,19 @@ namespace Opm
|
|||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
SimulatorFullyImplicitBlackoil<T>::SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param,
|
SimulatorFullyImplicitBlackoil<T>::SimulatorFullyImplicitBlackoil(const parameter::ParameterGroup& param,
|
||||||
|
ScheduleConstPtr schedule,
|
||||||
const Grid& grid,
|
const Grid& grid,
|
||||||
const DerivedGeology& geo,
|
const DerivedGeology& geo,
|
||||||
BlackoilPropsAdInterface& props,
|
BlackoilPropsAdInterface& props,
|
||||||
const RockCompressibility* rock_comp_props,
|
const RockCompressibility* rock_comp_props,
|
||||||
WellsManager& wells_manager,
|
const Wells* wells,
|
||||||
NewtonIterationBlackoilInterface& linsolver,
|
NewtonIterationBlackoilInterface& linsolver,
|
||||||
const double* gravity,
|
const double* gravity,
|
||||||
const bool has_disgas,
|
const bool has_disgas,
|
||||||
const bool has_vapoil )
|
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.
|
// \TODO: Treat bcs.
|
||||||
template<class T>
|
template<class T>
|
||||||
SimulatorFullyImplicitBlackoil<T>::Impl::Impl(const parameter::ParameterGroup& param,
|
SimulatorFullyImplicitBlackoil<T>::Impl::Impl(const parameter::ParameterGroup& param,
|
||||||
|
ScheduleConstPtr schedule,
|
||||||
const Grid& grid,
|
const Grid& grid,
|
||||||
const DerivedGeology& geo,
|
const DerivedGeology& geo,
|
||||||
BlackoilPropsAdInterface& props,
|
BlackoilPropsAdInterface& props,
|
||||||
const RockCompressibility* rock_comp_props,
|
const RockCompressibility* rock_comp_props,
|
||||||
WellsManager& wells_manager,
|
const Wells* wells,
|
||||||
NewtonIterationBlackoilInterface& linsolver,
|
NewtonIterationBlackoilInterface& linsolver,
|
||||||
const double* gravity,
|
const double* gravity,
|
||||||
const bool has_disgas,
|
const bool has_disgas,
|
||||||
const bool has_vapoil)
|
const bool has_vapoil)
|
||||||
: grid_(grid),
|
: schedule_(schedule)
|
||||||
|
, grid_(grid),
|
||||||
props_(props),
|
props_(props),
|
||||||
rock_comp_props_(rock_comp_props),
|
rock_comp_props_(rock_comp_props),
|
||||||
wells_manager_(wells_manager),
|
wells_(clone_wells(wells), & destroy_wells),
|
||||||
wells_(wells_manager.c_wells()),
|
|
||||||
gravity_(gravity),
|
gravity_(gravity),
|
||||||
geo_(geo),
|
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.
|
// For output.
|
||||||
output_ = param.getDefault("output", true);
|
output_ = param.getDefault("output", true);
|
||||||
|
Loading…
Reference in New Issue
Block a user