|
My Project
|
Facility for calculating volume-weighted average function values over user-defined regions in parallel. More...
#include <RegionPhasePVAverage.hpp>
Classes | |
| struct | CellValue |
| Minimal characteristics of a cell from a simulation grid. More... | |
| struct | Phase |
| Compile-time disambiguation type for phases. More... | |
| struct | Region |
| Compile-time disambiguation type for regions. More... | |
Public Types | |
| using | RegionArrayAccessor = std::function< const std::vector< int > &(const std::string &)> |
| Call-back function type for accessing region arrays–typically the FIP* arrays. | |
Public Member Functions | |
| RegionPhasePoreVolAverage (const Parallel::Communication &comm, std::size_t numPhases, const std::vector< std::string > ®ionNames, RegionArrayAccessor getRegionArray) | |
| Constructor. | |
| double | fieldValue (const Phase &p) const |
| Retrieve field-level average function value for specific phase. | |
| double | value (std::string_view rset, const Phase &p, const Region &r) const |
| Retrieve region-level average function value for specific phase in specific region of named region set. | |
| void | prepareAccumulation () |
| Clear internal arrays in preparation of accumulating region-level averages from per-cell contributions. | |
| void | addCell (std::size_t activeCell, const Phase &p, const CellValue &cv) |
| Incorporate contributions from a single cell. | |
| void | accumulateParallel () |
| Accumulate region-level average values across MPI ranks. | |
Facility for calculating volume-weighted average function values over user-defined regions in parallel.
Defaults to phase-filled pore-volume averages, but falls back to simple pore-volume averages if the saturation is identically zero in a region–i.e., calculates what the average value would be if the phase fully occupied the available pore-volume in this case.
|
explicit |
Constructor.
| [in] | comm | Grid level global communicator. |
| [in] | numPhases | Number of phases for which to calculate average values. |
| [in] | regionNames | List of region sets. Typically contains one or more of the FIP* array names and, possibly, the PVTNUM region set as well. |
| [in] | getRegionArray | Call-back function for accessing region definition from region set names. |
| void Opm::RegionPhasePoreVolAverage::accumulateParallel | ( | ) |
Accumulate region-level average values across MPI ranks.
Typically the last step in calculating the region-level average values. It is typically an error to call this function multiple times without an intervening call to prepareAccumulation().
| void Opm::RegionPhasePoreVolAverage::addCell | ( | std::size_t | activeCell, |
| const Phase & | p, | ||
| const CellValue & | cv | ||
| ) |
Incorporate contributions from a single cell.
| [in] | activeCell | Per-rank active cell ID–typically one of the rank's interior cells. |
| [in] | p | Phase for which to incorporate the per-cell contribution. |
| [in] | cv | Single cell function value contribution. |
Retrieve field-level average function value for specific phase.
| [in] | p | Phase for which to retrieve the field-level average function value. |
p. | double Opm::RegionPhasePoreVolAverage::value | ( | std::string_view | rset, |
| const Phase & | p, | ||
| const Region & | r | ||
| ) | const |
Retrieve region-level average function value for specific phase in specific region of named region set.
| [in] | rset | Named region set–e.g., "FIPNUM". |
| [in] | p | Phase for which to retrieve the region-level average function value. |
| [in] | r | Region ID for which to retrieve the region-level average function value. |