Avoid hard-coded appelyard parameter in flow_ebos

Start using the parameters in the parameter file instead of the hard-
coded ones.
Unify the restriction of the drs and drv in black-oil and black-oil-
solvent updateState
This commit is contained in:
Tor Harald Sandve 2016-11-25 12:40:33 +01:00
parent 6e03b9706f
commit e614c42818
5 changed files with 14 additions and 6 deletions

View File

@ -1260,7 +1260,7 @@ typedef Eigen::Array<double,
if (has_disgas_) {
const V rs_old = Eigen::Map<const V>(&reservoir_state.gasoilratio()[0], nc);
const V drs = isRs_ * dxvar;
const V drs_limited = sign(drs) * drs.abs().min( (rs_old.abs()*drmaxrel).max( ones*1e-6));
const V drs_limited = sign(drs) * drs.abs().min( (rs_old.abs()*drmaxrel).max( ones*1.0));
rs = rs_old - drs_limited;
rs = rs.max(zero);
}
@ -1268,7 +1268,7 @@ typedef Eigen::Array<double,
if (has_vapoil_) {
const V rv_old = Eigen::Map<const V>(&reservoir_state.rv()[0], nc);
const V drv = isRv_ * dxvar;
const V drv_limited = sign(drv) * drv.abs().min( (rv_old.abs()*drmaxrel).max( ones*1e-6));
const V drv_limited = sign(drv) * drv.abs().min( (rv_old.abs()*drmaxrel).max( ones*1e-3));
rv = rv_old - drv_limited;
rv = rv.max(zero);
}

View File

@ -19,6 +19,7 @@
#include <opm/autodiff/BlackoilModelParameters.hpp>
#include <opm/core/utility/parameters/ParameterGroup.hpp>
#include <opm/parser/eclipse/Units/Units.hpp>
namespace Opm
{
@ -43,6 +44,7 @@ namespace Opm
ds_max_ = param.getDefault("ds_max", ds_max_);
dr_max_rel_ = param.getDefault("dr_max_rel", dr_max_rel_);
dbhp_max_rel_= param.getDefault("dbhp_max_rel", dbhp_max_rel_);
dwell_fraction_max_ = param.getDefault("dwell_fraction_max", dwell_fraction_max_);
max_residual_allowed_ = param.getDefault("max_residual_allowed", max_residual_allowed_);
tolerance_mb_ = param.getDefault("tolerance_mb", tolerance_mb_);
tolerance_cnv_ = param.getDefault("tolerance_cnv", tolerance_cnv_);
@ -63,10 +65,11 @@ namespace Opm
void BlackoilModelParameters::reset()
{
// default values for the solver parameters
dp_max_rel_ = 0.2;
dp_max_rel_ = 1.0;
ds_max_ = 0.2;
dr_max_rel_ = 1.0e9;
dbhp_max_rel_ = 1.0;
dwell_fraction_max_ = 0.2;
max_residual_allowed_ = 1e7;
tolerance_mb_ = 1.0e-5;
tolerance_cnv_ = 1.0e-2;

View File

@ -38,6 +38,8 @@ namespace Opm
double dr_max_rel_;
/// Max relative change in bhp in single iteration.
double dbhp_max_rel_;
/// Max absolute change in well volume fraction in single iteration.
double dwell_fraction_max_;
/// Absolute max limit for residuals.
double max_residual_allowed_;
/// Relative mass balance tolerance (total mass balance error).

View File

@ -548,7 +548,7 @@ namespace Opm {
if (has_vapoil_) {
const V rv_old = Eigen::Map<const V>(&reservoir_state.rv()[0], nc);
const V drv = Base::isRv_ * dxvar;
const V drv_limited = sign(drv) * drv.abs().min( (rv_old.abs()*drmaxrel).max( ones*1e-6));
const V drv_limited = sign(drv) * drv.abs().min( (rv_old.abs()*drmaxrel).max( ones*1e-3));
rv = rv_old - drv_limited;
rv = rv.max(zero);
}

View File

@ -935,8 +935,8 @@ enum WellVariablePositions {
const int np = wells().number_of_phases;
const int nw = wells().number_of_wells;
double dFLimit = 0.2;
double dBHPLimit = 2.0;
double dFLimit = dWellFractionMax();
double dBHPLimit = dbhpMaxRel();
std::vector<double> xvar_well_old = well_state.wellSolutions();
for (int w = 0; w < nw; ++w) {
@ -1503,6 +1503,9 @@ enum WellVariablePositions {
mutable BVector invDrw_;
mutable BVector scaleAddRes_;
double dbhpMaxRel() const {return param_.dbhp_max_rel_; }
double dWellFractionMax() const {return param_.dwell_fraction_max_; }
// protected methods
EvalWell getBhp(const int wellIdx) const {
const WellControls* wc = wells().ctrls[wellIdx];