Opm::mswellhelpers Namespace Reference

Classes

class  ParallellMSWellB
 A wrapper around the B matrix for distributed MS wells. More...
 

Functions

template<typename MatrixType , typename VectorType >
VectorType applyUMFPack (Dune::UMFPack< MatrixType > &linsolver, VectorType x)
 Applies umfpack and checks for singularity. More...
 
template<class DiagMatWell , class WellWeight >
DiagMatWell::field_type contractCprWellDiagonal (const DiagMatWell &D, const WellWeight &lambda, const int pressureColumn)
 
template<typename VectorType , typename MatrixType >
Dune::Matrix< typename MatrixType::block_type > invertWithUMFPack (const int size, const int bsize, Dune::UMFPack< MatrixType > &linsolver)
 Applies umfpack and checks for singularity. More...
 
template<typename MatrixType , typename VectorType >
VectorType invDX (const MatrixType &D, VectorType x, DeferredLogger &deferred_logger)
 
template<typename ValueType , typename Scalar >
ValueType frictionPressureLoss (const Scalar l, const Scalar diameter, const Scalar area, const Scalar roughness, const ValueType &density, const ValueType &w, const ValueType &mu)
 
template<typename ValueType , typename Scalar >
ValueType valveContrictionPressureLoss (const ValueType &mass_rate, const ValueType &density, const Scalar area_con, const Scalar cv)
 
template<typename ValueType , typename Scalar >
ValueType velocityHead (const Scalar area, const ValueType &mass_rate, const ValueType &density)
 
template<typename ValueType , typename Scalar >
ValueType emulsionViscosity (const ValueType &water_fraction, const ValueType &water_viscosity, const ValueType &oil_fraction, const ValueType &oil_viscosity, const SICD &sicd)
 

Function Documentation

◆ applyUMFPack()

template<typename MatrixType , typename VectorType >
VectorType Opm::mswellhelpers::applyUMFPack ( Dune::UMFPack< MatrixType > &  linsolver,
VectorType  x 
)

Applies umfpack and checks for singularity.

◆ contractCprWellDiagonal()

template<class DiagMatWell , class WellWeight >
DiagMatWell::field_type Opm::mswellhelpers::contractCprWellDiagonal ( const DiagMatWell &  D,
const WellWeight &  lambda,
const int  pressureColumn 
)

Coarse CPRW diagonal for a multisegment well: lambda' D(:,p), summed over every segment row and every column of D.

In an augmented reservoir-well system this is R_w D P_w, where R_w applies lambda to each segment's conservation rows and P_w injects one coarse value into every segment pressure. This matches the pressure column used to assemble the coarse matrix. Classic CPRW eliminates wells from its fine vectors and does not prolong a coarse correction into segment pressures. Unlike the historical row-sum diagonal, this picks up the accumulation and perforation pressure derivatives in D.

Parameters
Dthe well's diagonal block, segment rows by segment columns
lambdareservoir weights; any beyond the well's conservation rows are ignored
pressureColumnthe segment-pressure column of a D block

Returns 1 on exact cancellation to avoid a zero coarse diagonal.

SystemCprwPressureStage::assembleCoarseMatrix runs the same inner kernel over its merged matrix, but distributes into a whole coarse row with per-block weights instead of accumulating one well's D into a single scalar, so the two are not one function.

◆ emulsionViscosity()

template<typename ValueType , typename Scalar >
ValueType Opm::mswellhelpers::emulsionViscosity ( const ValueType &  water_fraction,
const ValueType &  water_viscosity,
const ValueType &  oil_fraction,
const ValueType &  oil_viscosity,
const SICD &  sicd 
)

◆ frictionPressureLoss()

template<typename ValueType , typename Scalar >
ValueType Opm::mswellhelpers::frictionPressureLoss ( const Scalar  l,
const Scalar  diameter,
const Scalar  area,
const Scalar  roughness,
const ValueType &  density,
const ValueType &  w,
const ValueType &  mu 
)

◆ invDX()

template<typename MatrixType , typename VectorType >
VectorType Opm::mswellhelpers::invDX ( const MatrixType &  D,
VectorType  x,
DeferredLogger &  deferred_logger 
)

◆ invertWithUMFPack()

template<typename VectorType , typename MatrixType >
Dune::Matrix< typename MatrixType::block_type > Opm::mswellhelpers::invertWithUMFPack ( const int  size,
const int  bsize,
Dune::UMFPack< MatrixType > &  linsolver 
)

Applies umfpack and checks for singularity.

◆ valveContrictionPressureLoss()

template<typename ValueType , typename Scalar >
ValueType Opm::mswellhelpers::valveContrictionPressureLoss ( const ValueType &  mass_rate,
const ValueType &  density,
const Scalar  area_con,
const Scalar  cv 
)

◆ velocityHead()

template<typename ValueType , typename Scalar >
ValueType Opm::mswellhelpers::velocityHead ( const Scalar  area,
const ValueType &  mass_rate,
const ValueType &  density 
)