mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2544 Well CF Visualization: Use coordinate on well path as center
This commit is contained in:
parent
2bf0773815
commit
0aba950c12
@ -22,6 +22,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.h
|
${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare.h
|
${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTestRunner.h
|
${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTestRunner.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RiaExtractionTools.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
@ -47,6 +48,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaStringEncodingTools.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiaTextStringTools.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiaTextFileCompare.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTestRunner.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiaRegressionTestRunner.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RiaExtractionTools.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
81
ApplicationCode/Application/Tools/RiaExtractionTools.cpp
Normal file
81
ApplicationCode/Application/Tools/RiaExtractionTools.cpp
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018 Statoil ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RiaExtractionTools.h"
|
||||||
|
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include "RigWellPath.h"
|
||||||
|
#include "RimEclipseCase.h"
|
||||||
|
#include "RimMainPlotCollection.h"
|
||||||
|
#include "RimProject.h"
|
||||||
|
#include "RimWellLogPlotCollection.h"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RigEclipseWellLogExtractor* RiaExtractionTools::wellLogExtractorEclipseCase(RimWellPath* wellPath, RimEclipseCase* eclipseCase)
|
||||||
|
{
|
||||||
|
auto wlPlotCollection = wellLogPlotCollection();
|
||||||
|
if (!wlPlotCollection) return nullptr;
|
||||||
|
|
||||||
|
return wlPlotCollection->findOrCreateExtractor(wellPath, eclipseCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RigGeoMechWellLogExtractor* RiaExtractionTools::wellLogExtractorGeoMechCase(RimWellPath* wellPath, RimGeoMechCase* geomCase)
|
||||||
|
{
|
||||||
|
auto wlPlotCollection = wellLogPlotCollection();
|
||||||
|
if (!wlPlotCollection) return nullptr;
|
||||||
|
|
||||||
|
return wlPlotCollection->findOrCreateExtractor(wellPath, geomCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RigEclipseWellLogExtractor* RiaExtractionTools::findOrCreateSimWellExtractor(const QString& simWellName,
|
||||||
|
const QString& caseUserDescription,
|
||||||
|
const RigWellPath* wellPathGeom,
|
||||||
|
const RimEclipseCase* eclipseCase)
|
||||||
|
{
|
||||||
|
auto wlPlotCollection = wellLogPlotCollection();
|
||||||
|
if (!wlPlotCollection) return nullptr;
|
||||||
|
|
||||||
|
return wlPlotCollection->findOrCreateSimWellExtractor(
|
||||||
|
simWellName, caseUserDescription, wellPathGeom, eclipseCase->eclipseCaseData());
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimWellLogPlotCollection* RiaExtractionTools::wellLogPlotCollection()
|
||||||
|
{
|
||||||
|
auto proj = RiaApplication::instance()->project();
|
||||||
|
if (!proj) return nullptr;
|
||||||
|
|
||||||
|
auto plotCollection = proj->mainPlotCollection();
|
||||||
|
if (!plotCollection) return nullptr;
|
||||||
|
|
||||||
|
auto wellLogPlotCollection = plotCollection->wellLogPlotCollection();
|
||||||
|
return wellLogPlotCollection;
|
||||||
|
}
|
48
ApplicationCode/Application/Tools/RiaExtractionTools.h
Normal file
48
ApplicationCode/Application/Tools/RiaExtractionTools.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018 Statoil ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
class RigEclipseWellLogExtractor;
|
||||||
|
class RigGeoMechWellLogExtractor;
|
||||||
|
class RimEclipseCase;
|
||||||
|
class RimGeoMechCase;
|
||||||
|
class RimWellLogPlotCollection;
|
||||||
|
class RimWellPath;
|
||||||
|
class RigWellPath;
|
||||||
|
|
||||||
|
class QString;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
//
|
||||||
|
//==================================================================================================
|
||||||
|
namespace RiaExtractionTools
|
||||||
|
{
|
||||||
|
RigEclipseWellLogExtractor* wellLogExtractorEclipseCase(RimWellPath* wellPath, RimEclipseCase* eclipseCase);
|
||||||
|
RigGeoMechWellLogExtractor* wellLogExtractorGeoMechCase(RimWellPath* wellPath, RimGeoMechCase* geomCase);
|
||||||
|
|
||||||
|
/*
|
||||||
|
RigEclipseWellLogExtractor* findOrCreateSimWellExtractor(const QString& simWellName,
|
||||||
|
const QString& caseUserDescription,
|
||||||
|
const RigWellPath* wellPathGeom,
|
||||||
|
const RimEclipseCase* eclipseCase);
|
||||||
|
*/
|
||||||
|
|
||||||
|
RimWellLogPlotCollection* wellLogPlotCollection();
|
||||||
|
|
||||||
|
}; // namespace RiaExtractionTools
|
@ -20,8 +20,10 @@
|
|||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include "RigEclipseWellLogExtractor.h"
|
||||||
#include "RigMainGrid.h"
|
#include "RigMainGrid.h"
|
||||||
#include "RigVirtualPerforationTransmissibilities.h"
|
#include "RigVirtualPerforationTransmissibilities.h"
|
||||||
|
#include "RigWellPath.h"
|
||||||
|
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
@ -32,6 +34,8 @@
|
|||||||
|
|
||||||
#include "RiuViewer.h"
|
#include "RiuViewer.h"
|
||||||
|
|
||||||
|
#include "RiaExtractionTools.h"
|
||||||
|
#include "RigWellLogExtractor.h"
|
||||||
#include "cafDisplayCoordTransform.h"
|
#include "cafDisplayCoordTransform.h"
|
||||||
#include "cafEffectGenerator.h"
|
#include "cafEffectGenerator.h"
|
||||||
#include "cafPdmFieldCvfColor.h"
|
#include "cafPdmFieldCvfColor.h"
|
||||||
@ -80,17 +84,43 @@ void RivVirtualConnFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBa
|
|||||||
|
|
||||||
auto conn = trans->multipleCompletionsPerEclipseCell(m_rimWell, frameIndex);
|
auto conn = trans->multipleCompletionsPerEclipseCell(m_rimWell, frameIndex);
|
||||||
|
|
||||||
std::vector<std::pair<cvf::Vec3f, double>> centerColorPairs;
|
std::vector<WellPathCellIntersectionInfo> wellPathCellIntersections;
|
||||||
|
{
|
||||||
|
RigEclipseWellLogExtractor* extractor = RiaExtractionTools::wellLogExtractorEclipseCase(m_rimWell, eclipseCase);
|
||||||
|
if (extractor)
|
||||||
|
{
|
||||||
|
wellPathCellIntersections = extractor->cellIntersectionInfosAlongWellPath();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::pair<cvf::Vec3f, double>> centerColorPairs;
|
||||||
for (const auto& cell : conn)
|
for (const auto& cell : conn)
|
||||||
{
|
{
|
||||||
size_t gridIndex = cell.first.globalCellIndex();
|
size_t gridIndex = cell.first.globalCellIndex();
|
||||||
|
|
||||||
const RigCell& rigCell = mainGrid->cell(gridIndex);
|
const RigCell& rigCell = mainGrid->cell(gridIndex);
|
||||||
cvf::Vec3d center = rigCell.center();
|
|
||||||
cvf::Vec3d displayCoord = coordTransform->transformToDisplayCoord(center);
|
|
||||||
|
|
||||||
cvf::Color3f color = cvf::Color3f::BLUE;
|
cvf::Vec3d locationInDomainCoord = rigCell.center();
|
||||||
|
|
||||||
|
if (!wellPathCellIntersections.empty())
|
||||||
|
{
|
||||||
|
for (const auto& intersectionInfo : wellPathCellIntersections)
|
||||||
|
{
|
||||||
|
if (intersectionInfo.globCellIndex == cell.first.globalCellIndex())
|
||||||
|
{
|
||||||
|
double startMD = intersectionInfo.startMD;
|
||||||
|
double endMD = intersectionInfo.endMD;
|
||||||
|
|
||||||
|
double middleMD = (startMD + endMD) / 2.0;
|
||||||
|
|
||||||
|
locationInDomainCoord = m_rimWell->wellPathGeometry()->interpolatedPointAlongWellPath(middleMD);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cvf::Vec3d displayCoord = coordTransform->transformToDisplayCoord(locationInDomainCoord);
|
||||||
|
|
||||||
double transmissibility = HUGE_VAL;
|
double transmissibility = HUGE_VAL;
|
||||||
if (!cell.second.empty())
|
if (!cell.second.empty())
|
||||||
|
Loading…
Reference in New Issue
Block a user