addressing the reviewing comments for PR #3577
This commit is contained in:
@@ -123,6 +123,7 @@ namespace RestartIO {
|
||||
double skinFactor() const;
|
||||
CTFKind kind() const;
|
||||
const InjMult& injmult() const;
|
||||
bool activeInjMult() const;
|
||||
void setInjMult(const InjMult& inj_mult);
|
||||
|
||||
void setState(State state);
|
||||
@@ -191,7 +192,7 @@ namespace RestartIO {
|
||||
|
||||
std::array<int,3> ijk;
|
||||
CTFKind m_ctfkind;
|
||||
InjMult m_injmult;
|
||||
std::optional<InjMult> m_injmult;
|
||||
std::size_t m_global_index;
|
||||
/*
|
||||
The sort_value member is a peculiar quantity. The connections are
|
||||
|
||||
@@ -36,18 +36,14 @@ struct InjMult {
|
||||
NONE,
|
||||
};
|
||||
|
||||
bool is_active {false};
|
||||
double fracture_pressure {std::numeric_limits<double>::max()};
|
||||
double multiplier_gradient {0.};
|
||||
|
||||
static InjMultMode injMultModeFromString(const std::string& str, const KeywordLocation& location);
|
||||
|
||||
bool active() const;
|
||||
|
||||
template <class Serializer>
|
||||
void serializeOp(Serializer& serializer)
|
||||
{
|
||||
serializer(is_active);
|
||||
serializer(fracture_pressure);
|
||||
serializer(multiplier_gradient);
|
||||
}
|
||||
|
||||
@@ -391,6 +391,7 @@ public:
|
||||
Phase getPreferredPhase() const;
|
||||
InjMultMode getInjMultMode() const;
|
||||
const InjMult& getWellInjMult() const;
|
||||
bool aciveWellInjMult() const;
|
||||
|
||||
bool hasConnections() const;
|
||||
const std::vector<const Connection *> getConnections(int completion) const;
|
||||
@@ -596,7 +597,7 @@ private:
|
||||
PAvg m_pavg;
|
||||
double well_temperature;
|
||||
InjMultMode inj_mult_mode = InjMultMode::NONE;
|
||||
InjMult well_inj_mult;
|
||||
std::optional<InjMult> well_inj_mult;
|
||||
};
|
||||
|
||||
std::ostream& operator<<( std::ostream&, const Well::WellInjectionProperties& );
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/input/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
|
||||
#include <opm/input/eclipse/Schedule/Well/Connection.hpp>
|
||||
#include <opm/input/eclipse/Schedule/ScheduleGrid.hpp>
|
||||
|
||||
namespace Opm {
|
||||
@@ -297,7 +298,9 @@ const std::optional<std::pair<double, double>>& Connection::perf_range() const {
|
||||
ss << "segment_nr " << this->segment_number << std::endl;
|
||||
ss << "center_depth " << this->center_depth << std::endl;
|
||||
ss << "sort_value" << this->m_sort_value<< std::endl;
|
||||
ss << "INJMULT " << InjMult::InjMultToString(this->m_injmult) << std::endl;
|
||||
if (this->m_injmult.has_value()) {
|
||||
ss << "INJMULT " << InjMult::InjMultToString(this->m_injmult.value()) << std::endl;
|
||||
}
|
||||
|
||||
return ss.str();
|
||||
}
|
||||
@@ -446,7 +449,12 @@ Connection::CTFKind Connection::kind() const {
|
||||
}
|
||||
|
||||
const InjMult& Connection::injmult() const {
|
||||
return m_injmult;
|
||||
assert(this->activeInjMult());
|
||||
return m_injmult.value();
|
||||
}
|
||||
|
||||
bool Connection::activeInjMult() const {
|
||||
return this->m_injmult.has_value();
|
||||
}
|
||||
|
||||
void Connection::setInjMult(const InjMult& inj_mult) {
|
||||
|
||||
@@ -39,22 +39,15 @@ InjMult::InjMultMode InjMult::injMultModeFromString(const std::string& str, cons
|
||||
}
|
||||
|
||||
|
||||
bool InjMult::active() const
|
||||
{
|
||||
return this->is_active;
|
||||
}
|
||||
|
||||
bool InjMult::operator==(const InjMult& rhs) const
|
||||
{
|
||||
return is_active == rhs.is_active
|
||||
&& fracture_pressure == rhs.fracture_pressure
|
||||
return fracture_pressure == rhs.fracture_pressure
|
||||
&& multiplier_gradient == rhs.multiplier_gradient;
|
||||
}
|
||||
|
||||
|
||||
InjMult InjMult::serializationTestObject() {
|
||||
InjMult result;
|
||||
result.is_active = false;
|
||||
result.fracture_pressure = 1.e9;
|
||||
result.multiplier_gradient = 2.;
|
||||
return result;
|
||||
@@ -62,8 +55,8 @@ InjMult InjMult::serializationTestObject() {
|
||||
|
||||
|
||||
std::string InjMult::InjMultToString(const InjMult& mult) {
|
||||
std::string ss = fmt::format("active? {}, fracture_pressure {}, multiplier_gradient {}",
|
||||
mult.is_active, mult.fracture_pressure, mult.multiplier_gradient);
|
||||
std::string ss = fmt::format("fracture_pressure {}, multiplier_gradient {}",
|
||||
mult.fracture_pressure, mult.multiplier_gradient);
|
||||
return ss;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
#include "../MSW/Compsegs.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
@@ -310,7 +311,8 @@ Well::Well(const RestartIO::RstWell& rst_well,
|
||||
wvfpdp(std::make_shared<WVFPDP>()),
|
||||
wvfpexp(explicitTHPOptions(rst_well)),
|
||||
status(status_from_int(rst_well.well_status)),
|
||||
well_temperature(Metric::TemperatureOffset + ParserKeywords::STCOND::TEMPERATURE::defaultValue)
|
||||
well_temperature(Metric::TemperatureOffset + ParserKeywords::STCOND::TEMPERATURE::defaultValue),
|
||||
well_inj_mult(std::nullopt)
|
||||
{
|
||||
if (this->wtype.producer()) {
|
||||
auto p = std::make_shared<WellProductionProperties>(this->unit_system, wname);
|
||||
@@ -489,7 +491,8 @@ Well::Well(const std::string& wname_arg,
|
||||
wvfpdp(std::make_shared<WVFPDP>()),
|
||||
wvfpexp(std::make_shared<WVFPEXP>()),
|
||||
status(Status::SHUT),
|
||||
well_temperature(Metric::TemperatureOffset + ParserKeywords::STCOND::TEMPERATURE::defaultValue)
|
||||
well_temperature(Metric::TemperatureOffset + ParserKeywords::STCOND::TEMPERATURE::defaultValue),
|
||||
well_inj_mult(std::nullopt)
|
||||
{
|
||||
auto p = std::make_shared<WellProductionProperties>(this->unit_system, this->wname);
|
||||
p->whistctl_cmode = whistctl_cmode;
|
||||
@@ -1325,7 +1328,7 @@ bool Well::handleWINJMULT(const Opm::DeckRecord& record, const KeywordLocation&
|
||||
const double fracture_pressure = record.getItem<Kw::FRACTURING_PRESSURE>().getSIDouble(0);
|
||||
const double multiple_gradient = record.getItem<Kw::MULTIPLIER_GRADIENT>().getSIDouble(0);
|
||||
auto new_connections = std::make_shared<WellConnections>(this->connections->ordering(), this->headI, this->headJ);
|
||||
const InjMult inj_mult {true, fracture_pressure, multiple_gradient};
|
||||
const InjMult inj_mult {fracture_pressure, multiple_gradient};
|
||||
bool connections_update = false;
|
||||
bool well_inj_update = false;
|
||||
|
||||
@@ -1614,7 +1617,7 @@ bool Well::operator==(const Well& data) const {
|
||||
&& (this->getInjectionProperties() == data.getInjectionProperties())
|
||||
&& (this->well_temperature == data.well_temperature)
|
||||
&& (this->inj_mult_mode == data.inj_mult_mode)
|
||||
&& (this->getWellInjMult() == data.getWellInjMult())
|
||||
&& (this->well_inj_mult == data.well_inj_mult)
|
||||
;
|
||||
}
|
||||
|
||||
@@ -1701,7 +1704,12 @@ Opm::Well::InjMultMode Opm::Well::getInjMultMode() const {
|
||||
}
|
||||
|
||||
const Opm::InjMult& Opm::Well::getWellInjMult() const {
|
||||
return this->well_inj_mult;
|
||||
assert(this->aciveWellInjMult());
|
||||
return this->well_inj_mult.value();
|
||||
}
|
||||
|
||||
bool Opm::Well::aciveWellInjMult() const {
|
||||
return this->well_inj_mult.has_value();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user