WellInterface: move code using WellFoamProperties to compile unit

This commit is contained in:
Arne Morten Kvarving 2023-01-12 15:15:42 +01:00
parent a0f85c8a93
commit a29d5f81b6
3 changed files with 17 additions and 10 deletions

View File

@ -23,6 +23,7 @@
#include <opm/simulators/wells/WellInterfaceGeneric.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>
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
#include <opm/simulators/wells/PerforationData.hpp>
@ -439,4 +440,17 @@ bool WellInterfaceGeneric::isPressureControlled(const WellState& well_state) con
}
}
double WellInterfaceGeneric::wfoam_() const
{
auto injectorType = this->well_ecl_.injectorType();
if (injectorType == InjectorType::GAS) {
WellFoamProperties fprop = this->well_ecl_.getFoamProperties();
return fprop.m_foamConcentration;
} else {
// Not a gas injection well => no foam.
return 0.0;
}
}
} // namespace Opm

View File

@ -198,6 +198,8 @@ public:
protected:
bool getAllowCrossFlow() const;
double wfoam_() const;
// definition of the struct OperabilityStatus
struct OperabilityStatus {
bool isOperableAndSolvable() 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/WellFoamProperties.hpp>
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
#include <opm/simulators/wells/GroupState.hpp>
#include <opm/simulators/wells/TargetCalculator.hpp>
@ -122,15 +121,7 @@ namespace Opm
wfoam() const
{
if constexpr (has_foam) {
auto injectorType = this->well_ecl_.injectorType();
if (injectorType == InjectorType::GAS) {
WellFoamProperties fprop = this->well_ecl_.getFoamProperties();
return fprop.m_foamConcentration;
} else {
// Not a gas injection well => no foam.
return 0.0;
}
return this->wfoam_();
}
return 0.0;