This commit is contained in:
Kai Bao 2023-11-26 11:23:59 +00:00 committed by GitHub
commit 0511ddefd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -41,6 +41,8 @@ namespace Opm {
void update(const DeckRecord& record); void update(const DeckRecord& record);
void update(const RestartIO::RstWell& rst_well); void update(const RestartIO::RstWell& rst_well);
bool active() const;
bool operator==(const WVFPDP& other) const; bool operator==(const WVFPDP& other) const;
bool operator!=(const WVFPDP& other) const; bool operator!=(const WVFPDP& other) const;
@ -49,11 +51,13 @@ namespace Opm {
{ {
serializer(m_dp); serializer(m_dp);
serializer(m_fp); serializer(m_fp);
serializer(m_active);
} }
private: private:
double m_dp{0.0}; double m_dp{0.0};
double m_fp{1.0}; double m_fp{1.0};
bool m_active{false};
}; };
} // namespace Opm } // namespace Opm

View File

@ -33,23 +33,32 @@ namespace Opm {
WVFPDP result; WVFPDP result;
result.m_dp = 1.23; result.m_dp = 1.23;
result.m_fp = 0.456; result.m_fp = 0.456;
result.m_active = false;
return result; return result;
} }
bool WVFPDP::operator==(const WVFPDP& other) const { bool WVFPDP::operator==(const WVFPDP& other) const {
return (m_dp == other.m_dp) return (m_dp == other.m_dp)
&& (m_fp == other.m_fp); && (m_fp == other.m_fp)
&& (m_active == other.m_active);
} }
void WVFPDP::update(const DeckRecord& record) { void WVFPDP::update(const DeckRecord& record) {
m_dp = record.getItem<ParserKeywords::WVFPDP::DELTA_P>().getSIDouble(0); m_dp = record.getItem<ParserKeywords::WVFPDP::DELTA_P>().getSIDouble(0);
m_fp = record.getItem<ParserKeywords::WVFPDP::LOSS_SCALING_FACTOR>().get<double>(0); m_fp = record.getItem<ParserKeywords::WVFPDP::LOSS_SCALING_FACTOR>().get<double>(0);
this->m_active = true;
} }
void WVFPDP::update(const RestartIO::RstWell& rst_well) { void WVFPDP::update(const RestartIO::RstWell& rst_well) {
this->m_dp = rst_well.vfp_bhp_adjustment; this->m_dp = rst_well.vfp_bhp_adjustment;
this->m_fp = rst_well.vfp_bhp_scaling_factor; this->m_fp = rst_well.vfp_bhp_scaling_factor;
// \Note: not totally sure we should do this
this->m_active = true;
}
bool WVFPDP::active() const {
return this->m_active;
} }
double WVFPDP::getPressureLoss(double bhp_tab, double thp_limit) const { double WVFPDP::getPressureLoss(double bhp_tab, double thp_limit) const {