mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-09 15:43:07 -06:00
#3534 Completion Export : Guard for missing width values
This commit is contained in:
parent
5cddab62ac
commit
59f0112f2e
@ -174,21 +174,27 @@ double RigEclipseToStimPlanCalculator::areaWeightedWidth() const
|
||||
auto stimPlanFractureTemplate = dynamic_cast<const RimStimPlanFractureTemplate*>(m_fracture->fractureTemplate());
|
||||
if (stimPlanFractureTemplate)
|
||||
{
|
||||
RiaWeightedMeanCalculator<double> calc;
|
||||
|
||||
auto widthValues = stimPlanFractureTemplate->widthResultValues();
|
||||
|
||||
for (const auto& singleCellCalc : m_singleFractureCellCalculators)
|
||||
if (!widthValues.empty())
|
||||
{
|
||||
double cellArea = singleCellCalc.second.areaOpenForFlow();
|
||||
RiaWeightedMeanCalculator<double> calc;
|
||||
|
||||
size_t globalStimPlanCellIndex = singleCellCalc.first;
|
||||
double widthValue = widthValues[globalStimPlanCellIndex];
|
||||
for (const auto& singleCellCalc : m_singleFractureCellCalculators)
|
||||
{
|
||||
double cellArea = singleCellCalc.second.areaOpenForFlow();
|
||||
|
||||
calc.addValueAndWeight(widthValue, cellArea);
|
||||
size_t globalStimPlanCellIndex = singleCellCalc.first;
|
||||
double widthValue = widthValues[globalStimPlanCellIndex];
|
||||
|
||||
calc.addValueAndWeight(widthValue, cellArea);
|
||||
}
|
||||
|
||||
width = calc.weightedMean();
|
||||
}
|
||||
else
|
||||
{
|
||||
width = stimPlanFractureTemplate->computeFractureWidth(m_fracture);
|
||||
}
|
||||
|
||||
width = calc.weightedMean();
|
||||
}
|
||||
|
||||
return width;
|
||||
|
Loading…
Reference in New Issue
Block a user