Files
ResInsight/ApplicationLibCode/ReservoirDataModel/RigWellResultPoint.h
Magne Sjaastad d47d4060cc Add valve visualization to MSW wells
* Refactor geo generator
* Add valve visualization to segments that are connected to a valve
2023-03-02 13:06:38 +01:00

136 lines
4.9 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
//
// 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 "RiaDefines.h"
#include "cvfVector3.h"
#include <QDateTime>
#include <vector>
//==================================================================================================
/// Stores the info on a significant point in the well. Either a well-to-grid connection, or the
/// bottom position of a connection less well-segment
//==================================================================================================
struct RigWellResultPoint
{
RigWellResultPoint();
void setGridIndex( size_t gridIndex );
void setGridCellIndex( size_t cellIndex );
void setIsOpen( bool isOpen );
void setFlowData( double flowRate, double oilRate, double gasRate, double waterRate );
void setConnectionFactor( double connectionFactor );
void setSegmentData( int branchId, int segmentId );
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;
double gasRate() const;
double waterRate() const;
double connectionFactor() const;
void clearAllFlow();
size_t gridIndex() const;
size_t cellIndex() const;
int branchId() const;
int segmentId() const;
int outletBranchId() const;
int outletSegmentId() const;
cvf::Vec3d bottomPosition() const;
private:
size_t m_gridIndex;
size_t m_cellIndex; //< Index to cell which is included in the well
bool m_isOpen; //< Marks the well as open or closed as of Eclipse simulation
int m_ertBranchId;
int m_ertSegmentId;
int m_ertOutletBranchId;
int m_ertOutletSegmentId;
cvf::Vec3d m_bottomPosition; //< The estimated bottom position of the well segment, when we have no grid cell
// connections for the segment.
double m_flowRate; //< Total reservoir rate
double m_oilRate; //< Surface oil rate
double m_gasRate; //< Surface gas rate For Field-unit, converted to [stb/day] to align with oil and water.
double m_waterRate; //< Surface water rate
double m_connectionFactor;
bool m_isConnectedToValve;
};
//==================================================================================================
/// This class contains the connection information from and including a splitpoint to the end of
/// that particular branch.
//==================================================================================================
struct RigWellResultBranch
{
RigWellResultBranch()
: m_ertBranchId( -1 )
{
}
int m_ertBranchId;
std::vector<RigWellResultPoint> m_branchResultPoints;
};
//==================================================================================================
/// This class contains the well information for one timestep.
/// The main content is the vector of RigWellResultBranch which contains all the simple pipe
/// sections that make up the well
//==================================================================================================
class RigWellResultFrame
{
public:
RigWellResultFrame()
: m_productionType( RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
, m_isOpen( false )
{
}
const RigWellResultPoint* findResultCellWellHeadIncluded( size_t gridIndex, size_t gridCellIndex ) const;
const RigWellResultPoint* findResultCellWellHeadExcluded( size_t gridIndex, size_t gridCellIndex ) const;
RigWellResultPoint wellHeadOrStartCell() const;
RiaDefines::WellProductionType m_productionType;
bool m_isOpen;
RigWellResultPoint m_wellHead;
QDateTime m_timestamp;
std::vector<RigWellResultBranch> m_wellResultBranches;
};
using SimulationWellCellBranch = std::pair<std::vector<cvf::Vec3d>, std::vector<RigWellResultPoint>>;