mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use WellType when serializing and constructing Well
This commit is contained in:
parent
69871fdefd
commit
3ab0e570c7
@ -1264,7 +1264,7 @@ std::size_t packSize(const Well& data,
|
|||||||
packSize(data.getHeadI(), comm) +
|
packSize(data.getHeadI(), comm) +
|
||||||
packSize(data.getHeadJ(), comm) +
|
packSize(data.getHeadJ(), comm) +
|
||||||
packSize(data.getRefDepth(), comm) +
|
packSize(data.getRefDepth(), comm) +
|
||||||
packSize(data.getPreferredPhase(), comm) +
|
packSize(data.wellType(), comm) +
|
||||||
packSize(data.getWellConnectionOrdering(), comm) +
|
packSize(data.getWellConnectionOrdering(), comm) +
|
||||||
packSize(data.units(), comm) +
|
packSize(data.units(), comm) +
|
||||||
packSize(data.udqUndefined(), comm) +
|
packSize(data.udqUndefined(), comm) +
|
||||||
@ -1272,7 +1272,6 @@ std::size_t packSize(const Well& data,
|
|||||||
packSize(data.getDrainageRadius(), comm) +
|
packSize(data.getDrainageRadius(), comm) +
|
||||||
packSize(data.getAllowCrossFlow(), comm) +
|
packSize(data.getAllowCrossFlow(), comm) +
|
||||||
packSize(data.getAutomaticShutIn(), comm) +
|
packSize(data.getAutomaticShutIn(), comm) +
|
||||||
packSize(data.isProducer(), comm) +
|
|
||||||
packSize(data.wellGuideRate(), comm) +
|
packSize(data.wellGuideRate(), comm) +
|
||||||
packSize(data.getEfficiencyFactor(), comm) +
|
packSize(data.getEfficiencyFactor(), comm) +
|
||||||
packSize(data.getSolventFraction(), comm) +
|
packSize(data.getSolventFraction(), comm) +
|
||||||
@ -2912,7 +2911,7 @@ void pack(const Well& data,
|
|||||||
pack(data.getHeadI(), buffer, position, comm);
|
pack(data.getHeadI(), buffer, position, comm);
|
||||||
pack(data.getHeadJ(), buffer, position, comm);
|
pack(data.getHeadJ(), buffer, position, comm);
|
||||||
pack(data.getRefDepth(), 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.getWellConnectionOrdering(), buffer, position, comm);
|
||||||
pack(data.units(), buffer, position, comm);
|
pack(data.units(), buffer, position, comm);
|
||||||
pack(data.udqUndefined(), 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.getDrainageRadius(), buffer, position, comm);
|
||||||
pack(data.getAllowCrossFlow(), buffer, position, comm);
|
pack(data.getAllowCrossFlow(), buffer, position, comm);
|
||||||
pack(data.getAutomaticShutIn(), buffer, position, comm);
|
pack(data.getAutomaticShutIn(), buffer, position, comm);
|
||||||
pack(data.isProducer(), buffer, position, comm);
|
|
||||||
pack(data.wellGuideRate(), buffer, position, comm);
|
pack(data.wellGuideRate(), buffer, position, comm);
|
||||||
pack(data.getEfficiencyFactor(), buffer, position, comm);
|
pack(data.getEfficiencyFactor(), buffer, position, comm);
|
||||||
pack(data.getSolventFraction(), 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;
|
bool producer;
|
||||||
unpack(producer, buffer, position, comm);
|
unpack(producer, buffer, position, comm);
|
||||||
unpack(preferred_phase, 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;
|
std::size_t firstTimeStep, seqIndex;
|
||||||
int headI, headJ;
|
int headI, headJ;
|
||||||
double ref_depth;
|
double ref_depth;
|
||||||
Phase phase;
|
WellType wtype;
|
||||||
Connection::Order ordering;
|
Connection::Order ordering;
|
||||||
UnitSystem units;
|
UnitSystem units;
|
||||||
double udq_undefined;
|
double udq_undefined;
|
||||||
Well::Status status;
|
Well::Status status;
|
||||||
double drainageRadius;
|
double drainageRadius;
|
||||||
bool allowCrossFlow, automaticShutIn, isProducer;
|
bool allowCrossFlow, automaticShutIn;
|
||||||
Well::WellGuideRate guideRate;
|
Well::WellGuideRate guideRate;
|
||||||
double efficiencyFactor;
|
double efficiencyFactor;
|
||||||
double solventFraction;
|
double solventFraction;
|
||||||
@ -5119,7 +5117,7 @@ void unpack(Well& data,
|
|||||||
unpack(headI, buffer, position, comm);
|
unpack(headI, buffer, position, comm);
|
||||||
unpack(headJ, buffer, position, comm);
|
unpack(headJ, buffer, position, comm);
|
||||||
unpack(ref_depth, 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(ordering, buffer, position, comm);
|
||||||
unpack(units, buffer, position, comm);
|
unpack(units, buffer, position, comm);
|
||||||
unpack(udq_undefined, buffer, position, comm);
|
unpack(udq_undefined, buffer, position, comm);
|
||||||
@ -5127,7 +5125,6 @@ void unpack(Well& data,
|
|||||||
unpack(drainageRadius, buffer, position, comm);
|
unpack(drainageRadius, buffer, position, comm);
|
||||||
unpack(allowCrossFlow, buffer, position, comm);
|
unpack(allowCrossFlow, buffer, position, comm);
|
||||||
unpack(automaticShutIn, buffer, position, comm);
|
unpack(automaticShutIn, buffer, position, comm);
|
||||||
unpack(isProducer, buffer, position, comm);
|
|
||||||
unpack(guideRate, buffer, position, comm);
|
unpack(guideRate, buffer, position, comm);
|
||||||
unpack(efficiencyFactor, buffer, position, comm);
|
unpack(efficiencyFactor, buffer, position, comm);
|
||||||
unpack(solventFraction, buffer, position, comm);
|
unpack(solventFraction, buffer, position, comm);
|
||||||
@ -5147,8 +5144,8 @@ void unpack(Well& data,
|
|||||||
unpack(*segments, buffer, position, comm);
|
unpack(*segments, buffer, position, comm);
|
||||||
}
|
}
|
||||||
data = Well(name, groupName, firstTimeStep, seqIndex, headI, headJ,
|
data = Well(name, groupName, firstTimeStep, seqIndex, headI, headJ,
|
||||||
ref_depth, phase, ordering, units, udq_undefined, status,
|
ref_depth, wtype, ordering, units, udq_undefined, status,
|
||||||
drainageRadius, allowCrossFlow, automaticShutIn, isProducer,
|
drainageRadius, allowCrossFlow, automaticShutIn,
|
||||||
guideRate, efficiencyFactor, solventFraction, prediction_mode,
|
guideRate, efficiencyFactor, solventFraction, prediction_mode,
|
||||||
econLimits, foamProperties, polymerProperties, brineProperties,
|
econLimits, foamProperties, polymerProperties, brineProperties,
|
||||||
tracerProperties, connection, production, injection, segments);
|
tracerProperties, connection, production, injection, segments);
|
||||||
|
@ -323,9 +323,9 @@ Opm::Well getFullWell()
|
|||||||
{
|
{
|
||||||
Opm::UnitSystem unitSystem;
|
Opm::UnitSystem unitSystem;
|
||||||
return Opm::Well("test1", "test2", 1, 2, 3, 4, 5.0,
|
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,
|
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},
|
Opm::Well::WellGuideRate{true, 1.0, Opm::Well::GuideRateTarget::COMB, 2.0},
|
||||||
8.0, 9.0, false,
|
8.0, 9.0, false,
|
||||||
std::make_shared<Opm::WellEconProductionLimits>(),
|
std::make_shared<Opm::WellEconProductionLimits>(),
|
||||||
@ -2300,7 +2300,7 @@ BOOST_AUTO_TEST_CASE(Fault)
|
|||||||
BOOST_AUTO_TEST_CASE(WellType)
|
BOOST_AUTO_TEST_CASE(WellType)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_MPI
|
#ifdef HAVE_MPI
|
||||||
Opm::WellType val1(true, Phase::OIL);
|
Opm::WellType val1(true, Opm::Phase::OIL);
|
||||||
auto val2 = PackUnpack(val1);
|
auto val2 = PackUnpack(val1);
|
||||||
DO_CHECKS(WellType)
|
DO_CHECKS(WellType)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user