///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2017 Statoil ASA // // 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. // // 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. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RiaEclipseUnitTools.h" #include "Rim3dPropertiesInterface.h" #include "RimCheckableNamedObject.h" #include "RimFishbonesPipeProperties.h" #include "RimWellPathComponentInterface.h" #include "cvfColor3.h" #include "cvfVector3.h" // Include to make Pdm work for cvf::Color #include "cafPdmChildField.h" #include "cafPdmFieldCvfColor.h" #include "cafPdmProxyValueField.h" #include #include class RigFisbonesGeometry; class RimMultipleValveLocations; //================================================================================================== /// /// //================================================================================================== struct SubLateralIndex { size_t subIndex; std::vector lateralIndices; }; //================================================================================================== /// /// //================================================================================================== class RimFishbonesMultipleSubs : public caf::PdmObject, public Rim3dPropertiesInterface, public RimWellPathComponentInterface { CAF_PDM_HEADER_INIT; public: enum LocationType { FB_SUB_COUNT_END, FB_SUB_SPACING_END, FB_SUB_USER_DEFINED, FB_SUB_UNDEFINED }; enum LateralsOrientationType { FB_LATERAL_ORIENTATION_FIXED, FB_LATERAL_ORIENTATION_RANDOM }; public: RimFishbonesMultipleSubs(); ~RimFishbonesMultipleSubs() override; bool isActive() const; QString generatedName() const; void setMeasuredDepthAndCount( double startMD, double spacing, int subCount ); double measuredDepth( size_t subIndex ) const; double rotationAngle( size_t subIndex ) const; double exitAngle() const; double buildAngle() const; double tubingDiameter( RiaEclipseUnitTools::UnitSystem unitSystem ) const; double holeDiameter( RiaEclipseUnitTools::UnitSystem unitSystem ) const { return m_pipeProperties()->holeDiameter( unitSystem ); } double effectiveDiameter( RiaEclipseUnitTools::UnitSystem unitSystem ) const; double skinFactor() const { return m_pipeProperties()->skinFactor(); } double openHoleRoughnessFactor( RiaEclipseUnitTools::UnitSystem unitSystem ) const; double icdOrificeDiameter( RiaEclipseUnitTools::UnitSystem unitSystem ) const; double icdFlowCoefficient() const; size_t icdCount() const; std::vector lateralLengths() const; void geometryUpdated(); const std::vector& installedLateralIndices() const { return m_subLateralIndices; }; std::vector coordsForLateral( size_t subIndex, size_t lateralIndex ) const; std::vector> coordsAndMDForLateral( size_t subIndex, size_t lateralIndex ) const; void recomputeLateralLocations(); void setUnitSystemSpecificDefaults(); // Override from Rim3dPropertiesInterface cvf::BoundingBox boundingBoxInDomainCoords() const override; // Overrides from RimWellPathCompletionsInterface bool isEnabled() const override; RiaDefines::WellPathComponentType componentType() const override; QString componentLabel() const override; QString componentTypeLabel() const override; cvf::Color3f defaultComponentColor() const override; double startMD() const override; double endMD() const override; public: caf::PdmField fishbonesColor; protected: void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; caf::PdmFieldHandle* userDescriptionField() override; caf::PdmFieldHandle* objectToggleField() override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void initAfterRead() override; private: void computeRangesAndLocations(); void computeRotationAngles(); void computeSubLateralIndices(); static int randomValueFromRange( int min, int max ); void initialiseObsoleteFields(); void initValveLocationFromLegacyData(); private: caf::PdmField m_isActive; caf::PdmProxyValueField m_name; caf::PdmField m_lateralCountPerSub; caf::PdmField m_lateralLength; caf::PdmField m_lateralExitAngle; caf::PdmField m_lateralBuildAngle; caf::PdmField m_lateralTubingDiameter; caf::PdmField m_lateralOpenHoleRoghnessFactor; caf::PdmField m_lateralTubingRoghnessFactor; caf::PdmField m_lateralInstallSuccessFraction; caf::PdmField m_icdCount; caf::PdmField m_icdOrificeDiameter; caf::PdmField m_icdFlowCoefficient; caf::PdmChildField m_valveLocations; caf::PdmField> m_subsOrientationMode; caf::PdmField> m_installationRotationAngles; caf::PdmField m_fixedInstallationRotationAngle; caf::PdmChildField m_pipeProperties; caf::PdmField m_randomSeed; std::unique_ptr m_rigFishbonesGeometry; std::vector m_subLateralIndices; // Moved to RimMultipleValveLocations caf::PdmField> m_subsLocationMode_OBSOLETE; caf::PdmField m_rangeStart_OBSOLETE; caf::PdmField m_rangeEnd_OBSOLETE; caf::PdmField m_rangeSubSpacing_OBSOLETE; caf::PdmField m_rangeSubCount_OBSOLETE; caf::PdmField> m_locationOfSubs_OBSOLETE; // Given in measured depth };