#3884 Implemented Valve Templates for MSW parameters

This commit is contained in:
Gaute Lindkvist
2018-12-13 19:49:37 +01:00
parent c575e1d29e
commit 3adb1cc4bd
39 changed files with 1117 additions and 157 deletions

View File

@@ -69,7 +69,7 @@ void RicMswICDAccumulator::applyToSuperValve(std::shared_ptr<RicMswValve> valve)
///
//--------------------------------------------------------------------------------------------------
RicMswAICDAccumulator::RicMswAICDAccumulator(RiaEclipseUnitTools::UnitSystem unitSystem)
: RicMswValveAccumulator(unitSystem), m_valid(false), m_deviceOpen(false)
: RicMswValveAccumulator(unitSystem), m_valid(false), m_deviceOpen(false), m_accumulatedLength(0.0)
{
}
@@ -86,26 +86,28 @@ bool RicMswAICDAccumulator::accumulateValveParameters(const RimWellPathValve* we
{
m_valid = true;
m_deviceOpen = m_deviceOpen || params->isOpen();
std::array<double, AICD_NUM_PARAMS> values = params->doubleValues();
for (size_t i = 0; i < (size_t)AICD_NUM_PARAMS; ++i)
if (params->isOpen())
{
if (RiaStatisticsTools::isValidNumber(values[i]))
std::array<double, AICD_NUM_PARAMS> values = params->doubleValues();
for (size_t i = 0; i < (size_t)AICD_NUM_PARAMS; ++i)
{
m_meanCalculators[i].addValueAndWeight(values[i], contributionFraction);
if (RiaStatisticsTools::isValidNumber(values[i]))
{
m_meanCalculators[i].addValueAndWeight(values[i], contributionFraction);
}
}
std::pair<double, double> valveSegment = wellPathValve->valveSegments()[subValve];
double valveSegmentLength = std::fabs(valveSegment.second - valveSegment.first);
const RimPerforationInterval* perfInterval = nullptr;
wellPathValve->firstAncestorOrThisOfTypeAsserted(perfInterval);
double perfIntervalLength = std::fabs(perfInterval->endMD() - perfInterval->startMD());
double lengthFraction = 1.0;
if (perfIntervalLength > 1.0e-8)
{
lengthFraction = valveSegmentLength / perfIntervalLength;
}
m_accumulatedLength += lengthFraction * contributionFraction;
}
std::pair<double, double> valveSegment = wellPathValve->valveSegments()[subValve];
double valveSegmentLength = std::fabs(valveSegment.second - valveSegment.first);
const RimPerforationInterval* perfInterval = nullptr;
wellPathValve->firstAncestorOrThisOfTypeAsserted(perfInterval);
double perfIntervalLength = std::fabs(perfInterval->endMD() - perfInterval->startMD());
double lengthFraction = 1.0;
if (perfIntervalLength > 1.0e-8)
{
lengthFraction = valveSegmentLength / perfIntervalLength;
}
m_lengthCalculator.addValueAndWeight(lengthFraction, contributionFraction);
}
return true;
}
@@ -136,10 +138,8 @@ void RicMswAICDAccumulator::applyToSuperValve(std::shared_ptr<RicMswValve> valve
}
aicd->setIsValid(m_valid);
aicd->setIsOpen(m_deviceOpen);
if (m_lengthCalculator.validAggregatedWeight())
{
aicd->setLength(m_lengthCalculator.weightedMean());
}
aicd->setLength(m_accumulatedLength);
aicd->values() = values;
}
}