mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6216 Fracture Model: Add curve for Initial Stress.
This commit is contained in:
parent
d2fb79b7a4
commit
db269450e9
@ -32,6 +32,7 @@ void AppEnum<RiaDefines::CurveProperty>::setUp()
|
||||
addItem( RiaDefines::CurveProperty::INITIAL_PRESSURE, "INITIAL_PRESSURE", "Initial Pressure" );
|
||||
addItem( RiaDefines::CurveProperty::PRESSURE, "PRESSURE", "Pressure" );
|
||||
addItem( RiaDefines::CurveProperty::STRESS, "STRESS", "Stress" );
|
||||
addItem( RiaDefines::CurveProperty::INITIAL_STRESS, "INITIAL_STRESS", "Initial Stress" );
|
||||
addItem( RiaDefines::CurveProperty::STRESS_GRADIENT, "STRESS_GRADIENT", "Stress Gradient" );
|
||||
addItem( RiaDefines::CurveProperty::YOUNGS_MODULUS, "YOUNGS_MODULUS", "Young's Modulus" );
|
||||
addItem( RiaDefines::CurveProperty::POISSONS_RATIO, "POISSONS_RATIO", "Poisson's Ratio" );
|
||||
|
@ -35,6 +35,7 @@ enum class CurveProperty
|
||||
INITIAL_PRESSURE,
|
||||
PRESSURE,
|
||||
STRESS,
|
||||
INITIAL_STRESS,
|
||||
STRESS_GRADIENT,
|
||||
YOUNGS_MODULUS,
|
||||
POISSONS_RATIO,
|
||||
|
@ -132,8 +132,18 @@ RimFractureModelPlot*
|
||||
|
||||
{
|
||||
auto task = progInfo.task( "Creating stress track", 2 );
|
||||
createStressTrack( plot, fractureModel, eclipseCase, timeStep, RiaDefines::CurveProperty::STRESS );
|
||||
createStressTrack( plot, fractureModel, eclipseCase, timeStep, RiaDefines::CurveProperty::STRESS_GRADIENT );
|
||||
createStressTrack( plot,
|
||||
fractureModel,
|
||||
eclipseCase,
|
||||
timeStep,
|
||||
"Stress",
|
||||
{RiaDefines::CurveProperty::STRESS, RiaDefines::CurveProperty::INITIAL_STRESS} );
|
||||
createStressTrack( plot,
|
||||
fractureModel,
|
||||
eclipseCase,
|
||||
timeStep,
|
||||
"Stress Gradient",
|
||||
{RiaDefines::CurveProperty::STRESS_GRADIENT} );
|
||||
}
|
||||
|
||||
{
|
||||
@ -160,7 +170,7 @@ RimFractureModelPlot*
|
||||
|
||||
{
|
||||
auto task = progInfo.task( "Creating temperature track", 2 );
|
||||
createStressTrack( plot, fractureModel, eclipseCase, timeStep, RiaDefines::CurveProperty::TEMPERATURE );
|
||||
createStressTrack( plot, fractureModel, eclipseCase, timeStep, "Temperature", {RiaDefines::CurveProperty::TEMPERATURE} );
|
||||
}
|
||||
|
||||
{
|
||||
@ -470,13 +480,13 @@ void RicNewFractureModelPlotFeature::createElasticPropertiesTrack( RimFractureMo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewFractureModelPlotFeature::createStressTrack( RimFractureModelPlot* plot,
|
||||
RimFractureModel* fractureModel,
|
||||
RimEclipseCase* eclipseCase,
|
||||
int timeStep,
|
||||
RiaDefines::CurveProperty propertyType )
|
||||
void RicNewFractureModelPlotFeature::createStressTrack( RimFractureModelPlot* plot,
|
||||
RimFractureModel* fractureModel,
|
||||
RimEclipseCase* eclipseCase,
|
||||
int timeStep,
|
||||
const QString& trackName,
|
||||
const std::vector<RiaDefines::CurveProperty>& propertyTypes )
|
||||
{
|
||||
QString trackName = caf::AppEnum<RiaDefines::CurveProperty>::uiText( propertyType );
|
||||
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, trackName, plot );
|
||||
plotTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR );
|
||||
plotTrack->setLogarithmicScale( false );
|
||||
@ -484,34 +494,40 @@ void RicNewFractureModelPlotFeature::createStressTrack( RimFractureModelPlot*
|
||||
plotTrack->setShowWindow( true );
|
||||
plotTrack->setColSpan( RimPlot::TWO );
|
||||
|
||||
caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors();
|
||||
caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors();
|
||||
int colorIndex = 0;
|
||||
|
||||
RimFractureModelStressCurve* curve = new RimFractureModelStressCurve;
|
||||
curve->setCurveProperty( propertyType );
|
||||
curve->setFractureModel( fractureModel );
|
||||
curve->setCase( eclipseCase );
|
||||
curve->setColor( colors.cycledColor3f( 0 ) );
|
||||
curve->setLineStyle( RiuQwtPlotCurve::STYLE_SOLID );
|
||||
curve->setLineThickness( 2 );
|
||||
curve->setUiName( trackName );
|
||||
curve->setAutoNameComponents( false, false, false, false, false );
|
||||
if ( propertyType == RiaDefines::CurveProperty::STRESS_GRADIENT )
|
||||
for ( const RiaDefines::CurveProperty& propertyType : propertyTypes )
|
||||
{
|
||||
curve->setInterpolation( RiuQwtPlotCurve::INTERPOLATION_STEP_LEFT );
|
||||
RimFractureModelStressCurve* curve = new RimFractureModelStressCurve;
|
||||
curve->setCurveProperty( propertyType );
|
||||
curve->setFractureModel( fractureModel );
|
||||
curve->setCase( eclipseCase );
|
||||
curve->setColor( colors.cycledColor3f( colorIndex ) );
|
||||
curve->setLineStyle( RiuQwtPlotCurve::STYLE_SOLID );
|
||||
curve->setLineThickness( 2 );
|
||||
curve->setUiName( trackName );
|
||||
curve->setAutoNameComponents( false, false, false, false, false );
|
||||
if ( propertyType == RiaDefines::CurveProperty::STRESS_GRADIENT )
|
||||
{
|
||||
curve->setInterpolation( RiuQwtPlotCurve::INTERPOLATION_STEP_LEFT );
|
||||
}
|
||||
|
||||
plotTrack->addCurve( curve );
|
||||
plotTrack->setAutoScaleXEnabled( true );
|
||||
curve->loadDataAndUpdate( true );
|
||||
|
||||
curve->updateConnectedEditors();
|
||||
|
||||
colorIndex++;
|
||||
}
|
||||
|
||||
plotTrack->addCurve( curve );
|
||||
plotTrack->setAutoScaleXEnabled( true );
|
||||
curve->loadDataAndUpdate( true );
|
||||
|
||||
curve->updateConnectedEditors();
|
||||
plotTrack->updateConnectedEditors();
|
||||
plot->updateConnectedEditors();
|
||||
|
||||
RiaApplication::instance()->project()->updateConnectedEditors();
|
||||
|
||||
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( curve );
|
||||
RiuPlotMainWindowTools::showPlotMainWindow();
|
||||
}
|
||||
|
||||
|
@ -72,11 +72,12 @@ private:
|
||||
int timeStep,
|
||||
RiaDefines::CurveProperty propertyType );
|
||||
|
||||
static void createStressTrack( RimFractureModelPlot* plot,
|
||||
RimFractureModel* fractureModel,
|
||||
RimEclipseCase* eclipseCase,
|
||||
int timeStep,
|
||||
RiaDefines::CurveProperty propertyType );
|
||||
static void createStressTrack( RimFractureModelPlot* plot,
|
||||
RimFractureModel* fractureModel,
|
||||
RimEclipseCase* eclipseCase,
|
||||
int timeStep,
|
||||
const QString& trackName,
|
||||
const std::vector<RiaDefines::CurveProperty>& propertyTypes );
|
||||
|
||||
static RimFractureModelPlot* createFractureModelPlot( bool showAfterCreation, const QString& plotDescription );
|
||||
|
||||
|
@ -379,10 +379,23 @@ std::vector<double> RimFractureModelPlot::calculateStress() const
|
||||
{
|
||||
std::vector<double> stress;
|
||||
std::vector<double> stressGradients;
|
||||
calculateStressWithGradients( stress, stressGradients );
|
||||
std::vector<double> initialStress;
|
||||
calculateStressWithGradients( stress, stressGradients, initialStress );
|
||||
return stress;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimFractureModelPlot::calculateInitialStress() const
|
||||
{
|
||||
std::vector<double> stress;
|
||||
std::vector<double> stressGradients;
|
||||
std::vector<double> initialStress;
|
||||
calculateStressWithGradients( stress, stressGradients, initialStress );
|
||||
return initialStress;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -402,7 +415,8 @@ std::vector<double> RimFractureModelPlot::findCurveXValuesByProperty( RiaDefines
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFractureModelPlot::calculateStressWithGradients( std::vector<double>& stress,
|
||||
std::vector<double>& stressGradients ) const
|
||||
std::vector<double>& stressGradients,
|
||||
std::vector<double>& initialStress ) const
|
||||
{
|
||||
// Reference stress
|
||||
const double verticalStressRef = m_fractureModel->verticalStress();
|
||||
@ -468,6 +482,8 @@ bool RimFractureModelPlot::calculateStressWithGradients( std::vector<double>& st
|
||||
double depletionStress = Sh_init + deltaHorizontalStress;
|
||||
stress.push_back( RiaEclipseUnitTools::barToPsi( depletionStress ) );
|
||||
|
||||
initialStress.push_back( RiaEclipseUnitTools::barToPsi( Sh_init ) );
|
||||
|
||||
// Cache some results for the gradients calculation
|
||||
stressForGradients.push_back( Sv );
|
||||
pressureForGradients.push_back( initialPressure );
|
||||
@ -493,12 +509,12 @@ bool RimFractureModelPlot::calculateStressWithGradients( std::vector<double>& st
|
||||
// Second pass to calculate the stress gradients
|
||||
for ( size_t i = 0; i < layerBoundaryDepths.size(); i++ )
|
||||
{
|
||||
double diffStress = stressForGradients[i + 1] - stressForGradients[i];
|
||||
double diffPressure = pressureForGradients[i + 1] - pressureForGradients[i];
|
||||
double diffDepth = depthForGradients[i + 1] - depthForGradients[i];
|
||||
double k0 = findValueAtTopOfLayer( k0Data, layerBoundaryIndexes, i );
|
||||
double gradient = ( diffStress * k0 + diffPressure * ( 1.0 - k0 ) ) / diffDepth;
|
||||
stressGradients.push_back( RiaEclipseUnitTools::barPerMeterToPsiPerFeet( gradient ) );
|
||||
double diffStress = stressForGradients[i + 1] - stressForGradients[i];
|
||||
double diffPressure = pressureForGradients[i + 1] - pressureForGradients[i];
|
||||
double diffDepth = depthForGradients[i + 1] - depthForGradients[i];
|
||||
double k0 = findValueAtTopOfLayer( k0Data, layerBoundaryIndexes, i );
|
||||
double stressGradient = ( diffStress * k0 + diffPressure * ( 1.0 - k0 ) ) / diffDepth;
|
||||
stressGradients.push_back( RiaEclipseUnitTools::barPerMeterToPsiPerFeet( stressGradient ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -511,7 +527,8 @@ std::vector<double> RimFractureModelPlot::calculateStressGradient() const
|
||||
{
|
||||
std::vector<double> stress;
|
||||
std::vector<double> stressGradients;
|
||||
calculateStressWithGradients( stress, stressGradients );
|
||||
std::vector<double> initialStress;
|
||||
calculateStressWithGradients( stress, stressGradients, initialStress );
|
||||
return stressGradients;
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
std::vector<double> calculateHorizontalPermeability() const;
|
||||
std::vector<double> calculateReservoirPressure() const;
|
||||
std::vector<double> calculateStress() const;
|
||||
std::vector<double> calculateInitialStress() const;
|
||||
std::vector<double> calculateStressGradient() const;
|
||||
std::vector<double> calculateYoungsModulus() const;
|
||||
std::vector<double> calculatePoissonsRatio() const;
|
||||
@ -73,7 +74,9 @@ protected:
|
||||
void calculateLayers( std::vector<std::pair<double, double>>& layerBoundaryDepths,
|
||||
std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes ) const;
|
||||
RimWellLogExtractionCurve* findCurveByProperty( RiaDefines::CurveProperty curveProperty ) const;
|
||||
bool calculateStressWithGradients( std::vector<double>& stress, std::vector<double>& stressGradients ) const;
|
||||
bool calculateStressWithGradients( std::vector<double>& stress,
|
||||
std::vector<double>& stressGradients,
|
||||
std::vector<double>& initialStress ) const;
|
||||
|
||||
static double findValueAtTopOfLayer( const std::vector<double>& values,
|
||||
const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
|
||||
|
@ -128,6 +128,12 @@ void RimFractureModelStressCurve::performDataExtraction( bool* isUsingPseudoLeng
|
||||
std::vector<double> stressGradients = fractureModelPlot->calculateStressGradient();
|
||||
addDatapointsForBottomOfLayers( tvDepthValues, values, stressGradients );
|
||||
}
|
||||
else if ( m_curveProperty() == RiaDefines::CurveProperty::INITIAL_STRESS )
|
||||
{
|
||||
values = fractureModelPlot->calculateInitialStress();
|
||||
std::vector<double> stressGradients = fractureModelPlot->calculateStressGradient();
|
||||
addDatapointsForBottomOfLayers( tvDepthValues, values, stressGradients );
|
||||
}
|
||||
else if ( m_curveProperty() == RiaDefines::CurveProperty::STRESS_GRADIENT )
|
||||
{
|
||||
values = fractureModelPlot->calculateStressGradient();
|
||||
|
Loading…
Reference in New Issue
Block a user