Additional refactoring for POR-Bar result handling

* Always use element-nodal for POR calculations
* Add RigFemAddressDefines
Add special handling for "POR-Bar" result, always use element_nodal

* 9362 Show unit text "sg" when normalized by hydrostatic pressure
This commit is contained in:
Magne Sjaastad
2023-08-23 13:29:54 +02:00
committed by GitHub
parent 4b12f82583
commit bb293539d5
25 changed files with 203 additions and 88 deletions

View File

@@ -26,6 +26,7 @@
#include "RicfCommandObject.h"
#include "RifOdbReader.h"
#include "RigFemAddressDefines.h"
#include "RigFemPart.h"
#include "RigFemPartCollection.h"
#include "RigFemPartGrid.h"
@@ -503,8 +504,8 @@ cvf::BoundingBox RimGeoMechCase::reservoirBoundingBox()
RigFemPart* femPart = rigCaseData->femParts()->part( p );
const RigFemPartGrid* femPartGrid = femPart->getOrCreateStructGrid();
RigFemResultAddress porBarAddr( RigFemResultPosEnum::RIG_ELEMENT_NODAL, "POR-Bar", "" );
const std::vector<float>& resultValues = rigCaseData->femPartResults()->resultValues( porBarAddr, p, 0, 0 );
const std::vector<float>& resultValues =
rigCaseData->femPartResults()->resultValues( RigFemAddressDefines::elementNodalPorBarAddress(), p, 0, 0 );
for ( int i = 0; i < femPart->elementCount(); ++i )
{

View File

@@ -23,6 +23,7 @@
#include "RiaWeightedMeanCalculator.h"
#include "RigCellGeometryTools.h"
#include "RigFemAddressDefines.h"
#include "RigFemPart.h"
#include "RigFemPartCollection.h"
#include "RigFemPartGrid.h"
@@ -173,7 +174,7 @@ cvf::ref<cvf::UByteArray> RimGeoMechContourMapProjection::getCellVisibility() co
cvf::BoundingBox RimGeoMechContourMapProjection::calculateExpandedPorBarBBox( int timeStep, int frameIndex ) const
{
RigFemResultAddress porBarAddr( RigFemResultPosEnum::RIG_ELEMENT_NODAL,
"POR-Bar",
RigFemAddressDefines::porBar(),
view()->cellResult()->resultComponentName().toStdString() );
RigGeoMechCaseData* caseData = geoMechCase()->geoMechData();
RigFemPartResultsCollection* resultCollection = caseData->femPartResults();
@@ -274,7 +275,7 @@ std::vector<bool> RimGeoMechContourMapProjection::getMapCellVisibility()
if ( m_limitToPorePressureRegions )
{
resAddr = RigFemResultAddress( RigFemResultPosEnum::RIG_ELEMENT_NODAL, "POR-Bar", "" );
resAddr = RigFemAddressDefines::elementNodalPorBarAddress();
}
std::vector<double> cellResults = generateResultsFromAddress( resAddr, mapCellVisibility, view()->currentTimeStep() );
@@ -361,14 +362,14 @@ std::vector<double> RimGeoMechContourMapProjection::generateResultsFromAddress(
if ( !resultAddress.isValid() )
{
wasInvalid = true;
resultAddress = RigFemResultAddress( RigFemResultPosEnum::RIG_ELEMENT_NODAL, "POR-Bar", "" );
resultAddress = RigFemAddressDefines::elementNodalPorBarAddress();
}
if ( resultAddress.fieldName == "PP" )
{
resultAddress.fieldName = "POR-Bar"; // More likely to be in memory than POR
resultAddress.fieldName = RigFemAddressDefines::porBar(); // More likely to be in memory than POR
}
if ( resultAddress.fieldName == "POR-Bar" )
if ( resultAddress.fieldName == RigFemAddressDefines::porBar() )
{
resultAddress.resultPosType = RIG_ELEMENT_NODAL;
}

View File

@@ -25,6 +25,7 @@
#include "RifGeoMechReaderInterface.h"
#include "RigFemAddressDefines.h"
#include "RigFemPartCollection.h"
#include "RigFemPartGrid.h"
#include "RigFemPartResultCalculatorStressAnisotropy.h"
@@ -570,7 +571,7 @@ void RimGeoMechResultDefinition::loadResult()
resultAddress().fieldName == RiaResultNames::wbsSFGResult().toStdString() )
{
RigFemResultAddress stressResAddr( RIG_ELEMENT_NODAL, std::string( "ST" ), "" );
RigFemResultAddress porBarResAddr( RIG_ELEMENT_NODAL, std::string( "POR-Bar" ), "" );
RigFemResultAddress porBarResAddr = RigFemAddressDefines::elementNodalPorBarAddress();
m_geomCase->geoMechData()->femPartResults()->assertResultsLoaded( stressResAddr );
m_geomCase->geoMechData()->femPartResults()->assertResultsLoaded( porBarResAddr );
}
@@ -598,7 +599,7 @@ RigFemResultAddress RimGeoMechResultDefinition::resultAddress() const
if ( resultPositionType() == RIG_DIFFERENTIALS )
{
RigFemResultPosEnum resultPositionType = RIG_ELEMENT_NODAL;
if ( resultFieldName().toStdString() == "POR-Bar" )
if ( resultFieldName().toStdString() == RigFemAddressDefines::porBar() )
{
resultPositionType = RIG_NODAL;
}
@@ -796,7 +797,8 @@ QString RimGeoMechResultDefinition::currentResultUnits() const
return RiaWellLogUnitTools<double>::noUnitString();
}
if ( resultFieldName() == "SE" || resultFieldName() == "ST" || resultFieldName() == "POR-Bar" || resultFieldName() == "SM" ||
if ( resultFieldName() == "SE" || resultFieldName() == "ST" ||
resultFieldName() == QString::fromStdString( RigFemAddressDefines::porBar() ) || resultFieldName() == "SM" ||
resultFieldName() == "SEM" || resultFieldName() == "Q" )
{
auto componentName = resultComponentName();
@@ -805,6 +807,11 @@ QString RimGeoMechResultDefinition::currentResultUnits() const
return "Deg";
}
if ( rigFemResultAddress.normalizeByHydrostaticPressure() )
{
return "sg";
}
return "Bar";
}
else if ( resultFieldName() == "MODULUS" )
@@ -875,7 +882,7 @@ QString RimGeoMechResultDefinition::convertToUiResultFieldName( QString resultFi
if ( resultFieldName == "E" ) newName = "NativeAbaqus Strain";
if ( resultFieldName == "S" ) newName = "NativeAbaqus Stress";
if ( resultFieldName == "NE" ) newName = "E"; // Make NE and NS appear as E and SE
if ( resultFieldName == "POR-Bar" ) newName = "POR"; // POR-Bar appear as POR
if ( resultFieldName == QString::fromStdString( RigFemAddressDefines::porBar() ) ) newName = "POR"; // POR-Bar appear as POR
if ( resultFieldName == "MODULUS" ) newName = "Young's Modulus";
if ( resultFieldName == "RATIO" ) newName = "Poisson's Ratio";
if ( resultFieldName == "UCS" ) newName = "UCS bar/ 100";

View File

@@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "RiaPreferencesGeoMech.h"
#include "RigFemAddressDefines.h"
#include "RigWellPath.h"
#include "RigWellPathGeometryTools.h"
@@ -476,7 +477,12 @@ bool RimWellIASettings::updateResInsightParameters()
}
}
double ppValue = dataAccess.interpolatedResultValue( "POR-Bar", "", RigFemResultPosEnum::RIG_NODAL, position, 0, 0 );
double ppValue = dataAccess.interpolatedResultValue( QString::fromStdString( RigFemAddressDefines::porBar() ),
"",
RigFemResultPosEnum::RIG_NODAL,
position,
0,
0 );
if ( std::isfinite( ppValue ) )
{
initialStress->addParameter( "PP", ppValue * 100000.0 );