mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3235 from akva2/constexpr_micro_optim_wells
Small micro-optims in WellInterface
This commit is contained in:
commit
817e81d3b7
@ -107,15 +107,15 @@ namespace Opm
|
||||
typedef Dune::BlockVector<VectorBlockType> BVector;
|
||||
typedef DenseAd::Evaluation<double, /*size=*/numEq> Eval;
|
||||
|
||||
static const bool has_solvent = getPropValue<TypeTag, Properties::EnableSolvent>();
|
||||
static const bool has_zFraction = getPropValue<TypeTag, Properties::EnableExtbo>();
|
||||
static const bool has_polymer = getPropValue<TypeTag, Properties::EnablePolymer>();
|
||||
static constexpr bool has_solvent = getPropValue<TypeTag, Properties::EnableSolvent>();
|
||||
static constexpr bool has_zFraction = getPropValue<TypeTag, Properties::EnableExtbo>();
|
||||
static constexpr bool has_polymer = getPropValue<TypeTag, Properties::EnablePolymer>();
|
||||
static const bool has_energy = getPropValue<TypeTag, Properties::EnableEnergy>();
|
||||
static const bool has_temperature = getPropValue<TypeTag, Properties::EnableTemperature>();
|
||||
// flag for polymer molecular weight related
|
||||
static const bool has_polymermw = getPropValue<TypeTag, Properties::EnablePolymerMW>();
|
||||
static const bool has_foam = getPropValue<TypeTag, Properties::EnableFoam>();
|
||||
static const bool has_brine = getPropValue<TypeTag, Properties::EnableBrine>();
|
||||
static constexpr bool has_foam = getPropValue<TypeTag, Properties::EnableFoam>();
|
||||
static constexpr bool has_brine = getPropValue<TypeTag, Properties::EnableBrine>();
|
||||
static const int contiSolventEqIdx = Indices::contiSolventEqIdx;
|
||||
static const int contiZfracEqIdx = Indices::contiZfracEqIdx;
|
||||
static const int contiPolymerEqIdx = Indices::contiPolymerEqIdx;
|
||||
|
@ -97,13 +97,15 @@ namespace Opm
|
||||
|
||||
wsolvent_ = 0.0;
|
||||
|
||||
if ((has_solvent || has_zFraction) && well.isInjector()) {
|
||||
if constexpr (has_solvent || has_zFraction) {
|
||||
if (well.isInjector()) {
|
||||
auto injectorType = well_ecl_.injectorType();
|
||||
if (injectorType == InjectorType::GAS) {
|
||||
wsolvent_ = well_ecl_.getSolventFraction();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<typename TypeTag>
|
||||
void
|
||||
@ -373,10 +375,7 @@ namespace Opm
|
||||
WellInterface<TypeTag>::
|
||||
wpolymer() const
|
||||
{
|
||||
if (!has_polymer) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
if constexpr (has_polymer) {
|
||||
auto injectorType = well_ecl_.injectorType();
|
||||
|
||||
if (injectorType == InjectorType::WATER) {
|
||||
@ -389,6 +388,9 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -398,10 +400,7 @@ namespace Opm
|
||||
WellInterface<TypeTag>::
|
||||
wfoam() const
|
||||
{
|
||||
if (!has_foam) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
if constexpr (has_foam) {
|
||||
auto injectorType = well_ecl_.injectorType();
|
||||
|
||||
if (injectorType == InjectorType::GAS) {
|
||||
@ -413,6 +412,9 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename TypeTag>
|
||||
@ -420,10 +422,7 @@ namespace Opm
|
||||
WellInterface<TypeTag>::
|
||||
wsalt() const
|
||||
{
|
||||
if (!has_brine) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
if constexpr (has_brine) {
|
||||
auto injectorType = well_ecl_.injectorType();
|
||||
|
||||
if (injectorType == InjectorType::WATER) {
|
||||
@ -435,6 +434,9 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user