mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-30 13:03:49 -06:00
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:
parent
2bf24ca74b
commit
8da01a317d
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user