mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-23 09:46:24 -06:00
EclNewtonMethod: Fix convergence criterion if the residual is volumetric
This commit is contained in:
parent
0a9d6a0760
commit
43dd9928b4
@ -159,16 +159,25 @@ public:
|
||||
}
|
||||
|
||||
const auto& r = currentResidual[dofIdx];
|
||||
const double pvValue =
|
||||
Scalar pvValue =
|
||||
this->simulator_.problem().porosity(dofIdx)
|
||||
* this->model().dofTotalVolume(dofIdx);
|
||||
sumPv += pvValue;
|
||||
bool cnvViolated = false;
|
||||
|
||||
Scalar dofVolume = this->model().dofTotalVolume(dofIdx);
|
||||
|
||||
for (unsigned eqIdx = 0; eqIdx < r.size(); ++eqIdx) {
|
||||
Scalar tmpError = r[eqIdx] * dt * this->model().eqWeight(dofIdx, eqIdx) / pvValue;
|
||||
Scalar tmpError2 = r[eqIdx] * this->model().eqWeight(dofIdx, eqIdx);
|
||||
|
||||
// in the case of a volumetric formulation, the residual in the above is
|
||||
// per cubic meter
|
||||
if (GET_PROP_VALUE(TypeTag, UseVolumetricResidual)) {
|
||||
tmpError *= dofVolume;
|
||||
tmpError2 *= dofVolume;
|
||||
}
|
||||
|
||||
this->error_ = Opm::max(std::abs(tmpError), this->error_);
|
||||
|
||||
if (std::abs(tmpError) > this->tolerance_)
|
||||
|
Loading…
Reference in New Issue
Block a user