diff --git a/opm/core/utility/miscUtilities.cpp b/opm/core/utility/miscUtilities.cpp index d2276689f..b84f94e6c 100644 --- a/opm/core/utility/miscUtilities.cpp +++ b/opm/core/utility/miscUtilities.cpp @@ -35,17 +35,15 @@ namespace Opm /// @brief Computes pore volume of all cells in a grid. /// @param[in] grid a grid - /// @param[in] props rock and fluid properties + /// @param[in] porosity array of grid.number_of_cells porosity values /// @param[out] porevol the pore volume by cell. void computePorevolume(const UnstructuredGrid& grid, - const Opm::IncompPropertiesInterface& props, + const double* porosity, std::vector& porevol) { int num_cells = grid.number_of_cells; - ASSERT(num_cells == props.numCells()); porevol.resize(num_cells); - const double* poro = props.porosity(); - std::transform(poro, poro + num_cells, + std::transform(porosity, porosity + num_cells, grid.cell_volumes, porevol.begin(), std::multiplies()); @@ -54,22 +52,20 @@ namespace Opm /// @brief Computes pore volume of all cells in a grid, with rock compressibility effects. /// @param[in] grid a grid - /// @param[in] props rock and fluid properties + /// @param[in] porosity array of grid.number_of_cells porosity values /// @param[in] rock_comp rock compressibility properties /// @param[in] pressure pressure by cell /// @param[out] porevol the pore volume by cell. void computePorevolume(const UnstructuredGrid& grid, - const IncompPropertiesInterface& props, + const double* porosity, const RockCompressibility& rock_comp, const std::vector& pressure, std::vector& porevol) { int num_cells = grid.number_of_cells; - ASSERT(num_cells == props.numCells()); porevol.resize(num_cells); - const double* poro = props.porosity(); for (int i = 0; i < num_cells; ++i) { - porevol[i] = poro[i]*grid.cell_volumes[i]*rock_comp.poroMult(pressure[i]); + porevol[i] = porosity[i]*grid.cell_volumes[i]*rock_comp.poroMult(pressure[i]); } } diff --git a/opm/core/utility/miscUtilities.hpp b/opm/core/utility/miscUtilities.hpp index 131580a69..40fe0059b 100644 --- a/opm/core/utility/miscUtilities.hpp +++ b/opm/core/utility/miscUtilities.hpp @@ -34,21 +34,21 @@ namespace Opm /// @brief Computes pore volume of all cells in a grid. /// @param[in] grid a grid - /// @param[in] props rock and fluid properties + /// @param[in] porosity array of grid.number_of_cells porosity values /// @param[out] porevol the pore volume by cell. void computePorevolume(const UnstructuredGrid& grid, - const Opm::IncompPropertiesInterface& props, + const double* porosity, std::vector& porevol); /// @brief Computes pore volume of all cells in a grid, with rock compressibility effects. /// @param[in] grid a grid - /// @param[in] props rock and fluid properties + /// @param[in] porosity array of grid.number_of_cells porosity values /// @param[in] rock_comp rock compressibility properties /// @param[in] pressure pressure by cell /// @param[out] porevol the pore volume by cell. void computePorevolume(const UnstructuredGrid& grid, - const IncompPropertiesInterface& props, + const double* porosity, const RockCompressibility& rock_comp, const std::vector& pressure, std::vector& porevol);