diff --git a/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.cpp b/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.cpp index cad6277ca8..c9d7113380 100644 --- a/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.cpp +++ b/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.cpp @@ -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 RifFaultReactivationModelExporter::exportToStream( using PartBorderSurface = RimFaultReactivation::BorderSurface; std::vector> 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, 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 partNames = { { FaultGridPart::FW, "FW" }, @@ -82,6 +86,10 @@ std::pair RifFaultReactivationModelExporter::exportToStream( bool useGridElasticProperties = rimModel.useGridElasticProperties(); bool useGridStress = rimModel.useGridStress(); + double seaBedDepth = rimModel.seaBedDepth(); + double waterDensity = rimModel.waterDensity(); + double seaWaterLoad = RiaWellLogUnitTools::gravityAcceleration() * seaBedDepth * waterDensity; + auto dataAccess = rimModel.dataAccess(); auto model = rimModel.model(); @@ -101,7 +109,15 @@ std::pair 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 RifFaultReactivationModelExporter::printSteps( std: const std::vector& 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 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 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, "" }; diff --git a/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.h b/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.h index 9197d96396..14dffd1e79 100644 --- a/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.h +++ b/ApplicationLibCode/FileInterface/RifFaultReactivationModelExporter.h @@ -82,7 +82,8 @@ class RifFaultReactivationModelExporter const std::vector& timeSteps, const std::string& exportDirectory, bool useGridPorePressure, - bool useGridTemperature ); + bool useGridTemperature, + double seaWaterLoad ); static std::pair printInteractions( std::ostream& stream, diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.cpp b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.cpp index 178aeaba65..0ded3a19f1 100644 --- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.cpp +++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.cpp @@ -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; +} diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.h b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.h index 23c373f78b..e3c741b5eb 100644 --- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.h +++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationModel.h @@ -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 calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override; @@ -181,6 +184,8 @@ class RimFaultReactivationModel : public RimCheckableNamedObject, public RimPoly caf::PdmField m_useGridElasticProperties; caf::PdmField m_useGridStress; + caf::PdmField m_waterDensity; + caf::PdmField m_startCellIndex; caf::PdmField m_startCellFace;