Added computePorevolume() overload taking rock compressibility into account.

This commit is contained in:
Atgeirr Flø Rasmussen 2012-03-20 10:31:32 +01:00
parent a4a92b9bd9
commit 227d3e7d3c
2 changed files with 37 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include <opm/core/grid.h>
#include <opm/core/newwells.h>
#include <opm/core/fluid/IncompPropertiesInterface.hpp>
#include <opm/core/fluid/RockCompressibility.hpp>
#include <opm/core/utility/ErrorMacros.hpp>
#include <algorithm>
#include <functional>
@ -49,6 +50,28 @@ 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] 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 RockCompressibility& rock_comp,
const std::vector<double>& pressure,
std::vector<double>& 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]);
}
}
/// @brief Computes total saturated volumes over all grid cells.
/// @param[in] pv the pore volume by cell.
/// @param[in] s saturation values (for all P phases)

View File

@ -30,6 +30,7 @@ namespace Opm
{
class IncompPropertiesInterface;
class RockCompressibility;
/// @brief Computes pore volume of all cells in a grid.
/// @param[in] grid a grid
@ -40,6 +41,19 @@ namespace Opm
std::vector<double>& 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] 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 RockCompressibility& rock_comp,
const std::vector<double>& pressure,
std::vector<double>& porevol);
/// @brief Computes total saturated volumes over all grid cells.
/// @param[in] pv the pore volume by cell.
/// @param[in] s saturation values (for all P phases)