change PolymerInflow constructor interface due to commit 6628941c9c9d781db9ec8e3ac05a3a8dc49dcf21 in opm-parser.

This commit is contained in:
Liu Ming 2015-01-27 12:24:26 +08:00
parent 6a3bfba846
commit 74332085dc
6 changed files with 13 additions and 7 deletions

View File

@ -303,7 +303,7 @@ try
if (wells.c_wells() == 0) {
OPM_THROW(std::runtime_error, "Cannot control polymer injection via WPOLYMER without wells.");
}
polymer_inflow.reset(new PolymerInflowFromDeck(deck, *wells.c_wells(), props->numCells(), simtimer.currentStepNum()));
polymer_inflow.reset(new PolymerInflowFromDeck(deck, eclipseState, *wells.c_wells(), props->numCells(), simtimer.currentStepNum()));
} else {
polymer_inflow.reset(new PolymerInflowBasic(param.getDefault("poly_start_days", 300.0)*Opm::unit::day,
param.getDefault("poly_end_days", 800.0)*Opm::unit::day,

View File

@ -308,7 +308,7 @@ try
if (wells.c_wells() == 0) {
OPM_THROW(std::runtime_error, "Cannot control polymer injection via WPOLYMER without wells.");
}
polymer_inflow.reset(new PolymerInflowFromDeck(deck, *wells.c_wells(), props->numCells(), simtimer.currentStepNum()));
polymer_inflow.reset(new PolymerInflowFromDeck(deck, eclipseState, *wells.c_wells(), props->numCells(), simtimer.currentStepNum()));
} else {
polymer_inflow.reset(new PolymerInflowBasic(param.getDefault("poly_start_days", 300.0)*Opm::unit::day,
param.getDefault("poly_end_days", 800.0)*Opm::unit::day,

View File

@ -114,17 +114,19 @@ namespace Opm
void
PolymerInflowFromDeck::setInflowValues(Opm::DeckConstPtr deck,
Opm::EclipseStateConstPtr eclipseState,
size_t currentStep)
{
Opm::DeckKeywordConstPtr keyword = deck->getKeyword("WPOLYMER");
Schedule schedule(deck);
// Schedule schedule(deck);
ScheduleConstPtr schedule = eclipseState->getSchedule();
for (size_t recordNr = 0; recordNr < keyword->size(); recordNr++) {
DeckRecordConstPtr record = keyword->getRecord(recordNr);
const std::string& wellNamesPattern = record->getItem("WELL")->getTrimmedString(0);
std::string wellName = record->getItem("WELL")->getTrimmedString(0);
std::vector<WellPtr> wells = schedule.getWells(wellNamesPattern);
std::vector<WellPtr> wells = schedule->getWells(wellNamesPattern);
for (auto wellIter = wells.begin(); wellIter != wells.end(); ++wellIter) {
WellPtr well = *wellIter;
WellInjectionProperties injection = well->getInjectionProperties(currentStep);
@ -141,6 +143,7 @@ namespace Opm
/// Constructor.
/// @param[in] deck Input deck expected to contain WPOLYMER.
PolymerInflowFromDeck::PolymerInflowFromDeck(Opm::DeckConstPtr deck,
Opm::EclipseStateConstPtr eclipseState,
const Wells& wells,
const int num_cells,
size_t currentStep)
@ -150,7 +153,7 @@ namespace Opm
OPM_MESSAGE("PolymerInflowFromDeck initialized without WPOLYMER in current epoch.");
return;
}
setInflowValues(deck, currentStep);
setInflowValues(deck, eclipseState, currentStep);
std::unordered_map<std::string, double>::const_iterator map_it;
// Extract concentrations and put into cell->concentration map.

View File

@ -24,6 +24,7 @@
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellPolymerProperties.hpp>
#include <vector>
#include <string>
@ -101,6 +102,7 @@ namespace Opm
/// \param[in] num_cells Number of cells in grid.
/// \param[in] currentStep Number of current simulation step.
PolymerInflowFromDeck(Opm::DeckConstPtr deck,
Opm::EclipseStateConstPtr eclipseState,
const Wells& wells,
const int num_cells,
size_t currentStep);
@ -118,6 +120,7 @@ namespace Opm
std::unordered_map<std::string, double> wellPolymerRate_;
void setInflowValues(Opm::DeckConstPtr deck,
Opm::EclipseStateConstPtr eclipseState,
size_t currentStep);
};

View File

@ -335,7 +335,7 @@ namespace Opm
if (wells_manager.c_wells() == 0) {
OPM_THROW(std::runtime_error, "Cannot control polymer injection via WPOLYMER without wells.");
}
polymer_inflow_ptr.reset(new PolymerInflowFromDeck(deck_, *wells, Opm::UgGridHelpers::numCells(grid_), timer.currentStepNum()));
polymer_inflow_ptr.reset(new PolymerInflowFromDeck(deck_, eclipse_state_, *wells, Opm::UgGridHelpers::numCells(grid_), timer.currentStepNum()));
} else {
polymer_inflow_ptr.reset(new PolymerInflowBasic(0.0*Opm::unit::day,
1.0*Opm::unit::day,

View File

@ -285,7 +285,7 @@ namespace Opm
if (wells_manager.c_wells() == 0) {
OPM_THROW(std::runtime_error, "Cannot control polymer injection via WPOLYMER without wells.");
}
polymer_inflow_ptr.reset(new PolymerInflowFromDeck(deck_, *wells, Opm::UgGridHelpers::numCells(grid_), timer.currentStepNum()));
polymer_inflow_ptr.reset(new PolymerInflowFromDeck(deck_, eclipse_state_, *wells, Opm::UgGridHelpers::numCells(grid_), timer.currentStepNum()));
} else {
polymer_inflow_ptr.reset(new PolymerInflowBasic(0.0*Opm::unit::day,
1.0*Opm::unit::day,