mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-29 04:23:48 -06:00
Merge branch 'master' into oscillation_treatment_withlimitedupdate
Conflicts: opm/autodiff/FullyImplicitBlackoilSolver.hpp
This commit is contained in:
commit
578abe3b78
@ -241,15 +241,9 @@ namespace {
|
||||
ADB::null(),
|
||||
ADB::null() } )
|
||||
{
|
||||
if (param.has("dp_max_rel")) {
|
||||
dp_max_rel_ = param.get<double>(std::string("dp_max_rel"));
|
||||
}
|
||||
if (param.has("ds_max")) {
|
||||
ds_max_ = param.get<double>("ds_max");
|
||||
}
|
||||
if (param.has("drs_max_rel")) {
|
||||
drs_max_rel_ = param.get<double>("drs_max_rel");
|
||||
}
|
||||
dp_max_rel_ = param.getDefault("dp_max_rel", dp_max_rel_);
|
||||
ds_max_ = param.getDefault("ds_max", ds_max_);
|
||||
drs_max_rel_ = param.getDefault("drs_max_rel", drs_max_rel_);
|
||||
}
|
||||
|
||||
|
||||
@ -517,8 +511,8 @@ namespace {
|
||||
|
||||
// Initial well rates.
|
||||
assert (not xw.wellRates().empty());
|
||||
// Need to reshuffle well rates, from ordered by wells, then phase,
|
||||
// to ordered by phase, then wells.
|
||||
// Need to reshuffle well rates, from phase running fastest
|
||||
// to wells running fastest.
|
||||
const int nw = wells_.number_of_wells;
|
||||
// The transpose() below switches the ordering.
|
||||
const DataBlock wrates = Eigen::Map<const DataBlock>(& xw.wellRates()[0], nw, np).transpose();
|
||||
@ -1118,7 +1112,9 @@ namespace {
|
||||
break;
|
||||
case SURFACE_RATE:
|
||||
for (int phase = 0; phase < np; ++phase) {
|
||||
xw.wellRates()[np*w + phase] = target * distr[phase];
|
||||
if (distr[phase] > 0.0) {
|
||||
xw.wellRates()[np*w + phase] = target * distr[phase];
|
||||
}
|
||||
}
|
||||
rates_changed = true;
|
||||
break;
|
||||
@ -1135,7 +1131,11 @@ namespace {
|
||||
bhp = ADB::function(new_bhp, bhp.derivative());
|
||||
}
|
||||
if (rates_changed) {
|
||||
ADB::V new_qs = Eigen::Map<ADB::V>(xw.wellRates().data(), np*nw);
|
||||
// Need to reshuffle well rates, from phase running fastest
|
||||
// to wells running fastest.
|
||||
// The transpose() below switches the ordering.
|
||||
const DataBlock wrates = Eigen::Map<const DataBlock>(xw.wellRates().data(), nw, np).transpose();
|
||||
const ADB::V new_qs = Eigen::Map<const V>(wrates.data(), nw*np);
|
||||
well_phase_flow_rate = ADB::function(new_qs, well_phase_flow_rate.derivative());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user