Minor change to computeWDP() interface.

This commit is contained in:
Atgeirr Flø Rasmussen 2012-04-24 13:48:00 +02:00
parent 81733f5a43
commit eefcc69b3c
3 changed files with 6 additions and 5 deletions

View File

@ -57,8 +57,7 @@ int main(int argc, char** argv) {
computeTotalMobilityOmega(incomp_properties, all_cells, state.saturation(), totmob, omega);
std::vector<double> wdp;
std::vector<double> densities(incomp_properties.density(), incomp_properties.density() + incomp_properties.numPhases());
computeWDP(*wells.c_wells(), *grid.c_grid(), state.saturation(), densities, wdp);
computeWDP(*wells.c_wells(), *grid.c_grid(), state.saturation(), incomp_properties.density(), wdp, true);
std::vector<double> src;
Opm::FlowBCManager bcs;

View File

@ -405,10 +405,12 @@ 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)
const double* densities, std::vector<double>& wdp, bool per_grid_cell)
{
const size_t np = densities.size();
const int nw = wells.number_of_wells;
const size_t np = per_grid_cell ?
saturations.size()/grid.number_of_cells
: saturations.size()/wells.well_connpos[nw];
// Simple for now:
for (int i = 0; i < nw; i++) {
double depth_ref = wells.depth_ref[i];

View File

@ -188,7 +188,7 @@ namespace Opm
/// \param[in] per_grid_cell Whether or not the saturations are per grid cell or per
/// well cell.
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 = true);
const double* densities, std::vector<double>& wdp, bool per_grid_cell);
/// Computes (sums) the flow rate for each well.
/// \param[in] wells The wells for which the flow rate should be computed.