ebos: linearize the auxiliary equations for shut wells correctly

before this, a zero matrix was produced on the main diagonal which
(rightfully) caused the linear solver to bail out. Now, the linearized
equation is still rubbish, but it is not singular anymore and the
result for shut wells is not used anywhere in the first place...
This commit is contained in:
Andreas Lauser 2016-02-26 15:00:30 +01:00
parent 2bf24ca74b
commit 8da01a317d

View File

@ -339,6 +339,20 @@ public:
for (unsigned i = 0; i < numModelEq; ++ i)
diagBlock[i][i] = 1.0;
if (wellStatus() == Shut) {
// if the well is shut, make the auxiliary DOFs a trivial equation in the
// matrix: the main diagonal is already set to the identity matrix, the
// off-diagonal matrix entries must be set to 0.
auto wellDofIt = dofVariables_.begin();
const auto &wellDofEndIt = dofVariables_.end();
for (; wellDofIt != wellDofEndIt; ++ wellDofIt) {
matrix[wellGlobalDofIdx][wellDofIt->first] = 0.0;
matrix[wellDofIt->first][wellGlobalDofIdx] = 0.0;
residual[wellGlobalDofIdx] = 0.0;
}
return;
}
// account for the effect of the grid DOFs which are influenced by the well on
// the well equation and the effect of the well on the grid DOFs
auto wellDofIt = dofVariables_.begin();