Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ApplicationLibCode/Application/Tools/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RiaQDateTimeTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.h
${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileTools.h
${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.h
Expand Down Expand Up @@ -77,7 +76,6 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RiaQDateTimeTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaWellNameComparer.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaStdStringTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaInterpolationTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaSimWellBranchTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaProjectFileTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,11 @@ void RicExportFractureCompletionsImpl::calculateFractureToWellTransmissibilities
wellPathPoints = computeWellPointsInFracturePlane( fracture, wellPathGeometry );
}

RigWellPathStimplanIntersector wellFractureIntersector( wellPathPoints, fracture );
RigWellPathStimplanIntersector wellFractureIntersector( wellPathPoints,
fracture->transformMatrix(),
fracture->wellRadius(),
fracture->perforationLength(),
fracture->fractureGrid() );
const std::map<size_t, RigWellPathStimplanIntersector::WellCellIntersection>& fractureWellCells =
wellFractureIntersector.intersections();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include "RigVirtualPerforationTransmissibilities.h"
#include "Well/RigEclipseWellLogExtractor.h"
#include "Well/RigMswCenterLineCalculator.h"
#include "Well/RigSimulationWellCenterLineCalculator.h"
#include "Well/RigWellLogExtractor.h"
#include "Well/RigWellPath.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ WellFractureIntersectionData RimMeshFractureTemplate::wellFractureIntersectionDa

std::vector<cvf::Vec3d> wellPathPoints =
rimWellPath->wellPathGeometry()->wellPathPointsIncludingInterpolatedIntersectionPoint( fractureInstance->fractureMD() );
RigWellPathStimplanIntersector intersector( wellPathPoints, fractureInstance );
RigWellPathStimplanIntersector intersector( wellPathPoints,
fractureInstance->transformMatrix(),
fractureInstance->wellRadius(),
fractureInstance->perforationLength(),
fractureInstance->fractureGrid() );
for ( const auto& v : intersector.intersections() )
{
size_t fractureGlobalCellIndex = v.first;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include "RimFaultReactivationDataAccessorStressEclipse.h"

#include "RiaEclipseUnitTools.h"
#include "RiaInterpolationTools.h"
#include "RiaLogging.h"
#include "RiaWellLogUnitTools.h"
#include "RigInterpolationTools.h"

#include "RigCaseCellResultsData.h"
#include "RigEclipseResultAddress.h"
Expand Down Expand Up @@ -157,7 +157,7 @@ double RimFaultReactivationDataAccessorStressEclipse::extractStressValue( Stress
// Interpolate value from the two closest points.
std::vector<double> xs = { intersections[bottomIdx].z(), intersections[topIdx].z() };
std::vector<double> ys = { stressValues[bottomIdx], stressValues[topIdx] };
return RiaEclipseUnitTools::pascalToBar( RiaInterpolationTools::linear( xs, ys, position.z() ) );
return RiaEclipseUnitTools::pascalToBar( RigInterpolationTools::linear( xs, ys, position.z() ) );
}
}
else if ( position.z() <= intersections.back().z() )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include "RimFaultReactivationDataAccessorWellLogExtraction.h"

#include "RiaEclipseUnitTools.h"
#include "RiaInterpolationTools.h"
#include "RiaLogging.h"
#include "RigInterpolationTools.h"

#include "RigFaultReactivationModel.h"
#include "RigFemAddressDefines.h"
Expand Down Expand Up @@ -124,10 +124,10 @@ std::pair<double, cvf::Vec3d>
// Interpolate value from the two closest points.
std::vector<double> xs = { intersections[bottomIdx].z(), intersections[topIdx].z() };
std::vector<double> ys = { values[bottomIdx], values[topIdx] };
double porBar = RiaInterpolationTools::linear( xs, ys, position.z() );
double porBar = RigInterpolationTools::linear( xs, ys, position.z() );

// Interpolate position from depth
double fraction = RiaInterpolationTools::linear( xs, { 0.0, 1.0 }, position.z() );
double fraction = RigInterpolationTools::linear( xs, { 0.0, 1.0 }, position.z() );
cvf::Vec3d extractionPosition = lerp( intersections[bottomIdx], intersections[topIdx], fraction );
return { porBar, extractionPosition };
}
Expand Down Expand Up @@ -233,7 +233,7 @@ void RimFaultReactivationDataAccessorWellLogExtraction::fillInMissingValuesWithG

// Interpolate the missing values (should only be intra-reservoir by now)
std::vector<double> intersectionsZ = extractDepthValues( intersections );
RiaInterpolationTools::interpolateMissingValues( intersectionsZ, values );
RigInterpolationTools::interpolateMissingValues( intersectionsZ, values );
}

//--------------------------------------------------------------------------------------------------
Expand All @@ -256,7 +256,7 @@ void RimFaultReactivationDataAccessorWellLogExtraction::fillInMissingValuesWithT

// Interpolate the missing values (should only be intra-reservoir by now)
std::vector<double> intersectionsZ = extractDepthValues( intersections );
RiaInterpolationTools::interpolateMissingValues( intersectionsZ, values );
RigInterpolationTools::interpolateMissingValues( intersectionsZ, values );
}

//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,15 @@

#pragma once

namespace RimFaultReactivation
{

enum class GridPart
{
FW, // footwall
HW // hanging wall
};

enum class BorderSurface
{
UpperSurface,
FaultSurface,
LowerSurface,
Seabed
};
#include "RigFaultReactivationEnums.h"

enum class Boundary
namespace RimFaultReactivation
{
FarSide,
Bottom,
Fault,
Reservoir
};

enum class ElementSets
{
OverBurden,
UnderBurden,
Reservoir,
IntraReservoir,
FaultZone
};
using GridPart = RigFaultReactivation::GridPart;
using BorderSurface = RigFaultReactivation::BorderSurface;
using Boundary = RigFaultReactivation::Boundary;
using ElementSets = RigFaultReactivation::ElementSets;

enum class StressSource
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,12 @@ void RimFaultReactivationModel::updateVisualization()
m_2Dmodel->setPartColors( m_modelPart1Color, m_modelPart2Color );
m_2Dmodel->setGenerator( generator );
m_2Dmodel->updateGeometry( m_startCellIndex, (cvf::StructGridInterface::FaceType)m_startCellFace() );
m_2Dmodel->postProcessElementSets( eclipseCase() );
auto eCase = eclipseCase();
if ( eCase && eCase->eclipseCaseData() )
{
auto cellInfo = eCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
m_2Dmodel->postProcessElementSets( eCase->mainGrid(), cellInfo );
}

view->scheduleCreateDisplayModelAndRedraw();
}
Expand Down
43 changes: 39 additions & 4 deletions ApplicationLibCode/ProjectDataModel/RimSimWellInView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "Rim2dIntersectionView.h"
#include "RimCellFilterCollection.h"
#include "RimEclipseCase.h"
#include "RimEclipseResultCase.h"
#include "RimEclipseView.h"
#include "RimExtrudedCurveIntersection.h"
#include "RimIntersectionCollection.h"
Expand Down Expand Up @@ -184,10 +185,34 @@ std::vector<SimulationWellCellBranch> RimSimWellInView::wellBranchesForVisualiza

if ( simWellData && simWellData->isMultiSegmentWell() )
{
return RigMswCenterLineCalculator::calculateMswWellPipeGeometry( this );
auto eclipseView = firstAncestorOrThisOfTypeAsserted<RimEclipseView>();
if ( eclipseView->eclipseCase() && eclipseView->eclipseCase()->eclipseCaseData() )
{
auto eclipseCaseData = eclipseView->eclipseCase()->eclipseCaseData();
int timeStepIndex = eclipseView->currentTimeStep();

int shortBranchMergeThreshold = 4;
if ( auto eclipseResultCase = dynamic_cast<RimEclipseResultCase*>( eclipseView->eclipseCase() ) )
{
shortBranchMergeThreshold = eclipseResultCase->mswMergeThreshold();
}

return RigMswCenterLineCalculator::calculateMswWellPipeGeometry( eclipseCaseData, simWellData, timeStepIndex, shortBranchMergeThreshold );
}

return {};
}

return RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline( this );
auto eclipseView = firstAncestorOrThisOfTypeAsserted<RimEclipseView>();
if ( eclipseView->eclipseCase() && eclipseView->eclipseCase()->eclipseCaseData() )
{
return RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline( eclipseView->eclipseCase()->eclipseCaseData(),
simWellData,
eclipseView->wellCollection()->isAutoDetectingBranches(),
isUsingCellCenterForPipe() );
}

return {};
}

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -780,8 +805,18 @@ void RimSimWellInView::scaleDisk( double minValue, double maxValue )
//--------------------------------------------------------------------------------------------------
cvf::BoundingBox RimSimWellInView::boundingBoxInDomainCoords() const
{
auto noConst = const_cast<RimSimWellInView*>( this );
auto simWellBranches = RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline( noConst );
const RigSimWellData* simWellData = this->simWellData();
auto eclipseView = firstAncestorOrThisOfTypeAsserted<RimEclipseView>();

std::vector<SimulationWellCellBranch> simWellBranches;
if ( simWellData && eclipseView->eclipseCase() && eclipseView->eclipseCase()->eclipseCaseData() )
{
simWellBranches =
RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline( eclipseView->eclipseCase()->eclipseCaseData(),
simWellData,
eclipseView->wellCollection()->isAutoDetectingBranches(),
isUsingCellCenterForPipe() );
}

cvf::BoundingBox bb;
for ( const auto& [coords, wellCells] : simWellBranches )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
#include "RimStimPlanModelCurve.h"

#include "RiaApplication.h"
#include "RiaInterpolationTools.h"
#include "RiaLogging.h"
#include "RiaPreferences.h"
#include "RiaStimPlanModelDefines.h"
#include "RigInterpolationTools.h"

#include "RigEclipseCaseData.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#include "RimStimPlanModelElasticPropertyCalculator.h"

#include "RiaDefines.h"
#include "RiaInterpolationTools.h"
#include "RiaLogging.h"
#include "RiaResultNames.h"
#include "RiaStimPlanModelDefines.h"
#include "RigInterpolationTools.h"

#include "RigEclipseCaseData.h"
#include "RigEclipseResultAddress.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

#include "RiaDefines.h"
#include "RiaEclipseUnitTools.h"
#include "RiaInterpolationTools.h"
#include "RiaLogging.h"
#include "RiaStimPlanModelDefines.h"
#include "RigInterpolationTools.h"

#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"
Expand Down Expand Up @@ -211,7 +211,7 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C
}

// Fill in regions where it was not possible top interpolate with equilibration regions.
if ( hasMissingValues( values ) ) RiaInterpolationTools::interpolateMissingValues( measuredDepthValues, values );
if ( hasMissingValues( values ) ) RigInterpolationTools::interpolateMissingValues( measuredDepthValues, values );
}
}
else if ( curveProperty == RiaDefines::CurveProperty::PRESSURE_GRADIENT )
Expand Down Expand Up @@ -293,7 +293,7 @@ std::tuple<std::vector<double>, std::vector<double>, std::vector<double>>
// Interpolate a value for the given md
std::vector<double> xs = { sourceMds[startIndex], md, sourceMds[endIndex] };
std::vector<double> ys = { prevValue, std::numeric_limits<double>::infinity(), sourceValues[endIndex] };
RiaInterpolationTools::interpolateMissingValues( xs, ys );
RigInterpolationTools::interpolateMissingValues( xs, ys );
value = ys[1];
}

Expand Down Expand Up @@ -380,7 +380,7 @@ bool RimStimPlanModelPressureCalculator::extractPressureDataFromTable( RiaDefine

if ( needsExtrapolation )
{
RiaInterpolationTools::interpolateMissingValues( tvDepthValues, values );
RigInterpolationTools::interpolateMissingValues( tvDepthValues, values );
}

// Interpolate MDs from the tvd data from the table and well path geometry
Expand Down Expand Up @@ -585,7 +585,7 @@ double RimStimPlanModelPressureCalculator::interpolatePressure( const DepthValue
// Interpolate a value for the given tvd
std::vector<double> xs = { startDepth, depth, endDepth };
std::vector<double> ys = { startValue, std::numeric_limits<double>::infinity(), endValue };
RiaInterpolationTools::interpolateMissingValues( xs, ys );
RigInterpolationTools::interpolateMissingValues( xs, ys );
double value = ys[1];

RiaLogging::info( QString( "Interpolating initial pressure from %1 depth/value pairs (EQLNUM: %2, TVD: %3)."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

#include "RiaDefines.h"
#include "RiaEclipseUnitTools.h"
#include "RiaInterpolationTools.h"
#include "RiaLogging.h"
#include "RiaStimPlanModelDefines.h"
#include "RigInterpolationTools.h"

#include "RigEclipseCaseData.h"
#include "Well/RigEclipseWellLogExtractor.h"
Expand Down Expand Up @@ -134,7 +134,7 @@ bool RimStimPlanModelStressCalculator::calculate( RiaDefines::CurveProperty curv
measuredDepthValues.clear();
for ( double tvd : tvDepthValues )
{
double md = RiaInterpolationTools::linear( tvdValuesOfWellPath, mdValuesOfWellPath, tvd );
double md = RigInterpolationTools::linear( tvdValuesOfWellPath, mdValuesOfWellPath, tvd );
measuredDepthValues.push_back( md );
}
CVF_ASSERT( measuredDepthValues.size() == tvDepthValues.size() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#include "RimStimPlanModelWellLogCalculator.h"

#include "RiaDefines.h"
#include "RiaInterpolationTools.h"
#include "RiaLogging.h"
#include "RiaStimPlanModelDefines.h"
#include "RigInterpolationTools.h"

#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"
Expand Down Expand Up @@ -141,7 +141,7 @@ bool RimStimPlanModelWellLogCalculator::calculate( RiaDefines::CurveProperty cur
}
else if ( strategy == RimStimPlanModel::MissingValueStrategy::LINEAR_INTERPOLATION )
{
RiaInterpolationTools::interpolateMissingValues( measuredDepthValues, values );
RigInterpolationTools::interpolateMissingValues( measuredDepthValues, values );
}
else if ( strategy == RimStimPlanModel::MissingValueStrategy::OTHER_CURVE_PROPERTY )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

#include "RiaApplication.h"
#include "RiaDefines.h"
#include "RiaInterpolationTools.h"
#include "RiaLogging.h"
#include "RigInterpolationTools.h"

#include "RimEnsembleWellLogCurveSet.h"
#include "RimWellLogTrack.h"
Expand Down
2 changes: 2 additions & 0 deletions ApplicationLibCode/ReservoirDataModel/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RigElasticProperties.h
${CMAKE_CURRENT_LIST_DIR}/RigEnsembleFractureStatisticsCalculator.h
${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.h
${CMAKE_CURRENT_LIST_DIR}/RigInterpolationTools.h
${CMAKE_CURRENT_LIST_DIR}/RigEquil.h
${CMAKE_CURRENT_LIST_DIR}/RigFault.h
${CMAKE_CURRENT_LIST_DIR}/RigFaultReactivationModel.h
Expand Down Expand Up @@ -123,6 +124,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RigElasticProperties.cpp
${CMAKE_CURRENT_LIST_DIR}/RigEnsembleFractureStatisticsCalculator.cpp
${CMAKE_CURRENT_LIST_DIR}/RigEnsembleParameter.cpp
${CMAKE_CURRENT_LIST_DIR}/RigInterpolationTools.cpp
${CMAKE_CURRENT_LIST_DIR}/RigEquil.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFault.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFaultReactivationModel.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ void RigTransmissibilityCondenser::calculateCondensedTransmissibilities()
}

#include "RigFractureCell.h"
#include "RigFractureGrid.h"
#include "RigMainGrid.h"
#include "RimStimPlanFractureTemplate.h"

void printCellAddress( std::stringstream& str,
const RigMainGrid* mainGrid,
Expand Down
Loading
Loading