Update perfPressure

The secondary variable perfpressure is updated when the well
equation is assembled. The perfpressure is used to calculate the
welldensity.
This commit is contained in:
Tor Harald Sandve 2014-05-08 13:32:49 +02:00
parent 0ae44c32b1
commit 3143333b69
2 changed files with 13 additions and 1 deletions

View File

@ -170,6 +170,7 @@ namespace Opm {
void
addWellEq(const SolutionState& state,
WellStateFullyImplicitBlackoil& xw,
V& aliveWells);
void updateWellControls(ADB& bhp,

View File

@ -712,7 +712,7 @@ namespace {
// a well control is switched.
updateWellControls(state.bhp, state.qs, xw);
V aliveWells;
addWellEq(state, aliveWells);
addWellEq(state, xw, aliveWells);
addWellControlEq(state, xw, aliveWells);
}
@ -722,6 +722,7 @@ namespace {
template <class T>
void FullyImplicitBlackoilSolver<T>::addWellEq(const SolutionState& state,
WellStateFullyImplicitBlackoil& xw,
V& aliveWells)
{
const int nc = Opm::AutoDiffGrid::numCells(grid_);
@ -904,6 +905,7 @@ namespace {
residual_.material_balance_eq[phase] -= superset(cq_s[phase],well_cells,nc);
}
// Add WELL EQUATIONS
ADB qs = state.qs;
for (int phase = 0; phase < np; ++phase) {
@ -911,6 +913,15 @@ namespace {
}
V cq = superset(cq_s[0].value(), Span(nperf, np, 0), nperf*np);
for (int phase = 1; phase < np; ++phase) {
cq += superset(cq_s[phase].value(), Span(nperf, np, phase), nperf*np);
}
std::vector<double> cq_d(cq.data(), cq.data() + nperf*np);
xw.perfPhaseRates() = cq_d;
residual_.well_flux_eq = qs;
}