Work in progress on adding wells.

This commit is contained in:
Atgeirr Flø Rasmussen 2013-05-15 09:23:15 +02:00
parent 90a4984dea
commit 7dbb9b50e1

View File

@ -346,8 +346,10 @@ namespace Opm {
const V delta_t = dt * V::Ones(nc, 1); const V delta_t = dt * V::Ones(nc, 1);
const V transi = subset(geo_.transmissibility(), const V transi = subset(geo_.transmissibility(),
ops_.internal_faces); ops_.internal_faces);
const int num_perf = wells_.well_connpos[nw];
const std::vector<int> well_cells(wells_.well_cells, const std::vector<int> well_cells(wells_.well_cells,
wells_.well_cells + wells_.well_connpos[nw]); wells_.well_cells + num_perf);
const V transw = Eigen::Map<const V>(wells_.WI, num_perf, 1);
// Initialize AD variables: p (cell pressures) and bhp (well bhp). // Initialize AD variables: p (cell pressures) and bhp (well bhp).
const V p0 = Eigen::Map<const V>(&state.pressure()[0], nc, 1); const V p0 = Eigen::Map<const V>(&state.pressure()[0], nc, 1);
@ -380,6 +382,8 @@ namespace Opm {
// Finally construct well perforation pressures. // Finally construct well perforation pressures.
const ADB p_perfwell = well_to_perf*bhp + well_perf_dp; const ADB p_perfwell = well_to_perf*bhp + well_perf_dp;
// const ADB nkgradp_well = transw * (p_perfcell - p_perfwell);
cell_residual_ = ADB::constant(pv, bpat); cell_residual_ = ADB::constant(pv, bpat);
for (int phase = 0; phase < np; ++phase) { for (int phase = 0; phase < np; ++phase) {
const ADB cell_B = pdepfdata_.fvf(phase, p); const ADB cell_B = pdepfdata_.fvf(phase, p);