Merge branch 'master' into oscillation_treatment_withlimitedupdate

Conflicts:
	opm/autodiff/FullyImplicitBlackoilSolver.hpp
This commit is contained in:
Kai Bao
2014-05-21 10:12:49 +02:00

View File

@@ -241,15 +241,9 @@ namespace {
ADB::null(), ADB::null(),
ADB::null() } ) ADB::null() } )
{ {
if (param.has("dp_max_rel")) { dp_max_rel_ = param.getDefault("dp_max_rel", dp_max_rel_);
dp_max_rel_ = param.get<double>(std::string("dp_max_rel")); ds_max_ = param.getDefault("ds_max", ds_max_);
} drs_max_rel_ = param.getDefault("drs_max_rel", drs_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");
}
} }
@@ -517,8 +511,8 @@ namespace {
// Initial well rates. // Initial well rates.
assert (not xw.wellRates().empty()); assert (not xw.wellRates().empty());
// Need to reshuffle well rates, from ordered by wells, then phase, // Need to reshuffle well rates, from phase running fastest
// to ordered by phase, then wells. // to wells running fastest.
const int nw = wells_.number_of_wells; const int nw = wells_.number_of_wells;
// The transpose() below switches the ordering. // The transpose() below switches the ordering.
const DataBlock wrates = Eigen::Map<const DataBlock>(& xw.wellRates()[0], nw, np).transpose(); const DataBlock wrates = Eigen::Map<const DataBlock>(& xw.wellRates()[0], nw, np).transpose();
@@ -1118,8 +1112,10 @@ namespace {
break; break;
case SURFACE_RATE: case SURFACE_RATE:
for (int phase = 0; phase < np; ++phase) { for (int phase = 0; phase < np; ++phase) {
if (distr[phase] > 0.0) {
xw.wellRates()[np*w + phase] = target * distr[phase]; xw.wellRates()[np*w + phase] = target * distr[phase];
} }
}
rates_changed = true; rates_changed = true;
break; break;
default: default:
@@ -1135,7 +1131,11 @@ namespace {
bhp = ADB::function(new_bhp, bhp.derivative()); bhp = ADB::function(new_bhp, bhp.derivative());
} }
if (rates_changed) { 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()); well_phase_flow_rate = ADB::function(new_qs, well_phase_flow_rate.derivative());
} }
} }