Merge pull request #1315 from joakim-hove/extract-schedule

Use Schedule constructor.
This commit is contained in:
Joakim Hove
2017-11-06 17:06:49 +01:00
committed by GitHub
57 changed files with 267 additions and 473 deletions

View File

@@ -138,25 +138,24 @@ int main(int argc, char** argv)
Opm::checkDeck(*deck, parser);
Opm::MissingFeatures::checkKeywords(*deck);
}
std::shared_ptr<Opm::EclipseState> eclipseState =
std::make_shared< Opm::EclipseState > ( *deck, parseContext );
Opm::Runspec runspec( *deck );
const auto& phases = runspec.phases();
// Twophase cases
std::shared_ptr<Opm::EclipseState> eclipseState = std::make_shared< Opm::EclipseState > ( *deck, parseContext );
std::shared_ptr<Opm::Schedule> schedule = std::make_shared<Opm::Schedule>(*deck, eclipseState->getInputGrid(), eclipseState->get3DProperties(), phases, parseContext);
std::shared_ptr<Opm::SummaryConfig> summary_config = std::make_shared<Opm::SummaryConfig>(*deck, *schedule, eclipseState->getTableManager(), parseContext);
// Twophase cases
if( phases.size() == 2 ) {
// oil-gas
if (phases.active( Opm::Phase::GAS ))
{
Opm::flowEbosGasOilSetDeck(*deck, *eclipseState);
Opm::flowEbosGasOilSetDeck(*deck, *eclipseState, *schedule, *summary_config);
return Opm::flowEbosGasOilMain(argc, argv);
}
// oil-water
else if ( phases.active( Opm::Phase::WATER ) )
{
Opm::flowEbosOilWaterSetDeck(*deck, *eclipseState);
Opm::flowEbosOilWaterSetDeck(*deck, *eclipseState, *schedule, *summary_config);
return Opm::flowEbosOilWaterMain(argc, argv);
}
else {
@@ -167,17 +166,17 @@ int main(int argc, char** argv)
}
// Polymer case
else if ( phases.active( Opm::Phase::POLYMER ) ) {
Opm::flowEbosPolymerSetDeck(*deck, *eclipseState);
Opm::flowEbosPolymerSetDeck(*deck, *eclipseState, *schedule, *summary_config);
return Opm::flowEbosPolymerMain(argc, argv);
}
// Solvent case
else if ( phases.active( Opm::Phase::SOLVENT ) ) {
Opm::flowEbosSolventSetDeck(*deck, *eclipseState);
Opm::flowEbosSolventSetDeck(*deck, *eclipseState, *schedule, *summary_config);
return Opm::flowEbosSolventMain(argc, argv);
}
// Blackoil case
else if( phases.size() == 3 ) {
Opm::flowEbosBlackoilSetDeck(*deck, *eclipseState);
Opm::flowEbosBlackoilSetDeck(*deck, *eclipseState, *schedule, *summary_config);
return Opm::flowEbosBlackoilMain(argc, argv);
}
else

View File

@@ -36,7 +36,6 @@ main(int argc, char** argv)
{
typedef UnstructuredGrid Grid;
typedef Opm::SimulatorFullyImplicitBlackoilMultiSegment<Grid> Simulator;
Opm::FlowMain<Grid, Simulator> mainfunc;
return mainfunc.execute(argc, argv);
}

View File

@@ -1,366 +0,0 @@
/*
Copyright 2014 Statoil ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <iostream>
#include <fstream>
#include <memory>
#include <vector>
#include <string>
#include <ert/ecl/ecl_file.h>
#include <ert/ecl/ecl_kw.h>
#include <ert/ecl/ecl_grid.h>
#include <ert/ecl/ecl_nnc_export.h>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
#include <opm/core/grid.h>
#include <opm/core/grid/GridManager.hpp>
#include <opm/core/wells/WellsManager.hpp>
#include <opm/core/props/BlackoilPropertiesFromDeck.hpp>
#include <opm/autodiff/GeoProps.hpp>
#include <opm/autodiff/SimulatorFullyImplicitBlackoil.hpp>
#include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
#include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
using namespace Opm;
class CellTrans {
public:
CellTrans(const std::tuple<int,int,int>& ijk) :
m_ijk(ijk)
{
}
void update(const std::tuple<int,int,int>& ijk , double trans) {
auto iter = m_trans.find( ijk );
if (iter == m_trans.end())
m_trans.insert( std::pair<std::tuple<int,int,int> , double>(ijk , trans));
else
iter->second *= trans;
}
int numConnections() const {
return m_trans.size();
}
static void jsonDumpIJK(std::ostream& os , const std::tuple<int,int,int>& ijk ) {
os << "[" << std::get<0>(ijk) << "," << std::get<1>(ijk) << "," << std::get<2>(ijk) << "]";
}
void jsonDump(std::ostream& os , bool first) {
if (!first)
os <<",";
os << "[";
jsonDumpIJK(os , m_ijk );
os << ",[";
{
size_t count = 0;
for (auto transIter = m_trans.begin(); transIter != m_trans.end(); ++transIter) {
std::tuple<int,int,int> ijk = transIter->first;
double t = transIter->second;
os << "[";
jsonDumpIJK( os , ijk );
os << "," << t << "]";
count++;
if (count < m_trans.size())
os << ",";
else
os << "]";
}
}
os << "]" << std::endl;
}
std::tuple<int,int,int> m_ijk;
std::map<std::tuple<int,int,int> , double> m_trans;
};
class TransGraph {
public:
TransGraph(int nx , int ny , int nz) :
m_nx(nx),
m_ny(ny),
m_nz(nz)
{
m_transVector.resize( nx*ny*nz );
}
void update(int global_index1 , int global_index2 , double trans) {
int size = m_nx * m_ny * m_nz;
if ((global_index1 >= 0) &&
(global_index2 >= 0) &&
(global_index1 < size) &&
(global_index2 < size)) {
size_t g1 = std::min( global_index1 , global_index2 );
size_t g2 = std::max( global_index1 , global_index2 );
std::shared_ptr<CellTrans> cellTrans = m_transVector[g1];
if (!cellTrans) {
cellTrans = std::make_shared<CellTrans>( getIJK(g1) );
m_transVector[g1] = cellTrans;
}
cellTrans->update( getIJK(g2) , trans );
}
}
int activeCells() const {
int count = 0;
for (size_t g= 0; g < m_transVector.size(); g++) {
std::shared_ptr<CellTrans> cellTrans = m_transVector[g];
if (cellTrans)
count++;
}
return count;
}
int activeConnections() const {
int count = 0;
for (size_t g= 0; g < m_transVector.size(); g++) {
std::shared_ptr<CellTrans> cellTrans = m_transVector[g];
if (cellTrans)
count += cellTrans->numConnections();
}
return count;
}
std::tuple<int,int,int> getIJK(int g) const {
int k = g / (m_nx * m_ny);
int j = (g - k*m_nx*m_ny) / m_nx;
int i = g - k*m_nx*m_ny - j*m_nx;
return std::tuple<int,int,int>(i,j,k);
}
void jsonDump(const std::string& outputFile) {
std::ofstream os;
bool first = true;
os.open(outputFile.c_str());
os << "{ \"dims\" : [" << m_nx << "," << m_ny << "," << m_nz << "]" << " , \"graph\":[";
for (size_t g= 0; g < m_transVector.size(); g++) {
std::shared_ptr<CellTrans> cellTrans = m_transVector[g];
if (cellTrans) {
cellTrans->jsonDump(os , first);
first = false;
}
}
os << "]}" << std::endl;
os.close();
}
int m_nx;
int m_ny;
int m_nz;
std::vector<std::shared_ptr<CellTrans> > m_transVector;
};
/*****************************************************************/
void initOPMTrans(TransGraph& opmTrans, const Deck& deck, const EclipseState& eclipseState) {
std::shared_ptr<GridManager> grid = std::make_shared<GridManager>( eclipseState.getInputGrid(),
eclipseState.get3DProperties().getDoubleGridProperty( "PORV" ).getData() );
const struct UnstructuredGrid * cGrid = grid->c_grid();
std::shared_ptr<BlackoilPropsAdFromDeck> props;
props.reset(new BlackoilPropsAdFromDeck(deck, eclipseState, *grid->c_grid()));
DerivedGeology geology(*grid->c_grid() , *props, eclipseState, false);
const double * opm_trans_data = geology.transmissibility().data();
double SIconversion = Opm::unit::cubic(Opm::unit::meter) * Opm::unit::day * Opm::unit::barsa / (Opm::prefix::centi * Opm::unit::Poise);
{
for (int face_index = 0; face_index < cGrid->number_of_faces; face_index++ ) {
int global_index1 = cGrid->global_cell[ cGrid->face_cells[2*face_index] ];
int global_index2 = cGrid->global_cell[ cGrid->face_cells[2*face_index + 1] ];
opmTrans.update( global_index1 , global_index2 , opm_trans_data[ face_index ] * SIconversion );
}
}
}
void initEclipseTrans(TransGraph& eclipseTrans , const ecl_grid_type * ecl_grid , const ecl_file_type * ecl_init) {
int nx = ecl_grid_get_nx( ecl_grid );
int ny = ecl_grid_get_ny( ecl_grid );
int nz = ecl_grid_get_nz( ecl_grid );
if (ecl_file_has_kw( ecl_init , "TRANX")) {
ecl_kw_type * tranx_kw = ecl_file_iget_named_kw( ecl_init , "TRANX" , 0 );
ecl_kw_type * trany_kw = ecl_file_iget_named_kw( ecl_init , "TRANY" , 0 );
ecl_kw_type * tranz_kw = ecl_file_iget_named_kw( ecl_init , "TRANZ" , 0 );
for (int k=0; k < nz; k++) {
for (int j= 0; j < ny; j++) {
for (int i=0; i < nx; i++) {
if (ecl_grid_cell_active3( ecl_grid , i , j , k )) {
size_t g1 = ecl_grid_get_global_index3( ecl_grid , i , j , k );
int a = ecl_grid_get_active_index1( ecl_grid , g1 );
if (a >= 0) {
if (i < (nx - 1) && ecl_grid_cell_active3( ecl_grid , i + 1 , j , k)) {
size_t g2 = ecl_grid_get_global_index3( ecl_grid , i + 1, j , k );
eclipseTrans.update( g1 , g2 , ecl_kw_iget_float( tranx_kw , a ));
}
if (j < (ny - 1) && ecl_grid_cell_active3( ecl_grid , i , j + 1, k)) {
size_t g2 = ecl_grid_get_global_index3( ecl_grid , i , j + 1, k );
eclipseTrans.update( g1 , g2 , ecl_kw_iget_float( trany_kw , a ));
}
if (k < (nz - 1) && ecl_grid_cell_active3( ecl_grid , i , j , k + 1)) {
size_t g2 = ecl_grid_get_global_index3( ecl_grid , i , j , k + 1 );
eclipseTrans.update( g1 , g2 , ecl_kw_iget_float( tranz_kw , a ));
}
}
}
}
}
}
} else
std::cerr << "Init file does not have TRAN[XYZ] keywords" << std::endl;
if (ecl_file_has_kw( ecl_init , "TRANX-")) {
ecl_kw_type * tranxm_kw = ecl_file_iget_named_kw( ecl_init , "TRANX-" , 0 );
ecl_kw_type * tranym_kw = ecl_file_iget_named_kw( ecl_init , "TRANY-" , 0 );
ecl_kw_type * tranzm_kw = ecl_file_iget_named_kw( ecl_init , "TRANZ-" , 0 );
for (int k=0; k < nz; k++) {
for (int j= 0; j < ny; j++) {
for (int i=0; i < nx; i++) {
if (ecl_grid_cell_active3( ecl_grid , i , j , k )) {
size_t g1 = ecl_grid_get_global_index3( ecl_grid , i , j , k );
int a = ecl_grid_get_active_index1( ecl_grid , g1 );
if (a >= 0) {
if (i > 0 && ecl_grid_cell_active3( ecl_grid , i - 1 , j , k)) {
size_t g2 = ecl_grid_get_global_index3( ecl_grid , i - 1, j , k );
eclipseTrans.update( g1 , g2 , ecl_kw_iget_float( tranxm_kw , a ));
}
if (j > 0 && ecl_grid_cell_active3( ecl_grid , i , j - 1, k)) {
size_t g2 = ecl_grid_get_global_index3( ecl_grid , i , j - 1, k );
eclipseTrans.update( g1 , g2 , ecl_kw_iget_float( tranym_kw , a ));
}
if (k > 0 && ecl_grid_cell_active3( ecl_grid , i , j , k - 1)) {
size_t g2 = ecl_grid_get_global_index3( ecl_grid , i , j , k - 1 );
eclipseTrans.update( g1 , g2 , ecl_kw_iget_float( tranzm_kw , a ));
}
}
}
}
}
}
}
// NNC
{
size_t num_nnc = static_cast<size_t>( ecl_nnc_export_get_size( ecl_grid ));
std::vector<ecl_nnc_type> nnc(num_nnc);
ecl_nnc_export( ecl_grid , ecl_init , nnc.data());
for (auto nnc_iter = nnc.begin(); nnc_iter != nnc.end(); ++nnc_iter)
eclipseTrans.update( nnc_iter->global_index1 , nnc_iter->global_index2 , nnc_iter->trans );
}
}
void dump_transGraph( const Deck& deck , const EclipseState& eclipseState , const ecl_grid_type * ecl_grid , const ecl_file_type * ecl_init) {
int nx = ecl_grid_get_nx( ecl_grid );
int ny = ecl_grid_get_ny( ecl_grid );
int nz = ecl_grid_get_nz( ecl_grid );
TransGraph opmTrans(nx , ny , nz );
TransGraph eclipseTrans( nx , ny , nz);
initOPMTrans( opmTrans , deck , eclipseState );
initEclipseTrans( eclipseTrans , ecl_grid , ecl_init );
opmTrans.jsonDump("opm_trans.json");
eclipseTrans.jsonDump("eclipse_trans.json");
}
int main(int argc, char** argv) {
if (argc < 4) {
std::cerr << "The opm_init_check program needs three arguments:" << std::endl << std::endl;;
std::cerr << " ECLIPSE.DATA ECLIPSE.INIT ECLIPSE.EGRID" << std::endl << std::endl;
std::cerr << "Where the ECLIPSE.INIT and ECLIPSE.EGRID are existing binary files";
exit(1);
}
std::string input_file = argv[1];
std::string init_file = argv[2];
std::string grid_file = argv[3];
Parser parser;
ParseContext parseContext;
std::cout << "Parsing input file ............: " << input_file << std::endl;
const Deck& deck = parser.parseFile(input_file, parseContext);
EclipseState state( deck , parseContext );
std::cout << "Loading eclipse INIT file .....: " << init_file << std::endl;
ecl_file_type * ecl_init = ecl_file_open( init_file.c_str() , 0 );
std::cout << "Loading eclipse EGRID file ....: " << grid_file << std::endl;
ecl_grid_type * ecl_grid = ecl_grid_alloc( grid_file.c_str() );
dump_transGraph( deck , state , ecl_grid , ecl_init);
ecl_file_close( ecl_init );
ecl_grid_free( ecl_grid );
return 0;
}

View File

@@ -88,6 +88,7 @@ try
// If we have a "deck_filename", grid and props will be read from that.
bool use_deck = param.has("deck_filename");
std::shared_ptr< EclipseState > eclipseState;
std::shared_ptr< Schedule > schedule;
std::unique_ptr<GridManager> grid;
std::unique_ptr<BlackoilPropertiesInterface> props;
std::unique_ptr<RockCompressibility> rock_comp;
@@ -104,6 +105,12 @@ try
std::string deck_filename = param.get<std::string>("deck_filename");
auto deck = parser.parseFile(deck_filename , parseContext);
eclipseState.reset(new EclipseState(deck, parseContext));
schedule.reset( new Schedule(deck,
eclipseState->getInputGrid(),
eclipseState->get3DProperties(),
eclipseState->runspec().phases(),
parseContext));
// Grid init
grid.reset(new GridManager(eclipseState->getInputGrid()));
@@ -234,7 +241,7 @@ try
int step = 0;
SimulatorTimer simtimer;
// Use timer for last epoch to obtain total time.
const auto& timeMap = eclipseState->getSchedule().getTimeMap();
const auto& timeMap = schedule->getTimeMap();
simtimer.init(timeMap);
const double total_time = simtimer.totalTime();
for (size_t reportStepIdx = 0; reportStepIdx < timeMap.numTimesteps(); ++reportStepIdx) {
@@ -247,7 +254,7 @@ try
<< simtimer.numSteps() - step << ")\n\n" << std::flush;
// Create new wells, well_state
WellsManager wells(*eclipseState , reportStepIdx , *grid->c_grid());
WellsManager wells(*eclipseState , *schedule, reportStepIdx , *grid->c_grid());
// @@@ HACK: we should really make a new well state and
// properly transfer old well state to it every report step,
// since number of wells may change etc.

View File

@@ -101,7 +101,7 @@ try
// If we have a "deck_filename", grid and props will be read from that.
bool use_deck = param.has("deck_filename");
std::shared_ptr< EclipseState > eclipseState;
std::shared_ptr< Schedule > schedule;
std::unique_ptr<GridManager> grid;
std::unique_ptr<IncompPropertiesInterface> props;
std::unique_ptr<RockCompressibility> rock_comp;
@@ -117,6 +117,11 @@ try
std::string deck_filename = param.get<std::string>("deck_filename");
auto deck = parser.parseFile(deck_filename , parseContext);
eclipseState.reset( new EclipseState(deck, parseContext));
schedule.reset( new Schedule(deck,
eclipseState->getInputGrid(),
eclipseState->get3DProperties(),
eclipseState->runspec().phases(),
parseContext));
// Grid init
grid.reset(new GridManager(eclipseState->getInputGrid()));
{
@@ -244,7 +249,7 @@ try
rep = simulator.run(simtimer, *state, well_state);
} else {
// With a deck, we may have more epochs etc.
const auto& timeMap = eclipseState->getSchedule().getTimeMap();
const auto& timeMap = schedule->getTimeMap();
std::cout << "\n\n================ Starting main simulation loop ===============\n"
<< " (number of report steps: "
@@ -268,7 +273,7 @@ try
// << simtimer.numSteps() - step << ")\n\n" << std::flush;
// Create new wells, well_state
WellsManager wells(*eclipseState , reportStepIdx , *grid->c_grid());
WellsManager wells(*eclipseState, *schedule, reportStepIdx , *grid->c_grid());
// @@@ HACK: we should really make a new well state and
// properly transfer old well state to it every report step,
// since number of wells may change etc.

View File

@@ -107,6 +107,7 @@ try
std::unique_ptr<RockCompressibility> rock_comp;
std::unique_ptr<TwophaseState> state;
std::shared_ptr< EclipseState > eclipseState;
std::shared_ptr< Schedule > schedule;
// bool check_well_controls = false;
// int max_well_control_iterations = 0;
@@ -116,6 +117,11 @@ try
Opm::ParseContext parseContext;
auto deck = parser.parseFile(deck_filename, parseContext);
eclipseState.reset(new EclipseState(deck , parseContext));
schedule.reset( new Schedule(deck,
eclipseState->getInputGrid(),
eclipseState->get3DProperties(),
eclipseState->runspec().phases(),
parseContext));
// Grid init
grid.reset(new GridManager(eclipseState->getInputGrid()));
@@ -248,7 +254,7 @@ try
} else {
// With a deck, we may have more report steps etc.
WellState well_state;
const auto& timeMap = eclipseState->getSchedule().getTimeMap();
const auto& timeMap = schedule->getTimeMap();
SimulatorTimer simtimer;
for (size_t reportStepIdx = 0; reportStepIdx < timeMap.numTimesteps(); ++reportStepIdx) {
// Report on start of report step.
@@ -257,7 +263,7 @@ try
<< timeMap.numTimesteps() - reportStepIdx << ")\n\n" << std::flush;
// Create new wells, well_state
WellsManager wells(*eclipseState , reportStepIdx , *grid->c_grid());
WellsManager wells(*eclipseState , *schedule, reportStepIdx , *grid->c_grid());
// @@@ HACK: we should really make a new well state and
// properly transfer old well state to it every report step,
// since number of wells may change etc.

View File

@@ -96,6 +96,7 @@ try
Opm::PolymerProperties poly_props;
Opm::Deck deck;
std::unique_ptr< EclipseState > eclipseState;
std::unique_ptr< Schedule> schedule;
// bool check_well_controls = false;
// int max_well_control_iterations = 0;
double gravity[3] = { 0.0 };
@@ -105,7 +106,7 @@ try
Opm::ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE }});
deck = parser.parseFile(deck_filename , parseContext);
eclipseState.reset( new EclipseState(deck , parseContext) );
schedule.reset( new Schedule(deck, eclipseState->getInputGrid(), eclipseState->get3DProperties(), eclipseState->runspec().phases(), parseContext ));
// Grid init
grid.reset(new GridManager(eclipseState->getInputGrid()));
{
@@ -282,13 +283,13 @@ try
// Create new wells, polymer inflow controls.
eclipseState.reset( new EclipseState( deck ) );
WellsManager wells(*eclipseState , reportStepIdx , *grid->c_grid());
WellsManager wells(*eclipseState , *schedule, reportStepIdx , *grid->c_grid());
boost::scoped_ptr<PolymerInflowInterface> polymer_inflow;
if (use_wpolymer) {
if (wells.c_wells() == 0) {
OPM_THROW(std::runtime_error, "Cannot control polymer injection via WPOLYMER without wells.");
}
polymer_inflow.reset(new PolymerInflowFromDeck(*eclipseState, *wells.c_wells(), props->numCells(), simtimer.currentStepNum()));
polymer_inflow.reset(new PolymerInflowFromDeck( *schedule, *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

@@ -94,6 +94,7 @@ try
boost::scoped_ptr<IncompPropertiesInterface> props;
boost::scoped_ptr<RockCompressibility> rock_comp;
std::shared_ptr< EclipseState > eclipseState;
std::shared_ptr<Schedule> schedule;
std::unique_ptr<PolymerState> state;
Opm::PolymerProperties poly_props;
// bool check_well_controls = false;
@@ -106,7 +107,7 @@ try
deck = parser.parseFile(deck_filename , parseContext);
eclipseState.reset(new Opm::EclipseState(deck , parseContext));
schedule.reset( new Opm::Schedule(deck, eclipseState->getInputGrid(), eclipseState->get3DProperties(), eclipseState->runspec().phases(), parseContext));
// Grid init
grid.reset(new GridManager(eclipseState->getInputGrid()));
{
@@ -295,7 +296,7 @@ try
WellState well_state;
int step = 0;
const auto& timeMap = eclipseState->getSchedule().getTimeMap();
const auto& timeMap = schedule->getTimeMap();
SimulatorTimer simtimer;
simtimer.init(timeMap);
// Check for WPOLYMER presence in last epoch to decide
@@ -316,13 +317,13 @@ try
<< simtimer.numSteps() - step << ")\n\n" << std::flush;
// Create new wells, polymer inflow controls.
WellsManager wells(*eclipseState , reportStepIdx , *grid->c_grid());
WellsManager wells(*eclipseState , *schedule, reportStepIdx , *grid->c_grid());
boost::scoped_ptr<PolymerInflowInterface> polymer_inflow;
if (use_wpolymer) {
if (wells.c_wells() == 0) {
OPM_THROW(std::runtime_error, "Cannot control polymer injection via WPOLYMER without wells.");
}
polymer_inflow.reset(new PolymerInflowFromDeck(*eclipseState, *wells.c_wells(), props->numCells(), simtimer.currentStepNum()));
polymer_inflow.reset(new PolymerInflowFromDeck(*schedule, *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

@@ -38,6 +38,7 @@ try
Opm::Parser parser;
Opm::Deck deck = parser.parseFile(file_name , parseContext);
Opm::EclipseState eclipseState(deck , parseContext);
Opm::Schedule schedule(deck, eclipseState.getInputGrid(), eclipseState.get3DProperties(), eclipseState.runspec().phases(), parseContext);
std::cout << "Done!" << std::endl;
// Setup grid
@@ -48,7 +49,7 @@ try
RockCompressibility rock_comp(eclipseState);
// Finally handle the wells
WellsManager wells(eclipseState , 0 , *grid.c_grid());
WellsManager wells(eclipseState , schedule, 0 , *grid.c_grid());
double gravity[3] = {0.0, 0.0, parameters.getDefault<double>("gravity", 0.0)};
Opm::LinearSolverFactory linsolver(parameters);