Opm::ParallelWBPCalculation Class Reference

#include <ParallelWBPCalculation.hpp>

Public Types

using GlobalToLocal = ParallelPAvgDynamicSourceData::GlobalToLocal
 
using Evaluator = ParallelPAvgDynamicSourceData::Evaluator
 Callback for evaluating WBPn source terms on the current MPI rank. More...
 
using EvaluatorFactory = std::function< Evaluator()>
 

Public Member Functions

 ParallelWBPCalculation (const GridDims &cellIndexMap, const Parallel::Communication &gridComm)
 
ParallelWBPCalculationlocalCellIndex (GlobalToLocal localCellIdx)
 
ParallelWBPCalculationevalCellSource (Evaluator evalCellSrc)
 
std::size_t createCalculator (const Well &well, const ParallelWellInfo &parallelWellInfo, const std::vector< int > &localConnIdx, EvaluatorFactory makeWellSourceEvaluator)
 
void defineCommunication ()
 
void collectDynamicValues ()
 
void inferBlockAveragePressures (const std::size_t calcIndex, const PAvg &controls, const double gravity, const double refDepth)
 
const PAvgCalculator::Result & averagePressures (const std::size_t calcIndex) const
 

Detailed Description

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.

Member Typedef Documentation

◆ Evaluator

Callback for evaluating WBPn source terms on the current MPI rank.

◆ EvaluatorFactory

Callback for constructing a source term evaluation function on the current MPI rank. Needed for deferred construction of per-well source term evaluation functions.

◆ GlobalToLocal

Callback for inferring the source locations which are active on the current MPI rank.

Constructor & Destructor Documentation

◆ ParallelWBPCalculation()

Opm::ParallelWBPCalculation::ParallelWBPCalculation ( const GridDims &  cellIndexMap,
const Parallel::Communication gridComm 
)
explicit

Constructor.

Parameters
[in]cellIndexMapCell index triple map ((I,J,K) <-> global).
[in]gridCommMain, grid level, global communicator.

Member Function Documentation

◆ averagePressures()

const PAvgCalculator::Result & Opm::ParallelWBPCalculation::averagePressures ( const std::size_t  calcIndex) const

Retrieve results from most recent WBPn value calculation for specified well.

Parameters
[in]calcIndexCalculator object index. Return value from a previous call to member function createCalculator().
Returns
Result set from most recent call to member function inferBlockAveragePressures() for calcIndex.

◆ collectDynamicValues()

void Opm::ParallelWBPCalculation::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

std::logic_error

if the communication patterns have not been fully defined through a prior call to member function defineCommunication().

◆ createCalculator()

std::size_t Opm::ParallelWBPCalculation::createCalculator ( const Well &  well,
const ParallelWellInfo parallelWellInfo,
const std::vector< int > &  localConnIdx,
EvaluatorFactory  makeWellSourceEvaluator 
)

Create, or reassign, a WBPn calculation object for a particular well.

Parameters
[in]wellWell for which to create a WBPn calculation object.
[in]parallelWellInfoCommunicator object for the ranks sharing this well.
[in]localConnIdxLocal (on-rank) connection index. Sized according to
well.getConnections().size()
, but with a non-negative entry only for those active connections that intersect the current rank. If
localConnIdx[i] == j
, then the 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]makeWellSourceEvaluatorFactory function to support deferred creation of an evaluation function for the per-connection WBP source terms.
Returns
Calculator object index. Must be used in subsequent calls to inferBlockAveragePressures() and averagePressures() for this well.

◆ defineCommunication()

void Opm::ParallelWBPCalculation::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().

◆ evalCellSource()

ParallelWBPCalculation & Opm::ParallelWBPCalculation::evalCellSource ( Evaluator  evalCellSrc)

Assign evaluation function for computing the on-rank, cell level WBPn source terms.

Parameters
[in]evalCellSrcSource term evaluation function.
Returns
*this

◆ inferBlockAveragePressures()

void Opm::ParallelWBPCalculation::inferBlockAveragePressures ( const std::size_t  calcIndex,
const PAvg &  controls,
const double  gravity,
const double  refDepth 
)

Compute WBPn report values for a single well.

Parameters
[in]calcIndexCalculator object index. Return value from a previous call to member function createCalculator().
[in]controlsPressure averaging procedure controls for this well.
[in]gravityStrength of gravity acceleration.
[in]refDepthWBPn reference depth. Typically
Well::getWPaveRefDepth()
.

◆ localCellIndex()

ParallelWBPCalculation & Opm::ParallelWBPCalculation::localCellIndex ( GlobalToLocal  localCellIdx)

Assign translation function for inferring the on-rank IDs of the known source locations.

Parameters
[in]localCellIdxTranslation from global, Cartesian cell indices to local, on-rank, cell indices.
Returns
*this

The documentation for this class was generated from the following file: