2017-05-16 09:43:41 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2017- Statoil ASA
|
2018-08-20 15:15:48 +02:00
|
|
|
//
|
2017-05-16 09:43:41 +02:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
2018-08-20 15:15:48 +02:00
|
|
|
//
|
2017-05-16 09:43:41 +02:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2018-08-20 15:15:48 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-05-16 09:43:41 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2017-05-30 14:37:51 +02:00
|
|
|
#include "RicExportCompletionDataSettingsUi.h"
|
2018-10-29 10:00:27 +01:00
|
|
|
#include "RicExportFractureCompletionsImpl.h"
|
|
|
|
|
|
2021-01-21 14:30:15 +01:00
|
|
|
#include "RiaEclipseUnitTools.h"
|
|
|
|
|
|
2018-10-29 10:00:27 +01:00
|
|
|
#include "RimProject.h"
|
2020-02-28 11:56:07 +01:00
|
|
|
#include "RimTools.h"
|
2018-10-29 10:00:27 +01:00
|
|
|
#include "RimWellPath.h"
|
|
|
|
|
#include "RimWellPathCompletions.h"
|
2017-05-16 09:43:41 +02:00
|
|
|
|
2026-09-16 15:54:55 +02:00
|
|
|
#include "cafPdmScriptEnumNameRegistry.h"
|
|
|
|
|
|
2017-06-14 15:30:50 +02:00
|
|
|
namespace caf
|
|
|
|
|
{
|
2025-03-10 09:24:50 +01:00
|
|
|
template <>
|
|
|
|
|
void RicExportCompletionDataSettingsUi::ExportSplitType::setUp()
|
|
|
|
|
{
|
|
|
|
|
addItem( RicExportCompletionDataSettingsUi::ExportSplit::UNIFIED_FILE, "UNIFIED_FILE", "Unified File" );
|
|
|
|
|
addItem( RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL, "SPLIT_ON_WELL", "Split on Well" );
|
2025-12-02 16:03:56 +01:00
|
|
|
setDefault( RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL );
|
2025-03-10 09:24:50 +01:00
|
|
|
}
|
2017-06-15 11:37:00 +02:00
|
|
|
|
2025-03-10 09:24:50 +01:00
|
|
|
template <>
|
|
|
|
|
void RicExportCompletionDataSettingsUi::CompdatExportType::setUp()
|
|
|
|
|
{
|
|
|
|
|
addItem( RicExportCompletionDataSettingsUi::CompdatExport::TRANSMISSIBILITIES, "TRANSMISSIBILITIES", "Calculated Transmissibilities" );
|
|
|
|
|
addItem( RicExportCompletionDataSettingsUi::CompdatExport::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS,
|
|
|
|
|
"WPIMULT_AND_DEFAULT_CONNECTION_FACTORS",
|
|
|
|
|
"Default Connection Factors and WPIMULT (Fractures Not Supported)" );
|
|
|
|
|
setDefault( RicExportCompletionDataSettingsUi::CompdatExport::TRANSMISSIBILITIES );
|
|
|
|
|
}
|
2018-04-13 12:13:27 +02:00
|
|
|
|
2025-03-10 09:24:50 +01:00
|
|
|
template <>
|
|
|
|
|
void RicExportCompletionDataSettingsUi::TransScalingWBHPSource::setUp()
|
|
|
|
|
{
|
|
|
|
|
addItem( RicExportFractureCompletionsImpl::WBHP_FROM_SUMMARY, "WBHP_SUMMARY", "WBHP From Summary Case" );
|
|
|
|
|
addItem( RicExportFractureCompletionsImpl::WBHP_FROM_USER_DEF, "WBHP_USER_DEFINED", "Fixed User Defined WBHP" );
|
2018-09-25 10:12:45 +02:00
|
|
|
|
2025-03-10 09:24:50 +01:00
|
|
|
setDefault( RicExportFractureCompletionsImpl::WBHP_FROM_SUMMARY );
|
2017-06-14 15:30:50 +02:00
|
|
|
}
|
2025-03-10 09:24:50 +01:00
|
|
|
} // namespace caf
|
2017-06-14 15:30:50 +02:00
|
|
|
|
2026-09-16 15:54:55 +02:00
|
|
|
namespace
|
|
|
|
|
{
|
|
|
|
|
// Pin the Python StrEnum class names for the export settings used by RimEclipseCase_exportCompletions
|
|
|
|
|
struct RegisterScriptEnumNames
|
|
|
|
|
{
|
|
|
|
|
RegisterScriptEnumNames()
|
|
|
|
|
{
|
|
|
|
|
caf::PdmScriptEnumNameRegistry::registerName<RicExportCompletionDataSettingsUi::ExportSplit>( "CompletionExportSplit" );
|
|
|
|
|
caf::PdmScriptEnumNameRegistry::registerName<RicExportCompletionDataSettingsUi::CompdatExport>( "CompdatExportType" );
|
|
|
|
|
caf::PdmScriptEnumNameRegistry::registerName<RicExportFractureCompletionsImpl::PressureDepletionWBHPSource>(
|
|
|
|
|
"TransScalingWbhpSource" );
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const RegisterScriptEnumNames s_registerScriptEnumNames;
|
|
|
|
|
} // namespace
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_PDM_SOURCE_INIT( RicExportCompletionDataSettingsUi, "RicExportCompletionDataSettingsUi" );
|
2017-05-16 09:43:41 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-20 15:15:48 +02:00
|
|
|
///
|
2017-05-16 09:43:41 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-05-30 14:37:51 +02:00
|
|
|
RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi()
|
2017-05-16 09:43:41 +02:00
|
|
|
{
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitObject( "RimExportCompletionDataSettings" );
|
2017-05-16 09:43:41 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitFieldNoDefault( &fileSplit, "FileSplit", "File Split" );
|
2017-12-22 14:42:56 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_PDM_InitFieldNoDefault( &compdatExport, "compdatExport", "Export", "", " ", "" );
|
2017-06-14 15:30:50 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitField( &timeStep, "TimeStepIndex", 0, " Time Step" );
|
2018-03-14 09:35:48 +01:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitField( &includeMsw, "IncludeMSW", true, "Multi Segment Well Model" );
|
2018-09-06 09:53:35 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitField( &useLateralNTG, "UseLateralNTG", false, "Use NTG Horizontally" );
|
2017-05-30 15:42:05 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitField( &includePerforations, "IncludePerforations", true, "Perforations" );
|
|
|
|
|
CAF_PDM_InitField( &includeFishbones, "IncludeFishbones", true, "Fishbones" );
|
|
|
|
|
CAF_PDM_InitField( &includeFractures, "IncludeFractures", true, "Fractures" );
|
2017-05-29 13:13:25 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitField( &performTransScaling, "TransScalingType", false, "Perform Transmissibility Scaling" );
|
|
|
|
|
CAF_PDM_InitField( &transScalingTimeStep, "TransScalingTimeStep", 0, "Current Time Step" );
|
|
|
|
|
CAF_PDM_InitFieldNoDefault( &transScalingWBHPSource, "TransScalingWBHPSource", "WBHP Selection" );
|
|
|
|
|
CAF_PDM_InitField( &transScalingWBHP, "TransScalingWBHP", 200.0, "WBHP Before Production Start" );
|
2018-09-14 14:00:27 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
CAF_PDM_InitField( &excludeMainBoreForFishbones,
|
|
|
|
|
"ExcludeMainBoreForFishbones",
|
|
|
|
|
false,
|
|
|
|
|
" Exclude Main Bore Transmissibility",
|
|
|
|
|
"",
|
|
|
|
|
"Main bore perforation intervals are defined by start/end MD of each active fishbone sub "
|
|
|
|
|
"definition",
|
|
|
|
|
"" );
|
2018-08-20 15:15:48 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitField( &m_exportDataSourceAsComment, "ExportDataSourceAsComment", true, "Comments" );
|
2021-04-13 07:22:56 +02:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitField( &m_exportWelspec, "ExportWelspec", true, "WELSPEC keyword" );
|
2025-12-02 16:03:56 +01:00
|
|
|
|
|
|
|
|
const QString completionWelspecAfterMainBoreDesc = "If checked, export all mainbore well segments first, then completions. "
|
|
|
|
|
"Otherwise, export completion segments based on measured depth. "
|
|
|
|
|
"Applies to Fracture and Fishbones completions.";
|
|
|
|
|
CAF_PDM_InitField( &m_completionWelspecAfterMainBore,
|
|
|
|
|
"CompletionWelspecAfterMainBore",
|
|
|
|
|
true,
|
|
|
|
|
"Export completion well segments after main bore",
|
|
|
|
|
"",
|
|
|
|
|
completionWelspecAfterMainBoreDesc );
|
2021-03-02 09:25:53 +01:00
|
|
|
|
2021-11-14 14:15:12 +01:00
|
|
|
CAF_PDM_InitField( &m_useCustomFileName, "UseCustomFileName", false, "Use Custom Filename" );
|
|
|
|
|
CAF_PDM_InitField( &m_customFileName, "CustomFileName", {}, "Custom Filename" );
|
2021-04-30 13:51:15 +02:00
|
|
|
|
2018-08-20 15:15:48 +02:00
|
|
|
m_fracturesEnabled = true;
|
2018-04-09 11:23:14 +02:00
|
|
|
m_perforationsEnabled = true;
|
2018-08-20 15:15:48 +02:00
|
|
|
m_fishbonesEnabled = true;
|
2017-05-30 15:42:05 +02:00
|
|
|
}
|
|
|
|
|
|
2019-04-24 13:31:11 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RicExportCompletionDataSettingsUi::enableIncludeMsw()
|
|
|
|
|
{
|
|
|
|
|
includeMsw = true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-02 09:25:53 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RicExportCompletionDataSettingsUi::setExportDataSourceAsComment( bool enable )
|
|
|
|
|
{
|
|
|
|
|
m_exportDataSourceAsComment = enable;
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-13 12:13:27 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-20 15:15:48 +02:00
|
|
|
///
|
2018-04-13 12:13:27 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RicExportCompletionDataSettingsUi::showFractureInUi( bool enable )
|
2018-04-09 11:23:14 +02:00
|
|
|
{
|
|
|
|
|
m_fracturesEnabled = enable;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-20 15:15:48 +02:00
|
|
|
///
|
2018-04-09 11:23:14 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RicExportCompletionDataSettingsUi::showPerforationsInUi( bool enable )
|
2018-04-09 11:23:14 +02:00
|
|
|
{
|
|
|
|
|
m_perforationsEnabled = enable;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-20 15:15:48 +02:00
|
|
|
///
|
2018-04-09 11:23:14 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RicExportCompletionDataSettingsUi::showFishbonesInUi( bool enable )
|
2018-04-09 11:23:14 +02:00
|
|
|
{
|
|
|
|
|
m_fishbonesEnabled = enable;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-02 09:25:53 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
bool RicExportCompletionDataSettingsUi::exportDataSourceAsComment() const
|
|
|
|
|
{
|
|
|
|
|
return m_exportDataSourceAsComment;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-02 13:51:00 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RicExportCompletionDataSettingsUi::setExportWelspec( bool enable )
|
|
|
|
|
{
|
|
|
|
|
m_exportWelspec = enable;
|
|
|
|
|
}
|
|
|
|
|
|
2021-03-02 09:25:53 +01:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
bool RicExportCompletionDataSettingsUi::exportWelspec() const
|
|
|
|
|
{
|
|
|
|
|
return m_exportWelspec;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-02 13:51:00 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RicExportCompletionDataSettingsUi::setExportCompletionWelspecAfterMainBore( bool enable )
|
|
|
|
|
{
|
|
|
|
|
m_completionWelspecAfterMainBore = enable;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-13 07:22:56 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
bool RicExportCompletionDataSettingsUi::exportCompletionWelspecAfterMainBore() const
|
|
|
|
|
{
|
|
|
|
|
return m_completionWelspecAfterMainBore();
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-02 13:51:00 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
void RicExportCompletionDataSettingsUi::setCustomFileName( const QString& fileName )
|
|
|
|
|
{
|
|
|
|
|
m_useCustomFileName = !fileName.isEmpty();
|
|
|
|
|
m_customFileName = fileName;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-30 13:51:15 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
QString RicExportCompletionDataSettingsUi::customFileName() const
|
|
|
|
|
{
|
|
|
|
|
if ( m_useCustomFileName ) return m_customFileName();
|
|
|
|
|
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-14 22:30:22 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-20 15:15:48 +02:00
|
|
|
///
|
2017-08-14 22:30:22 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RicExportCompletionDataSettingsUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
|
const QVariant& oldValue,
|
|
|
|
|
const QVariant& newValue )
|
2017-08-14 22:30:22 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( changedField == &compdatExport )
|
2017-08-14 22:30:22 +02:00
|
|
|
{
|
2021-05-18 15:31:40 +02:00
|
|
|
if ( compdatExport == CompdatExport::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS )
|
2017-08-14 22:30:22 +02:00
|
|
|
{
|
|
|
|
|
includeFractures = false;
|
|
|
|
|
}
|
2021-05-18 15:31:40 +02:00
|
|
|
else if ( compdatExport == CompdatExport::TRANSMISSIBILITIES || includeMsw )
|
2017-08-14 22:30:22 +02:00
|
|
|
{
|
|
|
|
|
includeFractures = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-30 15:42:05 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-20 15:15:48 +02:00
|
|
|
///
|
2017-05-30 15:42:05 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 10:48:40 +01:00
|
|
|
QList<caf::PdmOptionItemInfo> RicExportCompletionDataSettingsUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
|
2017-05-30 15:42:05 +02:00
|
|
|
{
|
|
|
|
|
QList<caf::PdmOptionItemInfo> options;
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( fieldNeedingOptions == &timeStep )
|
2017-05-30 15:42:05 +02:00
|
|
|
{
|
2020-02-28 11:56:07 +01:00
|
|
|
RimTools::timeStepsForCase( caseToApply, &options );
|
2017-05-30 15:42:05 +02:00
|
|
|
}
|
2019-09-06 10:40:57 +02:00
|
|
|
else if ( fieldNeedingOptions == &transScalingTimeStep )
|
2018-10-29 10:00:27 +01:00
|
|
|
{
|
2023-02-26 10:48:40 +01:00
|
|
|
std::map<int, std::vector<std::pair<QString, QString>>> wellProductionStartStrings = generateWellProductionStartStrings();
|
2018-10-29 10:00:27 +01:00
|
|
|
|
|
|
|
|
QStringList timeStepNames;
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( caseToApply )
|
2018-10-29 10:00:27 +01:00
|
|
|
{
|
|
|
|
|
timeStepNames = caseToApply->timeStepStrings();
|
|
|
|
|
}
|
2019-09-06 10:40:57 +02:00
|
|
|
for ( int i = 0; i < timeStepNames.size(); i++ )
|
2018-10-29 10:00:27 +01:00
|
|
|
{
|
|
|
|
|
QString timeStepString = timeStepNames[i];
|
2019-09-06 10:40:57 +02:00
|
|
|
auto it = wellProductionStartStrings.find( i );
|
|
|
|
|
if ( it != wellProductionStartStrings.end() )
|
2018-10-29 10:00:27 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
int numberOfWells = static_cast<int>( it->second.size() );
|
2018-10-29 11:44:14 +01:00
|
|
|
QStringList wellList;
|
|
|
|
|
QStringList wellPressureList;
|
2019-09-06 10:40:57 +02:00
|
|
|
const int maxStringLength = 70;
|
|
|
|
|
QString startStringFormat( " [Start: %1]" );
|
2018-10-29 11:44:14 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
for ( int w = 0; w < numberOfWells; ++w )
|
2018-10-29 11:44:14 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
QString wellString = it->second[w].first;
|
|
|
|
|
QStringList candidateWellList = wellList;
|
|
|
|
|
candidateWellList << wellString;
|
2018-10-29 11:44:14 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( startStringFormat.arg( candidateWellList.join( ", " ) ).length() < maxStringLength )
|
2018-10-29 11:44:14 +01:00
|
|
|
{
|
2018-10-29 12:38:34 +01:00
|
|
|
wellList = candidateWellList;
|
2018-10-29 11:44:14 +01:00
|
|
|
}
|
|
|
|
|
|
2023-02-26 10:48:40 +01:00
|
|
|
QString wellStringWithPressure = QString( "%1 (%2)" ).arg( it->second[w].first ).arg( it->second[w].second );
|
2019-09-06 10:40:57 +02:00
|
|
|
QStringList candidateWellPressureList = wellPressureList;
|
|
|
|
|
candidateWellPressureList << wellStringWithPressure;
|
|
|
|
|
if ( startStringFormat.arg( candidateWellPressureList.join( ", " ) ).length() < maxStringLength )
|
2018-10-29 11:44:14 +01:00
|
|
|
{
|
2018-10-29 12:38:34 +01:00
|
|
|
wellPressureList = candidateWellPressureList;
|
2018-10-29 11:44:14 +01:00
|
|
|
}
|
|
|
|
|
}
|
2019-09-06 10:40:57 +02:00
|
|
|
|
|
|
|
|
if ( wellList.size() < numberOfWells )
|
2018-10-29 11:44:14 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
wellList += QString( "+ %1 more" ).arg( numberOfWells - wellList.size() );
|
|
|
|
|
timeStepString += startStringFormat.arg( wellList.join( ", " ) );
|
2018-10-29 11:44:14 +01:00
|
|
|
}
|
2019-09-06 10:40:57 +02:00
|
|
|
else if ( wellPressureList.size() < numberOfWells )
|
2018-10-29 11:44:14 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
timeStepString += startStringFormat.arg( wellList.join( ", " ) );
|
2018-10-29 11:44:14 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
timeStepString += startStringFormat.arg( wellPressureList.join( ", " ) );
|
2018-10-29 11:44:14 +01:00
|
|
|
}
|
2018-10-29 10:00:27 +01:00
|
|
|
}
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
options.push_back( caf::PdmOptionItemInfo( timeStepString, i ) );
|
2018-10-29 10:00:27 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-30 15:42:05 +02:00
|
|
|
else
|
|
|
|
|
{
|
2022-05-29 13:01:27 +02:00
|
|
|
options = RicCaseAndFileExportSettingsUi::calculateValueOptions( fieldNeedingOptions );
|
2017-05-30 15:42:05 +02:00
|
|
|
}
|
|
|
|
|
return options;
|
2017-05-16 09:43:41 +02:00
|
|
|
}
|
2017-06-12 12:03:42 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2018-08-20 15:15:48 +02:00
|
|
|
///
|
2017-06-12 12:03:42 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 10:40:57 +02:00
|
|
|
void RicExportCompletionDataSettingsUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2017-06-12 12:03:42 +02:00
|
|
|
{
|
2018-04-09 11:23:14 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Export Settings" );
|
|
|
|
|
group->add( &compdatExport );
|
|
|
|
|
group->add( &caseToApply );
|
|
|
|
|
group->add( &useLateralNTG );
|
2021-03-02 09:25:53 +01:00
|
|
|
group->add( &m_exportDataSourceAsComment );
|
|
|
|
|
group->add( &m_exportWelspec );
|
2021-04-13 07:22:56 +02:00
|
|
|
group->add( &includeMsw );
|
|
|
|
|
group->add( &m_completionWelspecAfterMainBore );
|
2018-09-24 10:35:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "File Settings" );
|
|
|
|
|
group->add( &fileSplit );
|
|
|
|
|
group->add( &folder );
|
2021-04-30 13:51:15 +02:00
|
|
|
|
2021-05-18 15:31:40 +02:00
|
|
|
if ( fileSplit() == ExportSplit::UNIFIED_FILE )
|
2021-04-30 13:51:15 +02:00
|
|
|
{
|
|
|
|
|
group->add( &m_useCustomFileName );
|
|
|
|
|
|
|
|
|
|
group->add( &m_customFileName );
|
|
|
|
|
m_customFileName.uiCapability()->setUiReadOnly( !m_useCustomFileName );
|
|
|
|
|
}
|
2018-04-09 11:23:14 +02:00
|
|
|
}
|
2017-06-12 12:03:42 +02:00
|
|
|
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Completions Export Selection" );
|
2025-02-03 18:19:03 +01:00
|
|
|
if ( m_perforationsEnabled )
|
2017-06-23 15:45:22 +02:00
|
|
|
{
|
2025-02-03 18:19:03 +01:00
|
|
|
group->add( &includePerforations );
|
|
|
|
|
group->add( &timeStep );
|
|
|
|
|
if ( !includePerforations )
|
|
|
|
|
timeStep.uiCapability()->setUiReadOnly( true );
|
|
|
|
|
else
|
|
|
|
|
timeStep.uiCapability()->setUiReadOnly( false );
|
2017-06-23 15:45:22 +02:00
|
|
|
}
|
2018-04-09 11:23:14 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( m_fracturesEnabled )
|
2017-06-23 15:45:22 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
group->add( &includeFractures );
|
2018-09-17 10:51:08 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmUiGroup* pddGroup = group->addNewGroup( "Pressure Differential Depletion Scaling" );
|
|
|
|
|
pddGroup->setUiReadOnly( !includeFractures() );
|
2018-11-13 16:47:53 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
pddGroup->add( &performTransScaling );
|
|
|
|
|
pddGroup->add( &transScalingTimeStep );
|
|
|
|
|
pddGroup->add( &transScalingWBHPSource );
|
|
|
|
|
pddGroup->add( &transScalingWBHP );
|
2018-11-13 16:47:53 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( !includeFractures() )
|
2018-11-13 16:47:53 +01:00
|
|
|
{
|
|
|
|
|
performTransScaling = false;
|
2019-09-06 10:40:57 +02:00
|
|
|
performTransScaling.uiCapability()->setUiReadOnly( true );
|
2018-11-13 16:47:53 +01:00
|
|
|
}
|
|
|
|
|
else
|
2018-09-19 15:19:41 +02:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
performTransScaling.uiCapability()->setUiReadOnly( false );
|
2018-11-13 16:47:53 +01:00
|
|
|
}
|
2018-09-19 15:19:41 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( !performTransScaling() )
|
2018-11-13 16:47:53 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
transScalingTimeStep.uiCapability()->setUiReadOnly( true );
|
|
|
|
|
transScalingWBHPSource.uiCapability()->setUiReadOnly( true );
|
|
|
|
|
transScalingWBHP.uiCapability()->setUiReadOnly( true );
|
2018-11-13 16:47:53 +01:00
|
|
|
}
|
|
|
|
|
else
|
2019-09-06 10:40:57 +02:00
|
|
|
{
|
|
|
|
|
transScalingTimeStep.uiCapability()->setUiReadOnly( false );
|
|
|
|
|
transScalingWBHPSource.uiCapability()->setUiReadOnly( false );
|
|
|
|
|
transScalingWBHP.uiCapability()->setUiReadOnly( false );
|
|
|
|
|
if ( transScalingWBHPSource == RicExportFractureCompletionsImpl::WBHP_FROM_SUMMARY )
|
2018-11-12 15:00:13 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
transScalingWBHP.uiCapability()->setUiName( "WBHP Before Production Start" );
|
2018-11-12 15:00:13 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
transScalingWBHP.uiCapability()->setUiName( "User Defined WBHP" );
|
2018-11-12 15:00:13 +01:00
|
|
|
}
|
2018-09-19 15:19:41 +02:00
|
|
|
}
|
2018-09-17 10:51:08 +02:00
|
|
|
|
2018-09-05 09:47:37 +02:00
|
|
|
// Set visibility
|
2023-02-26 10:48:40 +01:00
|
|
|
includeFractures.uiCapability()->setUiHidden( compdatExport == CompdatExport::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS &&
|
|
|
|
|
!includeMsw );
|
2017-06-23 15:45:22 +02:00
|
|
|
}
|
2018-04-13 12:13:27 +02:00
|
|
|
|
2025-02-03 18:19:03 +01:00
|
|
|
if ( m_fishbonesEnabled )
|
2018-04-13 12:13:27 +02:00
|
|
|
{
|
2025-02-03 18:19:03 +01:00
|
|
|
group->add( &includeFishbones );
|
|
|
|
|
group->add( &excludeMainBoreForFishbones );
|
2018-09-05 09:47:37 +02:00
|
|
|
|
2025-02-03 18:19:03 +01:00
|
|
|
// Set visibility
|
|
|
|
|
if ( !includeFishbones )
|
|
|
|
|
excludeMainBoreForFishbones.uiCapability()->setUiReadOnly( true );
|
|
|
|
|
else
|
|
|
|
|
excludeMainBoreForFishbones.uiCapability()->setUiReadOnly( false );
|
2018-04-13 12:13:27 +02:00
|
|
|
}
|
2017-06-21 16:38:57 +02:00
|
|
|
}
|
2017-08-14 22:30:22 +02:00
|
|
|
|
2017-06-12 12:03:42 +02:00
|
|
|
uiOrdering.skipRemainingFields();
|
|
|
|
|
}
|
2018-10-29 10:00:27 +01:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 10:48:40 +01:00
|
|
|
std::map<int, std::vector<std::pair<QString, QString>>> RicExportCompletionDataSettingsUi::generateWellProductionStartStrings()
|
2018-10-29 10:00:27 +01:00
|
|
|
{
|
2018-10-29 11:44:14 +01:00
|
|
|
std::map<int, std::vector<std::pair<QString, QString>>> wellProductionStartStrings;
|
2018-10-29 10:00:27 +01:00
|
|
|
|
2023-05-12 21:41:34 +02:00
|
|
|
const RimProject* project = RimProject::current();
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( caseToApply )
|
2018-10-29 10:00:27 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
for ( const RimWellPath* wellPath : project->allWellPaths() )
|
2018-10-29 10:00:27 +01:00
|
|
|
{
|
|
|
|
|
int initialWellProductionTimeStep = -1;
|
2019-09-06 10:40:57 +02:00
|
|
|
double initialWellPressure = 0.0;
|
|
|
|
|
double currentWellPressure = 0.0;
|
2023-02-26 10:48:40 +01:00
|
|
|
RicExportFractureCompletionsImpl::getWellPressuresAndInitialProductionTimeStepFromSummaryData( caseToApply,
|
|
|
|
|
wellPath->completionSettings()
|
|
|
|
|
->wellNameForExport(),
|
|
|
|
|
0,
|
|
|
|
|
&initialWellProductionTimeStep,
|
|
|
|
|
&initialWellPressure,
|
|
|
|
|
¤tWellPressure );
|
2019-09-06 10:40:57 +02:00
|
|
|
if ( initialWellProductionTimeStep >= 0 )
|
2018-10-29 10:00:27 +01:00
|
|
|
{
|
2019-09-06 10:40:57 +02:00
|
|
|
QString pressureUnits = RiaEclipseUnitTools::unitStringPressure( wellPath->unitSystem() );
|
|
|
|
|
wellProductionStartStrings[initialWellProductionTimeStep].push_back(
|
2023-02-26 10:48:40 +01:00
|
|
|
std::make_pair( wellPath->name(), QString( "%1 %2" ).arg( initialWellPressure, 4, 'f', 1 ).arg( pressureUnits ) ) );
|
2018-10-29 10:00:27 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return wellProductionStartStrings;
|
|
|
|
|
}
|