Work in progress

This commit is contained in:
jonjenssen committed 2025-08-15 12:54:41 +02:00
1 parent 559d15f04b
commit 431bf5d7ba
12 files changed
+409

No files matched your search

@@ -1,9 +1,13 @@
set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimCompletionData.h
${CMAKE_CURRENT_LIST_DIR}/RimWelspecsData.h
${CMAKE_CURRENT_LIST_DIR}/RimCompdatData.h
)
set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimCompletionData.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWelspecsData.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCompdatData.cpp
)
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
@@ -0,0 +1,52 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025 Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimCompdatData.h"
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmObjectScriptingCapability.h"
CAF_PDM_SOURCE_INIT( RimCompdatData, "Compdat" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCompdatData::RimCompdatData()
{
CAF_PDM_InitScriptableObject( "Compdat", ":/Well.png" );
CAF_PDM_InitScriptableFieldNoDefault( &m_wellname, "WellName", "Well Name" );
CAF_PDM_InitScriptableFieldNoDefault( &m_I, "GridI", "Grid I" );
CAF_PDM_InitScriptableFieldNoDefault( &m_J, "GridJ", "Grid J" );
CAF_PDM_InitScriptableFieldNoDefault( &m_upperK, "UpperK", "Upper K" );
CAF_PDM_InitScriptableFieldNoDefault( &m_lowerK, "LowerK", "Lower K" );
CAF_PDM_InitScriptableFieldNoDefault( &m_openShutFlag, "OpenShutFlag", "Open/Shut Flag" );
CAF_PDM_InitScriptableFieldNoDefault( &m_satTableNum, "SatTableNum", "Saturation Table Number" );
CAF_PDM_InitScriptableFieldNoDefault( &m_transmissibility, "Transmissibility", "Transmissibility" );
CAF_PDM_InitScriptableFieldNoDefault( &m_diameter, "Diameter", "Diameter" );
CAF_PDM_InitScriptableFieldNoDefault( &m_kh, "Kh", "Kh Factor" );
CAF_PDM_InitScriptableFieldNoDefault( &m_skinFactor, "SkinFactor", "Skin Factor" );
CAF_PDM_InitScriptableFieldNoDefault( &m_dFactor, "DFactor", "D Factor" );
CAF_PDM_InitScriptableFieldNoDefault( &m_direction, "Direction", "Direction" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCompdatData::~RimCompdatData()
{
}
@@ -0,0 +1,54 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025 Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include <optional>
#include <QString>
//==================================================================================================
///
///
//==================================================================================================
class RimCompdatData : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimCompdatData();
~RimCompdatData() override;
public:
caf::PdmField<QString> m_wellname;
caf::PdmField<int> m_I;
caf::PdmField<int> m_J;
caf::PdmField<int> m_upperK;
caf::PdmField<int> m_lowerK;
caf::PdmField<QString> m_openShutFlag;
caf::PdmField<std::optional<int>> m_satTableNum;
caf::PdmField<std::optional<double>> m_transmissibility;
caf::PdmField<std::optional<double>> m_diameter;
caf::PdmField<std::optional<double>> m_kh;
caf::PdmField<std::optional<double>> m_skinFactor;
caf::PdmField<std::optional<double>> m_dFactor;
caf::PdmField<std::optional<QString>> m_direction;
};
@@ -0,0 +1,45 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025 Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimCompletionData.h"
#include "RimCompdatData.h"
#include "RimWelspecsData.h"
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmObjectScriptingCapability.h"
CAF_PDM_SOURCE_INIT( RimCompletionData, "CompletionData" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCompletionData::RimCompletionData()
{
CAF_PDM_InitScriptableObject( "CompletionData", ":/Well.png" );
CAF_PDM_InitScriptableFieldNoDefault( &m_welspecs, "Welspecs", "Welspecs Data" );
CAF_PDM_InitScriptableFieldNoDefault( &m_compdat, "Compdat", "Compdat Data" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCompletionData::~RimCompletionData()
{
}
@@ -0,0 +1,42 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025 Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmField.h"
#include "cafPdmObject.h"
class RimWelspecsData;
class RimCompdatData;
//==================================================================================================
///
///
//==================================================================================================
class RimCompletionData : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimCompletionData();
~RimCompletionData() override;
private:
caf::PdmChildArrayField<RimWelspecsData*> m_welspecs;
caf::PdmChildArrayField<RimCompdatData*> m_compdat;
};
@@ -0,0 +1,53 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025 Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimWelspecsData.h"
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmObjectScriptingCapability.h"
CAF_PDM_SOURCE_INIT( RimWelspecsData, "Welspecs" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWelspecsData::RimWelspecsData()
{
CAF_PDM_InitScriptableObject( "Welspecs", ":/Well.png" );
CAF_PDM_InitScriptableFieldNoDefault( &m_wellname, "WellName", "Well Name" );
CAF_PDM_InitScriptableFieldNoDefault( &m_groupname, "GroupName", "Group Name" );
CAF_PDM_InitScriptableFieldNoDefault( &m_I, "WellI", "I" );
CAF_PDM_InitScriptableFieldNoDefault( &m_J, "WellJ", "J" );
CAF_PDM_InitScriptableFieldNoDefault( &m_bhpDepth, "BhpDepth", "BHP Depth" );
CAF_PDM_InitScriptableFieldNoDefault( &m_phase, "Phase", "Phase" );
CAF_PDM_InitScriptableFieldNoDefault( &m_drainageRadius, "DrainageRadius", "Drainage Radius" );
CAF_PDM_InitScriptableFieldNoDefault( &m_inflowEquation, "InflowEquation", "Inflow Equation" );
CAF_PDM_InitScriptableFieldNoDefault( &m_autoShutIn, "AutoShutIn", "Auto Shut In" );
CAF_PDM_InitScriptableFieldNoDefault( &m_crossFlow, "CrossFlow", "Cross Flow" );
CAF_PDM_InitScriptableFieldNoDefault( &m_pvtTableNum, "PvtTableNum", "PVT Table Number" );
CAF_PDM_InitScriptableFieldNoDefault( &m_hydrostaticDensCalc, "HydrostaticDensCalc", "Hydrostatic Density Calculation" );
CAF_PDM_InitScriptableFieldNoDefault( &m_fipRegion, "FipRegion", "FIP Region" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWelspecsData::~RimWelspecsData()
{
}
@@ -0,0 +1,54 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025 Equinor 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include <optional>
#include <QString>
//==================================================================================================
///
///
//==================================================================================================
class RimWelspecsData : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimWelspecsData();
~RimWelspecsData() override;
public:
caf::PdmField<QString> m_wellname;
caf::PdmField<QString> m_groupname;
caf::PdmField<int> m_I;
caf::PdmField<int> m_J;
caf::PdmField<std::optional<double>> m_bhpDepth;
caf::PdmField<QString> m_phase;
caf::PdmField<std::optional<double>> m_drainageRadius;
caf::PdmField<std::optional<QString>> m_inflowEquation;
caf::PdmField<std::optional<QString>> m_autoShutIn;
caf::PdmField<std::optional<QString>> m_crossFlow;
caf::PdmField<std::optional<int>> m_pvtTableNum;
caf::PdmField<std::optional<QString>> m_hydrostaticDensCalc;
caf::PdmField<std::optional<int>> m_fipRegion;
};
@@ -25,6 +25,7 @@
#include "Well/RigWellPath.h"
#include "Well/RigWellPathGeometryTools.h"
#include "CompletionData/RimCompletionData.h"
#include "RimExtrudedCurveIntersection.h"
#include "RimPlotCurve.h"
#include "RimProject.h"
@@ -286,3 +287,11 @@ void RimModeledWellPath::updateReferencePoint()
auto refPoint = topLevelModelledWell->geometryDefinition()->anchorPointXyz();
m_geometryDefinition->setReferencePointXyz( refPoint );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCompletionData* RimModeledWellPath::completionData()
{
return new RimCompletionData();
}
@@ -25,6 +25,7 @@
class RimWellPathTarget;
class RimWellPath;
class RimWellPathGeometryDef;
class RimCompletionData;
class RimModeledWellPath : public RimWellPath
{
@@ -42,6 +43,8 @@ public:
void updateTieInLocationFromParentWell();
void updateReferencePoint();
RimCompletionData* completionData();
private:
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
void onGeometryDefinitionChanged( const caf::SignalEmitter* emitter, bool fullUpdate );
@@ -18,6 +18,8 @@
#include "RimcWellPathCollection.h"
#include "CompletioNData/RimCompletionData.h"
#include "RimModeledWellPath.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
@@ -77,3 +79,56 @@ QString RimcWellPathCollection_importWellPath::classKeywordReturnedType() const
{
return RimWellPath::classKeywordStatic();
}
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellPathCollection, RimcWellPathCollection_wellCompletions, "WellCompletions" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimcWellPathCollection_wellCompletions::RimcWellPathCollection_wellCompletions( caf::PdmObjectHandle* self )
: caf::PdmObjectCreationMethod( self )
{
CAF_PDM_InitObject( "Well Completions" );
CAF_PDM_InitScriptableFieldNoDefault( &m_wellName, "WellName", "Name of Well" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::expected<caf::PdmObjectHandle*, QString> RimcWellPathCollection_wellCompletions::execute()
{
auto wellPathCollection = self<RimWellPathCollection>();
if ( !wellPathCollection )
{
return std::unexpected( QString( "Well path collection is missing. Cannot get completion data." ) );
}
if ( m_wellName().isEmpty() )
{
return std::unexpected( QString( "Well name is empty. Nothing to do." ) );
}
if ( auto wellPath = wellPathCollection->wellPathByName( m_wellName ) )
{
if ( auto modWellPath = dynamic_cast<RimModeledWellPath*>( wellPath ) )
{
if ( auto completionData = modWellPath->completionData() )
{
return completionData;
}
else
{
return std::unexpected( QString( "Well path '%1' does not have any completion data." ).arg( m_wellName ) );
}
}
}
return std::unexpected( QString( "Well path with name '%1' does not exist. Cannot get completion data." ).arg( m_wellName ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimcWellPathCollection_wellCompletions::classKeywordReturnedType() const
{
return RimCompletionData::classKeywordStatic();
}
@@ -40,3 +40,20 @@ public:
private:
caf::PdmField<QString> m_fileName;
};
//==================================================================================================
///
//==================================================================================================
class RimcWellPathCollection_wellCompletions : public caf::PdmObjectCreationMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcWellPathCollection_wellCompletions( caf::PdmObjectHandle* self );
std::expected<caf::PdmObjectHandle*, QString> execute() override;
QString classKeywordReturnedType() const override;
private:
caf::PdmField<QString> m_wellName;
};