Use WellType when serializing and constructing Well

This commit is contained in:
Joakim Hove 2020-03-03 17:43:58 +01:00
parent 69871fdefd
commit 3ab0e570c7
2 changed files with 11 additions and 14 deletions

View File

@ -1264,7 +1264,7 @@ std::size_t packSize(const Well& data,
packSize(data.getHeadI(), comm) +
packSize(data.getHeadJ(), comm) +
packSize(data.getRefDepth(), comm) +
packSize(data.getPreferredPhase(), comm) +
packSize(data.wellType(), comm) +
packSize(data.getWellConnectionOrdering(), comm) +
packSize(data.units(), comm) +
packSize(data.udqUndefined(), comm) +
@ -1272,7 +1272,6 @@ std::size_t packSize(const Well& data,
packSize(data.getDrainageRadius(), comm) +
packSize(data.getAllowCrossFlow(), comm) +
packSize(data.getAutomaticShutIn(), comm) +
packSize(data.isProducer(), comm) +
packSize(data.wellGuideRate(), comm) +
packSize(data.getEfficiencyFactor(), comm) +
packSize(data.getSolventFraction(), comm) +
@ -2912,7 +2911,7 @@ void pack(const Well& data,
pack(data.getHeadI(), buffer, position, comm);
pack(data.getHeadJ(), buffer, position, comm);
pack(data.getRefDepth(), buffer, position, comm);
pack(data.getPreferredPhase(), buffer, position, comm);
pack(data.wellType(), buffer, position, comm);
pack(data.getWellConnectionOrdering(), buffer, position, comm);
pack(data.units(), buffer, position, comm);
pack(data.udqUndefined(), buffer, position, comm);
@ -2920,7 +2919,6 @@ void pack(const Well& data,
pack(data.getDrainageRadius(), buffer, position, comm);
pack(data.getAllowCrossFlow(), buffer, position, comm);
pack(data.getAutomaticShutIn(), buffer, position, comm);
pack(data.isProducer(), buffer, position, comm);
pack(data.wellGuideRate(), buffer, position, comm);
pack(data.getEfficiencyFactor(), buffer, position, comm);
pack(data.getSolventFraction(), buffer, position, comm);
@ -4043,7 +4041,7 @@ void unpack(WellType& data, std::vector<char>& buffer, int& position, Dune::MPIH
bool producer;
unpack(producer, buffer, position, comm);
unpack(preferred_phase, buffer, position, comm);
data = WellType( producer, phase );
data = WellType( producer, preferred_phase );
}
@ -5091,13 +5089,13 @@ void unpack(Well& data,
std::size_t firstTimeStep, seqIndex;
int headI, headJ;
double ref_depth;
Phase phase;
WellType wtype;
Connection::Order ordering;
UnitSystem units;
double udq_undefined;
Well::Status status;
double drainageRadius;
bool allowCrossFlow, automaticShutIn, isProducer;
bool allowCrossFlow, automaticShutIn;
Well::WellGuideRate guideRate;
double efficiencyFactor;
double solventFraction;
@ -5119,7 +5117,7 @@ void unpack(Well& data,
unpack(headI, buffer, position, comm);
unpack(headJ, buffer, position, comm);
unpack(ref_depth, buffer, position, comm);
unpack(phase, buffer, position, comm);
unpack(wtype, buffer, position, comm);
unpack(ordering, buffer, position, comm);
unpack(units, buffer, position, comm);
unpack(udq_undefined, buffer, position, comm);
@ -5127,7 +5125,6 @@ void unpack(Well& data,
unpack(drainageRadius, buffer, position, comm);
unpack(allowCrossFlow, buffer, position, comm);
unpack(automaticShutIn, buffer, position, comm);
unpack(isProducer, buffer, position, comm);
unpack(guideRate, buffer, position, comm);
unpack(efficiencyFactor, buffer, position, comm);
unpack(solventFraction, buffer, position, comm);
@ -5147,8 +5144,8 @@ void unpack(Well& data,
unpack(*segments, buffer, position, comm);
}
data = Well(name, groupName, firstTimeStep, seqIndex, headI, headJ,
ref_depth, phase, ordering, units, udq_undefined, status,
drainageRadius, allowCrossFlow, automaticShutIn, isProducer,
ref_depth, wtype, ordering, units, udq_undefined, status,
drainageRadius, allowCrossFlow, automaticShutIn,
guideRate, efficiencyFactor, solventFraction, prediction_mode,
econLimits, foamProperties, polymerProperties, brineProperties,
tracerProperties, connection, production, injection, segments);

View File

@ -323,9 +323,9 @@ Opm::Well getFullWell()
{
Opm::UnitSystem unitSystem;
return Opm::Well("test1", "test2", 1, 2, 3, 4, 5.0,
Opm::Phase::WATER, Opm::Connection::Order::DEPTH,
Opm::WellType(Opm::Phase::WATER), Opm::Connection::Order::DEPTH,
unitSystem, 6.0, Opm::Well::Status::SHUT,
7.0, true, true, false,
7.0, true, false,
Opm::Well::WellGuideRate{true, 1.0, Opm::Well::GuideRateTarget::COMB, 2.0},
8.0, 9.0, false,
std::make_shared<Opm::WellEconProductionLimits>(),
@ -2300,7 +2300,7 @@ BOOST_AUTO_TEST_CASE(Fault)
BOOST_AUTO_TEST_CASE(WellType)
{
#ifdef HAVE_MPI
Opm::WellType val1(true, Phase::OIL);
Opm::WellType val1(true, Opm::Phase::OIL);
auto val2 = PackUnpack(val1);
DO_CHECKS(WellType)
#endif