WellInterface: move code using WellBrineProperties to compile unit

This commit is contained in:
Arne Morten Kvarving
2023-01-12 15:15:42 +01:00
parent 131f52773f
commit 71bf868ddb
3 changed files with 16 additions and 10 deletions

View File

@@ -22,6 +22,7 @@
#include <config.h>
#include <opm/simulators/wells/WellInterfaceGeneric.hpp>
#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/WellTestState.hpp>
@@ -453,4 +454,17 @@ double WellInterfaceGeneric::wfoam_() const
}
}
double WellInterfaceGeneric::wsalt_() const
{
auto injectorType = this->well_ecl_.injectorType();
if (injectorType == InjectorType::WATER) {
WellBrineProperties fprop = this->well_ecl_.getBrineProperties();
return fprop.m_saltConcentration;
} else {
// Not a water injection well => no salt (?).
return 0.0;
}
}
} // namespace Opm

View File

@@ -199,6 +199,7 @@ protected:
bool getAllowCrossFlow() const;
double wfoam_() const;
double wsalt_() const;
// definition of the struct OperabilityStatus
struct OperabilityStatus {

View File

@@ -22,7 +22,6 @@
#include <opm/common/Exceptions.hpp>
#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
#include <opm/input/eclipse/Schedule/Well/WellBrineProperties.hpp>
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
#include <opm/simulators/wells/GroupState.hpp>
#include <opm/simulators/wells/TargetCalculator.hpp>
@@ -136,15 +135,7 @@ namespace Opm
wsalt() const
{
if constexpr (has_brine) {
auto injectorType = this->well_ecl_.injectorType();
if (injectorType == InjectorType::WATER) {
WellBrineProperties fprop = this->well_ecl_.getBrineProperties();
return fprop.m_saltConcentration;
} else {
// Not a water injection well => no salt (?).
return 0.0;
}
return this->wsalt_();
}
return 0.0;