diff --git a/opm/autodiff/BlackoilMultiSegmentModel.hpp b/opm/autodiff/BlackoilMultiSegmentModel.hpp index cb539634f..fee6864da 100644 --- a/opm/autodiff/BlackoilMultiSegmentModel.hpp +++ b/opm/autodiff/BlackoilMultiSegmentModel.hpp @@ -123,9 +123,9 @@ namespace Opm { /// \param[in] dx updates to apply to primary variables /// \param[in, out] reservoir_state reservoir state variables /// \param[in, out] well_state well state variables - /* void updateState(const V& dx, + void updateState(const V& dx, ReservoirState& reservoir_state, - WellState& well_state) {}; */ + WellState& well_state); using Base::numPhases; protected: @@ -148,6 +148,13 @@ namespace Opm { using Base::grid_; using Base::canph_; using Base::residual_; + using Base::isSg_; + using Base::isRs_; + using Base::isRv_; + using Base::has_disgas_; + using Base::has_vapoil_; + using Base::primalVariable_; + using Base::cells_; // Diff to the pressure of the related segment. @@ -198,6 +205,12 @@ namespace Opm { using Base::fluidRvSat; using Base::fluidRsSat; using Base::fluidDensity; + using Base::updatePhaseCondFromPrimalVariable; + using Base::updateWellState; + using Base::computeGasPressure; + using Base::dpMaxRel; + using Base::dsMax; + using Base::drMaxRel; const std::vector& wellsMultiSegment() const { return wells_multisegment_; } diff --git a/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp b/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp index d4e7fa121..4789794e5 100644 --- a/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp +++ b/opm/autodiff/BlackoilMultiSegmentModel_impl.hpp @@ -1138,16 +1138,16 @@ namespace Opm { -/* - template - void BlackoilModelBase::updateState(const V& dx, + + template + void BlackoilMultiSegmentModel::updateState(const V& dx, ReservoirState& reservoir_state, WellState& well_state) { using namespace Opm::AutoDiffGrid; const int np = fluid_.numPhases(); const int nc = numCells(grid_); - const int nw = localWellsActive() ? wells().number_of_wells : 0; + const int nw = wellsMultiSegment().size(); const V null; assert(null.size() == 0); const V zero = V::Zero(nc); @@ -1162,7 +1162,8 @@ namespace Opm { varstart += dxvar.size(); // Extract well parts np phase rates + bhp - const V dwells = subset(dx, Span((np+1)*nw, 1, varstart)); + const int nseg_total = well_state.numberOfSegments(); + const V dwells = subset(dx, Span((np+1)*nseg_total, 1, varstart)); varstart += dwells.size(); assert(varstart == dx.size()); @@ -1357,7 +1358,7 @@ namespace Opm { // Update phase conditions used for property calculations. updatePhaseCondFromPrimalVariable(); } -*/ +