Bugfix: take minimum of allowed slopes, not maximum.

This commit is contained in:
Atgeirr Flø Rasmussen
2013-01-04 19:59:05 +01:00
parent 76868ebc1c
commit 583c905a43

View File

@@ -404,7 +404,7 @@ namespace Opm
const int dim = grid_.dimensions; const int dim = grid_.dimensions;
const int num_basis = DGBasis::numBasisFunc(dim, degree_); const int num_basis = DGBasis::numBasisFunc(dim, degree_);
double max_slope_mult = 0.0; double max_slope_mult = 1e100;
int num_upstream_faces = 0; int num_upstream_faces = 0;
// For inflow faces, ensure that cell tof does not dip below // For inflow faces, ensure that cell tof does not dip below
// the minimum value from upstream (for all faces). // the minimum value from upstream (for all faces).
@@ -453,7 +453,7 @@ namespace Opm
break; break;
} }
const double face_mult = (tof_c - min_upstream)/(tof_c - min_here); const double face_mult = (tof_c - min_upstream)/(tof_c - min_here);
max_slope_mult = std::max(max_slope_mult, face_mult); max_slope_mult = std::min(max_slope_mult, face_mult);
} }
ASSERT(max_slope_mult >= 0.0); ASSERT(max_slope_mult >= 0.0);