changed linsolver_tolerance to 1e-12, added check on swir/swor

This commit is contained in:
Kari B. Skjerve
2012-01-24 13:07:04 +01:00
parent 1361539489
commit 2f31cfa8d0
4 changed files with 47 additions and 8 deletions
+18 -2
View File
@@ -229,7 +229,7 @@ int main(int varnum, char** vararg)
options.insert(make_pair("maxPermContrast", "1e7")); // maximum allowed contrast in each single-phase computation
options.insert(make_pair("saturationThreshold", "0.00001")); // accuracy threshold for saturation, we ignore Pc values
// that give so small contributions to Sw near endpoints.
options.insert(make_pair("linsolver_tolerance", "1e-8")); // residual tolerance for linear solver
options.insert(make_pair("linsolver_tolerance", "1e-12")); // residual tolerance for linear solver
options.insert(make_pair("linsolver_verbosity", "0")); // verbosity level for linear solver
options.insert(make_pair("linsolver_type", "1")); // type of linear solver: 0 = ILU/BiCGStab, 1 = AMG/CG
@@ -908,10 +908,26 @@ int main(int varnum, char** vararg)
cout << "LF Volume: " << volume << endl;
cout << "Upscaled porosity: " << poreVolume/volume << endl;
cout << "Upscaled Swir: " << Swir << endl;
cout << "Upscaled Swor: " << Swor << endl;
cout << "Upscaled Swmax: " << Swor << endl; //Swor=1-Swmax
cout << "Saturation points to be computed: " << points << endl;
}
// Sometimes, if Swmax=1 or Swir=0 in the input tables, the upscaled
// values can be a little bit larger (within machine precision) and
// the check below fails. Hence, check if these values are within the
// the [0 1] interval within some precision (use linsolver_precision)
if (Swor > 1.0 && Swor - linsolver_tolerance < 1.0) {
Swor = 1.0;
}
if (Swir < 0.0 && Swir + linsolver_tolerance > 0.0) {
Swir = 0.0;
}
if (Swir < 0.0 || Swir > 1.0 || Swor < 0.0 || Swor > 1.0) {
if (isMaster) cerr << "ERROR: Swir/Swor unsensible. Check your input. Exiting";
usageandexit();
}
/***********************************************************************
* Step 6
* Upscale fractional flow ratio vs water saturation