Merge from dev

This commit is contained in:
astridkbjorke 2017-06-23 13:21:34 +02:00
commit ea08cc58fb
6 changed files with 74 additions and 15 deletions

View File

@ -34,6 +34,7 @@ namespace caf
{
addItem(RicExportCompletionDataSettingsUi::ALL_WELLS, "ALL_WELLS", "All Wells");
addItem(RicExportCompletionDataSettingsUi::CHECKED_WELLS, "CHECKED_WELLS", "Checked Wells");
addItem(RicExportCompletionDataSettingsUi::SELECTED_WELLS, "SELECTED_WELLS", "Selected Wells");
setDefault(RicExportCompletionDataSettingsUi::ALL_WELLS);
}
@ -53,6 +54,13 @@ CAF_PDM_SOURCE_INIT(RicExportCompletionDataSettingsUi, "RicExportCompletionDataS
///
//--------------------------------------------------------------------------------------------------
RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi(bool onlyWellPathCollectionSelected)
{
CAF_PDM_InitObject("RimExportCompletionDataSettings", "", "", "");
@ -67,6 +75,8 @@ RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi()
CAF_PDM_InitField(&includeFractures, "IncludeFractures", true, "Include Fractures", "", "", "");
CAF_PDM_InitField(&excludeMainBoreForFishbones, "ExcludeMainBoreForFishbones", false, "Exclude Main Bore Transmissibility For Fishbones", "", "", "");
m_onlyWellPathCollectionSelected = onlyWellPathCollectionSelected;
}
//--------------------------------------------------------------------------------------------------
@ -105,6 +115,18 @@ QList<caf::PdmOptionItemInfo> RicExportCompletionDataSettingsUi::calculateValueO
options.push_back(caf::PdmOptionItemInfo(timeStepNames[i], i));
}
}
else if (fieldNeedingOptions == &wellSelection)
{
if (m_onlyWellPathCollectionSelected)
{
options.push_back(caf::PdmOptionItemInfo("All Wells", ALL_WELLS));
options.push_back(caf::PdmOptionItemInfo("Checked Wells", CHECKED_WELLS));
}
else
{
options.push_back(caf::PdmOptionItemInfo("Selected Wells", SELECTED_WELLS));
}
}
else
{
options = RicCaseAndFileExportSettingsUi::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
@ -117,12 +139,15 @@ QList<caf::PdmOptionItemInfo> RicExportCompletionDataSettingsUi::calculateValueO
//--------------------------------------------------------------------------------------------------
void RicExportCompletionDataSettingsUi::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* generalExportSettings = uiOrdering.addNewGroup("General Export Settings");
generalExportSettings->add(&folder);
generalExportSettings->add(&caseToApply);
generalExportSettings->add(&timeStep);
generalExportSettings->add(&compdatExport);
generalExportSettings->add(&wellSelection);
if(!m_onlyWellPathCollectionSelected) wellSelection.setValue(SELECTED_WELLS);
generalExportSettings->add(&fileSplit);
if (!m_displayForSimWell)
@ -134,6 +159,7 @@ void RicExportCompletionDataSettingsUi::defineUiOrdering(QString uiConfigName, c
caf::PdmUiGroup* perfIntervalGroup = uiOrdering.addNewGroup("Export of Perforation Completions");
perfIntervalGroup->add(&includePerforations);
perfIntervalGroup->add(&timeStep);
caf::PdmUiGroup* fractureGroup = uiOrdering.addNewGroup("Export of Fracture Completions");
fractureGroup->add(&includeFractures);

View File

@ -41,6 +41,7 @@ public:
enum WellSelection {
ALL_WELLS,
CHECKED_WELLS,
SELECTED_WELLS,
};
typedef caf::AppEnum<WellSelection> WellSelectionType;
@ -52,6 +53,7 @@ public:
RicExportCompletionDataSettingsUi();
RicExportCompletionDataSettingsUi(bool onlyWellPathCollectionSelected);
caf::PdmField<ExportSplitType> fileSplit;
@ -75,5 +77,6 @@ protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
private:
bool m_onlyWellPathCollectionSelected;
bool m_displayForSimWell;
};

View File

@ -77,7 +77,11 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
std::map<size_t, std::vector<WellBorePartForTransCalc> > wellBorePartsInCells; //wellBore = main bore or fishbone lateral
findFishboneLateralsWellBoreParts(wellBorePartsInCells, wellPath, settings);
findFishboneImportedLateralsWellBoreParts(wellBorePartsInCells, wellPath, settings);
findMainWellBoreParts(wellBorePartsInCells, wellPath, settings);
if (!wellBorePartsInCells.empty())
{
//Don't include main bore if there are no fishbones
findMainWellBoreParts(wellBorePartsInCells, wellPath, settings);
}
std::vector<RigCompletionData> completionData;
@ -212,6 +216,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findMainWellBoreParts(st
for (auto& cell : intersectedCellsIntersectionInfo)
{
//TODO: should skinFactor be taken from well group instead???
double skinFactor = wellPath->fishbonesCollection()->wellPathCollection()->skinFactor();
QString completionMetaData = wellPath->name() + " main bore";
WellBorePartForTransCalc wellBorePart = WellBorePartForTransCalc(cell.internalCellLengths,

View File

@ -120,6 +120,10 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
exportSettings.showForWellPath();
}
bool onlyWellPathCollectionSelected = noWellPathsSelectedDirectly();
RicExportCompletionDataSettingsUi exportSettings(onlyWellPathCollectionSelected);
std::vector<RimCase*> cases;
app->project()->allCases(cases);
for (auto c : cases)
@ -137,7 +141,7 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export Completion Data", "");
if (propertyDialog.exec() == QDialog::Accepted)
{
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", QFileInfo(exportSettings.folder).absolutePath());
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", exportSettings.folder);
exportCompletions(wellPaths, simWells, exportSettings);
}
@ -159,14 +163,17 @@ std::vector<RimWellPath*> RicWellPathExportCompletionDataFeature::selectedWellPa
std::vector<RimWellPath*> wellPaths;
caf::SelectionManager::instance()->objectsByType(&wellPaths);
std::vector<RimWellPathCollection*> wellPathCollections;
caf::SelectionManager::instance()->objectsByType(&wellPathCollections);
for (auto wellPathCollection : wellPathCollections)
if (wellPaths.empty())
{
for (auto wellPath : wellPathCollection->wellPaths())
std::vector<RimWellPathCollection*> wellPathCollections;
caf::SelectionManager::instance()->objectsByType(&wellPathCollections);
for (auto wellPathCollection : wellPathCollections)
{
wellPaths.push_back(wellPath);
for (auto wellPath : wellPathCollection->wellPaths())
{
wellPaths.push_back(wellPath);
}
}
}
@ -175,6 +182,18 @@ std::vector<RimWellPath*> RicWellPathExportCompletionDataFeature::selectedWellPa
return wellPaths;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicWellPathExportCompletionDataFeature::noWellPathsSelectedDirectly()
{
std::vector<RimWellPath*> wellPaths;
caf::SelectionManager::instance()->objectsByType(&wellPaths);
if (wellPaths.empty()) return true;
else return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -215,7 +234,8 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector
}
std::vector<RimWellPath*> usedWellPaths;
if (exportSettings.wellSelection == RicExportCompletionDataSettingsUi::ALL_WELLS)
if (exportSettings.wellSelection == RicExportCompletionDataSettingsUi::ALL_WELLS
|| exportSettings.wellSelection == RicExportCompletionDataSettingsUi::SELECTED_WELLS)
{
usedWellPaths = wellPaths;
}
@ -652,7 +672,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateP
interval->skinFactor(),
interval->diameter(unitSystem),
direction);
completion.addMetadata("Perforation", QString("StartMD: %1 - EndMD: %2").arg(interval->startMD()).arg(interval->endMD() + QString(" : ") + QString::number(transmissibility)));
completion.addMetadata("Perforation", QString("StartMD: %1 - EndMD: %2").arg(interval->startMD()).arg(interval->endMD()) + QString(" : ") + QString::number(transmissibility));
completionData.push_back(completion);
}
}

View File

@ -129,6 +129,8 @@ protected:
std::vector<RimWellPath*> selectedWellPaths();
std::vector<RimEclipseWell*> selectedSimWells();
bool noWellPathsSelectedDirectly();
public:
static std::vector<WellSegmentLocation> findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath);
static std::vector<WellSegmentLocation> findWellSegmentLocations(const RimEclipseCase* caseToApply, const RimWellPath* wellPath, const std::vector<RimFishbonesMultipleSubs*>& fishbonesSubs);

View File

@ -118,10 +118,13 @@ void RimFishbonesCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
}
}
uiOrdering.add(&m_startMD);
uiOrdering.add(&m_mainBoreDiameter);
uiOrdering.add(&m_linerDiameter);
uiOrdering.add(&m_roughnessFactor);
caf::PdmUiGroup* wellGroup = uiOrdering.addNewGroup("Fishbone Well Properties");
wellGroup->add(&m_startMD);
wellGroup->add(&m_mainBoreDiameter);
caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup("Multi Segment Wells");
mswGroup->add(&m_linerDiameter);
mswGroup->add(&m_roughnessFactor);
}
//--------------------------------------------------------------------------------------------------