This commit is contained in:
Atgeirr Flø Rasmussen 2012-05-14 21:49:24 +02:00
commit ead94905db
2 changed files with 10 additions and 14 deletions

View File

@ -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<double>& 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<double>());
@ -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<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]);
porevol[i] = porosity[i]*grid.cell_volumes[i]*rock_comp.poroMult(pressure[i]);
}
}

View File

@ -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<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] 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<double>& pressure,
std::vector<double>& porevol);