mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Now computePorevolume() takes a porosity array instead of a property object.
This is to make it compatible with blackoil properties. An alternative would be to give [Incomp|Blackoil]PropertiesInterface a common base class (RockInterface?) with the common rock-related methods.
This commit is contained in:
parent
d4e530eb3c
commit
c0d43a69bd
@ -35,17 +35,15 @@ namespace Opm
|
|||||||
|
|
||||||
/// @brief Computes pore volume of all cells in a grid.
|
/// @brief Computes pore volume of all cells in a grid.
|
||||||
/// @param[in] grid 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.
|
/// @param[out] porevol the pore volume by cell.
|
||||||
void computePorevolume(const UnstructuredGrid& grid,
|
void computePorevolume(const UnstructuredGrid& grid,
|
||||||
const Opm::IncompPropertiesInterface& props,
|
const double* porosity,
|
||||||
std::vector<double>& porevol)
|
std::vector<double>& porevol)
|
||||||
{
|
{
|
||||||
int num_cells = grid.number_of_cells;
|
int num_cells = grid.number_of_cells;
|
||||||
ASSERT(num_cells == props.numCells());
|
|
||||||
porevol.resize(num_cells);
|
porevol.resize(num_cells);
|
||||||
const double* poro = props.porosity();
|
std::transform(porosity, porosity + num_cells,
|
||||||
std::transform(poro, poro + num_cells,
|
|
||||||
grid.cell_volumes,
|
grid.cell_volumes,
|
||||||
porevol.begin(),
|
porevol.begin(),
|
||||||
std::multiplies<double>());
|
std::multiplies<double>());
|
||||||
@ -54,22 +52,20 @@ namespace Opm
|
|||||||
|
|
||||||
/// @brief Computes pore volume of all cells in a grid, with rock compressibility effects.
|
/// @brief Computes pore volume of all cells in a grid, with rock compressibility effects.
|
||||||
/// @param[in] grid 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[in] rock_comp rock compressibility properties
|
/// @param[in] rock_comp rock compressibility properties
|
||||||
/// @param[in] pressure pressure by cell
|
/// @param[in] pressure pressure by cell
|
||||||
/// @param[out] porevol the pore volume by cell.
|
/// @param[out] porevol the pore volume by cell.
|
||||||
void computePorevolume(const UnstructuredGrid& grid,
|
void computePorevolume(const UnstructuredGrid& grid,
|
||||||
const IncompPropertiesInterface& props,
|
const double* porosity,
|
||||||
const RockCompressibility& rock_comp,
|
const RockCompressibility& rock_comp,
|
||||||
const std::vector<double>& pressure,
|
const std::vector<double>& pressure,
|
||||||
std::vector<double>& porevol)
|
std::vector<double>& porevol)
|
||||||
{
|
{
|
||||||
int num_cells = grid.number_of_cells;
|
int num_cells = grid.number_of_cells;
|
||||||
ASSERT(num_cells == props.numCells());
|
|
||||||
porevol.resize(num_cells);
|
porevol.resize(num_cells);
|
||||||
const double* poro = props.porosity();
|
|
||||||
for (int i = 0; i < num_cells; ++i) {
|
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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,21 +34,21 @@ namespace Opm
|
|||||||
|
|
||||||
/// @brief Computes pore volume of all cells in a grid.
|
/// @brief Computes pore volume of all cells in a grid.
|
||||||
/// @param[in] grid 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.
|
/// @param[out] porevol the pore volume by cell.
|
||||||
void computePorevolume(const UnstructuredGrid& grid,
|
void computePorevolume(const UnstructuredGrid& grid,
|
||||||
const Opm::IncompPropertiesInterface& props,
|
const double* porosity,
|
||||||
std::vector<double>& porevol);
|
std::vector<double>& porevol);
|
||||||
|
|
||||||
|
|
||||||
/// @brief Computes pore volume of all cells in a grid, with rock compressibility effects.
|
/// @brief Computes pore volume of all cells in a grid, with rock compressibility effects.
|
||||||
/// @param[in] grid 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[in] rock_comp rock compressibility properties
|
/// @param[in] rock_comp rock compressibility properties
|
||||||
/// @param[in] pressure pressure by cell
|
/// @param[in] pressure pressure by cell
|
||||||
/// @param[out] porevol the pore volume by cell.
|
/// @param[out] porevol the pore volume by cell.
|
||||||
void computePorevolume(const UnstructuredGrid& grid,
|
void computePorevolume(const UnstructuredGrid& grid,
|
||||||
const IncompPropertiesInterface& props,
|
const double* porosity,
|
||||||
const RockCompressibility& rock_comp,
|
const RockCompressibility& rock_comp,
|
||||||
const std::vector<double>& pressure,
|
const std::vector<double>& pressure,
|
||||||
std::vector<double>& porevol);
|
std::vector<double>& porevol);
|
||||||
|
Loading…
Reference in New Issue
Block a user