Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar > Class Template Reference

Cell face properties needed in TPSA equation calculations. More...

#include <FacePropertiesTPSA.hpp>

Classes

struct  FaceInfo
 

Public Types

using DimVector = Dune::FieldVector< Scalar, dimWorld >
 

Public Member Functions

 FacePropertiesTPSA (const EclipseState &eclState, const GridView &gridView, const CartesianIndexMapper &cartMapper, const Grid &grid, std::function< std::array< double, dimWorld >(int)> centroids)
 Constructor. More...
 
void finishInit ()
 Compute TPSA face properties. More...
 
void update ()
 Compute TPSA face properties. More...
 
Scalar weightAverage (unsigned elemIdx1, unsigned elemIdx2) const
 Average (half-)weight at interface between two elements. More...
 
Scalar weightAverageBoundary (unsigned elemIdx1, unsigned boundaryFaceIdx) const
 Average (half-)weight at boundary interface. More...
 
Scalar weightProduct (unsigned elemIdx1, unsigned elemIdx2) const
 Product of weights at interface between two elements. More...
 
Scalar weightProductBoundary (unsigned elemIdx1, unsigned boundaryFaceIdx) const
 Product of weights at boundary interface. More...
 
Scalar normalDistance (unsigned elemIdx1, unsigned elemIdx2) const
 Distance between two elements. More...
 
Scalar normalDistanceBoundary (unsigned elemIdx1, unsigned boundaryFaceIdx) const
 Distance to boundary interface. More...
 
DimVector cellFaceNormal (unsigned elemIdx1, unsigned elemIdx2)
 Cell face normal at interface between two elements. More...
 
const DimVectorcellFaceNormalBoundary (unsigned elemIdx1, unsigned boundaryFaceIdx) const
 Cell face normal of boundary interface. More...
 
const Scalar shearModulus (unsigned elemIdx) const
 Return shear modulus of an element. More...
 

Protected Member Functions

template<class Intersection >
void computeCellProperties (const Intersection &intersection, FaceInfo &inside, FaceInfo &outside, DimVector &faceNormal, std::false_type) const
 Compute face properties from general DUNE grid. More...
 
template<class Intersection >
void computeCellProperties (const Intersection &intersection, FaceInfo &inside, FaceInfo &outside, DimVector &faceNormal, std::true_type) const
 Compute face properties from DUNE CpGrid. More...
 
Scalar computeDistance_ (const DimVector &distVec, const DimVector &faceNormal)
 Compute normal distance from cell center to face center. More...
 
Scalar computeWeight_ (const Scalar distance, const Scalar smod)
 Compute weight ratio between distance and shear modulus. More...
 
DimVector distanceVector_ (const DimVector &faceCenter, const unsigned &cellIdx) const
 Distance vector from cell center to face center. More...
 
void extractSModulus_ ()
 Extract shear modulus from eclState. More...
 

Protected Attributes

std::vector< Scalar > sModulus_
 
std::unordered_map< std::uint64_t, Scalar > weightsAvg_
 
std::unordered_map< std::uint64_t, Scalar > weightsProd_
 
std::unordered_map< std::uint64_t, Scalar > distance_
 
std::unordered_map< std::uint64_t, DimVectorfaceNormal_
 
std::map< std::pair< unsigned, unsigned >, Scalar > weightsAvgBoundary_
 
std::map< std::pair< unsigned, unsigned >, Scalar > weightsProdBoundary_
 
std::map< std::pair< unsigned, unsigned >, Scalar > distanceBoundary_
 
std::map< std::pair< unsigned, unsigned >, DimVectorfaceNormalBoundary_
 
const EclipseState & eclState_
 
const GridView & gridView_
 
const CartesianIndexMapper & cartMapper_
 
const Grid & grid_
 
std::function< std::array< double, dimWorld >(int)> centroids_
 
std::vector< std::array< double, dimWorld > > centroids_cache_
 
const LookUpData< Grid, GridView > lookUpData_
 
const LookUpCartesianData< Grid, GridView > lookUpCartesianData_
 

Detailed Description

template<class Grid, class GridView, class ElementMapper, class CartesianIndexMapper, class Scalar>
class Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >

Cell face properties needed in TPSA equation calculations.

Similar calculations as done in Transmissibility class for TPFA

Member Typedef Documentation

◆ DimVector

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
using Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::DimVector = Dune::FieldVector<Scalar, dimWorld>

Constructor & Destructor Documentation

◆ FacePropertiesTPSA()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::FacePropertiesTPSA ( const EclipseState &  eclState,
const GridView &  gridView,
const CartesianIndexMapper &  cartMapper,
const Grid &  grid,
std::function< std::array< double, dimWorld >(int)>  centroids 
)

Constructor.

Parameters
eclStateEclipse state made from a deck
gridViewThe view on the DUNE grid which ought to be used (normally the leaf grid view)
cartMapperThe cartesian index mapper for lookup of cartesian indices
gridThe grid to lookup cell properties
centroidsFunction to lookup cell centroids

Member Function Documentation

◆ cellFaceNormal()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::DimVector Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::cellFaceNormal ( unsigned  elemIdx1,
unsigned  elemIdx2 
)

Cell face normal at interface between two elements.

Parameters
elemIdx1Cell index 1
elemIdx2Cell index 2
Returns
Face normals
Note
It is assumed that normals point from lower index to higher index!

References Opm::details::isIdTPSA().

Referenced by Opm::FlowProblemTPSA< TypeTag >::cellFaceNormal().

◆ cellFaceNormalBoundary()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
const FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::DimVector & Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::cellFaceNormalBoundary ( unsigned  elemIdx,
unsigned  boundaryFaceIdx 
) const

Cell face normal of boundary interface.

Parameters
elemIdxCell index
boundaryFaceIdxFace index
Returns
Face normals
Note
Boundary normals points outwards

Referenced by Opm::FlowProblemTPSA< TypeTag >::cellFaceNormalBoundary().

◆ computeCellProperties() [1/2]

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
template<class Intersection >
void Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::computeCellProperties ( const Intersection &  intersection,
FaceInfo inside,
FaceInfo outside,
DimVector faceNormal,
std::false_type   
) const
protected

Compute face properties from general DUNE grid.

Parameters
intersectionInfo on cell intersection
insideInfo describing inside face
outsideInfo describing outside face
faceNormalFace (unit) normal vector
Warning
Not implemented!

◆ computeCellProperties() [2/2]

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
template<class Intersection >
void Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::computeCellProperties ( const Intersection &  intersection,
FaceInfo inside,
FaceInfo outside,
DimVector faceNormal,
std::true_type   
) const
protected

Compute face properties from DUNE CpGrid.

Parameters
intersectionInfo on cell intersection
insideInfo describing inside face
outsideInfo describing outside face
faceNormalFace (unit) normal
Warning
LGR computations not implemented!

References Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::FaceInfo::elemIdx, Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::FaceInfo::faceCenter, and Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::FaceInfo::faceIdx.

◆ computeDistance_()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
Scalar Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::computeDistance_ ( const DimVector distVec,
const DimVector faceNormal 
)
protected

Compute normal distance from cell center to face center.

Parameters
distVecDistance vector from cell center to face center
faceNormalFace (unit) normal vector
Returns
Distance cell center -> face center

◆ computeWeight_()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
Scalar Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::computeWeight_ ( const Scalar  distance,
const Scalar  smod 
)
protected

Compute weight ratio between distance and shear modulus.

Parameters
distanceNormal distance from cell to face center
smodShear modulus
Returns
Weight ratio

◆ distanceVector_()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::DimVector Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::distanceVector_ ( const DimVector faceCenter,
const unsigned &  cellIdx 
) const
protected

Distance vector from cell center to face center.

Parameters
faceCenterFace center coordinates
cellIdxCell index
Returns
Distance vector cell center -> face center

◆ extractSModulus_()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
void Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::extractSModulus_
protected

Extract shear modulus from eclState.

Note
(from Transmissibility::extractPorosity()): All arrays provided by eclState are one-per-cell of "uncompressed" grid, whereas the simulation grid might remove a few elements (e.g. because it is distributed over several processes).

◆ finishInit()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
void Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::finishInit

Compute TPSA face properties.

Referenced by Opm::FlowProblemTPSA< TypeTag >::finishInit().

◆ normalDistance()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
Scalar Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::normalDistance ( unsigned  elemIdx1,
unsigned  elemIdx2 
) const

Distance between two elements.

Parameters
elemIdx1Cell index 1
elemIdx2Cell index 2
Returns
Distance

References Opm::details::isIdTPSA().

Referenced by Opm::FlowProblemTPSA< TypeTag >::normalDistance().

◆ normalDistanceBoundary()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
Scalar Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::normalDistanceBoundary ( unsigned  elemIdx,
unsigned  boundaryFaceIdx 
) const

Distance to boundary interface.

Parameters
elemIdxCell index
boundaryFaceIdxFace index
Returns
Distance to boundary

Referenced by Opm::FlowProblemTPSA< TypeTag >::normalDistanceBoundary().

◆ shearModulus()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
const Scalar Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::shearModulus ( unsigned  elemIdx) const
inline

◆ update()

◆ weightAverage()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
Scalar Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::weightAverage ( unsigned  elemIdx1,
unsigned  elemIdx2 
) const

Average (half-)weight at interface between two elements.

Parameters
elemIdx1Cell index 1
elemIdx2Cell index 2
Returns
Average weight

References Opm::details::isIdTPSA().

Referenced by Opm::FlowProblemTPSA< TypeTag >::weightAverage().

◆ weightAverageBoundary()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
Scalar Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::weightAverageBoundary ( unsigned  elemIdx,
unsigned  boundaryFaceIdx 
) const

Average (half-)weight at boundary interface.

Parameters
elemIdxCell index
boundaryFaceIdxFace index
Returns
Average weight at boundary

Referenced by Opm::FlowProblemTPSA< TypeTag >::weightAverageBoundary().

◆ weightProduct()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
Scalar Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::weightProduct ( unsigned  elemIdx1,
unsigned  elemIdx2 
) const

Product of weights at interface between two elements.

Parameters
elemIdx1Cell index 1
elemIdx2Cell index 2
Returns
Weight product

References Opm::details::isIdTPSA().

Referenced by Opm::FlowProblemTPSA< TypeTag >::weightProduct().

◆ weightProductBoundary()

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
Scalar Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::weightProductBoundary ( unsigned  elemIdx,
unsigned  boundaryFaceIdx 
) const

Product of weights at boundary interface.

Parameters
elemIdxCell index
boundaryFaceIdxFace index
Returns
Weight product at boundary

Member Data Documentation

◆ cartMapper_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
const CartesianIndexMapper& Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::cartMapper_
protected

◆ centroids_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::function<std::array<double, dimWorld>(int)> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::centroids_
protected

◆ centroids_cache_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::vector<std::array<double, dimWorld> > Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::centroids_cache_
protected

◆ distance_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::unordered_map<std::uint64_t, Scalar> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::distance_
protected

◆ distanceBoundary_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::map<std::pair<unsigned, unsigned>, Scalar> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::distanceBoundary_
protected

◆ eclState_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
const EclipseState& Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::eclState_
protected

◆ faceNormal_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::unordered_map<std::uint64_t, DimVector> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::faceNormal_
protected

◆ faceNormalBoundary_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::map<std::pair<unsigned, unsigned>, DimVector> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::faceNormalBoundary_
protected

◆ grid_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
const Grid& Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::grid_
protected

◆ gridView_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
const GridView& Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::gridView_
protected

◆ lookUpCartesianData_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
const LookUpCartesianData<Grid, GridView> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::lookUpCartesianData_
protected

◆ lookUpData_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
const LookUpData<Grid, GridView> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::lookUpData_
protected

◆ sModulus_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::vector<Scalar> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::sModulus_
protected

◆ weightsAvg_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::unordered_map<std::uint64_t, Scalar> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::weightsAvg_
protected

◆ weightsAvgBoundary_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::map<std::pair<unsigned, unsigned>, Scalar> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::weightsAvgBoundary_
protected

◆ weightsProd_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::unordered_map<std::uint64_t, Scalar> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::weightsProd_
protected

◆ weightsProdBoundary_

template<class Grid , class GridView , class ElementMapper , class CartesianIndexMapper , class Scalar >
std::map<std::pair<unsigned, unsigned>, Scalar> Opm::FacePropertiesTPSA< Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar >::weightsProdBoundary_
protected

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