Set ISEG Open/Shut Flag for Valves

Missing in earlier editions of the segment output code.
This commit is contained in:
Bård Skaflestad
2023-09-29 18:10:06 +02:00
parent d3bf44ce87
commit 1d5ae49cdc
3 changed files with 24 additions and 2 deletions

View File

@@ -69,6 +69,7 @@ namespace Opm {
// Status: OPEN or SHUT
ICDStatus status() const;
int ecl_status() const;
void setConMaxCrossArea(const double area);

View File

@@ -18,9 +18,11 @@
*/
#include <opm/input/eclipse/Schedule/MSW/Valve.hpp>
#include <opm/input/eclipse/Deck/DeckRecord.hpp>
#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
#include "icd_convert.hpp"
namespace Opm {
@@ -130,6 +132,11 @@ namespace Opm {
return m_status;
}
int Valve::ecl_status() const
{
return to_int(this->status());
}
double Valve::conFlowCoefficient() const {
return m_con_flow_coeff;
}

View File

@@ -495,7 +495,6 @@ namespace {
VectorItems::ISeg::index;
const auto& sicd = segment.spiralICD();
iSeg[baseIndex + Ix::SegmentType] = segment.ecl_type_id();
iSeg[baseIndex + Ix::ICDScalingMode] = sicd.methodFlowScaling();
iSeg[baseIndex + Ix::ICDOpenShutFlag] = sicd.ecl_status();
}
@@ -509,11 +508,21 @@ namespace {
VectorItems::ISeg::index;
const auto& aicd = segment.autoICD();
iSeg[baseIndex + Ix::SegmentType] = segment.ecl_type_id();
iSeg[baseIndex + Ix::ICDScalingMode] = aicd.methodFlowScaling();
iSeg[baseIndex + Ix::ICDOpenShutFlag] = aicd.ecl_status();
}
template <class ISegArray>
void assignValveCharacteristics(const Opm::Segment& segment,
const std::size_t baseIndex,
ISegArray& iSeg)
{
using Ix = ::Opm::RestartIO::Helpers::VectorItems::ISeg::index;
const auto& valve = segment.valve();
iSeg[baseIndex + Ix::ICDOpenShutFlag] = valve.ecl_status();
}
template <class ISegArray>
void assignSegmentTypeCharacteristics(const Opm::Segment& segment,
const std::size_t baseIndex,
@@ -522,9 +531,14 @@ namespace {
if (segment.isSpiralICD()) {
assignSpiralICDCharacteristics(segment, baseIndex, iSeg);
}
if (segment.isAICD()) {
assignAICDCharacteristics(segment, baseIndex, iSeg);
}
if (segment.isValve()) {
assignValveCharacteristics(segment, baseIndex, iSeg);
}
}
template <class ISegArray>