2013-05-16 12:59:35 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2014-09-23 15:04:57 +02:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2013-05-16 12:59:35 +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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2013-05-16 12:59:35 +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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2013-05-16 12:59:35 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2021-01-21 12:58:46 +01:00
|
|
|
#include "RiaDefines.h"
|
2017-06-07 11:57:25 +02:00
|
|
|
|
2020-10-06 15:00:39 +02:00
|
|
|
#include "RimWellPathComponentInterface.h"
|
2018-03-09 13:15:01 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
#include "cafAppEnum.h"
|
2019-12-11 08:23:37 +01:00
|
|
|
#include "cafFilePath.h"
|
2019-09-06 10:40:57 +02:00
|
|
|
#include "cafPdmChildField.h"
|
2013-05-16 12:59:35 +02:00
|
|
|
#include "cafPdmField.h"
|
2020-10-06 15:00:39 +02:00
|
|
|
#include "cafPdmObject.h"
|
2013-05-16 12:59:35 +02:00
|
|
|
#include "cafPdmPointer.h"
|
2020-02-06 16:18:50 +01:00
|
|
|
#include "cafPdmProxyValueField.h"
|
2014-07-24 10:11:43 +02:00
|
|
|
|
|
|
|
|
// Include to make Pdm work for cvf::Color
|
2019-09-06 10:40:57 +02:00
|
|
|
#include "cafPdmFieldCvfColor.h"
|
2014-07-24 10:11:43 +02:00
|
|
|
|
2017-05-05 11:21:40 +02:00
|
|
|
#include "cafPdmChildArrayField.h"
|
2019-09-06 10:40:57 +02:00
|
|
|
#include "cvfObject.h"
|
2013-05-16 12:59:35 +02:00
|
|
|
|
2017-10-27 09:11:03 +02:00
|
|
|
#include <functional>
|
|
|
|
|
|
2017-05-10 12:19:46 +02:00
|
|
|
class RifWellPathImporter;
|
2017-11-24 10:01:05 +01:00
|
|
|
class RifWellPathFormationsImporter;
|
2020-10-06 15:00:39 +02:00
|
|
|
class RigWellPath;
|
|
|
|
|
class RigWellPathFormations;
|
|
|
|
|
|
2013-05-16 12:59:35 +02:00
|
|
|
class RimProject;
|
2015-09-16 16:06:06 +02:00
|
|
|
class RimWellLogFile;
|
2018-03-07 15:12:27 +01:00
|
|
|
class RimFractureTemplateCollection;
|
2020-11-04 13:46:17 +01:00
|
|
|
class RimStimPlanModelCollection;
|
2017-05-19 15:44:32 +02:00
|
|
|
class RimFishbonesCollection;
|
2017-05-11 13:33:18 +02:00
|
|
|
class RimPerforationCollection;
|
2018-08-06 07:52:02 +02:00
|
|
|
class RimWellPathAttributeCollection;
|
2017-05-19 14:04:01 +02:00
|
|
|
class RimWellPathCompletions;
|
2021-02-26 14:27:59 +01:00
|
|
|
class RimWellPathCompletionSettings;
|
2017-01-02 11:59:30 +01:00
|
|
|
class RimWellPathFractureCollection;
|
2018-10-11 16:03:49 +02:00
|
|
|
class Rim3dWellLogCurve;
|
2018-03-07 15:12:27 +01:00
|
|
|
class Rim3dWellLogCurveCollection;
|
2021-04-13 07:22:56 +02:00
|
|
|
class RimWellPathTieIn;
|
2021-04-20 15:35:20 +02:00
|
|
|
class RimMswCompletionParameters;
|
2021-09-09 17:34:27 +02:00
|
|
|
class RimWellIASettingsCollection;
|
2013-05-16 12:59:35 +02:00
|
|
|
|
|
|
|
|
//==================================================================================================
|
2019-09-06 10:40:57 +02:00
|
|
|
///
|
|
|
|
|
///
|
2013-05-16 12:59:35 +02:00
|
|
|
//==================================================================================================
|
2020-10-06 15:00:39 +02:00
|
|
|
class RimWellPath : public caf::PdmObject, public RimWellPathComponentInterface
|
2013-05-16 12:59:35 +02:00
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
2017-10-11 13:52:29 +02:00
|
|
|
|
2017-10-13 11:18:53 +02:00
|
|
|
static const char SIM_WELL_NONE_UI_TEXT[];
|
2017-10-11 13:52:29 +02:00
|
|
|
|
2020-10-20 13:01:46 +02:00
|
|
|
public:
|
|
|
|
|
caf::Signal<> nameChanged;
|
|
|
|
|
|
2013-05-16 12:59:35 +02:00
|
|
|
public:
|
|
|
|
|
RimWellPath();
|
2018-10-18 19:45:57 +02:00
|
|
|
~RimWellPath() override;
|
2013-05-16 12:59:35 +02:00
|
|
|
|
2021-02-26 14:27:59 +01:00
|
|
|
virtual QString name() const;
|
|
|
|
|
void setName( const QString& name );
|
|
|
|
|
void setNameNoUpdateOfExportName( const QString& name );
|
2018-06-18 17:13:30 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
const QString associatedSimulationWellName() const;
|
|
|
|
|
int associatedSimulationWellBranch() const;
|
|
|
|
|
bool tryAssociateWithSimulationWell();
|
|
|
|
|
bool isAssociatedWithSimulationWell() const;
|
2018-06-18 17:13:30 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
virtual void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath );
|
2018-06-18 17:13:30 +02:00
|
|
|
|
2021-01-21 12:58:46 +01:00
|
|
|
void setUnitSystem( RiaDefines::EclipseUnitSystem unitSystem );
|
|
|
|
|
RiaDefines::EclipseUnitSystem unitSystem() const;
|
2018-06-18 17:13:30 +02:00
|
|
|
|
2020-02-06 16:18:50 +01:00
|
|
|
double airGap() const;
|
|
|
|
|
double datumElevation() const;
|
|
|
|
|
|
2020-10-06 15:00:39 +02:00
|
|
|
RigWellPath* wellPathGeometry();
|
|
|
|
|
const RigWellPath* wellPathGeometry() const;
|
2020-10-09 08:38:18 +02:00
|
|
|
void setWellPathGeometry( RigWellPath* wellPathModel );
|
2020-10-06 15:00:39 +02:00
|
|
|
|
|
|
|
|
double startMD() const override;
|
|
|
|
|
double endMD() const override;
|
2018-06-18 17:13:30 +02:00
|
|
|
|
2021-01-04 11:09:01 +01:00
|
|
|
double uniqueStartMD() const;
|
|
|
|
|
double uniqueEndMD() const;
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void addWellLogFile( RimWellLogFile* logFileInfo );
|
|
|
|
|
void deleteWellLogFile( RimWellLogFile* logFileInfo );
|
|
|
|
|
void detachWellLogFile( RimWellLogFile* logFileInfo );
|
|
|
|
|
std::vector<RimWellLogFile*> wellLogFiles() const;
|
|
|
|
|
RimWellLogFile* firstWellLogFileMatchingChannelName( const QString& channelName ) const;
|
2013-05-16 12:59:35 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void setFormationsGeometry( cvf::ref<RigWellPathFormations> wellPathFormations );
|
|
|
|
|
bool readWellPathFormationsFile( QString* errorMessage, RifWellPathFormationsImporter* wellPathFormationsImporter );
|
|
|
|
|
bool reloadWellPathFormationsFile( QString* errorMessage, RifWellPathFormationsImporter* wellPathFormationsImporter );
|
|
|
|
|
bool hasFormations() const;
|
|
|
|
|
const RigWellPathFormations* formationsGeometry() const;
|
2013-05-16 12:59:35 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void add3dWellLogCurve( Rim3dWellLogCurve* rim3dWellLogCurve );
|
|
|
|
|
Rim3dWellLogCurveCollection* rim3dWellLogCurveCollection() const;
|
2018-03-07 11:32:24 +01:00
|
|
|
|
2021-02-26 14:27:59 +01:00
|
|
|
std::vector<const RimWellPathComponentInterface*> allCompletionsRecursively() const;
|
|
|
|
|
const RimWellPathCompletions* completions() const;
|
|
|
|
|
const RimWellPathCompletionSettings* completionSettings() const;
|
|
|
|
|
RimWellPathCompletionSettings* completionSettings();
|
2021-04-20 15:35:20 +02:00
|
|
|
RimMswCompletionParameters* mswCompletionParameters();
|
|
|
|
|
const RimMswCompletionParameters* mswCompletionParameters() const;
|
2021-02-26 14:27:59 +01:00
|
|
|
|
2018-10-10 11:10:56 +02:00
|
|
|
RimFishbonesCollection* fishbonesCollection();
|
|
|
|
|
const RimFishbonesCollection* fishbonesCollection() const;
|
|
|
|
|
RimPerforationCollection* perforationIntervalCollection();
|
|
|
|
|
const RimPerforationCollection* perforationIntervalCollection() const;
|
|
|
|
|
RimWellPathFractureCollection* fractureCollection();
|
|
|
|
|
const RimWellPathFractureCollection* fractureCollection() const;
|
2020-11-04 13:46:17 +01:00
|
|
|
RimStimPlanModelCollection* stimPlanModelCollection();
|
|
|
|
|
const RimStimPlanModelCollection* stimPlanModelCollection() const;
|
2018-10-10 11:10:56 +02:00
|
|
|
RimWellPathAttributeCollection* attributeCollection();
|
|
|
|
|
const RimWellPathAttributeCollection* attributeCollection() const;
|
2021-09-09 17:34:27 +02:00
|
|
|
RimWellIASettingsCollection* wellIASettingsCollection();
|
2015-09-14 16:33:28 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
bool showWellPathLabel() const;
|
|
|
|
|
bool showWellPath() const;
|
2017-05-22 18:11:03 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
cvf::Color3f wellPathColor() const;
|
|
|
|
|
void setWellPathColor( const cvf::Color3f& color );
|
2013-10-24 09:50:16 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
double combinedScaleFactor() const;
|
|
|
|
|
double wellPathRadius( double characteristicCellSize ) const;
|
|
|
|
|
double wellPathRadiusScaleFactor() const;
|
2018-10-11 16:03:49 +02:00
|
|
|
|
|
|
|
|
// RimWellPathComponentInterface overrides
|
2019-09-06 10:40:57 +02:00
|
|
|
bool isEnabled() const override;
|
|
|
|
|
RiaDefines::WellPathComponentType componentType() const override;
|
|
|
|
|
QString componentLabel() const override;
|
|
|
|
|
QString componentTypeLabel() const override;
|
|
|
|
|
cvf::Color3f defaultComponentColor() const override;
|
2021-06-28 13:10:57 +02:00
|
|
|
void applyOffset( double offsetMD ) override;
|
2013-05-16 12:59:35 +02:00
|
|
|
|
2020-05-18 16:02:27 +02:00
|
|
|
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray,
|
|
|
|
|
std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
|
|
|
|
|
2021-04-13 07:22:56 +02:00
|
|
|
bool isTopLevelWellPath() const;
|
|
|
|
|
bool isMultiLateralWellPath() const;
|
|
|
|
|
RimWellPath* topLevelWellPath();
|
|
|
|
|
const RimWellPath* topLevelWellPath() const;
|
2021-05-27 11:44:26 +02:00
|
|
|
std::vector<RimWellPath*> allWellPathLaterals() const;
|
2021-08-13 16:48:33 +02:00
|
|
|
std::vector<RimWellPath*> wellPathLaterals() const;
|
2021-04-13 07:22:56 +02:00
|
|
|
|
|
|
|
|
RimWellPathTieIn* wellPathTieIn() const;
|
|
|
|
|
void connectWellPaths( RimWellPath* childWell, double tieInMeasuredDepth );
|
2021-02-26 14:27:59 +01:00
|
|
|
|
2018-06-18 17:13:30 +02:00
|
|
|
protected:
|
|
|
|
|
// Override PdmObject
|
2017-11-17 15:35:07 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmFieldHandle* userDescriptionField() override;
|
|
|
|
|
caf::PdmFieldHandle* objectToggleField() override;
|
2022-05-20 15:07:48 +02:00
|
|
|
bool isDeletable() const override;
|
2018-06-18 17:13:30 +02:00
|
|
|
|
2020-02-12 11:43:15 +01:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
2022-05-29 13:01:27 +02:00
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
2021-02-26 14:27:59 +01:00
|
|
|
void initAfterRead() override;
|
2019-09-06 10:40:57 +02:00
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
|
|
|
|
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
|
2021-05-10 15:12:29 +02:00
|
|
|
void defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
2017-10-11 13:52:29 +02:00
|
|
|
|
2021-02-26 14:27:59 +01:00
|
|
|
static void copyCompletionSettings( RimWellPath* from, RimWellPath* to );
|
|
|
|
|
|
2018-06-18 17:13:30 +02:00
|
|
|
// Fields
|
2018-06-22 15:32:10 +02:00
|
|
|
protected:
|
2020-02-06 16:18:50 +01:00
|
|
|
caf::PdmProxyValueField<double> m_airGap;
|
|
|
|
|
caf::PdmProxyValueField<double> m_datumElevation;
|
|
|
|
|
caf::PdmField<QString> m_name;
|
2018-06-18 17:13:30 +02:00
|
|
|
|
2018-07-04 17:01:40 +02:00
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
caf::PdmField<QString> m_simWellName;
|
|
|
|
|
caf::PdmField<int> m_branchIndex;
|
2018-06-18 17:13:30 +02:00
|
|
|
|
2021-01-21 12:58:46 +01:00
|
|
|
caf::PdmField<caf::AppEnum<RiaDefines::EclipseUnitSystem>> m_unitSystem;
|
2019-09-06 10:40:57 +02:00
|
|
|
|
2019-12-11 08:23:37 +01:00
|
|
|
caf::PdmField<caf::FilePath> m_wellPathFormationFilePath;
|
|
|
|
|
caf::PdmField<QString> m_formationKeyInFile;
|
2019-09-06 10:40:57 +02:00
|
|
|
|
|
|
|
|
caf::PdmField<bool> m_showWellPath;
|
|
|
|
|
caf::PdmField<bool> m_showWellPathLabel;
|
|
|
|
|
|
|
|
|
|
caf::PdmField<double> m_wellPathRadiusScaleFactor;
|
|
|
|
|
caf::PdmField<cvf::Color3f> m_wellPathColor;
|
|
|
|
|
|
2018-08-06 07:52:02 +02:00
|
|
|
caf::PdmChildArrayField<RimWellLogFile*> m_wellLogFiles;
|
|
|
|
|
caf::PdmChildField<Rim3dWellLogCurveCollection*> m_3dWellLogCurves;
|
2021-02-26 14:27:59 +01:00
|
|
|
caf::PdmChildField<RimWellPathCompletionSettings*> m_completionSettings;
|
2018-08-06 07:52:02 +02:00
|
|
|
caf::PdmChildField<RimWellPathCompletions*> m_completions;
|
|
|
|
|
caf::PdmChildField<RimWellPathAttributeCollection*> m_wellPathAttributes;
|
2021-09-09 17:34:27 +02:00
|
|
|
caf::PdmChildField<RimWellIASettingsCollection*> m_wellIASettingsCollection;
|
2018-06-18 17:13:30 +02:00
|
|
|
|
2021-04-13 07:22:56 +02:00
|
|
|
caf::PdmChildField<RimWellPathTieIn*> m_wellPathTieIn;
|
|
|
|
|
|
2018-06-22 15:32:10 +02:00
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
static size_t simulationWellBranchCount( const QString& simWellName );
|
2021-05-27 11:44:26 +02:00
|
|
|
void wellPathLateralsRecursively( std::vector<RimWellPath*>& wellPathLaterals ) const;
|
2018-06-22 15:32:10 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// Geometry and data
|
2020-10-06 12:37:16 +02:00
|
|
|
cvf::ref<RigWellPath> m_wellPathGeometry;
|
2019-09-06 10:40:57 +02:00
|
|
|
cvf::ref<RigWellPathFormations> m_wellPathFormations;
|
2013-05-16 12:59:35 +02:00
|
|
|
};
|