mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5591 Avoid saw tooth shape on normalized stresses
This commit is contained in:
@@ -295,6 +295,7 @@ RimGeoMechCase::CaseOpenStatus RimGeoMechCase::openGeoMechCase( std::string* err
|
||||
fileNames.push_back( fileName.path() );
|
||||
}
|
||||
geoMechCaseData->femPartResults()->addElementPropertyFiles( fileNames );
|
||||
geoMechCaseData->femPartResults()->setCalculationParameters( m_cohesion, cvf::Math::toRadians( m_frictionAngleDeg() ) );
|
||||
|
||||
m_geoMechCaseData = geoMechCaseData;
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ RimGeoMechResultDefinition::RimGeoMechResultDefinition( void )
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitField( &m_normalizationAirGap, "NormalizationAirGap", -1.0, "Air Gap", "", "", "" );
|
||||
CAF_PDM_InitField( &m_normalizationAirGap, "NormalizationAirGap", 0.0, "Air Gap", "", "", "" );
|
||||
m_normalizationAirGap.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_compactionRefLayerUiField,
|
||||
@@ -338,33 +338,13 @@ void RimGeoMechResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
m_resultVariableUiField = "";
|
||||
}
|
||||
}
|
||||
if ( &m_normalizeByHydrostaticPressure == changedField && m_normalizationAirGap < 0.0 )
|
||||
if ( &m_normalizeByHydrostaticPressure == changedField && m_normalizationAirGap == 0.0 )
|
||||
{
|
||||
RiaMedianCalculator<double> airGapCalc;
|
||||
for ( auto wellPath : RiaApplication::instance()->project()->allWellPaths() )
|
||||
calculateNormalizationAirGapDefault();
|
||||
if ( m_normalizeByHydrostaticPressure )
|
||||
{
|
||||
if ( wellPath->wellPathGeometry() )
|
||||
{
|
||||
double airGap = wellPath->wellPathGeometry()->rkbDiff();
|
||||
if ( airGap > 0.0 )
|
||||
{
|
||||
airGapCalc.add( airGap );
|
||||
}
|
||||
}
|
||||
m_geomCase->geoMechData()->femPartResults()->setNormalizationAirGap( m_normalizationAirGap );
|
||||
}
|
||||
if ( airGapCalc.valid() )
|
||||
{
|
||||
m_normalizationAirGap = airGapCalc.median();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_normalizationAirGap = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_normalizeByHydrostaticPressure && m_normalizationAirGap >= 0.0 )
|
||||
{
|
||||
m_geomCase->geoMechData()->femPartResults()->setNormalizationAirGap( m_normalizationAirGap );
|
||||
}
|
||||
|
||||
// Get the possible property filter owner
|
||||
@@ -456,6 +436,33 @@ void RimGeoMechResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechResultDefinition::calculateNormalizationAirGapDefault()
|
||||
{
|
||||
RiaMedianCalculator<double> airGapCalc;
|
||||
for ( auto wellPath : RiaApplication::instance()->project()->allWellPaths() )
|
||||
{
|
||||
if ( wellPath->wellPathGeometry() )
|
||||
{
|
||||
double airGap = wellPath->wellPathGeometry()->rkbDiff();
|
||||
if ( airGap > 0.0 )
|
||||
{
|
||||
airGapCalc.add( airGap );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( airGapCalc.valid() )
|
||||
{
|
||||
m_normalizationAirGap = airGapCalc.median();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_normalizationAirGap = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -798,6 +805,22 @@ QString RimGeoMechResultDefinition::defaultLasUnits() const
|
||||
return units;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimGeoMechResultDefinition::normalizationAirGap() const
|
||||
{
|
||||
return m_normalizationAirGap;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechResultDefinition::setNormalizationAirGap( double airGap )
|
||||
{
|
||||
m_normalizationAirGap = airGap;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -71,6 +71,9 @@ public:
|
||||
QString currentResultUnits() const;
|
||||
QString defaultLasUnits() const;
|
||||
|
||||
double normalizationAirGap() const;
|
||||
void setNormalizationAirGap( double airGap );
|
||||
|
||||
bool hasCategoryResult() const { return m_resultPositionType() == RIG_FORMATION_NAMES; }
|
||||
|
||||
void updateLegendTextAndRanges( RimRegularLegendConfig* legendConfigToUpdate,
|
||||
@@ -89,10 +92,13 @@ private:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
||||
bool* useOptionsOnly ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void initAfterRead() override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
void calculateNormalizationAirGapDefault();
|
||||
|
||||
void initAfterRead() override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
// Metadata and option build tools
|
||||
|
||||
std::map<std::string, std::vector<std::string>> getResultMetaDataForUIFieldSetting();
|
||||
|
||||
@@ -169,6 +169,7 @@ void RimGeoMechView::onLoadDataAndUpdate()
|
||||
CVF_ASSERT( this->cellResult() != nullptr );
|
||||
if ( this->hasUserRequestedAnimation() )
|
||||
{
|
||||
m_geomechCase->geoMechData()->femPartResults()->setNormalizationAirGap( this->cellResult()->normalizationAirGap() );
|
||||
m_geomechCase->geoMechData()->femPartResults()->assertResultsLoaded( this->cellResult()->resultAddress() );
|
||||
}
|
||||
progress.incrementProgress();
|
||||
|
||||
@@ -222,6 +222,7 @@ void RimWellLogExtractionCurve::setPropertiesFromView( Rim3dView* view )
|
||||
if ( geoMechView )
|
||||
{
|
||||
m_geomResultDefinition->setResultAddress( geoMechView->cellResultResultDefinition()->resultAddress() );
|
||||
m_geomResultDefinition->setNormalizationAirGap( geoMechView->cellResultResultDefinition()->normalizationAirGap() );
|
||||
m_timeStep = geoMechView->currentTimeStep();
|
||||
}
|
||||
else if ( geomCase )
|
||||
|
||||
Reference in New Issue
Block a user