Update grid part naming (#10879)

* Rename parts
* Make sure well extraction goes along model, not fault
* Match part naming with parts
This commit is contained in:
jonjenssen 2023-11-28 02:26:09 +01:00 committed by GitHub
parent da6757e9fa
commit 52259a69f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 60 additions and 25 deletions

View File

@ -50,16 +50,16 @@ std::pair<bool, std::string> RifFaultReactivationModelExporter::exportToStream(
// 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::PART1, PartBorderSurface::FaultSurface }, 4 },
{ { FaultGridPart::PART1, PartBorderSurface::UpperSurface }, 4 },
{ { FaultGridPart::PART1, PartBorderSurface::LowerSurface }, 4 },
{ { FaultGridPart::PART2, PartBorderSurface::FaultSurface }, 4 },
{ { FaultGridPart::PART2, PartBorderSurface::UpperSurface }, 4 },
{ { FaultGridPart::PART2, PartBorderSurface::LowerSurface }, 4 } };
std::map<std::pair<FaultGridPart, PartBorderSurface>, int> faces = { { { FaultGridPart::FW, PartBorderSurface::FaultSurface }, 4 },
{ { FaultGridPart::FW, PartBorderSurface::UpperSurface }, 4 },
{ { FaultGridPart::FW, PartBorderSurface::LowerSurface }, 4 },
{ { FaultGridPart::HW, PartBorderSurface::FaultSurface }, 4 },
{ { FaultGridPart::HW, PartBorderSurface::UpperSurface }, 4 },
{ { FaultGridPart::HW, PartBorderSurface::LowerSurface }, 4 } };
std::map<FaultGridPart, std::string> partNames = {
{ FaultGridPart::PART1, "LEFT_PART" },
{ FaultGridPart::PART2, "RIGHT_PART" },
{ FaultGridPart::FW, "FW" },
{ FaultGridPart::HW, "HW" },
};
std::map<RimFaultReactivation::Boundary, std::string> boundaries = {
@ -750,8 +750,8 @@ std::pair<bool, std::string>
RifInpExportTools::printHeading( stream,
"Contact Pair, interaction=" + interactionName + ", small sliding, type=SURFACE TO SURFACE" + extra );
std::string part1Name = partNames.find( RimFaultReactivation::GridPart::PART1 )->second;
std::string part2Name = partNames.find( RimFaultReactivation::GridPart::PART2 )->second;
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 );
}

View File

@ -23,8 +23,8 @@ namespace RimFaultReactivation
enum class GridPart
{
PART1,
PART2
FW, // footwall
HW // hanging wall
};
enum class BorderSurface

View File

@ -670,9 +670,10 @@ bool RimFaultReactivationModel::exportModelSettings()
auto [topPosition, bottomPosition] = m_2Dmodel->faultTopBottom();
auto faultNormal = m_2Dmodel->faultNormal();
// make sure we move horizontally
// make sure we move horizontally, and along the 2D model
faultNormal.z() = 0.0;
faultNormal.normalize();
faultNormal = faultNormal ^ cvf::Vec3d::Z_AXIS;
RimFaultReactivationTools::addSettingsToMap( settings, faultNormal, topPosition, bottomPosition );

View File

@ -49,7 +49,7 @@ RigFaultReactivationModel::RigFaultReactivationModel()
for ( auto part : allGridParts() )
{
m_3dparts[part] = std::make_shared<RigGriddedPart3d>();
m_3dparts[part] = new RigGriddedPart3d();
}
}
@ -58,6 +58,11 @@ RigFaultReactivationModel::RigFaultReactivationModel()
//--------------------------------------------------------------------------------------------------
RigFaultReactivationModel::~RigFaultReactivationModel()
{
for ( auto part : allGridParts() )
{
if ( m_3dparts[part] != nullptr ) delete m_3dparts[part];
m_3dparts[part] = nullptr;
}
}
//--------------------------------------------------------------------------------------------------
@ -65,7 +70,7 @@ RigFaultReactivationModel::~RigFaultReactivationModel()
//--------------------------------------------------------------------------------------------------
std::vector<RimFaultReactivation::GridPart> RigFaultReactivationModel::allGridParts() const
{
return { GridPart::PART1, GridPart::PART2 };
return { GridPart::FW, GridPart::HW };
}
//--------------------------------------------------------------------------------------------------
@ -139,7 +144,17 @@ std::pair<cvf::Vec3d, cvf::Vec3d> RigFaultReactivationModel::modelLocalNormalsXY
void RigFaultReactivationModel::updateGeometry( size_t startCell, cvf::StructGridInterface::FaceType startFace )
{
reset();
m_generator->generateGeometry( startCell, startFace, m_3dparts[GridPart::PART1].get(), m_3dparts[GridPart::PART2].get() );
auto frontPart = m_3dparts[GridPart::FW];
auto backPart = m_3dparts[GridPart::HW];
m_generator->generateGeometry( startCell, startFace, frontPart, backPart );
if ( backPart->topHeight() > frontPart->topHeight() )
{
m_3dparts[GridPart::HW] = frontPart;
m_3dparts[GridPart::FW] = backPart;
}
auto& frontPoints = m_generator->frontPoints();
auto& backPoints = m_generator->backPoints();
@ -191,7 +206,7 @@ const std::vector<std::vector<cvf::Vec3d>>& RigFaultReactivationModel::meshLines
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::shared_ptr<RigGriddedPart3d> RigFaultReactivationModel::grid( RimFaultReactivation::GridPart part ) const
const RigGriddedPart3d* RigFaultReactivationModel::grid( RimFaultReactivation::GridPart part ) const
{
return m_3dparts.at( part );
}

View File

@ -80,7 +80,7 @@ public:
const std::vector<std::vector<cvf::Vec3d>>& meshLines( GridPart part ) const;
std::shared_ptr<RigGriddedPart3d> grid( GridPart part ) const;
const RigGriddedPart3d* grid( GridPart part ) const;
const cvf::Vec3d faultNormal() const;
const std::pair<cvf::Vec3d, cvf::Vec3d> faultTopBottom() const;
@ -93,5 +93,5 @@ private:
bool m_isValid;
std::map<GridPart, std::shared_ptr<RigGriddedPart3d>> m_3dparts;
std::map<GridPart, RigGriddedPart3d*> m_3dparts;
};

View File

@ -477,14 +477,16 @@ void RigFaultReactivationModelGenerator::generateGeometry( size_t
m_maxCellHeight,
m_cellSizeHeightFactor,
m_horizontalPartition,
m_modelThickness );
m_modelThickness,
m_topReservoirFront.z() );
backPart->generateGeometry( m_backPoints,
backReservoirLayers,
kLayersBack,
m_maxCellHeight,
m_cellSizeHeightFactor,
m_horizontalPartition,
m_modelThickness );
m_modelThickness,
m_topReservoirBack.z() );
frontPart->generateLocalNodes( m_localCoordTransform );
backPart->generateLocalNodes( m_localCoordTransform );

View File

@ -34,6 +34,7 @@
//--------------------------------------------------------------------------------------------------
RigGriddedPart3d::RigGriddedPart3d()
: m_useLocalCoordinates( false )
, m_topHeight( 0.0 )
{
}
@ -193,10 +194,13 @@ void RigGriddedPart3d::generateGeometry( const std::array<cvf::Vec3d, 12>& input
const double maxCellHeight,
double cellSizeFactor,
const std::vector<double>& horizontalPartition,
double modelThickness )
double modelThickness,
double topHeight )
{
reset();
m_topHeight = topHeight;
std::map<Regions, std::vector<double>> layersPerRegion;
layersPerRegion[Regions::LowerUnderburden] = generateGrowingLayers( inputPoints[1].z(), inputPoints[0].z(), maxCellHeight, cellSizeFactor );
@ -481,6 +485,14 @@ bool RigGriddedPart3d::useLocalCoordinates() const
return m_useLocalCoordinates;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RigGriddedPart3d::topHeight() const
{
return m_topHeight;
}
//--------------------------------------------------------------------------------------------------
/// Output elements will be of type HEX8
///

View File

@ -49,14 +49,17 @@ public:
double maxCellHeight,
double cellSizeFactor,
const std::vector<double>& horizontalPartition,
double modelThickness );
double modelThickness,
double topHeight );
void generateLocalNodes( const cvf::Mat4d transform );
void setUseLocalCoordinates( bool useLocalCoordinates );
bool useLocalCoordinates() const;
double topHeight() const;
const std::vector<cvf::Vec3d>& nodes() const;
const std::vector<cvf::Vec3d>& globalNodes() const;
void setUseLocalCoordinates( bool useLocalCoordinates );
bool useLocalCoordinates() const;
const std::vector<std::vector<unsigned int>>& elementIndices() const;
const std::map<RimFaultReactivation::BorderSurface, std::vector<unsigned int>>& borderSurfaceElements() const;
@ -91,6 +94,8 @@ private:
private:
bool m_useLocalCoordinates;
double m_topHeight;
std::vector<cvf::Vec3d> m_nodes;
std::vector<cvf::Vec3d> m_localNodes;
std::vector<std::vector<unsigned int>> m_elementIndices;