20#ifndef WDFAC_HPP_HEADER_INCLUDED
21#define WDFAC_HPP_HEADER_INCLUDED
25#include <fmt/format.h>
30 class WellConnections;
33namespace Opm {
namespace RestartIO {
89 return ! (*
this == other);
99 template <
class Serializer>
177 template <
typename DensityCallback,
typename GasViscCallback>
179 GasViscCallback&& gas_visc,
182 switch (this->m_type) {
183 case WDFacType::NONE:
186 case WDFacType::DFACTOR:
187 return this->scaledWellLevelDFactor(this->m_d, conn);
189 case WDFacType::DAKEMODEL:
190 return this->dakeModelDFactor(rhoGS(), gas_visc(), conn);
192 case WDFacType::CON_DFACTOR:
193 return this->connectionLevelDFactor(conn);
196 throw std::runtime_error {
197 fmt::format(
"Unknown D-Factor model '{}'",
198 static_cast<int>(this->m_type))
222 return ! (*
this == other);
231 template <
class Serializer>
234 serializer(this->m_type);
235 serializer(this->m_d);
236 serializer(this->m_total_cf);
237 serializer(this->m_corr);
258 WDFacType m_type { WDFacType::NONE };
264 double m_total_cf{-1.0};
267 Correlation m_corr{};
277 double connectionLevelDFactor(
const Connection& conn)
const;
290 double dakeModelDFactor(
const double rhoGS,
291 const double gas_visc,
292 const Connection& conn)
const;
302 double scaledWellLevelDFactor(
const double dfac,
303 const Connection& conn)
const;
Definition Connection.hpp:53
Definition DeckRecord.hpp:32
Class for (de-)serializing.
Definition Serializer.hpp:84
bool operator!=(const WDFAC &other) const
Inequality operator.
Definition WDFAC.hpp:220
void updateWDFACType(const WellConnections &connections)
Check if any input-level connctions have a non-trivial D-factor and update this well's D-factor categ...
Definition WDFAC.cpp:99
void updateWDFACCOR(const DeckRecord &record)
Configure D-factor calculation from Dake correlation model (keyword WDFACCOR).
Definition WDFAC.cpp:90
void updateWDFAC(const DeckRecord &record)
Configure D-factor calculation from well-level D-factor description (keyword 'WDFAC')
Definition WDFAC.cpp:83
double getDFactor(DensityCallback &&rhoGS, GasViscCallback &&gas_visc, const Connection &conn) const
Retrieve currently configured D-factor for single connection.
Definition WDFAC.hpp:178
WDFAC()=default
Default constructor.
bool operator==(const WDFAC &other) const
Equality operator.
Definition WDFAC.cpp:123
void updateTotalCF(const WellConnections &connections)
Capture sum of all CTFs for the purpose of translating well-level D-factors to connection-level D-fac...
Definition WDFAC.cpp:112
const Correlation & getDFactorCorrelationCoefficients() const
Retrieve current D-factor correlation model coefficients.
Definition WDFAC.hpp:203
static WDFAC serializationTestObject()
Serialisation test object.
Definition WDFAC.cpp:71
void serializeOp(Serializer &serializer)
Serialisation operator.
Definition WDFAC.hpp:232
bool useDFactor() const
Whether or not a flow-dependent skin factor ('D') has been configured for the current well.
Definition WDFAC.cpp:118
Definition WellConnections.hpp:48
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Parameters for Dake's D-factor correlation model.
Definition WDFAC.hpp:66
bool operator==(const Correlation &other) const
Equality operator.
Definition WDFAC.cpp:49
bool operator!=(const Correlation &other) const
Inequality operator.
Definition WDFAC.hpp:87
double coeff_a
Multiplicative coefficient 'A'.
Definition WDFAC.hpp:68
void serializeOp(Serializer &serializer)
Serialisation operator.
Definition WDFAC.hpp:100
static Correlation serializationTestObject()
Serialisation test object.
Definition WDFAC.cpp:44
double exponent_b
Power coefficient 'B' for the effective permeability.
Definition WDFAC.hpp:71
double exponent_c
Power coefficient 'C' for the porosity term.
Definition WDFAC.hpp:74