adding two more parameters related to ms wells

to help to tune and improve the convergence.
This commit is contained in:
Kai Bao 2017-10-04 13:09:49 +02:00
parent fc64d34bc2
commit c3a368e58e
4 changed files with 14 additions and 3 deletions

View File

@ -51,6 +51,8 @@ namespace Opm
tolerance_wells_ = param.getDefault("tolerance_wells", tolerance_wells_ );
tolerance_well_control_ = param.getDefault("tolerance_well_control", tolerance_well_control_);
tolerance_pressure_ms_wells_ = param.getDefault("tolerance_pressure_ms_wells", tolerance_pressure_ms_wells_);
max_welleq_iter_ = param.getDefault("max_welleq_iter", max_welleq_iter_);
max_pressure_change_ms_wells_ = param.getDefault("max_pressure_change_ms_wells", max_pressure_change_ms_wells_);
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);
@ -78,6 +80,8 @@ namespace Opm
tolerance_wells_ = 1.0e-4;
tolerance_well_control_ = 1.0e-7;
tolerance_pressure_ms_wells_ = 100.0;
max_welleq_iter_ = 15;
max_pressure_change_ms_wells_ = 100000.; // 1.0 bar
maxSinglePrecisionTimeStep_ = unit::convert::from( 20.0, unit::day );
solve_welleq_initially_ = true;
update_equations_scaling_ = false;

View File

@ -53,6 +53,11 @@ namespace Opm
double tolerance_well_control_;
/// Tolerance for the pressure equations for multisegment wells
double tolerance_pressure_ms_wells_;
/// Maximum pressure change over an iteratio for ms wells
double max_pressure_change_ms_wells_;
/// Maximum iteration number of the well equation solution
int max_welleq_iter_;
/// Tolerance for time step in seconds where single precision can be used
/// for solving for the Jacobian

View File

@ -411,6 +411,8 @@ namespace Opm {
std::vector< Scalar > B_avg( numComp, Scalar() );
computeAverageFormationFactor(ebosSimulator, B_avg);
const int max_iter = param_.max_welleq_iter_;
int it = 0;
bool converged;
do {
@ -442,7 +444,7 @@ namespace Opm {
updateWellControls(well_state);
initPrimaryVariablesEvaluation();
}
} while (it < 15);
} while (it < max_iter);
if (converged) {
if ( terminal_output_ ) {

View File

@ -556,7 +556,6 @@ namespace Opm
// check convergence for flux residuals
for ( int comp_idx = 0; comp_idx < numComponents(); ++comp_idx)
{
// report.converged = report.converged && (maximum_residual[comp_idx] < param.tolerance_wells_ * 10.);
report.converged = report.converged && (maximum_residual[comp_idx] < param.tolerance_wells_);
}
@ -828,6 +827,7 @@ namespace Opm
// maybe better to give it a different name
const double dBHPLimit = param.dbhp_max_rel_;
const double dFLimit = param.dwell_fraction_max_;
const double max_pressure_change = param.max_pressure_change_ms_wells_;
const std::vector<std::array<double, numWellEq> > old_primary_variables = primary_variables_;
for (int seg = 0; seg < numberOfSegments(); ++seg) {
@ -850,7 +850,7 @@ namespace Opm
{
const int sign = dwells[seg][SPres] > 0.? 1 : -1;
const double current_pressure = old_primary_variables[seg][SPres];
const double dx_limited = sign * std::min(std::abs(dwells[seg][SPres]), dBHPLimit * current_pressure);
const double dx_limited = sign * std::min(std::abs(dwells[seg][SPres]), max_pressure_change);
primary_variables_[seg][SPres] = old_primary_variables[seg][SPres] - dx_limited;
}