adapted to the interface change of WellsManager

At the moment, for the ParallelDebugOutput, we put a dummy
dyanmic_list_econ_limited, not sure how it will the parallel running.

The basic problem is that when initialzing the globalWellState_, what
will happen if they can not find state information for a well in the Wells*.

If some defaulted values are used, then no big problem here.
This commit is contained in:
Kai Bao 2016-06-27 13:39:25 +02:00
parent b4df2ccff0
commit 18fa442721
5 changed files with 21 additions and 1 deletions

View File

@ -28,6 +28,7 @@
#include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp>
#include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp>
#include <opm/core/wells/DynamicListEconLimited.hpp>
#if HAVE_OPM_GRID
#include <dune/grid/common/p2pcommunicator.hh>
@ -523,6 +524,10 @@ namespace Opm
if( isIORank() )
{
Dune::CpGrid& globalGrid = *grid_;
// TODO: make a dummy DynamicListEconLimited here for NOW for compilation and development
// TODO: NOT SURE whether it will cause problem for parallel running
// TODO: TO BE TESTED AND IMPROVED
const DynamicListEconLimited dynamic_list_econ_limited;
// Create wells and well state.
WellsManager wells_manager(eclipseState_,
reportStep,
@ -533,6 +538,7 @@ namespace Opm
Opm::UgGridHelpers::cell2Faces( globalGrid ),
Opm::UgGridHelpers::beginFaceCentroids( globalGrid ),
permeability_,
dynamic_list_econ_limited,
false);
const Wells* wells = wells_manager.c_wells();

View File

@ -25,6 +25,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
#include <opm/core/utility/initHydroCarbonState.hpp>
#include <opm/core/well_controls.h>
#include <opm/core/wells/DynamicListEconLimited.hpp>
namespace Opm
{
@ -131,6 +132,7 @@ namespace Opm
unsigned int totalLinearIterations = 0;
bool is_well_potentials_computed = param_.getDefault("compute_well_potentials", false );
std::vector<double> well_potentials;
DynamicListEconLimited dynamic_list_econ_limited;
// Main simulation loop.
while (!timer.done()) {
@ -153,6 +155,7 @@ namespace Opm
Opm::UgGridHelpers::cell2Faces(grid_),
Opm::UgGridHelpers::beginFaceCentroids(grid_),
props_.permeability(),
dynamic_list_econ_limited,
is_parallel_run_,
well_potentials);
const Wells* wells = wells_manager.c_wells();

View File

@ -89,6 +89,7 @@ namespace Opm
unsigned int totalNonlinearIterations = 0;
unsigned int totalLinearIterations = 0;
DynamicListEconLimited dynamic_list_econ_limited;
// Main simulation loop.
while (!timer.done()) {
@ -109,6 +110,7 @@ namespace Opm
Opm::UgGridHelpers::cell2Faces(grid_),
Opm::UgGridHelpers::beginFaceCentroids(grid_),
props_.permeability(),
dynamic_list_econ_limited,
is_parallel_run_);
const Wells* wells = wells_manager.c_wells();
WellState well_state;

View File

@ -28,6 +28,7 @@
#include <opm/output/eclipse/EclipseReader.hpp>
#include <opm/core/utility/miscUtilities.hpp>
#include <opm/core/utility/parameters/ParameterGroup.hpp>
#include <opm/core/wells/DynamicListEconLimited.hpp>
#include <opm/output/Cells.hpp>
#include <opm/output/OutputWriter.hpp>
@ -352,6 +353,8 @@ namespace Opm
SimulationDataContainer& simulatorstate,
WellStateFullyImplicitBlackoil& wellstate)
{
// gives a dummy dynamic_list_econ_limited
DynamicListEconLimited dummy_list_econ_limited;
WellsManager wellsmanager(eclipseState_,
eclipseState_->getInitConfig()->getRestartStep(),
Opm::UgGridHelpers::numCells(grid),
@ -360,7 +363,8 @@ namespace Opm
Opm::UgGridHelpers::dimensions(grid),
Opm::UgGridHelpers::cell2Faces(grid),
Opm::UgGridHelpers::beginFaceCentroids(grid),
permeability);
permeability,
dummy_list_econ_limited);
const Wells* wells = wellsmanager.c_wells();
wellstate.resize(wells, simulatorstate); //Resize for restart step

View File

@ -48,6 +48,7 @@
#include <opm/core/utility/Units.hpp>
#include <opm/core/wells/WellsManager.hpp>
#include <opm/core/wells.h>
#include <opm/core/wells/DynamicListEconLimited.hpp>
#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
#include <opm/autodiff/GridHelpers.hpp>
@ -91,6 +92,9 @@ struct SetupMSW {
const size_t current_timestep = 0;
// dummy_dynamic_list_econ_lmited
const Opm::DynamicListEconLimited dummy_dynamic_list;
// Create wells.
Opm::WellsManager wells_manager(ecl_state,
current_timestep,
@ -101,6 +105,7 @@ struct SetupMSW {
Opm::UgGridHelpers::cell2Faces(grid),
Opm::UgGridHelpers::beginFaceCentroids(grid),
fluidprops->permeability(),
dummy_dynamic_list,
false);
const Wells* wells = wells_manager.c_wells();