My Project
|
Parallel facility for managing the on-rank collection and global distribution of WBPn source values as well as local calculation and distributed reduction of the inferred WBPn report values. More...
#include <ParallelWBPCalculation.hpp>
Public Types | |
using | GlobalToLocal = typename ParallelPAvgDynamicSourceData< Scalar >::GlobalToLocal |
Callback for inferring the source locations which are active on the current MPI rank. | |
using | Evaluator = typename ParallelPAvgDynamicSourceData< Scalar >::Evaluator |
Callback for evaluating WBPn source terms on the current MPI rank. | |
using | EvaluatorFactory = std::function< Evaluator()> |
Callback for constructing a source term evaluation function on the current MPI rank. | |
Public Member Functions | |
ParallelWBPCalculation (const GridDims &cellIndexMap, const Parallel::Communication &gridComm) | |
Constructor. | |
ParallelWBPCalculation & | localCellIndex (GlobalToLocal localCellIdx) |
Assign translation function for inferring the on-rank IDs of the known source locations. | |
ParallelWBPCalculation & | evalCellSource (Evaluator evalCellSrc) |
Assign evaluation function for computing the on-rank, cell level WBPn source terms. | |
std::size_t | createCalculator (const Well &well, const ParallelWellInfo< Scalar > ¶llelWellInfo, const std::vector< int > &localConnIdx, EvaluatorFactory makeWellSourceEvaluator) |
Create, or reassign, a WBPn calculation object for a particular well. | |
void | defineCommunication () |
Set up communication patterns for both cell and connection level source terms and partial/intermediate WBPn results. | |
void | collectDynamicValues () |
Collect all on-rank source term value and distribute those on-rank values to all other MPI ranks. | |
void | inferBlockAveragePressures (const std::size_t calcIndex, const PAvg &controls, const Scalar gravity, const Scalar refDepth) |
Compute WBPn report values for a single well. | |
const PAvgCalculatorResult< Scalar > & | averagePressures (const std::size_t calcIndex) const |
Retrieve results from most recent WBPn value calculation for specified well. | |
Parallel facility for managing the on-rank collection and global distribution of WBPn source values as well as local calculation and distributed reduction of the inferred WBPn report values.
using Opm::ParallelWBPCalculation< Scalar >::EvaluatorFactory = std::function<Evaluator()> |
Callback for constructing a source term evaluation function on the current MPI rank.
Needed for deferred construction of per-well source term evaluation functions.
|
explicit |
Constructor.
[in] | cellIndexMap | Cell index triple map ((I,J,K) <-> global). |
[in] | gridComm | Main, grid level, global communicator. |
const Opm::PAvgCalculatorResult< Scalar > & Opm::ParallelWBPCalculation< Scalar >::averagePressures | ( | const std::size_t | calcIndex | ) | const |
Retrieve results from most recent WBPn value calculation for specified well.
[in] | calcIndex | Calculator object index. Return value from a previous call to member function createCalculator() . |
inferBlockAveragePressures()
for calcIndex
. void Opm::ParallelWBPCalculation< Scalar >::collectDynamicValues | ( | ) |
Collect all on-rank source term value and distribute those on-rank values to all other MPI ranks.
Will call the registered source term evaluation functions for all on-rank source locations. Once this function returns, all ranks have a full view of all cell level source term values, and all ranks which share an individual well have a full view of the per-connection source term values for that well.
Will throw
an object of type
if the communication patterns have not been fully defined through a prior call to member function defineCommunication()
.
std::size_t Opm::ParallelWBPCalculation< Scalar >::createCalculator | ( | const Well & | well, |
const ParallelWellInfo< Scalar > & | parallelWellInfo, | ||
const std::vector< int > & | localConnIdx, | ||
EvaluatorFactory | makeWellSourceEvaluator | ||
) |
Create, or reassign, a WBPn calculation object for a particular well.
[in] | well | Well for which to create a WBPn calculation object. |
[in] | parallelWellInfo | Communicator object for the ranks sharing this well. |
[in] | localConnIdx | Local (on-rank) connection index. Sized according to well.getConnections().size()
localConnIdx[i] == j
constexpr auto getPropValue() get the value data member of a property Definition propertysystem.hh:242 i-th global connection is the j-th active connection on the current rank. Use a negative value to identify a connection that is either not flowing or which does not intersect the current MPI rank. |
[in] | makeWellSourceEvaluator | Factory function to support deferred creation of an evaluation function for the per-connection WBP source terms. |
well
. void Opm::ParallelWBPCalculation< Scalar >::defineCommunication | ( | ) |
Set up communication patterns for both cell and connection level source terms and partial/intermediate WBPn results.
Clients must call this function once all calculation objects have been created, and strictly before the first call to member function collectDynamicValues()
.
Opm::ParallelWBPCalculation< Scalar > & Opm::ParallelWBPCalculation< Scalar >::evalCellSource | ( | Evaluator | evalCellSrc | ) |
Assign evaluation function for computing the on-rank, cell level WBPn source terms.
[in] | evalCellSrc | Source term evaluation function. |
void Opm::ParallelWBPCalculation< Scalar >::inferBlockAveragePressures | ( | const std::size_t | calcIndex, |
const PAvg & | controls, | ||
const Scalar | gravity, | ||
const Scalar | refDepth | ||
) |
Compute WBPn report values for a single well.
[in] | calcIndex | Calculator object index. Return value from a previous call to member function createCalculator() . |
[in] | controls | Pressure averaging procedure controls for this well. |
[in] | gravity | Strength of gravity acceleration. |
[in] | refDepth | WBPn reference depth. Typically Well::getWPaveRefDepth()
|
Opm::ParallelWBPCalculation< Scalar > & Opm::ParallelWBPCalculation< Scalar >::localCellIndex | ( | GlobalToLocal | localCellIdx | ) |
Assign translation function for inferring the on-rank IDs of the known source locations.
[in] | localCellIdx | Translation from global, Cartesian cell indices to local, on-rank, cell indices. |