mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fault Reactivation: add sea water load to initial step.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "RiaBaseDefs.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaVersionInfo.h"
|
||||
#include "RiaWellLogUnitTools.h"
|
||||
|
||||
#include "RifInpExportTools.h"
|
||||
#include "RimFaultReactivationDataAccess.h"
|
||||
@@ -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" },
|
||||
@@ -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();
|
||||
@@ -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 );
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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." };
|
||||
@@ -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" );
|
||||
@@ -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 );
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
return { true, "" };
|
||||
|
||||
@@ -82,7 +82,8 @@ private:
|
||||
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,
|
||||
|
||||
@@ -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 );
|
||||
@@ -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();
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -128,6 +128,9 @@ public:
|
||||
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;
|
||||
@@ -181,6 +184,8 @@ private:
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user