23#ifndef OPM_MSWELLHELPERS_HEADER_INCLUDED
24#define OPM_MSWELLHELPERS_HEADER_INCLUDED
26#include <dune/istl/matrix.hh>
38template<
class Scalar>
class ParallelWellInfo;
42namespace mswellhelpers
56 template<
class MatrixType>
60 using Scalar =
typename MatrixType::field_type;
65 template<
class X,
class Y>
66 void mv (
const X& x, Y& y)
const;
69 template<
class X,
class Y>
70 void mmv (
const X& x, Y& y)
const;
78 template <
typename MatrixType,
typename VectorType>
104 template <
class DiagMatWell,
class WellWeight>
105 typename DiagMatWell::field_type
107 const WellWeight& lambda,
108 const int pressureColumn)
110 using Scalar =
typename DiagMatWell::field_type;
111 using Block =
typename DiagMatWell::block_type;
116 assert(pressureColumn == Block::cols - 1);
117 const std::size_t numConservationRows =
118 std::min(lambda.size(),
static_cast<std::size_t
>(Block::rows - 1));
121 for (std::size_t row = 0; row < D.N(); ++row) {
122 for (
auto col = D[row].begin(), end = D[row].end(); col != end; ++col) {
123 for (std::size_t i = 0; i < numConservationRows; ++i) {
124 diag += lambda[i] * (*col)[i][pressureColumn];
128 return (diag == 0.0) ? Scalar{1.0} : diag;
134 template <
typename VectorType,
typename MatrixType>
135 Dune::Matrix<typename MatrixType::block_type>
143 template <
typename MatrixType,
typename VectorType>
155 template <
typename ValueType,
typename Scalar>
157 const Scalar area,
const Scalar roughness,
158 const ValueType& density,
159 const ValueType& w,
const ValueType& mu);
162 template <
typename ValueType,
typename Scalar>
164 const ValueType& density,
165 const Scalar area_con,
const Scalar cv);
168 template <
typename ValueType,
typename Scalar>
170 const ValueType& density);
174 template <
typename ValueType,
typename Scalar>
176 const ValueType& water_viscosity,
177 const ValueType& oil_fraction,
178 const ValueType& oil_viscosity,
Definition: MSWellHelpers.hpp:33
Definition: DeferredLogger.hpp:57
Class encapsulating some information about parallel wells.
Definition: ParallelWellInfo.hpp:217
A wrapper around the B matrix for distributed MS wells.
Definition: MSWellHelpers.hpp:58
typename MatrixType::field_type Scalar
Definition: MSWellHelpers.hpp:60
void mv(const X &x, Y &y) const
y = A x
ParallellMSWellB(const MatrixType &B, const ParallelWellInfo< Scalar > ¶llel_well_info)
void mmv(const X &x, Y &y) const
y = A x
Definition: fvbaseprimaryvariables.hh:161
ValueType velocityHead(const Scalar area, const ValueType &mass_rate, const ValueType &density)
ValueType valveContrictionPressureLoss(const ValueType &mass_rate, const ValueType &density, const Scalar area_con, const Scalar cv)
VectorType applyUMFPack(Dune::UMFPack< MatrixType > &linsolver, VectorType x)
Applies umfpack and checks for singularity.
ValueType frictionPressureLoss(const Scalar l, const Scalar diameter, const Scalar area, const Scalar roughness, const ValueType &density, const ValueType &w, const ValueType &mu)
Dune::Matrix< typename MatrixType::block_type > invertWithUMFPack(const int size, const int bsize, Dune::UMFPack< MatrixType > &linsolver)
Applies umfpack and checks for singularity.
DiagMatWell::field_type contractCprWellDiagonal(const DiagMatWell &D, const WellWeight &lambda, const int pressureColumn)
Definition: MSWellHelpers.hpp:106
ValueType emulsionViscosity(const ValueType &water_fraction, const ValueType &water_viscosity, const ValueType &oil_fraction, const ValueType &oil_viscosity, const SICD &sicd)
VectorType invDX(const MatrixType &D, VectorType x, DeferredLogger &deferred_logger)
Definition: blackoilbioeffectsmodules.hh:45