diff --git a/opm/autodiff/BlackoilModel.hpp b/opm/autodiff/BlackoilModel.hpp index bfcb2a81f..3e869ef67 100644 --- a/opm/autodiff/BlackoilModel.hpp +++ b/opm/autodiff/BlackoilModel.hpp @@ -65,12 +65,13 @@ namespace Opm { const DerivedGeology& geo, const RockCompressibility* rock_comp_props, const Wells* wells, + const VFPProperties* vfp_properties, const NewtonIterationBlackoilInterface& linsolver, Opm::EclipseStateConstPtr eclState, const bool has_disgas, const bool has_vapoil, const bool terminal_output) - : Base(param, grid, fluid, geo, rock_comp_props, wells, linsolver, + : Base(param, grid, fluid, geo, rock_comp_props, wells, vfp_properties, linsolver, eclState, has_disgas, has_vapoil, terminal_output) { } diff --git a/opm/autodiff/BlackoilModelBase.hpp b/opm/autodiff/BlackoilModelBase.hpp index 0ab18c520..2b863da81 100644 --- a/opm/autodiff/BlackoilModelBase.hpp +++ b/opm/autodiff/BlackoilModelBase.hpp @@ -43,6 +43,7 @@ namespace Opm { class DerivedGeology; class RockCompressibility; class NewtonIterationBlackoilInterface; + class VFPProperties; /// Struct for containing iteration variables. @@ -117,6 +118,7 @@ namespace Opm { /// \param[in] geo rock properties /// \param[in] rock_comp_props if non-null, rock compressibility properties /// \param[in] wells well structure + /// \param[in] vfp_properties Vertical flow performance tables /// \param[in] linsolver linear solver /// \param[in] eclState eclipse state /// \param[in] has_disgas turn on dissolved gas @@ -128,6 +130,7 @@ namespace Opm { const DerivedGeology& geo , const RockCompressibility* rock_comp_props, const Wells* wells, + const VFPProperties* vfp_properties, const NewtonIterationBlackoilInterface& linsolver, Opm::EclipseStateConstPtr eclState, const bool has_disgas, @@ -236,6 +239,7 @@ namespace Opm { const DerivedGeology& geo_; const RockCompressibility* rock_comp_props_; const Wells* wells_; + const VFPProperties* vfp_properties_; const NewtonIterationBlackoilInterface& linsolver_; // For each canonical phase -> true if active const std::vector active_; diff --git a/opm/autodiff/BlackoilModelBase_impl.hpp b/opm/autodiff/BlackoilModelBase_impl.hpp index fdfc259ae..0331c61e0 100644 --- a/opm/autodiff/BlackoilModelBase_impl.hpp +++ b/opm/autodiff/BlackoilModelBase_impl.hpp @@ -144,6 +144,7 @@ namespace detail { const DerivedGeology& geo , const RockCompressibility* rock_comp_props, const Wells* wells, + const VFPProperties* vfp_properties, const NewtonIterationBlackoilInterface& linsolver, Opm::EclipseStateConstPtr eclState, const bool has_disgas, @@ -154,6 +155,7 @@ namespace detail { , geo_ (geo) , rock_comp_props_(rock_comp_props) , wells_ (wells) + , vfp_properties_(vfp_properties) , linsolver_ (linsolver) , active_(detail::activePhases(fluid.phaseUsage())) , canph_ (detail::active2Canonical(fluid.phaseUsage())) @@ -1369,7 +1371,7 @@ namespace detail { } const ADB bhp_residual = state.bhp - bhp_targets; const ADB rate_residual = rate_distr * state.qs - rate_targets; - //ARB: add here const ... thp_residual = state.bhp - vfpprop.bhp(thp_ctrl, state.qs, alq?); //Make bhp function take ADB's as input params. + //const ADB thp_residual = state.bhp - vfpprop.bhp(thp_ctrl, state.qs, alq); //wells // Choose bhp residual for positive bhp targets. Selector bhp_selector(bhp_targets); diff --git a/opm/autodiff/SimulatorBase.hpp b/opm/autodiff/SimulatorBase.hpp index 05e3e3da9..a6c192e81 100644 --- a/opm/autodiff/SimulatorBase.hpp +++ b/opm/autodiff/SimulatorBase.hpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -191,6 +192,8 @@ namespace Opm RateConverterType rateConverter_; // Threshold pressures. std::vector threshold_pressures_by_face_; + //Vertical flow performance tables + VFPProperties vfpProperties_; // Whether this a parallel simulation or not bool is_parallel_run_; }; diff --git a/opm/autodiff/SimulatorBase_impl.hpp b/opm/autodiff/SimulatorBase_impl.hpp index 8e88754db..a95737e1e 100644 --- a/opm/autodiff/SimulatorBase_impl.hpp +++ b/opm/autodiff/SimulatorBase_impl.hpp @@ -53,7 +53,8 @@ namespace Opm output_writer_(output_writer), rateConverter_(props_, std::vector(AutoDiffGrid::numCells(grid_), 0)), threshold_pressures_by_face_(threshold_pressures_by_face), - is_parallel_run_( false ) + is_parallel_run_( false ), + vfpProperties_(eclipse_state->getVFPProdTables()) { // Misc init. const int num_cells = AutoDiffGrid::numCells(grid); @@ -339,6 +340,7 @@ namespace Opm geo_, rock_comp_props_, wells, + &vfpProperties_, solver_, eclipse_state_, has_disgas_,