adding updateState() for BlackoilMultiSegmentModel

This commit is contained in:
Kai Bao 2015-09-28 14:26:54 +02:00
parent 2e74b7cbaf
commit f496646182
2 changed files with 22 additions and 8 deletions

View File

@ -123,9 +123,9 @@ namespace Opm {
/// \param[in] dx updates to apply to primary variables /// \param[in] dx updates to apply to primary variables
/// \param[in, out] reservoir_state reservoir state variables /// \param[in, out] reservoir_state reservoir state variables
/// \param[in, out] well_state well state variables /// \param[in, out] well_state well state variables
/* void updateState(const V& dx, void updateState(const V& dx,
ReservoirState& reservoir_state, ReservoirState& reservoir_state,
WellState& well_state) {}; */ WellState& well_state);
using Base::numPhases; using Base::numPhases;
protected: protected:
@ -148,6 +148,13 @@ namespace Opm {
using Base::grid_; using Base::grid_;
using Base::canph_; using Base::canph_;
using Base::residual_; 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. // Diff to the pressure of the related segment.
@ -198,6 +205,12 @@ namespace Opm {
using Base::fluidRvSat; using Base::fluidRvSat;
using Base::fluidRsSat; using Base::fluidRsSat;
using Base::fluidDensity; using Base::fluidDensity;
using Base::updatePhaseCondFromPrimalVariable;
using Base::updateWellState;
using Base::computeGasPressure;
using Base::dpMaxRel;
using Base::dsMax;
using Base::drMaxRel;
const std::vector<WellMultiSegmentConstPtr>& wellsMultiSegment() const { return wells_multisegment_; } const std::vector<WellMultiSegmentConstPtr>& wellsMultiSegment() const { return wells_multisegment_; }

View File

@ -1138,16 +1138,16 @@ namespace Opm {
/*
template <class Grid, class Implementation> template <class Grid>
void BlackoilModelBase<Grid, Implementation>::updateState(const V& dx, void BlackoilMultiSegmentModel<Grid>::updateState(const V& dx,
ReservoirState& reservoir_state, ReservoirState& reservoir_state,
WellState& well_state) WellState& well_state)
{ {
using namespace Opm::AutoDiffGrid; using namespace Opm::AutoDiffGrid;
const int np = fluid_.numPhases(); const int np = fluid_.numPhases();
const int nc = numCells(grid_); const int nc = numCells(grid_);
const int nw = localWellsActive() ? wells().number_of_wells : 0; const int nw = wellsMultiSegment().size();
const V null; const V null;
assert(null.size() == 0); assert(null.size() == 0);
const V zero = V::Zero(nc); const V zero = V::Zero(nc);
@ -1162,7 +1162,8 @@ namespace Opm {
varstart += dxvar.size(); varstart += dxvar.size();
// Extract well parts np phase rates + bhp // 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(); varstart += dwells.size();
assert(varstart == dx.size()); assert(varstart == dx.size());
@ -1357,7 +1358,7 @@ namespace Opm {
// Update phase conditions used for property calculations. // Update phase conditions used for property calculations.
updatePhaseCondFromPrimalVariable(); updatePhaseCondFromPrimalVariable();
} }
*/