separating the WINJMULT for well and connections

with more testing, it looks like when multiple records are entered. The
records with WREV mode and records with CIRR and CREV modes work
differently in term of overwriting the previous records. So it is
necessary to store them separately.
This commit is contained in:
Kai Bao
2023-06-19 15:35:12 +02:00
parent b7617f9469
commit 68e586bf7a
7 changed files with 167 additions and 77 deletions

View File

@@ -30,6 +30,8 @@
#include <optional>
#include <limits>
#include <opm/input/eclipse/Schedule/Well/WINJMULT.hpp>
namespace Opm {
namespace RestartIO {
@@ -77,34 +79,6 @@ namespace RestartIO {
Defaulted,
};
struct InjMult {
bool is_active {false};
double fracture_pressure {std::numeric_limits<double>::max()};
double multiplier_gradient {0.};
bool active() const
{
return is_active;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(is_active);
serializer(fracture_pressure);
serializer(multiplier_gradient);
}
bool operator==( const InjMult& rhs ) const {
return is_active == rhs.is_active
&& fracture_pressure == rhs.fracture_pressure
&& multiplier_gradient == rhs.multiplier_gradient;
}
};
Connection();
Connection(int i, int j , int k ,
std::size_t global_index,
@@ -150,8 +124,6 @@ namespace RestartIO {
CTFKind kind() const;
const InjMult& injmult() const;
void setInjMult(const InjMult& inj_mult);
// remove the injMult setting and INJMULT is not active for this connection
void clearInjMult();
void setState(State state);
void setComplnum(int compnum);

View File

@@ -0,0 +1,63 @@
/*
Copyright 2023 Equinor.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_WINJMULT_HPP
#define OPM_WINJMULT_HPP
#include <limits>
namespace Opm {
class KeywordLocation;
struct InjMult {
enum class InjMultMode {
WREV,
CREV,
CIRR,
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);
}
bool operator==(const InjMult& rhs) const;
static InjMult serializationTestObject();
static std::string InjMultToString(const InjMult&);
};
}
#endif // OPM_WINJMULT_HPP

View File

@@ -39,6 +39,7 @@
#include <opm/input/eclipse/Schedule/Well/WellEnums.hpp>
#include <opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp>
#include <opm/input/eclipse/Schedule/Well/WellProductionControls.hpp>
#include <opm/input/eclipse/Schedule/Well/WINJMULT.hpp>
#include <opm/input/eclipse/Units/UnitSystem.hpp>
namespace Opm {
@@ -76,14 +77,10 @@ class Well {
public:
using Status = WellStatus;
enum class InjMultMode {
WREV,
CREV,
CIRR,
NONE,
};
static InjMultMode injMultModeFromString(const std::string& str, const KeywordLocation& location);
/*
* The mode for the keyword WINJMULT. It can have four different values: WREV, CREV, CIRR and NONE.
*/
using InjMultMode = InjMult::InjMultMode;
/*
The elements in this enum are used as bitmasks to keep track
@@ -393,6 +390,7 @@ public:
const std::string& groupName() const;
Phase getPreferredPhase() const;
InjMultMode getInjMultMode() const;
const InjMult& getWellInjMult() const;
bool hasConnections() const;
const std::vector<const Connection *> getConnections(int completion) const;
@@ -550,6 +548,7 @@ public:
serializer(m_pavg);
serializer(well_temperature);
serializer(inj_mult_mode);
serializer(well_inj_mult);
}
private:
@@ -597,6 +596,7 @@ private:
PAvg m_pavg;
double well_temperature;
InjMultMode inj_mult_mode = InjMultMode::NONE;
InjMult well_inj_mult;
};
std::ostream& operator<<( std::ostream&, const Well::WellInjectionProperties& );