Files
ResInsight/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletionSettings.h
T
Kristian Bendiksen c56e921160 #14958 Sim Events: Move PRESSURE_COMPONENTS to WELSPECS
Move Pressure Drop and Length and Depth from the segment collection to
the well path completion settings. PRESSURE_COMPONENTS is now a dated
WELSPECS attribute used for the WELSEGS header at export, and is
rejected on SEGMENT events.
2026-10-19 09:28:29 +02:00

160 lines
5.2 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- 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 "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include <QRegularExpression>
#include <optional>
class RimMswCompletionParameters;
class RimWellPathCompletionsLegacy;
class RimWellPathCompletionSettings : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
enum WellType
{
OIL,
GAS,
WATER,
LIQUID
};
using WellTypeEnum = caf::AppEnum<WellType>;
enum GasInflowEquation
{
STANDARD_EQ,
RUSSELL_GOODRICH,
DRY_GAS_PSEUDO_PRESSURE,
GENERALIZED_PSEUDO_PRESSURE
};
using GasInflowEnum = caf::AppEnum<GasInflowEquation>;
enum AutomaticWellShutIn
{
ISOLATE_FROM_FORMATION,
STOP_ABOVE_FORMATION
};
using AutomaticWellShutInEnum = caf::AppEnum<AutomaticWellShutIn>;
enum HydrostaticDensity
{
SEGMENTED,
AVERAGED
};
using HydrostaticDensityEnum = caf::AppEnum<HydrostaticDensity>;
enum class PressureDropType
{
HYDROSTATIC,
HYDROSTATIC_FRICTION,
HYDROSTATIC_FRICTION_ACCELERATION
};
using PressureDropEnum = caf::AppEnum<PressureDropType>;
enum class LengthAndDepthType
{
ABS,
INC
};
using LengthAndDepthEnum = caf::AppEnum<LengthAndDepthType>;
public:
RimWellPathCompletionSettings();
RimWellPathCompletionSettings( const RimWellPathCompletionSettings& rhs );
RimWellPathCompletionSettings& operator=( const RimWellPathCompletionSettings& rhs );
QString groupName() const;
QString wellName() const;
WellType wellType() const;
bool allowWellCrossFlow() const;
PressureDropEnum pressureDrop() const;
LengthAndDepthEnum lengthAndDepth() const;
void setGroupName( const QString& name );
void setReferenceDepth( std::optional<double> depth );
void setWellType( WellType wellType );
void setAllowWellCrossFlow( bool allowCrossFlow );
void setPressureDrop( PressureDropType pressureDropType );
void setLengthAndDepth( LengthAndDepthType lengthAndDepthType );
void setWellNameForExport( const QString& name );
void updateWellPathNameHasChanged( const QString& newWellPathName, const QString& previousWellPathName );
QString wellNameForExport() const;
QString groupNameForExport() const;
QString referenceDepthForExport() const;
QString wellTypeNameForExport() const;
QString drainageRadiusForExport() const;
QString gasInflowEquationForExport() const;
QString automaticWellShutInForExport() const;
QString allowWellCrossFlowForExport() const;
QString wellBoreFluidPVTForExport() const;
QString hydrostaticDensityForExport() const;
QString fluidInPlaceRegionForExport() const;
int wellBoreFluidPVT() const;
int fluidInPlaceRegion() const;
std::optional<double> referenceDepth() const;
std::optional<double> drainageRadius() const;
static QRegularExpression wellNameForExportRegExp();
RimMswCompletionParameters* mswCompletionParameters() const;
void importLegacyMswData( const RimMswCompletionParameters* legacyParameters );
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void initAfterRead() override;
private:
QString formatStringForExport( const QString& text, const QString& defaultText = "" ) const;
private:
friend class RimWellPathCompletions;
caf::PdmField<QString> m_wellNameForExport;
caf::PdmField<QString> m_groupName;
caf::PdmField<std::optional<double>> m_referenceDepth;
caf::PdmField<std::optional<double>> m_drainageRadius;
caf::PdmField<WellTypeEnum> m_preferredFluidPhase;
caf::PdmField<GasInflowEnum> m_gasInflowEquation;
caf::PdmField<AutomaticWellShutInEnum> m_automaticWellShutIn;
caf::PdmField<bool> m_allowWellCrossFlow;
caf::PdmField<int> m_wellBoreFluidPVTTable;
caf::PdmField<HydrostaticDensityEnum> m_hydrostaticDensity;
caf::PdmField<int> m_fluidInPlaceRegion;
caf::PdmField<PressureDropEnum> m_pressureDrop;
caf::PdmField<LengthAndDepthEnum> m_lengthAndDepth;
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters;
// OBSOLETE fields - kept for backward compatibility when reading old files
caf::PdmField<QString> m_referenceDepth_OBSOLETE;
caf::PdmField<QString> m_drainageRadiusForPI_OBSOLETE;
};