Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq > Class Template Reference

#include <MultisegmentWellEquations.hpp>

Inheritance diagram for Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq >:
Inheritance graph

Public Types

using VectorBlockWellType = Dune::FieldVector< Scalar, numWellEq >
 
using BVectorWell = Dune::BlockVector< VectorBlockWellType >
 
using VectorBlockType = Dune::FieldVector< Scalar, numEq >
 
using BVector = Dune::BlockVector< VectorBlockType >
 
using DiagMatrixBlockWellType = Dune::FieldMatrix< Scalar, numWellEq, numWellEq >
 
using DiagMatWell = Dune::BCRSMatrix< DiagMatrixBlockWellType >
 
using OffDiagMatrixBlockWellType = Dune::FieldMatrix< Scalar, numWellEq, numEq >
 
using OffDiagMatWell = Dune::BCRSMatrix< OffDiagMatrixBlockWellType >
 

Public Member Functions

 MultisegmentWellEquations (const MultisegmentWellGeneric< Scalar > &well)
 
void init (const int num_cells, const int numPerfs, const std::vector< int > &cells, const std::vector< std::vector< int > > &segment_inlets, const std::vector< std::vector< int > > &segment_perforations)
 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 createSolver ()
 Compute the LU-decomposition of D matrix. More...
 
BVectorWell solve () const
 Apply inverted D matrix to residual and return result. More...
 
BVectorWell solve (const BVectorWell &rhs) const
 Apply inverted D matrix to rhs and return result. 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, const WellInterfaceGeneric &well, const int seg_pressure_var_ind, const WellState< Scalar > &well_state) const
 Extract CPR pressure matrix. More...
 
const BVectorWellresidual () const
 Returns a const reference to the residual. More...
 

Friends

class MultisegmentWellEquationAccess< Scalar, numWellEq, numEq >
 

Member Typedef Documentation

◆ BVector

template<class Scalar , int numWellEq, int numEq>
using Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq >::BVector = Dune::BlockVector<VectorBlockType>

◆ BVectorWell

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

◆ DiagMatrixBlockWellType

template<class Scalar , int numWellEq, int numEq>
using Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq >::DiagMatrixBlockWellType = Dune::FieldMatrix<Scalar,numWellEq,numWellEq>

◆ DiagMatWell

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

◆ OffDiagMatrixBlockWellType

template<class Scalar , int numWellEq, int numEq>
using Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq >::OffDiagMatrixBlockWellType = Dune::FieldMatrix<Scalar,numWellEq,numEq>

◆ OffDiagMatWell

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

◆ VectorBlockType

template<class Scalar , int numWellEq, int numEq>
using Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq >::VectorBlockType = Dune::FieldVector<Scalar,numEq>

◆ VectorBlockWellType

template<class Scalar , int numWellEq, int numEq>
using Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq >::VectorBlockWellType = Dune::FieldVector<Scalar,numWellEq>

Constructor & Destructor Documentation

◆ MultisegmentWellEquations()

template<class Scalar , int numWellEq, int numEq>
Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq >::MultisegmentWellEquations ( const MultisegmentWellGeneric< Scalar > &  well)

Member Function Documentation

◆ apply() [1/2]

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

Apply linear operator to vector.

◆ apply() [2/2]

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

Apply linear operator to vector.

◆ clear()

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

Set all coefficients to 0.

◆ createSolver()

template<class Scalar , int numWellEq, int numEq>
void Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq >::createSolver ( )

Compute the LU-decomposition of D matrix.

◆ extract()

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

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

◆ extractCPRPressureMatrix()

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

Extract CPR pressure matrix.

◆ init()

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

Setup sparsity pattern for the matrices.

Parameters
num_cellsTotal number of cells
numPerfsNumber of perforations
cellsCell indices for perforations
segment_inletsCell indices for segment inlets
segment_perforationsCell indices for segment perforations

◆ recoverSolutionWell()

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

Recover well solution.

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

◆ residual()

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

Returns a const reference to the residual.

◆ solve() [1/2]

template<class Scalar , int numWellEq, int numEq>
BVectorWell Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq >::solve ( ) const

Apply inverted D matrix to residual and return result.

◆ solve() [2/2]

template<class Scalar , int numWellEq, int numEq>
BVectorWell Opm::MultisegmentWellEquations< Scalar, numWellEq, numEq >::solve ( const BVectorWell rhs) const

Apply inverted D matrix to rhs and return result.

Friends And Related Function Documentation

◆ MultisegmentWellEquationAccess< Scalar, numWellEq, numEq >

template<class Scalar , int numWellEq, int numEq>
friend class MultisegmentWellEquationAccess< Scalar, numWellEq, numEq >
friend

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