diff --git a/.gitignore b/.gitignore index 9c1b858..1853284 100644 --- a/.gitignore +++ b/.gitignore @@ -68,4 +68,10 @@ examples/upscale_* examples/grdecldips data steadystate_test_implicit -steadystate_test_explicit \ No newline at end of file +steadystate_test_explicit +======= +*.iml +.idea +*/opm-simulation + + diff --git a/examples/sim_poly_fibo_ad.cpp b/examples/sim_poly_fibo_ad.cpp index 5f3719b..9075c6d 100644 --- a/examples/sim_poly_fibo_ad.cpp +++ b/examples/sim_poly_fibo_ad.cpp @@ -129,6 +129,8 @@ try // Rock and fluid init props.reset(new BlackoilPropertiesFromDeck(deck, eclipseState, *grid->c_grid(), param)); new_props.reset(new BlackoilPropsAdFromDeck(deck, eclipseState, *grid->c_grid())); + const bool polymer = deck->hasKeyword("POLYMER"); + const bool use_wpolymer = deck->hasKeyword("WPOLYMER"); PolymerProperties polymer_props(deck, eclipseState); PolymerPropsAd polymer_props_ad(polymer_props); // check_well_controls = param.getDefault("check_well_controls", false); @@ -158,6 +160,7 @@ try initStateEquil(*grid->c_grid(), *props, deck, eclipseState, grav, state.blackoilState()); state.faceflux().resize(grid->c_grid()->number_of_faces, 0.0); } else { + state.init(*grid->c_grid(), props->numPhases()); initBlackoilStateFromDeck(*grid->c_grid(), *props, deck, gravity[2], state.blackoilState()); } @@ -197,8 +200,7 @@ try simtimer.init(timeMap); //Check for WPOLYMER presence in last report step to decide //polymer injection control type. - const bool polymer = deck->hasKeyword("POLYMER"); - const bool use_wpolymer = deck->hasKeyword("WPOLYMER"); + std::cout << polymer << " " << use_wpolymer << std::endl; if (polymer){ if (!use_wpolymer) { OPM_MESSAGE("Warning: simulate polymer injection without WPOLYMER."); @@ -229,6 +231,10 @@ try OPM_THROW(std::runtime_error, "Cannot control polymer injection via WPOLYMER without wells."); } polymer_inflow.reset(new PolymerInflowFromDeck(deck, *wells.c_wells(), props->numCells())); + } else { + polymer_inflow.reset(new PolymerInflowBasic(0.0*Opm::unit::day, + 1.0*Opm::unit::day, + 0.0)); } SimulatorFullyImplicitBlackoilPolymer simulator(param, *grid->c_grid(), diff --git a/opm/polymer/PolymerProperties.hpp b/opm/polymer/PolymerProperties.hpp index 8662db5..73d0da3 100644 --- a/opm/polymer/PolymerProperties.hpp +++ b/opm/polymer/PolymerProperties.hpp @@ -129,8 +129,6 @@ namespace Opm c_max_ = plymaxTable.getPolymerConcentrationColumn()[0]; mix_param_ = plmixparRecord->getItem("TODD_LONGSTAFF")->getSIDouble(0); - std::cout << "Debug output:\n"; - std::cout << "mix_param: " << mix_param_ <<" cmax: " << c_max_; // We assume NTSFUN=1 const auto& plyrockTable = eclipseState->getPlyrockTables()[0]; @@ -143,8 +141,6 @@ namespace Opm ads_index_ = static_cast(plyrockTable.getAdsorbtionIndexColumn()[0]); c_max_ads_ = plyrockTable.getMaxAdsorbtionColumn()[0]; - std::cout << " IPV: " << dead_pore_vol_ <<" rs: " << res_factor_ << " rock_den: " << rock_density_ - << " ads_index: " << ads_index_ << " cmax_ads: " << c_max_ads_ << std::endl; // We assume NTPVT=1 const auto& plyviscTable = eclipseState->getPlyviscTables()[0]; @@ -152,23 +148,11 @@ namespace Opm c_vals_visc_ = plyviscTable.getPolymerConcentrationColumn(); visc_mult_vals_ = plyviscTable.getViscosityMultiplierColumn(); - std::cout << "PLYVISC\n"; - auto N = c_vals_visc_.size(); - for (size_t i = 0; i < N; ++i) { - std::cout << c_vals_visc_[i] << " " << visc_mult_vals_[i] << "\n"; - } - // We assume NTSFUN=1 const auto& plyadsTable = eclipseState->getPlyadsTables()[0]; - c_vals_ads_ = plyadsTable.getPolymerConcentrationColumn(); ads_vals_ = plyadsTable.getAdsorbedPolymerColumn(); - std::cout << "PLYADS\n"; - auto M = c_vals_ads_.size(); - for (size_t i = 0; i < M; ++i) { - std::cout << c_vals_ads_[i] << " " << ads_vals_[i] << "\n"; - } } double cMax() const; diff --git a/opm/polymer/SimulatorCompressiblePolymer.cpp b/opm/polymer/SimulatorCompressiblePolymer.cpp index 544543d..c581484 100644 --- a/opm/polymer/SimulatorCompressiblePolymer.cpp +++ b/opm/polymer/SimulatorCompressiblePolymer.cpp @@ -292,7 +292,7 @@ namespace Opm wellreport.push(props_, *wells_, state.pressure(), state.surfacevol(), state.saturation(), 0.0, well_state.bhp(), well_state.perfRates()); } - for (; !timer.done(); ++timer) { +// for (; !timer.done(); ++timer) { // Report timestep and (optionally) write state to disk. timer.report(std::cout); if (output_ && (timer.currentStepNum() % output_interval_ == 0)) { @@ -388,6 +388,7 @@ namespace Opm double stepsize = timer.currentStepLength(); polymer_inflow_.getInflowValues(current_time, current_time + stepsize, polymer_inflow_c); + // Solve transport. transport_timer.start(); if (num_transport_substeps_ != 1) { @@ -492,7 +493,7 @@ namespace Opm state.saturation(), timer.simulationTimeElapsed() + timer.currentStepLength(), well_state.bhp(), well_state.perfRates()); } - } +// } if (output_) { if (output_vtk_) {