Skip to content

Commit

Permalink
Well Target Candidates: compute probability, and simplify vector names.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriben committed Dec 19, 2024
1 parent caf796c commit be98a28
Showing 1 changed file with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ RimRegularGridCase* RigWellTargetCandidatesGenerator::generateEnsembleCandidates
targetCase->setCellCount( resultGridCellCount );
targetCase->createModel( "" );

std::vector<int> occupancy;
std::vector<int> occurrence;

std::map<QString, std::vector<std::vector<double>>> resultNamesAndSamples;
resultNamesAndSamples["TOTAL_PORV_SOIL"] = {};
Expand All @@ -771,10 +771,23 @@ RimRegularGridCase* RigWellTargetCandidatesGenerator::generateEnsembleCandidates
{
auto task = progInfo.task( "Accumulating results.", 1 );

accumulateResultsForSingleCase( *eclipseCase, *targetCase, resultNamesAndSamples, occupancy );
accumulateResultsForSingleCase( *eclipseCase, *targetCase, resultNamesAndSamples, occurrence );
}

createResultVector( *targetCase, "OCCUPANCY", occupancy );
auto createFractionVector = []( const std::vector<int>& occurrence, int maxOccurrence ) -> std::vector<double>
{
std::vector<double> fractions( occurrence.size() );
std::transform( occurrence.begin(),
occurrence.end(),
fractions.begin(),
[maxOccurrence]( int value ) { return static_cast<double>( value ) / maxOccurrence; } );

return fractions;
};

createResultVector( *targetCase, "OCCURRENCE", occurrence );
std::vector<double> probability = createFractionVector( occurrence, static_cast<int>( ensemble.cases().size() ) );
createResultVector( *targetCase, "PROBABILITY", probability );

for ( auto [resultName, vec] : resultNamesAndSamples )
{
Expand Down Expand Up @@ -830,12 +843,12 @@ void RigWellTargetCandidatesGenerator::computeStatisticsAndCreateVectors( RimEcl
if ( RiaStatisticsTools::isValidNumber( maxValue ) && maxValue > -std::numeric_limits<double>::max() ) maxResults[i] = maxValue;
}

createResultVector( targetCase, "ENSEMBLE_" + resultName + "_P10", p10Results );
createResultVector( targetCase, "ENSEMBLE_" + resultName + "_P50", p50Results );
createResultVector( targetCase, "ENSEMBLE_" + resultName + "_P90", p90Results );
createResultVector( targetCase, "ENSEMBLE_" + resultName + "_MEAN", meanResults );
createResultVector( targetCase, "ENSEMBLE_" + resultName + "_MIN", minResults );
createResultVector( targetCase, "ENSEMBLE_" + resultName + "_MAX", maxResults );
createResultVector( targetCase, resultName + "_P10", p10Results );
createResultVector( targetCase, resultName + "_P50", p50Results );
createResultVector( targetCase, resultName + "_P90", p90Results );
createResultVector( targetCase, resultName + "_MEAN", meanResults );
createResultVector( targetCase, resultName + "_MIN", minResults );
createResultVector( targetCase, resultName + "_MAX", maxResults );
}

//--------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit be98a28

Please sign in to comment.