checking the residual for the well control equations.

This commit is contained in:
Kai Bao
2016-11-11 13:26:22 +01:00
parent 736585e85b
commit ce8498c4d7
3 changed files with 13 additions and 2 deletions

View File

@@ -1840,6 +1840,7 @@ namespace detail {
const double tol_mb = param_.tolerance_mb_;
const double tol_cnv = param_.tolerance_cnv_;
const double tol_wells = param_.tolerance_wells_;
const double tol_well_control = param_.tolerance_well_control_;
const int nc = Opm::AutoDiffGrid::numCells(grid_);
const int np = asImpl().numPhases();
@@ -1893,7 +1894,7 @@ namespace detail {
const double residualWell = detail::infinityNormWell(residual_.well_eq,
linsolver_.parallelInformation());
converged_Well = converged_Well && (residualWell < Opm::unit::barsa);
converged_Well = converged_Well && (residualWell < tol_well_control);
const bool converged = converged_MB && converged_CNV && converged_Well;
// Residual in Pascal can have high values and still be ok.
@@ -1913,6 +1914,7 @@ namespace detail {
for (int idx = 0; idx < np; ++idx) {
msg += " W-FLUX(" + materialName(idx).substr(0, 1) + ")";
}
msg += " WELL-CONT";
// std::cout << " WELL-CONT ";
OpmLog::note(msg);
}
@@ -1929,6 +1931,7 @@ namespace detail {
for (int idx = 0; idx < np; ++idx) {
ss << std::setw(11) << well_flux_residual[idx];
}
ss << std::setw(11) << residualWell;
// std::cout << std::setw(11) << residualWell;
ss.precision(oprec);
ss.flags(oflags);
@@ -1976,6 +1979,7 @@ namespace detail {
getWellConvergence(const int iteration)
{
const double tol_wells = param_.tolerance_wells_;
const double tol_well_control = param_.tolerance_well_control_;
const int nc = Opm::AutoDiffGrid::numCells(grid_);
const int np = asImpl().numPhases();
@@ -2010,7 +2014,7 @@ namespace detail {
const double residualWell = detail::infinityNormWell(residual_.well_eq,
linsolver_.parallelInformation());
converged_Well = converged_Well && (residualWell < Opm::unit::barsa);
converged_Well = converged_Well && (residualWell < tol_well_control);
const bool converged = converged_Well;
// if one of the residuals is NaN, throw exception, so that the solver can be restarted
@@ -2040,6 +2044,7 @@ namespace detail {
for (int idx = 0; idx < np; ++idx) {
msg += " W-FLUX(" + materialName(idx).substr(0, 1) + ")";
}
msg += " WELL-CONT";
OpmLog::note(msg);
}
std::ostringstream ss;
@@ -2049,6 +2054,7 @@ namespace detail {
for (int idx = 0; idx < np; ++idx) {
ss << std::setw(11) << well_flux_residual[idx];
}
ss << std::setw(11) << residualWell;
ss.precision(oprec);
ss.flags(oflags);
OpmLog::note(ss.str());