Loading...
Searching...
No Matches
WellHelpers.hpp
/*
Copyright 2016 SINTEF ICT, Applied Mathematics.
Copyright 2016 Statoil ASA.
Copyright 2020 OPM-OP AS.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_WELLHELPERS_HEADER_INCLUDED
#define OPM_WELLHELPERS_HEADER_INCLUDED
#include <dune/istl/bcrsmatrix.hh>
#include <dune/common/dynmatrix.hh>
#include <cstdint>
namespace Opm {
template<class Scalar> class ParallelWellInfo;
struct WellProductionControls;
struct WellInjectionControls;
enum class WellProducerCMode : std::uint16_t;
enum class WellInjectorCMode : std::uint16_t;
namespace wellhelpers {
template<typename Scalar>
class ParallelStandardWellB
{
public:
using Block = Dune::DynamicMatrix<Scalar>;
using Matrix = Dune::BCRSMatrix<Block>;
ParallelStandardWellB(const Matrix& B,
const ParallelWellInfo<Scalar>& parallel_well_info);
template<class X, class Y>
void mv (const X& x, Y& y) const;
template<class X, class Y>
void mmv (const X& x, Y& y) const;
private:
const Matrix& B_;
const ParallelWellInfo<Scalar>& parallel_well_info_;
};
template<class Scalar>
Scalar computeHydrostaticCorrection(const Scalar well_ref_depth,
const Scalar vfp_ref_depth,
const Scalar rho,
const Scalar gravity);
template<typename MatrixType, typename VectorType, typename Comm>
void sumDistributedWellEntries(MatrixType& mat,
VectorType& vec,
const Comm& comm);
// explicit transpose of a dense matrix due to compilation problems
// used for calculating quasiimpes well weights
template <class DenseMatrix>
DenseMatrix transposeDenseDynMatrix(const DenseMatrix& M);
bool rateControlWithZeroProdTarget(const WellProductionControls& controls,
WellProducerCMode mode);
bool rateControlWithZeroInjTarget(const WellInjectionControls& controls,
WellInjectorCMode mode);
} // namespace wellhelpers
} // namespace Opm
#endif
Opm::ParallelWellInfo
Class encapsulating some information about parallel wells.
Definition ParallelWellInfo.hpp:198
Opm::wellhelpers::ParallelStandardWellB::mv
void mv(const X &x, Y &y) const
y = A x
Definition WellHelpers.cpp:52
Opm::wellhelpers::ParallelStandardWellB::mmv
void mmv(const X &x, Y &y) const
y = A x
Definition WellHelpers.cpp:109
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43