diff --git a/examples/sim_poly2p_comp_reorder.cpp b/examples/sim_poly2p_comp_reorder.cpp index 20bd16df7..fba329e68 100644 --- a/examples/sim_poly2p_comp_reorder.cpp +++ b/examples/sim_poly2p_comp_reorder.cpp @@ -109,7 +109,7 @@ try // check_well_controls = param.getDefault("check_well_controls", false); // max_well_control_iterations = param.getDefault("max_well_control_iterations", 10); // Rock compressibility. - rock_comp.reset(new RockCompressibility(deck)); + rock_comp.reset(new RockCompressibility(deck, eclipseState)); // Gravity. gravity[2] = deck->hasKeyword("NOGRAV") ? 0.0 : unit::gravity; // Init state variables (saturation and pressure). @@ -120,7 +120,7 @@ try } initBlackoilSurfvol(*grid->c_grid(), *props, state); // Init polymer properties. - poly_props.readFromDeck(deck); + poly_props.readFromDeck(eclipseState); } else { // Grid init. const int nx = param.getDefault("nx", 100); diff --git a/examples/sim_poly2p_incomp_reorder.cpp b/examples/sim_poly2p_incomp_reorder.cpp index e1cbc23a5..5e427af2d 100644 --- a/examples/sim_poly2p_incomp_reorder.cpp +++ b/examples/sim_poly2p_incomp_reorder.cpp @@ -109,7 +109,7 @@ try // check_well_controls = param.getDefault("check_well_controls", false); // max_well_control_iterations = param.getDefault("max_well_control_iterations", 10); // Rock compressibility. - rock_comp.reset(new RockCompressibility(deck)); + rock_comp.reset(new RockCompressibility(deck, eclipseState)); // Gravity. gravity[2] = deck->hasKeyword("NOGRAV") ? 0.0 : unit::gravity; // Init state variables (saturation and pressure). @@ -119,7 +119,7 @@ try initStateFromDeck(*grid->c_grid(), *props, deck, gravity[2], state); } // Init polymer properties. - poly_props.readFromDeck(deck); + poly_props.readFromDeck(eclipseState); } else { // Grid init. const int nx = param.getDefault("nx", 100); diff --git a/opm/polymer/PolymerProperties.hpp b/opm/polymer/PolymerProperties.hpp index 4ee4ba9fd..aee061fae 100644 --- a/opm/polymer/PolymerProperties.hpp +++ b/opm/polymer/PolymerProperties.hpp @@ -21,11 +21,7 @@ #define OPM_POLYMERPROPERTIES_HEADER_INCLUDED #include -#include -#include -#include -#include -#include +#include #include #include @@ -86,9 +82,9 @@ namespace Opm { } - PolymerProperties(Opm::DeckConstPtr deck) + PolymerProperties(Opm::EclipseStateConstPtr eclipseState) { - readFromDeck(deck); + readFromDeck(eclipseState); } void set(double c_max, @@ -121,11 +117,11 @@ namespace Opm shear_vrf_vals_ = shear_vrf_vals; } - void readFromDeck(Opm::DeckConstPtr deck) + void readFromDeck(Opm::EclipseStateConstPtr eclipseState) { // We assume NTMISC=1 - Opm::PlymaxTable plymaxTable(deck->getKeyword("PLYMAX"), /*tableIdx=*/0); - Opm::TlmixparTable tlmixparTable(deck->getKeyword("TLMIXPAR"), /*tableIdx=*/0); + const auto& plymaxTable = eclipseState->getPlymaxTables()[0]; + const auto& tlmixparTable = eclipseState->getTlmixparTables()[0]; // We also assume that each table has exactly one row... assert(plymaxTable.numRows() == 1); @@ -135,7 +131,7 @@ namespace Opm mix_param_ = tlmixparTable.getViscosityParameterColumn()[0]; // We assume NTSFUN=1 - Opm::PlyrockTable plyrockTable(deck->getKeyword("PLYROCK"), /*tableIdx=*/0); + const auto& plyrockTable = eclipseState->getPlyrockTables()[0]; // We also assume that each table has exactly one row... assert(plyrockTable.numRows() == 1); @@ -147,7 +143,7 @@ namespace Opm c_max_ads_ = plyrockTable.getMaxAdsorbtionColumn()[0]; // We assume NTPVT=1 - Opm::PlyviscTable plyviscTable(deck->getKeyword("PLYVISC"), /*tableIdx=*/0); + const auto& plyviscTable = eclipseState->getPlyviscTables()[0]; // We also assume that each table has exactly one row... assert(plyviscTable.numRows() == 1); @@ -156,7 +152,7 @@ namespace Opm visc_mult_vals_[0] = plyviscTable.getViscosityMultiplierColumn()[0]; // We assume NTSFUN=1 - Opm::PlyadsTable plyadsTable(deck->getKeyword("PLYADS"), /*tableIdx=*/0); + const auto& plyadsTable = eclipseState->getPlyadsTables()[0]; // We also assume that each table has exactly one row... assert(plyadsTable.numRows() == 1);