Add valve visualization to MSW wells

* Refactor geo generator
* Add valve visualization to segments that are connected to a valve
This commit is contained in:
Magne Sjaastad
2023-03-02 13:06:38 +01:00
committed by GitHub
parent 8a2d9ec83e
commit d47d4060cc
16 changed files with 452 additions and 200 deletions
@@ -192,6 +192,14 @@ std::vector<SimulationWellCellBranch>
resPoint.setGridIndex( gridIndex );
resPoint.setGridCellIndex( cellIndex );
auto gridAndCellIndex = std::make_pair( gridIndex, cellIndex );
if ( std::find( wellBranch.m_gridCellsConnectedToValve.begin(),
wellBranch.m_gridCellsConnectedToValve.end(),
gridAndCellIndex ) != wellBranch.m_gridCellsConnectedToValve.end() )
{
resPoint.setIsConnectedToValve( true );
}
cellCenterCoords.push_back( pos );
cellCenterResultPoints.push_back( resPoint );
}
@@ -333,6 +341,7 @@ std::vector<RigMswCenterLineCalculator::WellBranch>
for ( const auto& [gridAndCellIndex, localOutputSegment] : branch.m_gridCellsConnectedToSegments )
{
longBranch.m_segmentsWithGridCells[outputSegment.outputSegmentId].push_back( gridAndCellIndex );
longBranch.m_gridCellsConnectedToValve.push_back( gridAndCellIndex );
}
}
}
@@ -50,6 +50,7 @@ private:
std::map<std::pair<size_t, size_t>, OutputSegment> m_gridCellsConnectedToSegments;
std::map<int, std::vector<std::pair<size_t, size_t>>> m_segmentsWithGridCells;
std::vector<std::pair<size_t, size_t>> m_gridCellsConnectedToValve;
bool containsGridCell( const std::pair<size_t, size_t>& candidateGridAndCellIndex ) const
{
@@ -35,6 +35,7 @@ RigWellResultPoint::RigWellResultPoint()
, m_gasRate( 0.0 )
, m_waterRate( 0.0 )
, m_connectionFactor( 0.0 )
, m_isConnectedToValve( false )
{
}
@@ -107,6 +108,14 @@ void RigWellResultPoint::setBottomPosition( const cvf::Vec3d& bottomPosition )
m_bottomPosition = bottomPosition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellResultPoint::setIsConnectedToValve( bool enable )
{
m_isConnectedToValve = true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -149,6 +158,14 @@ bool RigWellResultPoint::isEqual( const RigWellResultPoint& other ) const
m_oilRate == other.m_oilRate && m_gasRate == other.m_gasRate && m_waterRate == other.m_waterRate );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigWellResultPoint::isConnectedToValve() const
{
return m_isConnectedToValve;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -44,12 +44,14 @@ struct RigWellResultPoint
void setOutletSegmentData( int outletBranchId, int outletSegmentId );
void setBottomPosition( const cvf::Vec3d& bottomPosition );
void setIsConnectedToValve( bool enable );
bool isPointValid() const;
bool isCell() const;
bool isValid() const;
bool isOpen() const;
bool isEqual( const RigWellResultPoint& other ) const;
bool isConnectedToValve() const;
double flowRate() const;
double oilRate() const;
@@ -86,6 +88,7 @@ private:
double m_waterRate; //< Surface water rate
double m_connectionFactor;
bool m_isConnectedToValve;
};
//==================================================================================================