Moves calculation of the total pore volume into convergenceReduction.

It is a global reduction in the parallel case and should therefore be
computed together with the other ones.
This commit is contained in:
Markus Blatt 2015-01-27 12:49:55 +01:00
parent ddc2b820a7
commit f820e1d441
2 changed files with 8 additions and 5 deletions

View File

@ -353,8 +353,9 @@ namespace Opm {
/// residual mass balance (tol_cnv).
bool getConvergence(const double dt, const int iteration);
/// Compute the reduction within the convergence check.
void
/// \brief Compute the reduction within the convergence check.
/// \return The total pore volume.
double
convergenceReduction(const Eigen::Array<double, Eigen::Dynamic, MaxNumPhases>& B,
const Eigen::Array<double, Eigen::Dynamic, MaxNumPhases>& tempV,
const Eigen::Array<double, Eigen::Dynamic, MaxNumPhases>& R,

View File

@ -1886,7 +1886,7 @@ namespace {
}
template<class T>
void
double
FullyImplicitBlackoilSolver<T>::convergenceReduction(const Eigen::Array<double, Eigen::Dynamic, MaxNumPhases>& B,
const Eigen::Array<double, Eigen::Dynamic, MaxNumPhases>& tempV,
const Eigen::Array<double, Eigen::Dynamic, MaxNumPhases>& R,
@ -1907,6 +1907,9 @@ namespace {
R_sum[pu.phase_pos[idx]] = B_avg[pu.phase_pos[idx]] = maxCoeff[pu.phase_pos[idx]] =0.;
}
}
// Compute total pore volume
const V pv = geo_.poreVolume();
return pv.sum();
}
template<class T>
@ -1920,7 +1923,6 @@ namespace {
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
const V pv = geo_.poreVolume();
const double pvSum = pv.sum();
const std::vector<PhasePresence> cond = phaseCondition();
@ -1944,7 +1946,7 @@ namespace {
}
}
convergenceReduction(B, tempV, R, B_avg, maxCoeff, R_sum, nc);
const double pvSum = convergenceReduction(B, tempV, R, B_avg, maxCoeff, R_sum, nc);
bool converged_MB = true;
bool converged_CNV = true;