Merge pull request #1211 from andlaus/improve_cnv

Improve stability by changing the convergence check
This commit is contained in:
Atgeirr Flø Rasmussen
2017-06-15 10:39:13 +02:00
committed by GitHub
5 changed files with 14 additions and 5 deletions

View File

@@ -27,7 +27,7 @@ macro (add_test_compareECLFiles casename filename simulator abs_tol rel_tol pref
set(DIR ${casename})
endif()
if(${ARGC} GREATER 8)
set(TEST_ARGS ${OPM_DATA_ROOT}/${DIR}/${ARGV1} deckfilename=${OPM_DATA_ROOT}/${DIR}/${filename})
set(TEST_ARGS ${OPM_DATA_ROOT}/${DIR}/${ARGV8} deck_filename=${OPM_DATA_ROOT}/${DIR}/${filename}.DATA)
else()
set(TEST_ARGS ${OPM_DATA_ROOT}/${DIR}/${filename})
endif()
@@ -113,8 +113,8 @@ add_test_compareECLFiles(spe3 SPE3CASE1 flow_legacy ${abs_tol} ${rel_tol} compar
add_test_compareECLFiles(spe9 SPE9_CP_SHORT flow_ebos ${abs_tol} ${rel_tol} compareECLFiles "")
add_test_compareECLFiles(spe9 SPE9_CP_SHORT flow_legacy ${abs_tol} ${rel_tol} compareECLFiles "")
add_test_compareECLFiles(msw_2d_h 2D_H__ flow_multisegment ${abs_tol} ${rel_tol} compareECLFiles "")
add_test_compareECLFiles(polymer_simple2D 2D_THREEPHASE_POLY_HETER flow_polymer ${abs_tol} ${rel_tol} compareECLFiles "" polymer_simple2D run.param)
add_test_compareECLFiles(spe5 SPE5CASE1 flow_solvent ${abs_tol} ${rel_tol} compareECLFiles "")
add_test_compareECLFiles(polymer_simple2D 2D_THREEPHASE_POLY_HETER flow_polymer ${abs_tol} ${rel_tol} compareECLFiles "")
add_test_compareECLFiles(spe5 SPE5CASE1 flow_solvent ${abs_tol} ${rel_tol} compareECLFiles "" spe5 run.param)
# Restart tests
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-restart-regressionTest.sh "")

View File

@@ -975,7 +975,12 @@ namespace Opm {
residual_norms.push_back(CNV[compIdx]);
}
const bool converged = converged_MB && converged_CNV && converged_Well;
bool converged = converged_MB && converged_Well;
// do not care about the cell based residual in the last two Newton
// iterations
if (iteration < param_.max_strict_iter_)
converged = converged && converged_CNV;
if ( terminal_output_ )
{

View File

@@ -52,6 +52,7 @@ namespace Opm
tolerance_well_control_ = param.getDefault("tolerance_well_control", tolerance_well_control_);
maxSinglePrecisionTimeStep_ = unit::convert::from(
param.getDefault("max_single_precision_days", unit::convert::to( maxSinglePrecisionTimeStep_, unit::day) ), unit::day );
max_strict_iter_ = param.getDefault("max_strict_iter",8);
solve_welleq_initially_ = param.getDefault("solve_welleq_initially",solve_welleq_initially_);
update_equations_scaling_ = param.getDefault("update_equations_scaling", update_equations_scaling_);
use_update_stabilization_ = param.getDefault("use_update_stabilization", use_update_stabilization_);

View File

@@ -56,6 +56,9 @@ namespace Opm
/// for solving for the Jacobian
double maxSinglePrecisionTimeStep_;
/// Maximum number of Newton iterations before we give up on the CNV convergence criterion
int max_strict_iter_;
/// Solve well equation initially
bool solve_welleq_initially_;

View File

@@ -184,7 +184,7 @@ namespace Opm
relax_max_ = 0.5;
relax_increment_ = 0.1;
relax_rel_tol_ = 0.2;
max_iter_ = 15;
max_iter_ = 10;
min_iter_ = 1;
}