This commit is contained in:
Kjetil Olsen Lye
2012-04-13 13:20:36 +02:00
3 changed files with 14 additions and 10 deletions

View File

@@ -408,6 +408,8 @@ namespace Opm
void computeWDP(const Wells& wells, const UnstructuredGrid& grid, const std::vector<double>& saturations,
const std::vector<double>& densities, std::vector<double>& wdp)
{
const size_t np = densities.size();
// Simple for now:
for(int i = 0; i < wells.number_of_wells; i++) {
double depth_ref = wells.depth_ref[i];
@@ -425,9 +427,9 @@ namespace Opm
saturation_sum = 1.0;
}
double density = 0.0;
for(size_t i = 0; i < densities.size(); i++) {
for(size_t p = 0; p < np; p++) {
// Is this a smart way of doing it?
density += saturations[densities.size()*cell+i]*densities[i]/saturation_sum;
density += saturations[np*cell + p] * densities[p];
}
// Is the sign correct?