mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve MSW export including multi lateral wells
Based on branch https://github.com/OPM/ResInsight/tree/system-msw-refactor - Move completion settings to property of well path - Rename to RimFishbones - Export implicit COMPSEGS for fishbones main bore - Add valve for each branch - Increase version number to be able to handle import of legacy project files
This commit is contained in:
@@ -25,8 +25,8 @@
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimFishbones.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
@@ -67,38 +67,35 @@ void RicExportFishbonesLateralsFeature::onActionTriggered( bool isChecked )
|
||||
auto exportFile = EXP::openFileForExport( folder, fileName );
|
||||
auto stream = EXP::createOutputFileStream( *exportFile );
|
||||
|
||||
for ( RimFishbonesMultipleSubs* fishbone : wellPath->fishbonesCollection()->activeFishbonesSubs() )
|
||||
for ( RimFishbones* fishbone : wellPath->fishbonesCollection()->activeFishbonesSubs() )
|
||||
{
|
||||
const QString fishboneName = fishbone->generatedName();
|
||||
|
||||
for ( auto& sub : fishbone->installedLateralIndices() )
|
||||
for ( const auto& [subIndex, lateralIndex] : fishbone->installedLateralIndices() )
|
||||
{
|
||||
for ( size_t lateralIndex : sub.lateralIndices )
|
||||
std::vector<std::pair<cvf::Vec3d, double>> coordsAndMD =
|
||||
fishbone->coordsAndMDForLateral( subIndex, lateralIndex );
|
||||
|
||||
std::vector<cvf::Vec3d> lateralCoords;
|
||||
std::vector<double> lateralMDs;
|
||||
|
||||
lateralCoords.reserve( coordsAndMD.size() );
|
||||
lateralMDs.reserve( coordsAndMD.size() );
|
||||
|
||||
for ( auto& coordMD : coordsAndMD )
|
||||
{
|
||||
std::vector<std::pair<cvf::Vec3d, double>> coordsAndMD =
|
||||
fishbone->coordsAndMDForLateral( sub.subIndex, lateralIndex );
|
||||
|
||||
std::vector<cvf::Vec3d> lateralCoords;
|
||||
std::vector<double> lateralMDs;
|
||||
|
||||
lateralCoords.reserve( coordsAndMD.size() );
|
||||
lateralMDs.reserve( coordsAndMD.size() );
|
||||
|
||||
for ( auto& coordMD : coordsAndMD )
|
||||
{
|
||||
lateralCoords.push_back( coordMD.first );
|
||||
lateralMDs.push_back( coordMD.second );
|
||||
}
|
||||
|
||||
RigWellPath geometry( lateralCoords, lateralMDs );
|
||||
|
||||
// Pad with "0" to get a total of two characters defining the sub index text
|
||||
QString subIndexText = QString( "%1" ).arg( sub.subIndex, 2, 10, QChar( '0' ) );
|
||||
QString lateralName =
|
||||
QString( "%1_%2_Sub%3_Lat%4" ).arg( wellPath->name() ).arg( fishboneName ).arg( subIndexText ).arg( lateralIndex );
|
||||
|
||||
EXP::writeWellPathGeometryToStream( *stream, geometry, lateralName, mdStepSize, false, 0.0, false );
|
||||
lateralCoords.push_back( coordMD.first );
|
||||
lateralMDs.push_back( coordMD.second );
|
||||
}
|
||||
|
||||
RigWellPath geometry( lateralCoords, lateralMDs );
|
||||
|
||||
// Pad with "0" to get a total of two characters defining the sub index text
|
||||
QString subIndexText = QString( "%1" ).arg( subIndex, 2, 10, QChar( '0' ) );
|
||||
QString lateralName =
|
||||
QString( "%1_%2_Sub%3_Lat%4" ).arg( wellPath->name() ).arg( fishboneName ).arg( subIndexText ).arg( lateralIndex );
|
||||
|
||||
EXP::writeWellPathGeometryToStream( *stream, geometry, lateralName, mdStepSize, false, 0.0, false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user