Removing two input paramters in stablizeNewton().

Removing the bool input parameters osicllate and stagnate from the
stablizeNewton(). Basically, the value omega will decide if the
relaxation will be applied.
This commit is contained in:
Kai Bao 2014-05-21 10:44:20 +02:00
parent 578abe3b78
commit 5277fa389d
2 changed files with 14 additions and 17 deletions

View File

@ -282,8 +282,7 @@ namespace Opm {
const int it, const double relaxRelTol,
bool &oscillate, bool &stagnate ) const;
void stablizeNewton(V &dx, V &dxOld, const bool &oscillate, const bool &stagnate, const double omega,
const RelaxType relax_type) const;
void stablizeNewton(V &dx, V &dxOld, const double omega, const RelaxType relax_type) const;
const double dpMaxRel () const { return dp_max_rel_; }
const double dsMax () const { return ds_max_; }
const double drsMaxRel () const { return drs_max_rel_; }

View File

@ -1700,11 +1700,11 @@ namespace {
void
FullyImplicitBlackoilSolver<T>::detectNewtonOscillations(const std::vector<std::vector<double>> residual_history,
const int it, const double relaxRelTol,
bool &oscillate, bool &stagnate ) const {
// It looks like that in MRST detection of oscillation in two primary variables results in the determination
// of the detection of oscillation for the solver.
// Here, we decide that the oscillation will be reported when oscillation for one primary variable is detected.
bool &oscillate, bool &stagnate ) const
{
// The detection of oscillation in two primary variable results in the report of the detection
// of oscillation for the solver
// Stagnate is not used for any treatment here.
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
oscillate = false;
@ -1731,8 +1731,8 @@ namespace {
residual_history[it][Water] );
oscillateWater = (relChange1 < relaxRelTol) && (relChange2 > relaxRelTol);
double relChange3 = std::fabs((residual_history[it-1][Water] - residual_history[it - 2][Water]) /
residual_history[it-2][Water] );
double relChange3 = std::fabs((residual_history[it - 1][Water] - residual_history[it - 2][Water]) /
residual_history[it - 2][Water] );
stagnateWater = relChange3 < 1.e-3;
}
@ -1744,8 +1744,8 @@ namespace {
residual_history[it][Oil] );
oscillateOil = (relChange1 < relaxRelTol) && (relChange2 > relaxRelTol);
double relChange3 = std::fabs((residual_history[it-1][Oil] - residual_history[it - 2][Oil]) /
residual_history[it-2][Oil] );
double relChange3 = std::fabs((residual_history[it - 1][Oil] - residual_history[it - 2][Oil]) /
residual_history[it - 2][Oil] );
stagnateOil = relChange3 < 1.e-3;
}
@ -1757,8 +1757,8 @@ namespace {
residual_history[it][Gas] );
oscillateGas = (relChange1 < relaxRelTol) && (relChange2 > relaxRelTol);
double relChange3 = std::fabs((residual_history[it-1][Gas] - residual_history[it - 2][Gas]) /
residual_history[it-2][Gas] );
double relChange3 = std::fabs((residual_history[it - 1][Gas] - residual_history[it - 2][Gas]) /
residual_history[it - 2][Gas] );
stagnateGas = relChange3 < 1.e-3;
}
@ -1770,9 +1770,8 @@ namespace {
template<class T>
void
FullyImplicitBlackoilSolver<T>::stablizeNewton( V &dx, V &dxOld, const bool &oscillate, const bool &stagnate,
const double omega, const RelaxType relax_type) const {
FullyImplicitBlackoilSolver<T>::stablizeNewton( V &dx, V &dxOld, const double omega,
const RelaxType relax_type) const {
const V tempDxOld = dxOld;
dxOld = dx;
@ -1787,7 +1786,6 @@ namespace {
if (omega == 1.) {
return;
}
// const V dxold = dx;
dx = dx*omega + (1.-omega)*tempDxOld;
return;
default: