mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2553 Move RigWellResultPoint into separate file
This commit is contained in:
parent
436420b648
commit
c7fbc99c9d
@ -63,6 +63,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigWellPathFormations.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigStimPlanFractureDefinition.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigFractureGrid.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigFractureCell.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellResultPoint.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryTools.h
|
||||
)
|
||||
|
||||
@ -126,6 +127,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RigWellPathFormations.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigStimPlanFractureDefinition.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigFractureGrid.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigFractureCell.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellResultPoint.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryTools.cpp
|
||||
)
|
||||
|
||||
|
@ -22,6 +22,14 @@
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigSimWellData::RigSimWellData()
|
||||
: m_isMultiSegmentWell(false)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RigWellResultPoint.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfMath.h"
|
||||
@ -27,162 +29,13 @@
|
||||
|
||||
#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() :
|
||||
m_gridIndex(cvf::UNDEFINED_SIZE_T),
|
||||
m_gridCellIndex(cvf::UNDEFINED_SIZE_T),
|
||||
m_isOpen(false),
|
||||
m_ertBranchId(-1),
|
||||
m_ertSegmentId(-1),
|
||||
m_bottomPosition(cvf::Vec3d::UNDEFINED),
|
||||
m_flowRate(0.0),
|
||||
m_oilRate(0.0),
|
||||
m_gasRate(0.0),
|
||||
m_waterRate(0.0)
|
||||
{ }
|
||||
|
||||
bool isPointValid() const
|
||||
{
|
||||
return m_bottomPosition != cvf::Vec3d::UNDEFINED;
|
||||
}
|
||||
|
||||
bool isCell() const
|
||||
{
|
||||
return m_gridCellIndex != cvf::UNDEFINED_SIZE_T;
|
||||
}
|
||||
|
||||
bool isValid() const
|
||||
{
|
||||
return isCell() || isPointValid();
|
||||
}
|
||||
|
||||
double flowRate() const
|
||||
{
|
||||
if ( isCell() && m_isOpen)
|
||||
{
|
||||
return m_flowRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
double oilRate() const
|
||||
{
|
||||
if ( isCell() && m_isOpen)
|
||||
{
|
||||
return m_oilRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
double gasRate() const
|
||||
{
|
||||
if ( isCell() && m_isOpen)
|
||||
{
|
||||
return m_gasRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
double waterRate() const
|
||||
{
|
||||
if ( isCell() && m_isOpen)
|
||||
{
|
||||
return m_waterRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
bool isEqual(const RigWellResultPoint& other ) const
|
||||
{
|
||||
return ( m_gridIndex == other.m_gridIndex
|
||||
&& m_gridCellIndex == other.m_gridCellIndex
|
||||
&& m_isOpen == other.m_isOpen
|
||||
&& m_ertBranchId == other.m_ertBranchId
|
||||
&& m_ertSegmentId == other.m_ertSegmentId
|
||||
&& m_flowRate == other.m_flowRate);
|
||||
}
|
||||
|
||||
size_t m_gridIndex;
|
||||
size_t m_gridCellIndex; //< 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;
|
||||
|
||||
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 allign with oil and water.
|
||||
double m_waterRate; //< Surface water rate
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
/// 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:
|
||||
enum WellProductionType { PRODUCER, OIL_INJECTOR, GAS_INJECTOR, WATER_INJECTOR, UNDEFINED_PRODUCTION_TYPE };
|
||||
|
||||
public:
|
||||
RigWellResultFrame() :
|
||||
m_productionType(UNDEFINED_PRODUCTION_TYPE),
|
||||
m_isOpen(false)
|
||||
{ }
|
||||
|
||||
const RigWellResultPoint* findResultCell(size_t gridIndex, size_t gridCellIndex) const;
|
||||
|
||||
RigWellResultPoint wellHeadOrStartCell() const;
|
||||
WellProductionType m_productionType;
|
||||
bool m_isOpen;
|
||||
RigWellResultPoint m_wellHead;
|
||||
QDateTime m_timestamp;
|
||||
|
||||
std::vector<RigWellResultBranch> m_wellResultBranches;
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigSimWellData : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RigSimWellData() { m_isMultiSegmentWell = false; }
|
||||
RigSimWellData();
|
||||
|
||||
void setMultiSegmentWell(bool isMultiSegmentWell);
|
||||
bool isMultiSegmentWell() const;
|
||||
|
146
ApplicationCode/ReservoirDataModel/RigWellResultPoint.cpp
Normal file
146
ApplicationCode/ReservoirDataModel/RigWellResultPoint.cpp
Normal file
@ -0,0 +1,146 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigWellResultPoint.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigWellResultPoint::RigWellResultPoint()
|
||||
: m_gridIndex(cvf::UNDEFINED_SIZE_T)
|
||||
, m_gridCellIndex(cvf::UNDEFINED_SIZE_T)
|
||||
, m_isOpen(false)
|
||||
, m_ertBranchId(-1)
|
||||
, m_ertSegmentId(-1)
|
||||
, m_bottomPosition(cvf::Vec3d::UNDEFINED)
|
||||
, m_flowRate(0.0)
|
||||
, m_oilRate(0.0)
|
||||
, m_gasRate(0.0)
|
||||
, m_waterRate(0.0)
|
||||
, m_connectionFactor(0.0)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigWellResultPoint::isPointValid() const
|
||||
{
|
||||
return m_bottomPosition != cvf::Vec3d::UNDEFINED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigWellResultPoint::isCell() const
|
||||
{
|
||||
return m_gridCellIndex != cvf::UNDEFINED_SIZE_T;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigWellResultPoint::isValid() const
|
||||
{
|
||||
return isCell() || isPointValid();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigWellResultPoint::isEqual(const RigWellResultPoint& other) const
|
||||
{
|
||||
return ( m_gridIndex == other.m_gridIndex
|
||||
&& m_gridCellIndex == other.m_gridCellIndex
|
||||
&& m_isOpen == other.m_isOpen
|
||||
&& m_ertBranchId == other.m_ertBranchId
|
||||
&& m_ertSegmentId == other.m_ertSegmentId
|
||||
&& m_flowRate == other.m_flowRate
|
||||
&& m_oilRate == other.m_oilRate
|
||||
&& m_gasRate == other.m_gasRate
|
||||
&& m_waterRate == other.m_waterRate);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigWellResultPoint::flowRate() const
|
||||
{
|
||||
if (isCell() && m_isOpen)
|
||||
{
|
||||
return m_flowRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigWellResultPoint::oilRate() const
|
||||
{
|
||||
if (isCell() && m_isOpen)
|
||||
{
|
||||
return m_oilRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigWellResultPoint::gasRate() const
|
||||
{
|
||||
if (isCell() && m_isOpen)
|
||||
{
|
||||
return m_gasRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigWellResultPoint::waterRate() const
|
||||
{
|
||||
if (isCell() && m_isOpen)
|
||||
{
|
||||
return m_waterRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigWellResultPoint::connectionFactor() const
|
||||
{
|
||||
return m_connectionFactor;
|
||||
}
|
||||
|
114
ApplicationCode/ReservoirDataModel/RigWellResultPoint.h
Normal file
114
ApplicationCode/ReservoirDataModel/RigWellResultPoint.h
Normal file
@ -0,0 +1,114 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "cvfBase.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();
|
||||
|
||||
bool isPointValid() const;
|
||||
bool isCell() const;
|
||||
bool isValid() const;
|
||||
bool isEqual(const RigWellResultPoint& other) const;
|
||||
|
||||
double flowRate() const;
|
||||
double oilRate() const;
|
||||
double gasRate() const;
|
||||
double waterRate() const;
|
||||
double connectionFactor() const;
|
||||
|
||||
size_t m_gridIndex;
|
||||
size_t m_gridCellIndex; //< 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;
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
/// 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:
|
||||
enum WellProductionType
|
||||
{
|
||||
PRODUCER,
|
||||
OIL_INJECTOR,
|
||||
GAS_INJECTOR,
|
||||
WATER_INJECTOR,
|
||||
UNDEFINED_PRODUCTION_TYPE
|
||||
};
|
||||
|
||||
public:
|
||||
RigWellResultFrame()
|
||||
: m_productionType(UNDEFINED_PRODUCTION_TYPE)
|
||||
, m_isOpen(false)
|
||||
{
|
||||
}
|
||||
|
||||
const RigWellResultPoint* findResultCell(size_t gridIndex, size_t gridCellIndex) const;
|
||||
|
||||
RigWellResultPoint wellHeadOrStartCell() const;
|
||||
WellProductionType m_productionType;
|
||||
bool m_isOpen;
|
||||
RigWellResultPoint m_wellHead;
|
||||
QDateTime m_timestamp;
|
||||
|
||||
std::vector<RigWellResultBranch> m_wellResultBranches;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user