Skip to content

Commit

Permalink
Fault Reactivation: add sea water load to initial step.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriben committed Dec 7, 2023
1 parent fd0e1af commit 0a2f2da
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "RiaBaseDefs.h"
#include "RiaEclipseUnitTools.h"
#include "RiaVersionInfo.h"
#include "RiaWellLogUnitTools.h"

#include "RifInpExportTools.h"
#include "RimFaultReactivationDataAccess.h"
Expand All @@ -46,16 +47,19 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
using PartBorderSurface = RimFaultReactivation::BorderSurface;
std::vector<std::pair<PartBorderSurface, std::string>> borders = { { PartBorderSurface::UpperSurface, "TOP" },
{ PartBorderSurface::FaultSurface, "FAULT" },
{ PartBorderSurface::LowerSurface, "BASE" } };
{ PartBorderSurface::LowerSurface, "BASE" },
{ PartBorderSurface::Seabed, "SEABED" } };

// The two parts are "mirrored", so face number 4 of the two parts should face eachother.
using FaultGridPart = RimFaultReactivation::GridPart;
std::map<std::pair<FaultGridPart, PartBorderSurface>, int> faces = { { { FaultGridPart::FW, PartBorderSurface::FaultSurface }, 4 },
{ { FaultGridPart::FW, PartBorderSurface::UpperSurface }, 4 },
{ { FaultGridPart::FW, PartBorderSurface::LowerSurface }, 4 },
{ { FaultGridPart::FW, PartBorderSurface::Seabed }, 2 },
{ { FaultGridPart::HW, PartBorderSurface::FaultSurface }, 4 },
{ { FaultGridPart::HW, PartBorderSurface::UpperSurface }, 4 },
{ { FaultGridPart::HW, PartBorderSurface::LowerSurface }, 4 } };
{ { FaultGridPart::HW, PartBorderSurface::LowerSurface }, 4 },
{ { FaultGridPart::HW, PartBorderSurface::Seabed }, 2 } };

std::map<FaultGridPart, std::string> partNames = {
{ FaultGridPart::FW, "FW" },
Expand All @@ -82,6 +86,10 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
bool useGridElasticProperties = rimModel.useGridElasticProperties();
bool useGridStress = rimModel.useGridStress();

double seaBedDepth = rimModel.seaBedDepth();
double waterDensity = rimModel.waterDensity();
double seaWaterLoad = RiaWellLogUnitTools<double>::gravityAcceleration() * seaBedDepth * waterDensity;

auto dataAccess = rimModel.dataAccess();

auto model = rimModel.model();
Expand All @@ -101,7 +109,15 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
[&]() { return printInteractions( stream, partNames, borders ); },
[&]()
{
return printSteps( stream, *model, *dataAccess, partNames, rimModel.selectedTimeSteps(), exportDirectory, useGridPorePressure, useGridTemperature );
return printSteps( stream,
*model,
*dataAccess,
partNames,
rimModel.selectedTimeSteps(),
exportDirectory,
useGridPorePressure,
useGridTemperature,
seaWaterLoad );
},
};

Expand Down Expand Up @@ -575,7 +591,8 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::printSteps( std:
const std::vector<QDateTime>& timeSteps,
const std::string& exportDirectory,
bool useGridPorePressure,
bool useGridTemperature )
bool useGridTemperature,
double seaWaterLoad )
{
// First time step has to be selected in order to export currently
if ( timeSteps.size() < 2 ) return { false, "Failed to export fault reactivation INP: needs at least two time steps." };
Expand All @@ -593,6 +610,21 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::printSteps( std:
RifInpExportTools::printHeading( stream, stepType );
RifInpExportTools::printNumbers( stream, { 1.0, 1.0, 1e-05, 1.0 } );

if ( i == 0 )
{
RifInpExportTools::printHeading( stream, "Dload" );
RifInpExportTools::printLine( stream, ",GRAV, 9.80665, 0., 0., -1." );

RifInpExportTools::printComment( stream, "SEAWATER LOAD" );

for ( auto [part, partName] : partNames )
{
RifInpExportTools::printHeading( stream, "Dsload" );
std::string seaBedName = partName + "." + "SEABED";
RifInpExportTools::printLine( stream, seaBedName + ", P, " + std::to_string( seaWaterLoad ) );
}
}

if ( useGridPorePressure )
{
RifInpExportTools::printSectionComment( stream, "BOUNDARY CONDITIONS" );
Expand Down Expand Up @@ -737,22 +769,26 @@ std::pair<bool, std::string>
RifInpExportTools::printSectionComment( stream, "INTERACTIONS" );
for ( const auto& [border, borderName] : borders )
{
RifInpExportTools::printComment( stream, "Interaction: " + borderName );

std::string interactionName = "NON-FAULT";
std::string extra;
if ( border == RimFaultReactivation::BorderSurface::FaultSurface )
if ( border != RimFaultReactivation::BorderSurface::Seabed )
{
interactionName = "FAULT";
extra = ", adjust=0.0";
}
RifInpExportTools::printComment( stream, "Interaction: " + borderName );

RifInpExportTools::printHeading( stream,
"Contact Pair, interaction=" + interactionName + ", small sliding, type=SURFACE TO SURFACE" + extra );
std::string interactionName = "NON-FAULT";
std::string extra;
if ( border == RimFaultReactivation::BorderSurface::FaultSurface )
{
interactionName = "FAULT";
extra = ", adjust=0.0";
}

RifInpExportTools::printHeading( stream,
"Contact Pair, interaction=" + interactionName + ", small sliding, type=SURFACE TO SURFACE" +
extra );

std::string part1Name = partNames.find( RimFaultReactivation::GridPart::FW )->second;
std::string part2Name = partNames.find( RimFaultReactivation::GridPart::HW )->second;
RifInpExportTools::printLine( stream, part1Name + "." + borderName + ", " + part2Name + "." + borderName );
std::string part1Name = partNames.find( RimFaultReactivation::GridPart::FW )->second;
std::string part2Name = partNames.find( RimFaultReactivation::GridPart::HW )->second;
RifInpExportTools::printLine( stream, part1Name + "." + borderName + ", " + part2Name + "." + borderName );
}
}

return { true, "" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ class RifFaultReactivationModelExporter
const std::vector<QDateTime>& timeSteps,
const std::string& exportDirectory,
bool useGridPorePressure,
bool useGridTemperature );
bool useGridTemperature,
double seaWaterLoad );

static std::pair<bool, std::string>
printInteractions( std::ostream& stream,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ RimFaultReactivationModel::RimFaultReactivationModel()
CAF_PDM_InitField( &m_useGridElasticProperties, "UseGridElasticProperties", false, "Output Grid Elastic Properties" );
CAF_PDM_InitField( &m_useGridStress, "UseGridStress", false, "Output Grid Stress" );

CAF_PDM_InitField( &m_waterDensity, "WaterDensity", 1030.0, "Water Density [kg/m3]" );

CAF_PDM_InitFieldNoDefault( &m_targets, "Targets", "Targets" );
m_targets.uiCapability()->setUiEditorTypeName( caf::PdmUiTableViewEditor::uiEditorTypeName() );
m_targets.uiCapability()->setUiTreeChildrenHidden( true );
Expand Down Expand Up @@ -464,6 +466,7 @@ void RimFaultReactivationModel::defineUiOrdering( QString uiConfigName, caf::Pdm
propertiesGrp->add( &m_useGridDensity );
propertiesGrp->add( &m_useGridElasticProperties );
propertiesGrp->add( &m_useGridStress );
propertiesGrp->add( &m_waterDensity );

auto trgGroup = uiOrdering.addNewGroup( "Debug" );
trgGroup->setCollapsedByDefault();
Expand Down Expand Up @@ -792,3 +795,19 @@ bool RimFaultReactivationModel::useGridStress() const
{
return m_useGridStress();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationModel::seaBedDepth() const
{
return m_modelMinZ;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimFaultReactivationModel::waterDensity() const
{
return m_waterDensity;
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class RimFaultReactivationModel : public RimCheckableNamedObject, public RimPoly
bool useGridElasticProperties() const;
bool useGridStress() const;

double seaBedDepth() const;
double waterDensity() const;

protected:
caf::PdmFieldHandle* userDescriptionField() override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
Expand Down Expand Up @@ -181,6 +184,8 @@ class RimFaultReactivationModel : public RimCheckableNamedObject, public RimPoly
caf::PdmField<bool> m_useGridElasticProperties;
caf::PdmField<bool> m_useGridStress;

caf::PdmField<double> m_waterDensity;

caf::PdmField<size_t> m_startCellIndex;
caf::PdmField<int> m_startCellFace;

Expand Down

0 comments on commit 0a2f2da

Please sign in to comment.