///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #include "RimNonDarcyPerforationParameters.h" #include "RimWellPath.h" #include "cafPdmUiObjectEditorHandle.h" #include namespace caf { template <> void caf::AppEnum::setUp() { addItem( RimNonDarcyPerforationParameters::NON_DARCY_NONE, "None", "None" ); addItem( RimNonDarcyPerforationParameters::NON_DARCY_COMPUTED, "Computed", "Compute D-factor" ); addItem( RimNonDarcyPerforationParameters::NON_DARCY_USER_DEFINED, "UserDefined", "User Defined D-factor" ); setDefault( RimNonDarcyPerforationParameters::NON_DARCY_NONE ); } } // namespace caf CAF_PDM_SOURCE_INIT( RimNonDarcyPerforationParameters, "RimNonDarcyPerforationParameters" ); //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- RimNonDarcyPerforationParameters::RimNonDarcyPerforationParameters() { CAF_PDM_InitObject( "NonDarcyPerforationParameters", ":/CompletionsSymbol16x16.png", "", "" ); CAF_PDM_InitFieldNoDefault( &m_nonDarcyFlowType, "NonDarcyFlowType", "Non-Darcy Flow", "", "", "" ); CAF_PDM_InitField( &m_userDefinedDFactor, "UserDefinedDFactor", 1.0, "D Factor", "", "", "" ); CAF_PDM_InitField( &m_gridPermeabilityScalingFactor, "GridPermeabilityScalingFactor", 1.0, "Grid Permeability Scaling Factor (Kr) [0..1]", "", "", "" ); CAF_PDM_InitField( &m_wellRadius, "WellRadius", 0.108, "Well Radius (rw) [m]", "", "", "" ); CAF_PDM_InitField( &m_relativeGasDensity, "RelativeGasDensity", 0.8, "Relative Gas Density (γ)", "", "Relative density of gas at surface conditions with respect to air at STP", "" ); CAF_PDM_InitField( &m_gasViscosity, "GasViscosity", 0.02, "Gas Viscosity (μ) [cP]", "", "Gas viscosity at bottom hole pressure", "" ); CAF_PDM_InitField( &m_inertialCoefficientBeta0, "InertialCoefficientBeta0", 883.90, "Inertial Coefficient (β0) [Forch. unit]", "", "", "" ); CAF_PDM_InitField( &m_permeabilityScalingFactor, "PermeabilityScalingFactor", -1.1045, "Permeability Scaling Factor (B)", "", "", "" ); CAF_PDM_InitField( &m_porosityScalingFactor, "PorosityScalingFactor", 0.0, "Porosity Scaling Factor (C)", "", "", "" ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- RimNonDarcyPerforationParameters::~RimNonDarcyPerforationParameters() { } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- RimNonDarcyPerforationParameters::NonDarcyFlowEnum RimNonDarcyPerforationParameters::nonDarcyFlowType() const { return m_nonDarcyFlowType(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RimNonDarcyPerforationParameters::userDefinedDFactor() const { return m_userDefinedDFactor; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RimNonDarcyPerforationParameters::gridPermeabilityScalingFactor() const { return m_gridPermeabilityScalingFactor; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RimNonDarcyPerforationParameters::wellRadius() const { return m_wellRadius; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RimNonDarcyPerforationParameters::relativeGasDensity() const { return m_relativeGasDensity; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RimNonDarcyPerforationParameters::gasViscosity() const { return m_gasViscosity; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RimNonDarcyPerforationParameters::inertialCoefficientBeta0() const { return m_inertialCoefficientBeta0; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RimNonDarcyPerforationParameters::permeabilityScalingFactor() const { return m_permeabilityScalingFactor; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RimNonDarcyPerforationParameters::porosityScalingFactor() const { return m_porosityScalingFactor; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimNonDarcyPerforationParameters::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) { if ( changedField == &m_nonDarcyFlowType ) { caf::PdmUiObjectEditorHandle::updateUiAllObjectEditors(); } } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimNonDarcyPerforationParameters::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) { auto nonDarcyFlowGroup = uiOrdering.addNewGroup( "Non-Darcy Flow" ); nonDarcyFlowGroup->add( &m_nonDarcyFlowType ); if ( m_nonDarcyFlowType == NON_DARCY_USER_DEFINED ) { nonDarcyFlowGroup->add( &m_userDefinedDFactor ); } else if ( m_nonDarcyFlowType == NON_DARCY_COMPUTED ) { { auto group = nonDarcyFlowGroup->addNewGroup( "Parameters" ); group->add( &m_gridPermeabilityScalingFactor ); group->add( &m_wellRadius ); group->add( &m_relativeGasDensity ); group->add( &m_gasViscosity ); } { auto group = nonDarcyFlowGroup->addNewGroup( "β Factor" ); group->add( &m_inertialCoefficientBeta0 ); group->add( &m_permeabilityScalingFactor ); group->add( &m_porosityScalingFactor ); } } uiOrdering.skipRemainingFields( true ); }