Opm::StandardWellEquations< Scalar, numEq > Class Template Reference

#include <StandardWellEquations.hpp>

Inheritance diagram for Opm::StandardWellEquations< Scalar, numEq >:
Inheritance graph

Public Types

using VectorBlockWellType = Dune::DynamicVector< Scalar >
 
using BVectorWell = Dune::BlockVector< VectorBlockWellType >
 
using DiagMatrixBlockWellType = Dune::DynamicMatrix< Scalar >
 
using DiagMatWell = Dune::BCRSMatrix< DiagMatrixBlockWellType >
 
using OffDiagMatrixBlockWellType = Dune::DynamicMatrix< Scalar >
 
using OffDiagMatWell = Dune::BCRSMatrix< OffDiagMatrixBlockWellType >
 
using BVector = Dune::BlockVector< Dune::FieldVector< Scalar, numEq > >
 

Public Member Functions

 StandardWellEquations (const ParallelWellInfo &parallel_well_info)
 
void init (const int num_cells, const int numWellEq, const int numPerfs, const std::vector< int > &cells)
 Setup sparsity pattern for the matrices. More...
 
void clear ()
 Set all coefficients to 0. More...
 
void apply (const BVector &x, BVector &Ax) const
 Apply linear operator to vector. More...
 
void apply (BVector &r) const
 Apply linear operator to vector. More...
 
void solve (BVectorWell &dx_well) const
 Apply inverted D matrix to residual and store in vector. More...
 
void solve (const BVectorWell &rhs_well, BVectorWell &x_well) const
 Apply inverted D matrix to rhs and store in vector. More...
 
void invert ()
 Invert D matrix. More...
 
void recoverSolutionWell (const BVector &x, BVectorWell &xw) const
 Recover well solution. More...
 
template<class SparseMatrixAdapter >
void extract (SparseMatrixAdapter &jacobian) const
 Add the matrices of this well to the sparse matrix adapter. More...
 
template<class PressureMatrix >
void extractCPRPressureMatrix (PressureMatrix &jacobian, const BVector &weights, const int pressureVarIndex, const bool use_well_weights, const WellInterfaceGeneric &well, const int bhp_var_index, const WellState< Scalar > &well_state) const
 Extract CPR pressure matrix. More...
 
unsigned int getNumBlocks () const
 Get the number of blocks of the C and B matrices. More...
 
void sumDistributed (Parallel::Communication comm)
 Sum with off-process contribution. More...
 
const BVectorWellresidual () const
 Returns a const reference to the residual. More...
 

Friends

class StandardWellEquationAccess< Scalar, numEq >
 

Member Typedef Documentation

◆ BVector

template<class Scalar , int numEq>
using Opm::StandardWellEquations< Scalar, numEq >::BVector = Dune::BlockVector<Dune::FieldVector<Scalar,numEq> >

◆ BVectorWell

template<class Scalar , int numEq>
using Opm::StandardWellEquations< Scalar, numEq >::BVectorWell = Dune::BlockVector<VectorBlockWellType>

◆ DiagMatrixBlockWellType

template<class Scalar , int numEq>
using Opm::StandardWellEquations< Scalar, numEq >::DiagMatrixBlockWellType = Dune::DynamicMatrix<Scalar>

◆ DiagMatWell

template<class Scalar , int numEq>
using Opm::StandardWellEquations< Scalar, numEq >::DiagMatWell = Dune::BCRSMatrix<DiagMatrixBlockWellType>

◆ OffDiagMatrixBlockWellType

template<class Scalar , int numEq>
using Opm::StandardWellEquations< Scalar, numEq >::OffDiagMatrixBlockWellType = Dune::DynamicMatrix<Scalar>

◆ OffDiagMatWell

template<class Scalar , int numEq>
using Opm::StandardWellEquations< Scalar, numEq >::OffDiagMatWell = Dune::BCRSMatrix<OffDiagMatrixBlockWellType>

◆ VectorBlockWellType

template<class Scalar , int numEq>
using Opm::StandardWellEquations< Scalar, numEq >::VectorBlockWellType = Dune::DynamicVector<Scalar>

Constructor & Destructor Documentation

◆ StandardWellEquations()

template<class Scalar , int numEq>
Opm::StandardWellEquations< Scalar, numEq >::StandardWellEquations ( const ParallelWellInfo parallel_well_info)

Member Function Documentation

◆ apply() [1/2]

template<class Scalar , int numEq>
void Opm::StandardWellEquations< Scalar, numEq >::apply ( BVector r) const

Apply linear operator to vector.

◆ apply() [2/2]

template<class Scalar , int numEq>
void Opm::StandardWellEquations< Scalar, numEq >::apply ( const BVector x,
BVector Ax 
) const

Apply linear operator to vector.

◆ clear()

template<class Scalar , int numEq>
void Opm::StandardWellEquations< Scalar, numEq >::clear ( )

Set all coefficients to 0.

◆ extract()

template<class Scalar , int numEq>
template<class SparseMatrixAdapter >
void Opm::StandardWellEquations< Scalar, numEq >::extract ( SparseMatrixAdapter &  jacobian) const

Add the matrices of this well to the sparse matrix adapter.

◆ extractCPRPressureMatrix()

template<class Scalar , int numEq>
template<class PressureMatrix >
void Opm::StandardWellEquations< Scalar, numEq >::extractCPRPressureMatrix ( PressureMatrix &  jacobian,
const BVector weights,
const int  pressureVarIndex,
const bool  use_well_weights,
const WellInterfaceGeneric well,
const int  bhp_var_index,
const WellState< Scalar > &  well_state 
) const

Extract CPR pressure matrix.

◆ getNumBlocks()

template<class Scalar , int numEq>
unsigned int Opm::StandardWellEquations< Scalar, numEq >::getNumBlocks ( ) const

Get the number of blocks of the C and B matrices.

◆ init()

template<class Scalar , int numEq>
void Opm::StandardWellEquations< Scalar, numEq >::init ( const int  num_cells,
const int  numWellEq,
const int  numPerfs,
const std::vector< int > &  cells 
)

Setup sparsity pattern for the matrices.

Parameters
num_cellsTotal number of cells
numWellEqNumber of well equations
numPerfsNumber of perforations
cellsCell indices for perforations

◆ invert()

template<class Scalar , int numEq>
void Opm::StandardWellEquations< Scalar, numEq >::invert ( )

Invert D matrix.

◆ recoverSolutionWell()

template<class Scalar , int numEq>
void Opm::StandardWellEquations< Scalar, numEq >::recoverSolutionWell ( const BVector x,
BVectorWell xw 
) const

Recover well solution.

xw = inv(D)*(rw - C*x)

◆ residual()

template<class Scalar , int numEq>
const BVectorWell & Opm::StandardWellEquations< Scalar, numEq >::residual ( ) const
inline

Returns a const reference to the residual.

◆ solve() [1/2]

template<class Scalar , int numEq>
void Opm::StandardWellEquations< Scalar, numEq >::solve ( BVectorWell dx_well) const

Apply inverted D matrix to residual and store in vector.

◆ solve() [2/2]

template<class Scalar , int numEq>
void Opm::StandardWellEquations< Scalar, numEq >::solve ( const BVectorWell rhs_well,
BVectorWell x_well 
) const

Apply inverted D matrix to rhs and store in vector.

◆ sumDistributed()

template<class Scalar , int numEq>
void Opm::StandardWellEquations< Scalar, numEq >::sumDistributed ( Parallel::Communication  comm)

Sum with off-process contribution.

Friends And Related Function Documentation

◆ StandardWellEquationAccess< Scalar, numEq >

template<class Scalar , int numEq>
friend class StandardWellEquationAccess< Scalar, numEq >
friend

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