WellInterface: move code using WellMICPProperties to compile unit

This commit is contained in:
Arne Morten Kvarving 2023-01-12 15:15:42 +01:00
parent f74f2ded8e
commit c0e9193e50
3 changed files with 49 additions and 31 deletions

View File

@ -25,6 +25,7 @@
#include <opm/input/eclipse/Schedule/Well/WellBrineProperties.hpp>
#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
#include <opm/input/eclipse/Schedule/Well/WellFoamProperties.hpp>
#include <opm/input/eclipse/Schedule/Well/WellMICPProperties.hpp>
#include <opm/input/eclipse/Schedule/Well/WellPolymerProperties.hpp>
#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
@ -442,6 +443,20 @@ bool WellInterfaceGeneric::isPressureControlled(const WellState& well_state) con
}
}
double WellInterfaceGeneric::wmicrobes_() const
{
auto injectorType = this->well_ecl_.injectorType();
if (injectorType == InjectorType::WATER) {
WellMICPProperties microbes = this->well_ecl_.getMICPProperties();
const double microbial_injection_concentration = microbes.m_microbialConcentration;
return microbial_injection_concentration;
} else {
// Not a water injection well => no microbes.
return 0.0;
}
}
double WellInterfaceGeneric::wfoam_() const
{
auto injectorType = this->well_ecl_.injectorType();
@ -468,6 +483,20 @@ double WellInterfaceGeneric::wsalt_() const
}
}
double WellInterfaceGeneric::woxygen_() const
{
auto injectorType = this->well_ecl_.injectorType();
if (injectorType == InjectorType::WATER) {
WellMICPProperties oxygen = this->well_ecl_.getMICPProperties();
const double oxygen_injection_concentration = oxygen.m_oxygenConcentration;
return oxygen_injection_concentration;
} else {
// Not a water injection well => no oxygen.
return 0.0;
}
}
double WellInterfaceGeneric::wpolymer_() const
{
auto injectorType = this->well_ecl_.injectorType();
@ -482,6 +511,20 @@ double WellInterfaceGeneric::wpolymer_() const
}
}
double WellInterfaceGeneric::wurea_() const
{
auto injectorType = this->well_ecl_.injectorType();
if (injectorType == InjectorType::WATER) {
WellMICPProperties urea = this->well_ecl_.getMICPProperties();
const double urea_injection_concentration = urea.m_ureaConcentration / 10.; //Dividing by scaling factor 10
return urea_injection_concentration;
} else {
// Not a water injection well => no urea.
return 0.0;
}
}
int WellInterfaceGeneric::polymerTable_() const
{
return this->well_ecl_.getPolymerProperties().m_skprpolytable;

View File

@ -198,9 +198,12 @@ public:
protected:
bool getAllowCrossFlow() const;
double wmicrobes_() const;
double wfoam_() const;
double woxygen_() const;
double wpolymer_() const;
double wsalt_() const;
double wurea_() const;
int polymerTable_() const;
int polymerInjTable_() const;

View File

@ -22,7 +22,6 @@
#include <opm/common/Exceptions.hpp>
#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
#include <opm/input/eclipse/Schedule/Well/WellMICPProperties.hpp>
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
#include <opm/simulators/wells/GroupState.hpp>
#include <opm/simulators/wells/TargetCalculator.hpp>
@ -139,16 +138,7 @@ namespace Opm
wmicrobes() const
{
if constexpr (has_micp) {
auto injectorType = this->well_ecl_.injectorType();
if (injectorType == InjectorType::WATER) {
WellMICPProperties microbes = this->well_ecl_.getMICPProperties();
const double microbial_injection_concentration = microbes.m_microbialConcentration;
return microbial_injection_concentration;
} else {
// Not a water injection well => no microbes.
return 0.0;
}
return this->wmicrobes_();
}
return 0.0;
@ -160,16 +150,7 @@ namespace Opm
woxygen() const
{
if constexpr (has_micp) {
auto injectorType = this->well_ecl_.injectorType();
if (injectorType == InjectorType::WATER) {
WellMICPProperties oxygen = this->well_ecl_.getMICPProperties();
const double oxygen_injection_concentration = oxygen.m_oxygenConcentration;
return oxygen_injection_concentration;
} else {
// Not a water injection well => no oxygen.
return 0.0;
}
return this->woxygen_();
}
return 0.0;
@ -187,16 +168,7 @@ namespace Opm
wurea() const
{
if constexpr (has_micp) {
auto injectorType = this->well_ecl_.injectorType();
if (injectorType == InjectorType::WATER) {
WellMICPProperties urea = this->well_ecl_.getMICPProperties();
const double urea_injection_concentration = urea.m_ureaConcentration / 10.; //Dividing by scaling factor 10
return urea_injection_concentration;
} else {
// Not a water injection well => no urea.
return 0.0;
}
return this->wurea_();
}
return 0.0;