A class which handles tracers as specified in by ECL. More...

#include <TracerModel.hpp>

Inheritance diagram for Opm::TracerModel< TypeTag >:
Inheritance graph

Classes

struct  TracerBatch
 

Public Types

using CartesianIndexMapper = Dune::CartesianIndexMapper< GetPropType< TypeTag, Properties::Grid > >
 

Public Member Functions

 TracerModel (Simulator &simulator)
 
void init (bool rst)
 
void prepareTracerBatches ()
 
void beginTimeStep ()
 
void endTimeStep ()
 Informs the tracer model that a time step has just been finished. More...
 
template<class Restarter >
void serialize (Restarter &)
 This method writes the complete state of all tracer to the hard disk. More...
 
template<class Restarter >
void deserialize (Restarter &)
 This method restores the complete state of the tracer from disk. More...
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 
int numTracers () const
 Return the number of tracers considered by the tracerModel. More...
 
const std::string & name (int tracerIdx) const
 Return the tracer name. More...
 
std::string fname (int tracerIdx) const
 
GetPropType< TypeTag, Properties::Scalar > tracerConcentration (int tracerIdx, int globalDofIdx) const
 Return the tracer concentration for tracer index and global DofIdx. More...
 
void setTracerConcentration (int tracerIdx, int globalDofIdx, GetPropType< TypeTag, Properties::Scalar > value)
 
const std::map< std::pair< std::string, std::string >, double > & getWellTracerRates () const
 Return well tracer rates. More...
 

Static Public Attributes

static constexpr int dimWorld
 

Protected Member Functions

template<class LhsEval >
void computeVolume_ (LhsEval &freeVolume, const int tracerPhaseIdx, const ElementContext &elemCtx, unsigned scvIdx, unsigned timeIdx)
 
void computeFlux_ (TracerEvaluation &freeFlux, bool &isUpFree, const int tracerPhaseIdx, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
 
template<class TrRe >
void assembleTracerEquationVolume (TrRe &tr, const ElementContext &elemCtx, const Scalar scvVolume, const Scalar dt, unsigned I, unsigned I1)
 
template<class TrRe >
void assembleTracerEquationFlux (TrRe &tr, const ElementContext &elemCtx, unsigned scvfIdx, unsigned I, unsigned J)
 
template<class TrRe , class Well >
void assembleTracerEquationWell (TrRe &tr, const Well &well)
 
void assembleTracerEquations_ ()
 
void updateStorageCache ()
 
void advanceTracerFields ()
 
void doInit (bool rst, std::size_t numGridDof, std::size_t gasPhaseIdx, std::size_t oilPhaseIdx, std::size_t waterPhaseIdx)
 Initialize all internal data structures needed by the tracer module. More...
 
bool linearSolve_ (const TracerMatrix &M, TracerVector &x, TracerVector &b)
 
bool linearSolveBatchwise_ (const TracerMatrix &M, std::vector< TracerVector > &x, std::vector< TracerVector > &b)
 
double currentConcentration_ (const Well &eclWell, const std::string &name) const
 

Protected Attributes

Simulator & simulator_
 
std::array< TracerBatch< TracerVector >, 3 > tbatch
 
TracerBatch< TracerVector > & wat_
 
TracerBatch< TracerVector > & oil_
 
TracerBatch< TracerVector > & gas_
 
const GetPropType< TypeTag, Properties::GridView > & gridView_
 
const EclipseState & eclState_
 
const CartesianIndexMappercartMapper_
 
const GetPropType< TypeTag, Properties::DofMapper > & dofMapper_
 
std::vector< int > tracerPhaseIdx_
 
std::vector< Dune::BlockVector< Dune::FieldVector< GetPropType< TypeTag, Properties::Scalar >, 1 > > > tracerConcentration_
 
std::unique_ptr< TracerMatrix > tracerMatrix_
 
std::vector< Dune::BlockVector< Dune::FieldVector< GetPropType< TypeTag, Properties::Scalar >, 1 > > > storageOfTimeIndex1_
 
std::map< std::pair< std::string, std::string >, double > wellTracerRate_
 
std::function< std::array< double, dimWorld >(int)> centroids_
 Function returning the cell centers. More...
 

Detailed Description

template<class TypeTag>
class Opm::TracerModel< TypeTag >

A class which handles tracers as specified in by ECL.

Member Typedef Documentation

◆ CartesianIndexMapper

using Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::CartesianIndexMapper = Dune::CartesianIndexMapper<GetPropType< TypeTag, Properties::Grid > >
inherited

Constructor & Destructor Documentation

◆ TracerModel()

template<class TypeTag >
Opm::TracerModel< TypeTag >::TracerModel ( Simulator &  simulator)
inline

Member Function Documentation

◆ advanceTracerFields()

◆ assembleTracerEquationFlux()

template<class TypeTag >
template<class TrRe >
void Opm::TracerModel< TypeTag >::assembleTracerEquationFlux ( TrRe &  tr,
const ElementContext &  elemCtx,
unsigned  scvfIdx,
unsigned  I,
unsigned  J 
)
inlineprotected

◆ assembleTracerEquations_()

◆ assembleTracerEquationVolume()

template<class TypeTag >
template<class TrRe >
void Opm::TracerModel< TypeTag >::assembleTracerEquationVolume ( TrRe &  tr,
const ElementContext &  elemCtx,
const Scalar  scvVolume,
const Scalar  dt,
unsigned  I,
unsigned  I1 
)
inlineprotected

◆ assembleTracerEquationWell()

◆ beginTimeStep()

◆ computeFlux_()

template<class TypeTag >
void Opm::TracerModel< TypeTag >::computeFlux_ ( TracerEvaluation &  freeFlux,
bool &  isUpFree,
const int  tracerPhaseIdx,
const ElementContext &  elemCtx,
unsigned  scvfIdx,
unsigned  timeIdx 
)
inlineprotected

◆ computeVolume_()

template<class TypeTag >
template<class LhsEval >
void Opm::TracerModel< TypeTag >::computeVolume_ ( LhsEval &  freeVolume,
const int  tracerPhaseIdx,
const ElementContext &  elemCtx,
unsigned  scvIdx,
unsigned  timeIdx 
)
inlineprotected

◆ currentConcentration_()

double Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::currentConcentration_ ( const Well &  eclWell,
const std::string &  name 
) const
protectedinherited

◆ deserialize()

template<class TypeTag >
template<class Restarter >
void Opm::TracerModel< TypeTag >::deserialize ( Restarter &  )
inline

This method restores the complete state of the tracer from disk.

It is the inverse of the serialize() method.

◆ doInit()

void Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::doInit ( bool  rst,
std::size_t  numGridDof,
std::size_t  gasPhaseIdx,
std::size_t  oilPhaseIdx,
std::size_t  waterPhaseIdx 
)
protectedinherited

Initialize all internal data structures needed by the tracer module.

◆ endTimeStep()

◆ fname()

std::string Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::fname ( int  tracerIdx) const
inherited

◆ getWellTracerRates()

const std::map< std::pair< std::string, std::string >, double > & Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::getWellTracerRates ( ) const
inlineinherited

Return well tracer rates.

◆ init()

◆ linearSolve_()

bool Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::linearSolve_ ( const TracerMatrix M,
TracerVector x,
TracerVector b 
)
protectedinherited

◆ linearSolveBatchwise_()

bool Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::linearSolveBatchwise_ ( const TracerMatrix M,
std::vector< TracerVector > &  x,
std::vector< TracerVector > &  b 
)
protectedinherited

◆ name()

const std::string & Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::name ( int  tracerIdx) const
inherited

Return the tracer name.

◆ numTracers()

int Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::numTracers
inherited

Return the number of tracers considered by the tracerModel.

◆ prepareTracerBatches()

◆ serialize()

template<class TypeTag >
template<class Restarter >
void Opm::TracerModel< TypeTag >::serialize ( Restarter &  )
inline

This method writes the complete state of all tracer to the hard disk.

◆ serializeOp()

template<class TypeTag >
template<class Serializer >
void Opm::TracerModel< TypeTag >::serializeOp ( Serializer &  serializer)
inline

◆ setTracerConcentration()

void Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::setTracerConcentration ( int  tracerIdx,
int  globalDofIdx,
GetPropType< TypeTag, Properties::Scalar >  value 
)
inherited

◆ tracerConcentration()

GetPropType< TypeTag, Properties::Scalar > Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::tracerConcentration ( int  tracerIdx,
int  globalDofIdx 
) const
inherited

Return the tracer concentration for tracer index and global DofIdx.

◆ updateStorageCache()

template<class TypeTag >
void Opm::TracerModel< TypeTag >::updateStorageCache ( )
inlineprotected

Member Data Documentation

◆ cartMapper_

const CartesianIndexMapper& Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::cartMapper_
protectedinherited

◆ centroids_

std::function<std::array<double,dimWorld>(int)> Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::centroids_
protectedinherited

Function returning the cell centers.

◆ dimWorld

constexpr int Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::dimWorld
staticconstexprinherited

◆ dofMapper_

const GetPropType< TypeTag, Properties::DofMapper > & Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::dofMapper_
protectedinherited

◆ eclState_

const EclipseState& Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::eclState_
protectedinherited

◆ gas_

template<class TypeTag >
TracerBatch<TracerVector>& Opm::TracerModel< TypeTag >::gas_
protected

◆ gridView_

const GetPropType< TypeTag, Properties::GridView > & Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::gridView_
protectedinherited

◆ oil_

template<class TypeTag >
TracerBatch<TracerVector>& Opm::TracerModel< TypeTag >::oil_
protected

◆ simulator_

◆ storageOfTimeIndex1_

std::vector<Dune::BlockVector<Dune::FieldVector<GetPropType< TypeTag, Properties::Scalar > , 1> > > Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::storageOfTimeIndex1_
protectedinherited

◆ tbatch

◆ tracerConcentration_

std::vector<Dune::BlockVector<Dune::FieldVector<GetPropType< TypeTag, Properties::Scalar > , 1> > > Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::tracerConcentration_
protectedinherited

◆ tracerMatrix_

std::unique_ptr<TracerMatrix> Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::tracerMatrix_
protectedinherited

◆ tracerPhaseIdx_

std::vector<int> Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::tracerPhaseIdx_
protectedinherited

◆ wat_

template<class TypeTag >
TracerBatch<TracerVector>& Opm::TracerModel< TypeTag >::wat_
protected

◆ wellTracerRate_

std::map<std::pair<std::string, std::string>, double> Opm::GenericTracerModel< GetPropType< TypeTag, Properties::Grid > , GetPropType< TypeTag, Properties::GridView > , GetPropType< TypeTag, Properties::DofMapper > , GetPropType< TypeTag, Properties::Stencil > , GetPropType< TypeTag, Properties::Scalar > >::wellTracerRate_
protectedinherited

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