Fixed computeWDP. Small prettification of code.
This commit is contained in:
parent
d26a9ee4c8
commit
2528d35b19
@ -404,7 +404,6 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void computeWDP(const Wells& wells, const UnstructuredGrid& grid, const std::vector<double>& saturations,
|
||||
const std::vector<double>& densities, std::vector<double>& wdp, bool per_grid_cell)
|
||||
{
|
||||
@ -421,10 +420,9 @@ namespace Opm
|
||||
|
||||
double saturation_sum = 0.0;
|
||||
for (size_t p = 0; p < np; p++) {
|
||||
if(per_grid_cell) {
|
||||
if (!per_grid_cell) {
|
||||
saturation_sum += saturations[i * nw * np + j * np + p];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
saturation_sum += saturations[np * cell + p];
|
||||
}
|
||||
}
|
||||
@ -433,10 +431,9 @@ namespace Opm
|
||||
}
|
||||
double density = 0.0;
|
||||
for (size_t p = 0; p < np; p++) {
|
||||
if(per_grid_cell) {
|
||||
if (!per_grid_cell) {
|
||||
density += saturations[i * nw * np + j * np + p] * densities[p] / saturation_sum;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Is this a smart way of doing it?
|
||||
density += saturations[np * cell + p] * densities[p] / saturation_sum;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user