Fixes in computeFluxes().

- Give AD variables the correct block pattern (although as we
   change fluid interface they will not need to be ad types).
 - Make sure 'flux' is only on inner faces.
 - Copy full fluxes to state.faceflux().
This commit is contained in:
Atgeirr Flø Rasmussen 2013-05-16 14:46:54 +02:00
parent 84d163e9fa
commit f6c6ee0fa0

View File

@ -457,14 +457,13 @@ namespace Opm {
const int np = state.numPhases(); const int np = state.numPhases();
const V p0 = Eigen::Map<const V>(&state.pressure()[0], nc, 1); const V p0 = Eigen::Map<const V>(&state.pressure()[0], nc, 1);
const ADB p = ADB::constant(p0, std::vector<int>(1, nc)); const ADB p = ADB::constant(p0, cell_residual_.blockPattern());
const V transi = subset(geo_.transmissibility(), const V transi = subset(geo_.transmissibility(),
ops_.internal_faces); ops_.internal_faces);
const V nkgradp = transi * (ops_.ngrad * p0.matrix()).array(); const V nkgradp = transi * (ops_.ngrad * p0.matrix()).array();
V flux = Eigen::Map<const V>(&state.faceflux()[0], V flux = V::Zero(ops_.internal_faces.size(), 1);
grid_.number_of_faces, 1);
for (int phase = 0; phase < np; ++phase) { for (int phase = 0; phase < np; ++phase) {
const ADB cell_rho = pdepfdata_.phaseDensity(phase, p); const ADB cell_rho = pdepfdata_.phaseDensity(phase, p);
@ -479,6 +478,8 @@ namespace Opm {
flux += mf * head; flux += mf * head;
} }
V all_flux = superset(flux, ops_.internal_faces, grid_.number_of_faces);
std::copy(all_flux.data(), all_flux.data() + grid_.number_of_faces, state.faceflux().data());
} }
}; };
} // namespace Opm } // namespace Opm