mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
Add reference well depth adjustment to geomech case (#9547)
- Fix bug in retrieving bottom TVD value from ref well - Add result calculator for K-indices in geomech case - Improve depth adjustment algorithm
This commit is contained in:
1 parent
8c0719c75f
commit
2e5683aead
5 files changed
+228
-52
No files matched your search
@@ -102,6 +102,8 @@ add_library(
|
||||
RigFemPartResultCalculatorMudWeightWindow.cpp
|
||||
RigFemPartResultCalculatorShearSlipIndicator.h
|
||||
RigFemPartResultCalculatorShearSlipIndicator.cpp
|
||||
RigFemPartResultCalculatorKIndices.h
|
||||
RigFemPartResultCalculatorKIndices.cpp
|
||||
RimGeoMechGeometrySelectionItem.h
|
||||
RimGeoMechGeometrySelectionItem.cpp
|
||||
)
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022- Equinor 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 "RigFemPartResultCalculatorKIndices.h"
|
||||
|
||||
#include "RigFemPart.h"
|
||||
#include "RigFemPartCollection.h"
|
||||
#include "RigFemPartGrid.h"
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
#include "RigFemResultAddress.h"
|
||||
#include "RigFemScalarResultFrames.h"
|
||||
#include "RigFormationNames.h"
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPartResultCalculatorKIndices::RigFemPartResultCalculatorKIndices( RigFemPartResultsCollection& collection )
|
||||
: RigFemPartResultCalculator( collection )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemPartResultCalculatorKIndices::~RigFemPartResultCalculatorKIndices()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFemPartResultCalculatorKIndices::isMatching( const RigFemResultAddress& resVarAddr ) const
|
||||
{
|
||||
return ( resVarAddr.fieldName == "INDEX" && resVarAddr.componentName == "INDEX_K" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFemScalarResultFrames* RigFemPartResultCalculatorKIndices::calculate( int partIndex,
|
||||
const RigFemResultAddress& resVarAddr )
|
||||
{
|
||||
caf::ProgressInfo frameCountProgress( 2, "" );
|
||||
frameCountProgress.setProgressDescription(
|
||||
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
|
||||
|
||||
RigFemScalarResultFrames* resFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
|
||||
resFrames->enableAsSingleFrameResult();
|
||||
|
||||
const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex );
|
||||
std::vector<float>& dstFrameData = resFrames->frameData( 0 );
|
||||
|
||||
const size_t valCount = femPart->elementNodeResultCount();
|
||||
dstFrameData.resize( valCount, std::numeric_limits<float>::infinity() );
|
||||
|
||||
const RigFormationNames* activeFormNames = m_resultCollection->activeFormationNames();
|
||||
|
||||
frameCountProgress.incrementProgress();
|
||||
|
||||
if ( activeFormNames )
|
||||
{
|
||||
// Has to be done before the parallel loop because the first call allocates.
|
||||
const RigFemPartGrid* structGrid = femPart->getOrCreateStructGrid();
|
||||
|
||||
const int elementCount = femPart->elementCount();
|
||||
|
||||
// Using max() as std::numeric_limits<size_t>::infinity() returns 0
|
||||
constexpr size_t maxValue = std::numeric_limits<size_t>::max();
|
||||
|
||||
#pragma omp parallel for
|
||||
for ( int elmIdx = 0; elmIdx < elementCount; ++elmIdx )
|
||||
{
|
||||
RigElementType elmType = femPart->elementType( elmIdx );
|
||||
int elmNodeCount = RigFemTypes::elementNodeCount( elmType );
|
||||
|
||||
size_t i, j, k = maxValue;
|
||||
bool validIndex = structGrid->ijkFromCellIndex( elmIdx, &i, &j, &k );
|
||||
if ( validIndex )
|
||||
{
|
||||
for ( int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx )
|
||||
{
|
||||
size_t elmNodResIdx = femPart->elementNodeResultIdx( elmIdx, elmNodIdx );
|
||||
dstFrameData[elmNodResIdx] = k != maxValue ? static_cast<float>( k ) : HUGE_VALF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resFrames;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2022- Equinor 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
|
||||
|
||||
#include "RigFemPartResultCalculator.h"
|
||||
|
||||
class RigFemPartResultsCollection;
|
||||
class RigFemScalarResultFrames;
|
||||
class RigFemResultAddress;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigFemPartResultCalculatorKIndices : public RigFemPartResultCalculator
|
||||
{
|
||||
public:
|
||||
explicit RigFemPartResultCalculatorKIndices( RigFemPartResultsCollection& collection );
|
||||
~RigFemPartResultCalculatorKIndices() override;
|
||||
bool isMatching( const RigFemResultAddress& resVarAddr ) const override;
|
||||
RigFemScalarResultFrames* calculate( int partIndex, const RigFemResultAddress& resVarAddr ) override;
|
||||
};
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "RigFemPartResultCalculatorFormationIndices.h"
|
||||
#include "RigFemPartResultCalculatorGamma.h"
|
||||
#include "RigFemPartResultCalculatorInitialPorosity.h"
|
||||
#include "RigFemPartResultCalculatorKIndices.h"
|
||||
#include "RigFemPartResultCalculatorMudWeightWindow.h"
|
||||
#include "RigFemPartResultCalculatorNE.h"
|
||||
#include "RigFemPartResultCalculatorNodalGradients.h"
|
||||
@@ -199,6 +200,8 @@ RigFemPartResultsCollection::RigFemPartResultsCollection( RifGeoMechReaderInterf
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorShearSlipIndicator( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorFormationIndices( *this ) ) );
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorKIndices( *this ) ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -684,6 +687,8 @@ std::map<std::string, std::vector<std::string>>
|
||||
fieldCompNames["PE"].push_back( "PE2" );
|
||||
fieldCompNames["PE"].push_back( "PE3" );
|
||||
}
|
||||
|
||||
fieldCompNames["INDEX"].push_back( "INDEX_K" );
|
||||
}
|
||||
else if ( resPos == RIG_INTEGRATION_POINT )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user