Merge pull request #916 from totto82/frankenstein_fix_appleyard2

Improvments in convergence for flow_ebos
This commit is contained in:
Andreas Lauser 2016-11-14 15:02:00 +01:00 committed by GitHub
commit 293f7ca1c7
5 changed files with 14 additions and 11 deletions

View File

@ -565,11 +565,13 @@ namespace Opm {
const int nc = numCells(grid_);
for (int cell_idx = 0; cell_idx < nc; ++cell_idx) {
double dp = dx[cell_idx][flowPhaseToEbosCompIdx(0)];
const double& dp = dx[cell_idx][flowPhaseToEbosCompIdx(0)];
//reservoir_state.pressure()[cell_idx] -= dp;
double& p = reservoir_state.pressure()[cell_idx];
p -= dp;
p = std::max(p, 1e5);
const double& dp_rel_max = dpMaxRel();
const int sign_dp = dp > 0 ? 1: -1;
p -= sign_dp * std::min(std::abs(dp), std::abs(p)*dp_rel_max);
p = std::max(p, 0.0);
// Saturation updates.
const double dsw = active_[Water] ? dx[cell_idx][flowPhaseToEbosCompIdx(1)] : 0.0;
@ -656,7 +658,7 @@ namespace Opm {
reservoir_state.hydroCarbonState()[cell_idx] = HydroCarbonState::OilOnly; // sg --> rs
sg = 0;
so = 1.0 - sw - sg;
double rsSat = FluidSystem::oilPvt().saturatedGasDissolutionFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]);
const double& rsSat = FluidSystem::oilPvt().saturatedGasDissolutionFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]);
double& rs = reservoir_state.gasoilratio()[cell_idx];
rs = rsSat*(1-epsilon);
} else if (so <= 0.0 && has_vapoil_) {
@ -665,7 +667,7 @@ namespace Opm {
sg = 1.0 - sw - so;
double& rv = reservoir_state.rv()[cell_idx];
// use gas pressure?
double rvSat = FluidSystem::gasPvt().saturatedOilVaporizationFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]);
const double& rvSat = FluidSystem::gasPvt().saturatedOilVaporizationFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]);
rv = rvSat*(1-epsilon);
}
break;
@ -683,7 +685,7 @@ namespace Opm {
double rsSat = FluidSystem::oilPvt().saturatedGasDissolutionFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]);
const double& rsSat = FluidSystem::oilPvt().saturatedGasDissolutionFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]);
if (rs > ( rsSat * (1+epsilon) ) ) {
reservoir_state.hydroCarbonState()[cell_idx] = HydroCarbonState::GasAndOil;
sg = epsilon;
@ -701,7 +703,7 @@ namespace Opm {
//std::cout << "watonly rv -> sg" << cell_idx << std::endl;
break;
}
double rvSat = FluidSystem::gasPvt().saturatedOilVaporizationFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]);
const double& rvSat = FluidSystem::gasPvt().saturatedOilVaporizationFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]);
if (rv > rvSat * (1+epsilon) ) {
reservoir_state.hydroCarbonState()[cell_idx] = HydroCarbonState::GasAndOil;
so = epsilon;

View File

@ -59,7 +59,7 @@ namespace Opm
void BlackoilModelParameters::reset()
{
// default values for the solver parameters
dp_max_rel_ = 1.0e9;
dp_max_rel_ = 1.0;
ds_max_ = 0.2;
dr_max_rel_ = 1.0e9;
max_residual_allowed_ = 1e7;

View File

@ -66,7 +66,7 @@ namespace Opm
{
newton_use_gmres_ = false;
linear_solver_reduction_ = 1e-2;
linear_solver_maxiter_ = 75;
linear_solver_maxiter_ = 150;
linear_solver_restart_ = 40;
linear_solver_verbosity_ = 0;
require_full_sparsity_pattern_ = false;

View File

@ -248,7 +248,7 @@ namespace Opm
stagnate = (stagnate && !(std::abs((F1[p] - F2[p]) / F2[p]) > 1.0e-3));
}
oscillate = (oscillatePhase > 1);
oscillate = (oscillatePhase > 0);
}

View File

@ -1502,7 +1502,8 @@ namespace Opm {
currentControlIdx += wells().comp_frac[np*wellIdx + i] * i;
}
if (wellVolumeFractionScaled(wellIdx,currentControlIdx) == 0) {
const double eps = 1e-6;
if (wellVolumeFractionScaled(wellIdx,currentControlIdx) < eps) {
return qs;
}
return (target_rate * wellVolumeFractionScaled(wellIdx,phaseIdx) / wellVolumeFractionScaled(wellIdx,currentControlIdx));