Rename Completion -> Connection
This commit is contained in:
@@ -73,7 +73,7 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/EclipseState/IOConfig/IOConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Runspec.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Completion.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Connection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/CompletionSet.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group.cpp
|
||||
@@ -178,7 +178,7 @@ if(ENABLE_ECL_INPUT)
|
||||
tests/parser/AquanconTests.cpp
|
||||
tests/parser/BoxTests.cpp
|
||||
tests/parser/ColumnSchemaTests.cpp
|
||||
tests/parser/CompletionTests.cpp
|
||||
tests/parser/ConnectionTests.cpp
|
||||
tests/parser/COMPSEGUnits.cpp
|
||||
tests/parser/CopyRegTests.cpp
|
||||
tests/parser/DeckTests.cpp
|
||||
@@ -453,7 +453,7 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Completion.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Connection.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef COMPLETIONSET_HPP_
|
||||
#define COMPLETIONSET_HPP_
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
|
||||
|
||||
namespace Opm {
|
||||
class EclipseGrid;
|
||||
@@ -30,18 +30,18 @@ namespace Opm {
|
||||
public:
|
||||
CompletionSet() = default;
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
CompletionSet( std::initializer_list< Completion > );
|
||||
CompletionSet( std::initializer_list< Connection > );
|
||||
CompletionSet(const CompletionSet& src, const EclipseGrid& grid);
|
||||
|
||||
using const_iterator = std::vector< Completion >::const_iterator;
|
||||
using const_iterator = std::vector< Connection >::const_iterator;
|
||||
|
||||
void add( Completion );
|
||||
void add( Connection );
|
||||
size_t size() const;
|
||||
const Completion& get(size_t index) const;
|
||||
const Completion& getFromIJK(const int i, const int j, const int k) const;
|
||||
const Connection& get(size_t index) const;
|
||||
const Connection& getFromIJK(const int i, const int j, const int k) const;
|
||||
|
||||
const_iterator begin() const { return this->m_completions.begin(); }
|
||||
const_iterator end() const { return this->m_completions.end(); }
|
||||
const_iterator begin() const { return this->m_connections.begin(); }
|
||||
const_iterator end() const { return this->m_connections.end(); }
|
||||
void filter(const EclipseGrid& grid);
|
||||
bool allCompletionsShut() const;
|
||||
/// Order completions irrespective of input order.
|
||||
@@ -62,7 +62,7 @@ namespace Opm {
|
||||
bool operator!=( const CompletionSet& ) const;
|
||||
|
||||
private:
|
||||
std::vector< Completion > m_completions;
|
||||
std::vector< Connection > m_connections;
|
||||
size_t findClosestCompletion(int oi, int oj, double oz, size_t start_pos);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -39,9 +39,9 @@ namespace Opm {
|
||||
class Eclipse3DProperties;
|
||||
class Schedule;
|
||||
|
||||
class Completion {
|
||||
class Connection {
|
||||
public:
|
||||
Completion(int i, int j , int k ,
|
||||
Connection(int i, int j , int k ,
|
||||
int complnum,
|
||||
double depth,
|
||||
WellCompletion::StateEnum state ,
|
||||
@@ -51,12 +51,12 @@ namespace Opm {
|
||||
const int satTableId,
|
||||
const WellCompletion::DirectionEnum direction = WellCompletion::DirectionEnum::Z);
|
||||
|
||||
Completion(const Completion&, WellCompletion::StateEnum newStatus);
|
||||
Completion(const Completion&, double wellPi);
|
||||
Completion(const Completion&, int complnum );
|
||||
Completion(const Completion& completion_initial, int segment_number, double center_depth);
|
||||
Connection(const Connection&, WellCompletion::StateEnum newStatus);
|
||||
Connection(const Connection&, double wellPi);
|
||||
Connection(const Connection&, int complnum );
|
||||
Connection(const Connection& connection_initial, int segment_number, double center_depth);
|
||||
|
||||
bool sameCoordinate(const Completion& other) const;
|
||||
bool sameCoordinate(const Connection& other) const;
|
||||
bool sameCoordinate(const int i, const int j, const int k) const;
|
||||
|
||||
int getI() const;
|
||||
@@ -78,7 +78,7 @@ namespace Opm {
|
||||
|
||||
WellCompletion::DirectionEnum getDirection() const;
|
||||
|
||||
static std::map< std::string, std::vector< Completion > >
|
||||
static std::map< std::string, std::vector< Connection > >
|
||||
fromCOMPDAT( const EclipseGrid& grid,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const DeckKeyword& compdatKeyword,
|
||||
@@ -86,8 +86,8 @@ namespace Opm {
|
||||
const ParseContext&,
|
||||
const Schedule&);
|
||||
|
||||
bool operator==( const Completion& ) const;
|
||||
bool operator!=( const Completion& ) const;
|
||||
bool operator==( const Connection& ) const;
|
||||
bool operator!=( const Connection& ) const;
|
||||
|
||||
private:
|
||||
int m_i, m_j, m_k;
|
||||
@@ -40,7 +40,7 @@ namespace Opm {
|
||||
|
||||
template< typename > class DynamicState;
|
||||
|
||||
class Completion;
|
||||
class COnnection;
|
||||
class CompletionSet;
|
||||
class Segment;
|
||||
class SegmentSet;
|
||||
@@ -94,7 +94,7 @@ namespace Opm {
|
||||
bool isInjector(size_t timeStep) const;
|
||||
void addWELSPECS(const DeckRecord& deckRecord);
|
||||
|
||||
void addCompletions(size_t time_step, const std::vector< Completion >& );
|
||||
void addCompletions(size_t time_step, const std::vector< Connection >& );
|
||||
void addCompletionSet(size_t time_step, CompletionSet );
|
||||
const CompletionSet& getCompletions(size_t timeStep) const;
|
||||
const CompletionSet& getCompletions() const;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp>
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
CompletionSet::CompletionSet( std::initializer_list< Completion > cs ) {
|
||||
CompletionSet::CompletionSet( std::initializer_list< Connection > cs ) {
|
||||
for( auto&& c : cs ) this->add( c );
|
||||
}
|
||||
|
||||
@@ -41,14 +41,14 @@ namespace Opm {
|
||||
}
|
||||
|
||||
size_t CompletionSet::size() const {
|
||||
return m_completions.size();
|
||||
return m_connections.size();
|
||||
}
|
||||
|
||||
const Completion& CompletionSet::get(size_t index) const {
|
||||
return this->m_completions.at( index );
|
||||
const Connection& CompletionSet::get(size_t index) const {
|
||||
return this->m_connections.at( index );
|
||||
}
|
||||
|
||||
const Completion& CompletionSet::getFromIJK(const int i, const int j, const int k) const {
|
||||
const Connection& CompletionSet::getFromIJK(const int i, const int j, const int k) const {
|
||||
for (size_t ic = 0; ic < size(); ++ic) {
|
||||
if (get(ic).sameCoordinate(i, j, k)) {
|
||||
return get(ic);
|
||||
@@ -58,31 +58,31 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
void CompletionSet::add( Completion completion ) {
|
||||
auto same = [&]( const Completion& c ) {
|
||||
void CompletionSet::add( Connection completion ) {
|
||||
auto same = [&]( const Connection& c ) {
|
||||
return c.sameCoordinate( completion );
|
||||
};
|
||||
|
||||
auto prev = std::find_if( this->m_completions.begin(),
|
||||
this->m_completions.end(),
|
||||
auto prev = std::find_if( this->m_connections.begin(),
|
||||
this->m_connections.end(),
|
||||
same );
|
||||
|
||||
if( prev != this->m_completions.end() ) {
|
||||
if( prev != this->m_connections.end() ) {
|
||||
// update the completion, but preserve it's number
|
||||
*prev = Completion( completion, prev->complnum() );
|
||||
*prev = Connection( completion, prev->complnum() );
|
||||
return;
|
||||
}
|
||||
|
||||
m_completions.emplace_back( completion );
|
||||
m_connections.emplace_back( completion );
|
||||
}
|
||||
|
||||
bool CompletionSet::allCompletionsShut( ) const {
|
||||
auto shut = []( const Completion& c ) {
|
||||
auto shut = []( const Connection& c ) {
|
||||
return c.getState() == WellCompletion::StateEnum::SHUT;
|
||||
};
|
||||
|
||||
return std::all_of( this->m_completions.begin(),
|
||||
this->m_completions.end(),
|
||||
return std::all_of( this->m_connections.begin(),
|
||||
this->m_connections.end(),
|
||||
shut );
|
||||
}
|
||||
|
||||
@@ -90,14 +90,14 @@ namespace Opm {
|
||||
|
||||
void CompletionSet::orderCompletions(size_t well_i, size_t well_j)
|
||||
{
|
||||
if (m_completions.empty()) {
|
||||
if (m_connections.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the first completion and swap it into the 0-position.
|
||||
const double surface_z = 0.0;
|
||||
size_t first_index = findClosestCompletion(well_i, well_j, surface_z, 0);
|
||||
std::swap(m_completions[first_index], m_completions[0]);
|
||||
std::swap(m_connections[first_index], m_connections[0]);
|
||||
|
||||
// Repeat for remaining completions.
|
||||
//
|
||||
@@ -105,13 +105,13 @@ namespace Opm {
|
||||
// O(n^2) algorithm. However, it should be acceptable since
|
||||
// the expected number of completions is fairly low (< 100).
|
||||
|
||||
if( this->m_completions.empty() ) return;
|
||||
if( this->m_connections.empty() ) return;
|
||||
|
||||
for (size_t pos = 1; pos < m_completions.size() - 1; ++pos) {
|
||||
const auto& prev = m_completions[pos - 1];
|
||||
for (size_t pos = 1; pos < m_connections.size() - 1; ++pos) {
|
||||
const auto& prev = m_connections[pos - 1];
|
||||
const double prevz = prev.getCenterDepth();
|
||||
size_t next_index = findClosestCompletion(prev.getI(), prev.getJ(), prevz, pos);
|
||||
std::swap(m_completions[next_index], m_completions[pos]);
|
||||
std::swap(m_connections[next_index], m_connections[pos]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,8 +122,8 @@ namespace Opm {
|
||||
size_t closest = std::numeric_limits<size_t>::max();
|
||||
int min_ijdist2 = std::numeric_limits<int>::max();
|
||||
double min_zdiff = std::numeric_limits<double>::max();
|
||||
for (size_t pos = start_pos; pos < m_completions.size(); ++pos) {
|
||||
const auto& completion = m_completions[ pos ];
|
||||
for (size_t pos = start_pos; pos < m_connections.size(); ++pos) {
|
||||
const auto& completion = m_connections[ pos ];
|
||||
|
||||
const double depth = completion.getCenterDepth();
|
||||
const int ci = completion.getI();
|
||||
@@ -156,10 +156,16 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
<<<<<<< HEAD:src/opm/parser/eclipse/EclipseState/Schedule/CompletionSet.cpp
|
||||
void CompletionSet::filter(const EclipseGrid& grid) {
|
||||
auto new_end = std::remove_if(m_completions.begin(),
|
||||
m_completions.end(),
|
||||
[&grid](const Completion& c) { return !grid.cellActive(c.getI(), c.getJ(), c.getK()); });
|
||||
m_completions.erase(new_end, m_completions.end());
|
||||
=======
|
||||
void ConnectionSet::filter(const EclipseGrid& grid) {
|
||||
auto new_end = std::remove_if(m_connections.begin(),
|
||||
m_connections.end(),
|
||||
>>>>>>> e36a653... fixup! Rename Completion -> Connection:src/opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.cpp
|
||||
[&grid](const Connection& c) { return !grid.cellActive(c.getI(), c.getJ(), c.getK()); });
|
||||
m_connections.erase(new_end, m_connections.end());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
Completion::Completion(int i, int j , int k ,
|
||||
Connection::Connection(int i, int j , int k ,
|
||||
int compnum,
|
||||
double depth,
|
||||
WellCompletion::StateEnum state ,
|
||||
@@ -57,14 +57,14 @@ namespace Opm {
|
||||
m_center_depth( depth )
|
||||
{}
|
||||
|
||||
Completion::Completion(const Completion& oldCompletion, WellCompletion::StateEnum newStatus ) :
|
||||
Completion( oldCompletion )
|
||||
Connection::Connection(const Connection& oldConnection, WellCompletion::StateEnum newStatus ) :
|
||||
Connection( oldConnection )
|
||||
{
|
||||
this->m_state = newStatus;
|
||||
}
|
||||
|
||||
Completion::Completion(const Completion& oldCompletion, double wellPi) :
|
||||
Completion( oldCompletion )
|
||||
Connection::Connection(const Connection& oldConnection, double wellPi) :
|
||||
Connection( oldConnection )
|
||||
{
|
||||
if( this->m_wellPi != 0 ) {
|
||||
this->m_wellPi *= wellPi;
|
||||
@@ -73,21 +73,21 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
Completion::Completion( const Completion& c, int num ) :
|
||||
Completion( c )
|
||||
Connection::Connection( const Connection& c, int num ) :
|
||||
Connection( c )
|
||||
{
|
||||
this->m_complnum = num;
|
||||
}
|
||||
|
||||
Completion::Completion(const Completion& completion_initial, int segment_number, double center_depth)
|
||||
: Completion(completion_initial)
|
||||
Connection::Connection(const Connection& connection_initial, int segment_number, double center_depth)
|
||||
: Connection(connection_initial)
|
||||
{
|
||||
assert(segment_number > 0);
|
||||
this->m_segment_number = segment_number;
|
||||
this->m_center_depth = center_depth;
|
||||
}
|
||||
|
||||
bool Completion::sameCoordinate(const Completion& other) const {
|
||||
bool Connection::sameCoordinate(const Connection& other) const {
|
||||
if ((m_i == other.m_i) &&
|
||||
(m_j == other.m_j) &&
|
||||
(m_k == other.m_k))
|
||||
@@ -96,7 +96,7 @@ namespace Opm {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Completion::sameCoordinate(const int i, const int j, const int k) const {
|
||||
bool Connection::sameCoordinate(const int i, const int j, const int k) const {
|
||||
if ((m_i == i) && (m_j == j) && (m_k == k)) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -107,19 +107,19 @@ namespace Opm {
|
||||
|
||||
/**
|
||||
This will break up one record and return a pair: <name ,
|
||||
[Completion1, Completion2, ... , CompletionN]>. The reason it
|
||||
[Connection1, Connection2, ... , ConnectionN]>. The reason it
|
||||
will return a list is that the 'K1 K2' structure is
|
||||
disentangled, and each completion is returned separately.
|
||||
*/
|
||||
|
||||
inline std::vector< Completion >
|
||||
inline std::vector< Connection >
|
||||
fromCOMPDAT( const EclipseGrid& grid,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const DeckRecord& compdatRecord,
|
||||
const Well& well,
|
||||
int prev_complnum ) {
|
||||
|
||||
std::vector< Completion > completions;
|
||||
std::vector< Connection > completions;
|
||||
|
||||
// We change from eclipse's 1 - n, to a 0 - n-1 solution
|
||||
// I and J can be defaulted with 0 or *, in which case they are fetched
|
||||
@@ -135,7 +135,7 @@ namespace Opm {
|
||||
int K1 = compdatRecord.getItem("K1").get< int >(0) - 1;
|
||||
int K2 = compdatRecord.getItem("K2").get< int >(0) - 1;
|
||||
WellCompletion::StateEnum state = WellCompletion::StateEnumFromString( compdatRecord.getItem("STATE").getTrimmedString(0) );
|
||||
Value<double> connectionTransmissibilityFactor("ConnectionTransmissibilityFactor");
|
||||
Value<double> connectionTransmissibilityFactor("CompletionTransmissibilityFactor");
|
||||
Value<double> diameter("Diameter");
|
||||
Value<double> skinFactor("SkinFactor");
|
||||
int satTableId;
|
||||
@@ -187,21 +187,21 @@ namespace Opm {
|
||||
Will return a map:
|
||||
|
||||
{
|
||||
"WELL1" : [ Completion1 , Completion2 , ... , CompletionN ],
|
||||
"WELL2" : [ Completion1 , Completion2 , ... , CompletionN ],
|
||||
"WELL1" : [ Connection1 , Connection2 , ... , ConnectionN ],
|
||||
"WELL2" : [ Connection1 , Connection2 , ... , ConnectionN ],
|
||||
...
|
||||
}
|
||||
*/
|
||||
|
||||
std::map< std::string, std::vector< Completion > >
|
||||
Completion::fromCOMPDAT( const EclipseGrid& grid ,
|
||||
std::map< std::string, std::vector< Connection > >
|
||||
Connection::fromCOMPDAT( const EclipseGrid& grid ,
|
||||
const Eclipse3DProperties& eclipseProperties,
|
||||
const DeckKeyword& compdatKeyword,
|
||||
const std::vector< const Well* >& wells,
|
||||
const ParseContext& parseContext,
|
||||
const Schedule& schedule) {
|
||||
|
||||
std::map< std::string, std::vector< Completion > > res;
|
||||
std::map< std::string, std::vector< Connection > > res;
|
||||
std::vector< int > prev_compls( wells.size(), 0 );
|
||||
|
||||
for( const auto& record : compdatKeyword ) {
|
||||
@@ -233,7 +233,7 @@ namespace Opm {
|
||||
return res;
|
||||
}
|
||||
|
||||
void Completion::fixDefaultIJ(int wellHeadI , int wellHeadJ) {
|
||||
void Connection::fixDefaultIJ(int wellHeadI , int wellHeadJ) {
|
||||
if (m_i < 0)
|
||||
m_i = wellHeadI;
|
||||
|
||||
@@ -241,82 +241,82 @@ namespace Opm {
|
||||
m_j = wellHeadJ;
|
||||
}
|
||||
|
||||
void Completion::shift_complnum( int shift ) {
|
||||
void Connection::shift_complnum( int shift ) {
|
||||
this->m_complnum += shift;
|
||||
}
|
||||
|
||||
int Completion::getI() const {
|
||||
int Connection::getI() const {
|
||||
return m_i;
|
||||
}
|
||||
|
||||
int Completion::getJ() const {
|
||||
int Connection::getJ() const {
|
||||
return m_j;
|
||||
}
|
||||
|
||||
int Completion::getK() const {
|
||||
int Connection::getK() const {
|
||||
return m_k;
|
||||
}
|
||||
|
||||
int Completion::complnum() const {
|
||||
int Connection::complnum() const {
|
||||
return this->m_complnum;
|
||||
}
|
||||
|
||||
WellCompletion::StateEnum Completion::getState() const {
|
||||
WellCompletion::StateEnum Connection::getState() const {
|
||||
return m_state;
|
||||
}
|
||||
|
||||
double Completion::getConnectionTransmissibilityFactor() const {
|
||||
double Connection::getConnectionTransmissibilityFactor() const {
|
||||
return m_connectionTransmissibilityFactor.getValue();
|
||||
}
|
||||
|
||||
double Completion::getDiameter() const {
|
||||
double Connection::getDiameter() const {
|
||||
return m_diameter.getValue();
|
||||
}
|
||||
|
||||
double Completion::getSkinFactor() const {
|
||||
double Connection::getSkinFactor() const {
|
||||
return m_skinFactor.getValue();
|
||||
}
|
||||
|
||||
int Completion::getSatTableId() const {
|
||||
int Connection::getSatTableId() const {
|
||||
return m_satTableId;
|
||||
}
|
||||
|
||||
const Value<double>& Completion::getConnectionTransmissibilityFactorAsValueObject() const {
|
||||
const Value<double>& Connection::getConnectionTransmissibilityFactorAsValueObject() const {
|
||||
return m_connectionTransmissibilityFactor;
|
||||
}
|
||||
|
||||
Value<double> Completion::getDiameterAsValueObject() const {
|
||||
Value<double> Connection::getDiameterAsValueObject() const {
|
||||
return m_diameter;
|
||||
}
|
||||
|
||||
Value<double> Completion::getSkinFactorAsValueObject() const {
|
||||
Value<double> Connection::getSkinFactorAsValueObject() const {
|
||||
return m_skinFactor;
|
||||
}
|
||||
|
||||
WellCompletion::DirectionEnum Completion::getDirection() const {
|
||||
WellCompletion::DirectionEnum Connection::getDirection() const {
|
||||
return m_direction;
|
||||
}
|
||||
|
||||
double Completion::getWellPi() const {
|
||||
double Connection::getWellPi() const {
|
||||
return m_wellPi;
|
||||
}
|
||||
|
||||
int Completion::getSegmentNumber() const {
|
||||
int Connection::getSegmentNumber() const {
|
||||
if (!attachedToSegment()) {
|
||||
throw std::runtime_error(" the completion is not attached to a segment!\n ");
|
||||
}
|
||||
return m_segment_number;
|
||||
}
|
||||
|
||||
double Completion::getCenterDepth() const {
|
||||
double Connection::getCenterDepth() const {
|
||||
return m_center_depth;
|
||||
}
|
||||
|
||||
bool Completion::attachedToSegment() const {
|
||||
bool Connection::attachedToSegment() const {
|
||||
return (m_segment_number > 0);
|
||||
}
|
||||
|
||||
bool Completion::operator==( const Completion& rhs ) const {
|
||||
bool Connection::operator==( const Connection& rhs ) const {
|
||||
return this->m_i == rhs.m_i
|
||||
&& this->m_j == rhs.m_j
|
||||
&& this->m_k == rhs.m_k
|
||||
@@ -333,7 +333,7 @@ namespace Opm {
|
||||
&& this->m_center_depth == rhs.m_center_depth;
|
||||
}
|
||||
|
||||
bool Completion::operator!=( const Completion& rhs ) const {
|
||||
bool Connection::operator!=( const Connection& rhs ) const {
|
||||
return !( *this == rhs );
|
||||
}
|
||||
}
|
||||
@@ -23,11 +23,12 @@
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
||||
#include "Compsegs.hpp"
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/C.hpp>
|
||||
|
||||
#include "Compsegs.hpp"
|
||||
|
||||
namespace Opm {
|
||||
|
||||
|
||||
@@ -237,8 +238,8 @@ namespace Opm {
|
||||
const int j = compseg.m_j;
|
||||
const int k = compseg.m_k;
|
||||
|
||||
const Completion& completion = completion_set.getFromIJK( i, j, k );
|
||||
completion_set.add(Completion(completion, compseg.m_segment_number, compseg.m_center_depth) );
|
||||
const Connection& connection = completion_set.getFromIJK( i, j, k );
|
||||
completion_set.add(Connection(connection, compseg.m_segment_number, compseg.m_center_depth) );
|
||||
}
|
||||
|
||||
for (size_t ic = 0; ic < completion_set.size(); ++ic) {
|
||||
|
||||
@@ -606,7 +606,7 @@ namespace Opm {
|
||||
continue;
|
||||
}
|
||||
|
||||
newCompletionSet.add( Completion{ currentCompletion, wellPi } );
|
||||
newCompletionSet.add( Connection{ currentCompletion, wellPi } );
|
||||
}
|
||||
|
||||
well->addCompletionSet(currentStep, newCompletionSet);
|
||||
@@ -935,7 +935,7 @@ namespace Opm {
|
||||
const int K1 = maybe( record, "K1" );
|
||||
const int K2 = maybe( record, "K2" );
|
||||
|
||||
auto new_completion = [=]( const Completion& c ) -> Completion {
|
||||
auto new_completion = [=]( const Connection& c ) -> Connection {
|
||||
if( !defaulted( I ) && c.getI() != I ) return c;
|
||||
if( !defaulted( J ) && c.getJ() != J ) return c;
|
||||
if( !defaulted( K1 ) && c.getK() < K1 ) return c;
|
||||
@@ -1011,7 +1011,7 @@ namespace Opm {
|
||||
* criteria *and* the completion number. A defaulted field always
|
||||
* matches the property in question.
|
||||
*/
|
||||
auto new_completion = [=]( const Completion& completion ) -> Completion {
|
||||
auto new_completion = [=]( const Connection& completion ) -> Connection {
|
||||
if( !defaulted( I ) && completion.getI() != I ) return completion;
|
||||
if( !defaulted( J ) && completion.getJ() != J ) return completion;
|
||||
if( !defaulted( K ) && completion.getK() != K ) return completion;
|
||||
@@ -1418,7 +1418,7 @@ namespace Opm {
|
||||
|
||||
void Schedule::handleCOMPDAT( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const Eclipse3DProperties& eclipseProperties, const ParseContext& parseContext) {
|
||||
const auto wells = this->getWells( currentStep );
|
||||
auto completions = Completion::fromCOMPDAT( grid, eclipseProperties, keyword, wells, parseContext, *this );
|
||||
auto completions = Connection::fromCOMPDAT( grid, eclipseProperties, keyword, wells, parseContext, *this );
|
||||
|
||||
for( const auto pair : completions ) {
|
||||
auto& well = this->m_wells.get( pair.first );
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp>
|
||||
@@ -359,7 +359,7 @@ namespace Opm {
|
||||
return m_completions.back();
|
||||
}
|
||||
|
||||
void Well::addCompletions(size_t time_step, const std::vector< Completion >& newCompletions ) {
|
||||
void Well::addCompletions(size_t time_step, const std::vector< Connection >& newCompletions ) {
|
||||
auto new_set = this->getCompletions( time_step );
|
||||
int complnum_shift = new_set.size();
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
@@ -211,7 +211,7 @@ inline std::array< int, 3 > getijk( const DeckRecord& record,
|
||||
}};
|
||||
}
|
||||
|
||||
inline std::array< int, 3 > getijk( const Completion& completion ) {
|
||||
inline std::array< int, 3 > getijk( const Connection& completion ) {
|
||||
return {{ completion.getI(), completion.getJ(), completion.getK() }};
|
||||
}
|
||||
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
inline std::ostream& operator<<( std::ostream& stream, const Completion& c ) {
|
||||
inline std::ostream& operator<<( std::ostream& stream, const Connection& c ) {
|
||||
return stream << "(" << c.getI() << "," << c.getJ() << "," << c.getK() << ")";
|
||||
}
|
||||
|
||||
@@ -54,12 +54,12 @@ inline std::ostream& operator<<( std::ostream& stream, const CompletionSet& cs )
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CreateCompletionOK) {
|
||||
Opm::Completion completion(10,10,10, 1, 0.0,Opm::WellCompletion::OPEN,Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion(10,10,10, 1, 0.0,Opm::WellCompletion::OPEN,Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(testGetFunctions) {
|
||||
Opm::Completion completion(10,11,12, 1, 0.0, Opm::WellCompletion::OPEN,Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion(10,11,12, 1, 0.0, Opm::WellCompletion::OPEN,Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
BOOST_CHECK_EQUAL( 10 , completion.getI() );
|
||||
BOOST_CHECK_EQUAL( 11 , completion.getJ() );
|
||||
BOOST_CHECK_EQUAL( 12 , completion.getK() );
|
||||
@@ -73,11 +73,11 @@ BOOST_AUTO_TEST_CASE(testGetFunctions) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CompletionTestssameCoordinate) {
|
||||
Opm::Completion completion1(10,10,10, 1, 0.0, Opm::WellCompletion::OPEN, Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion2(10,10,10, 1, 0.0, Opm::WellCompletion::OPEN, Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion3(11,10,10, 1, 0.0, Opm::WellCompletion::OPEN, Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion4(10,11,10, 1, 0.0, Opm::WellCompletion::OPEN, Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion5(10,10,11, 1, 0.0, Opm::WellCompletion::OPEN, Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion1(10,10,10, 1, 0.0, Opm::WellCompletion::OPEN, Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion2(10,10,10, 1, 0.0, Opm::WellCompletion::OPEN, Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion3(11,10,10, 1, 0.0, Opm::WellCompletion::OPEN, Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion4(10,11,10, 1, 0.0, Opm::WellCompletion::OPEN, Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion5(10,10,11, 1, 0.0, Opm::WellCompletion::OPEN, Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
|
||||
BOOST_CHECK( completion1.sameCoordinate( completion2 ));
|
||||
BOOST_CHECK_EQUAL( false , completion1.sameCoordinate( completion3 ));
|
||||
@@ -94,8 +94,8 @@ BOOST_AUTO_TEST_CASE(CreateCompletionSetOK) {
|
||||
|
||||
BOOST_AUTO_TEST_CASE(AddCompletionSizeCorrect) {
|
||||
Opm::CompletionSet completionSet;
|
||||
Opm::Completion completion1( 10,10,10, 1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion2( 11,10,10, 1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion1( 10,10,10, 1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion2( 11,10,10, 1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
completionSet.add( completion1 );
|
||||
BOOST_CHECK_EQUAL( 1U , completionSet.size() );
|
||||
|
||||
@@ -108,8 +108,8 @@ BOOST_AUTO_TEST_CASE(AddCompletionSizeCorrect) {
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CompletionSetGetOutOfRangeThrows) {
|
||||
Opm::CompletionSet completionSet;
|
||||
Opm::Completion completion1( 10,10,10,1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion2( 11,10,10,1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion1( 10,10,10,1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion2( 11,10,10,1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
completionSet.add( completion1 );
|
||||
BOOST_CHECK_EQUAL( 1U , completionSet.size() );
|
||||
|
||||
@@ -124,8 +124,8 @@ BOOST_AUTO_TEST_CASE(CompletionSetGetOutOfRangeThrows) {
|
||||
|
||||
BOOST_AUTO_TEST_CASE(AddCompletionSameCellUpdates) {
|
||||
Opm::CompletionSet completionSet;
|
||||
Opm::Completion completion1( 10,10,10, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion2( 10,10,10, 1, 0.0,Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion2( 10,10,10, 1, 0.0,Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
|
||||
|
||||
completionSet.add( completion1 );
|
||||
@@ -140,9 +140,9 @@ BOOST_AUTO_TEST_CASE(AddCompletionSameCellUpdates) {
|
||||
BOOST_AUTO_TEST_CASE(AddCompletionCopy) {
|
||||
Opm::CompletionSet completionSet;
|
||||
|
||||
Opm::Completion completion1( 10,10,10, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion2( 10,10,11, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion3( 10,10,12, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion3( 10,10,12, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
|
||||
completionSet.add( completion1 );
|
||||
completionSet.add( completion2 );
|
||||
@@ -161,9 +161,9 @@ BOOST_AUTO_TEST_CASE(AddCompletionCopy) {
|
||||
BOOST_AUTO_TEST_CASE(ActiveCompletions) {
|
||||
Opm::EclipseGrid grid(10,10,10);
|
||||
Opm::CompletionSet completions;
|
||||
Opm::Completion completion1( 0,0,0, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion2( 0,0,1, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion completion3( 0,0,2, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion1( 0,0,0, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion2( 0,0,1, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection completion3( 0,0,2, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
|
||||
completions.add( completion1 );
|
||||
completions.add( completion2 );
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
|
||||
@@ -43,13 +43,13 @@
|
||||
|
||||
BOOST_AUTO_TEST_CASE(MultisegmentWellTest) {
|
||||
Opm::CompletionSet completion_set;
|
||||
completion_set.add(Opm::Completion( 19, 0, 0, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.5), Opm::Value<double>("SKIN", 0.), 0) );
|
||||
completion_set.add(Opm::Completion( 19, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.5), Opm::Value<double>("SKIN", 0.), 0) );
|
||||
completion_set.add(Opm::Completion( 19, 0, 2, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), 0) );
|
||||
completion_set.add(Opm::Completion( 18, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), 0, Opm::WellCompletion::DirectionEnum::X) );
|
||||
completion_set.add(Opm::Completion( 17, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), 0, Opm::WellCompletion::DirectionEnum::X) );
|
||||
completion_set.add(Opm::Completion( 16, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), 0, Opm::WellCompletion::DirectionEnum::X) );
|
||||
completion_set.add(Opm::Completion( 15, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), 0, Opm::WellCompletion::DirectionEnum::X) );
|
||||
completion_set.add(Opm::Connection( 19, 0, 0, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.5), Opm::Value<double>("SKIN", 0.), 0) );
|
||||
completion_set.add(Opm::Connection( 19, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.5), Opm::Value<double>("SKIN", 0.), 0) );
|
||||
completion_set.add(Opm::Connection( 19, 0, 2, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), 0) );
|
||||
completion_set.add(Opm::Connection( 18, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), 0, Opm::WellCompletion::DirectionEnum::X) );
|
||||
completion_set.add(Opm::Connection( 17, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), 0, Opm::WellCompletion::DirectionEnum::X) );
|
||||
completion_set.add(Opm::Connection( 16, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), 0, Opm::WellCompletion::DirectionEnum::X) );
|
||||
completion_set.add(Opm::Connection( 15, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), 0, Opm::WellCompletion::DirectionEnum::X) );
|
||||
|
||||
BOOST_CHECK_EQUAL( 7U , completion_set.size() );
|
||||
|
||||
@@ -90,31 +90,31 @@ BOOST_AUTO_TEST_CASE(MultisegmentWellTest) {
|
||||
|
||||
BOOST_CHECK_EQUAL(7U, new_completion_set.size());
|
||||
|
||||
const Opm::Completion& completion1 = new_completion_set.get(0);
|
||||
const Opm::Connection& completion1 = new_completion_set.get(0);
|
||||
const int segment_number_completion1 = completion1.getSegmentNumber();
|
||||
const double center_depth_completion1 = completion1.getCenterDepth();
|
||||
BOOST_CHECK_EQUAL(segment_number_completion1, 1);
|
||||
BOOST_CHECK_EQUAL(center_depth_completion1, 2512.5);
|
||||
|
||||
const Opm::Completion& completion3 = new_completion_set.get(2);
|
||||
const Opm::Connection& completion3 = new_completion_set.get(2);
|
||||
const int segment_number_completion3 = completion3.getSegmentNumber();
|
||||
const double center_depth_completion3 = completion3.getCenterDepth();
|
||||
BOOST_CHECK_EQUAL(segment_number_completion3, 3);
|
||||
BOOST_CHECK_EQUAL(center_depth_completion3, 2562.5);
|
||||
|
||||
const Opm::Completion& completion5 = new_completion_set.get(4);
|
||||
const Opm::Connection& completion5 = new_completion_set.get(4);
|
||||
const int segment_number_completion5 = completion5.getSegmentNumber();
|
||||
const double center_depth_completion5 = completion5.getCenterDepth();
|
||||
BOOST_CHECK_EQUAL(segment_number_completion5, 6);
|
||||
BOOST_CHECK_CLOSE(center_depth_completion5, 2538.83, 0.001);
|
||||
|
||||
const Opm::Completion& completion6 = new_completion_set.get(5);
|
||||
const Opm::Connection& completion6 = new_completion_set.get(5);
|
||||
const int segment_number_completion6 = completion6.getSegmentNumber();
|
||||
const double center_depth_completion6 = completion6.getCenterDepth();
|
||||
BOOST_CHECK_EQUAL(segment_number_completion6, 6);
|
||||
BOOST_CHECK_CLOSE(center_depth_completion6, 2537.83, 0.001);
|
||||
|
||||
const Opm::Completion& completion7 = new_completion_set.get(6);
|
||||
const Opm::Connection& completion7 = new_completion_set.get(6);
|
||||
const int segment_number_completion7 = completion7.getSegmentNumber();
|
||||
const double center_depth_completion7 = completion7.getCenterDepth();
|
||||
BOOST_CHECK_EQUAL(segment_number_completion7, 7);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
@@ -52,7 +53,7 @@ static Opm::TimeMap createXDaysTimeMap(size_t numDays) {
|
||||
}
|
||||
|
||||
namespace Opm {
|
||||
inline std::ostream& operator<<( std::ostream& stream, const Completion& c ) {
|
||||
inline std::ostream& operator<<( std::ostream& stream, const Connection& c ) {
|
||||
return stream << "(" << c.getI() << "," << c.getJ() << "," << c.getK() << ")";
|
||||
}
|
||||
inline std::ostream& operator<<( std::ostream& stream, const Well& well ) {
|
||||
@@ -344,15 +345,15 @@ BOOST_AUTO_TEST_CASE(UpdateCompletions) {
|
||||
const auto& completions = well.getCompletions( 0 );
|
||||
BOOST_CHECK_EQUAL( 0U , completions.size());
|
||||
|
||||
Opm::Completion comp1( 10 , 10 , 10 , 1, 10, Opm::WellCompletion::AUTO , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion comp2( 10 , 10 , 11 , 1, 11, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion comp3( 10 , 10 , 12 , 1, 12, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion comp4( 10 , 10 , 12 , 1, 12, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Completion comp5( 10 , 10 , 13 , 1, 13, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection comp1( 10 , 10 , 10 , 1, 10, Opm::WellCompletion::AUTO , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection comp2( 10 , 10 , 11 , 1, 11, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection comp3( 10 , 10 , 12 , 1, 12, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection comp4( 10 , 10 , 12 , 1, 12, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
Opm::Connection comp5( 10 , 10 , 13 , 1, 13, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
|
||||
//std::vector<Opm::CompletionConstPtr> newCompletions2{ comp4 , comp5}; Newer c++
|
||||
|
||||
std::vector< Opm::Completion > newCompletions, newCompletions2;
|
||||
std::vector< Opm::Connection > newCompletions, newCompletions2;
|
||||
newCompletions.push_back( comp1 );
|
||||
newCompletions.push_back( comp2 );
|
||||
newCompletions.push_back( comp3 );
|
||||
@@ -372,8 +373,8 @@ BOOST_AUTO_TEST_CASE(UpdateCompletions) {
|
||||
}
|
||||
|
||||
// Helper function for CompletionOrder test.
|
||||
inline Opm::Completion completion( int i, int j, int k, int complnum = 1 ) {
|
||||
return Opm::Completion{ i, j, k,
|
||||
inline Opm::Connection connection( int i, int j, int k, int complnum = 1 ) {
|
||||
return Opm::Connection { i, j, k,
|
||||
complnum,
|
||||
k*1.0,
|
||||
Opm::WellCompletion::AUTO,
|
||||
@@ -390,10 +391,10 @@ BOOST_AUTO_TEST_CASE(CompletionOrder) {
|
||||
{
|
||||
// Vertical well.
|
||||
Opm::Well well("WELL1" , 5, 5, 0.0, Opm::Phase::OIL, timeMap , 0);
|
||||
auto c1 = completion(5, 5, 8);
|
||||
auto c2 = completion(5, 5, 9);
|
||||
auto c3 = completion(5, 5, 1);
|
||||
auto c4 = completion(5, 5, 0);
|
||||
auto c1 = connection(5, 5, 8);
|
||||
auto c2 = connection(5, 5, 9);
|
||||
auto c3 = connection(5, 5, 1);
|
||||
auto c4 = connection(5, 5, 0);
|
||||
Opm::CompletionSet cv1 = { c1, c2 };
|
||||
well.addCompletionSet(1, cv1);
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(1).get(0), c1);
|
||||
@@ -406,14 +407,14 @@ BOOST_AUTO_TEST_CASE(CompletionOrder) {
|
||||
{
|
||||
// Horizontal well.
|
||||
Opm::Well well("WELL1" , 5, 5, 0.0, Opm::Phase::OIL, timeMap , 0);
|
||||
auto c1 = completion(6, 5, 8, 1);
|
||||
auto c2 = completion(5, 6, 7, 2);
|
||||
auto c3 = completion(7, 5, 8, 1);
|
||||
auto c4 = completion(9, 5, 8, 2);
|
||||
auto c5 = completion(8, 5, 9, 3);
|
||||
auto c6 = completion(5, 5, 4, 1);
|
||||
auto c1 = connection(6, 5, 8, 1);
|
||||
auto c2 = connection(5, 6, 7, 2);
|
||||
auto c3 = connection(7, 5, 8, 1);
|
||||
auto c4 = connection(9, 5, 8, 2);
|
||||
auto c5 = connection(8, 5, 9, 3);
|
||||
auto c6 = connection(5, 5, 4, 1);
|
||||
|
||||
std::vector< Opm::Completion > cv1 = { c1, c2 };
|
||||
std::vector< Opm::Connection > cv1 = { c1, c2 };
|
||||
well.addCompletions(1, cv1);
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(1).get(0), c2);
|
||||
|
||||
@@ -423,29 +424,29 @@ BOOST_AUTO_TEST_CASE(CompletionOrder) {
|
||||
* comparing to the right value by forcing the right-hand-side of the
|
||||
* comparison to use the expected completion number
|
||||
*/
|
||||
std::vector< Opm::Completion > cv2 = { c3, c4, c5 };
|
||||
std::vector< Opm::Connection > cv2 = { c3, c4, c5 };
|
||||
well.addCompletions(2, cv2);
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(1).get(0), Completion( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(0), Completion( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(1), Completion( c1, 1 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(2), Completion( c3, 3 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(3), Completion( c5, 5 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(4), Completion( c4, 4 ) );
|
||||
std::vector< Opm::Completion > cv3 = { c6 };
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(1).get(0), Connection( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(0), Connection( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(1), Connection( c1, 1 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(2), Connection( c3, 3 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(3), Connection( c5, 5 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(4), Connection( c4, 4 ) );
|
||||
std::vector< Opm::Connection > cv3 = { c6 };
|
||||
|
||||
well.addCompletions(3, cv3);
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(1).get(0), Completion( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(0), Completion( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(1), Completion( c1, 1 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(2), Completion( c3, 3 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(3), Completion( c5, 5 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(4), Completion( c4, 4 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(0), Completion( c6, 6 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(1), Completion( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(2), Completion( c1, 1 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(3), Completion( c3, 3 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(4), Completion( c5, 5 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(5), Completion( c4, 4 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(1).get(0), Connection( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(0), Connection( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(1), Connection( c1, 1 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(2), Connection( c3, 3 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(3), Connection( c5, 5 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(2).get(4), Connection( c4, 4 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(0), Connection( c6, 6 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(1), Connection( c2, 2 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(2), Connection( c1, 1 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(3), Connection( c3, 3 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(4), Connection( c5, 5 ) );
|
||||
BOOST_CHECK_EQUAL(well.getCompletions(3).get(5), Connection( c4, 4 ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -636,8 +637,8 @@ BOOST_AUTO_TEST_CASE(WellStatus) {
|
||||
|
||||
Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0);
|
||||
|
||||
std::vector<Opm::Completion> newCompletions;
|
||||
Opm::Completion comp1(10 , 10 , 10 , 1, 0.25 , Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
std::vector<Opm::Connection> newCompletions;
|
||||
Opm::Connection comp1(10 , 10 , 10 , 1, 0.25 , Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), 0);
|
||||
|
||||
newCompletions.push_back( comp1 );
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
||||
|
||||
@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE( CreateCompletionsFromKeyword ) {
|
||||
const auto& COMPDAT1 = deck.getKeyword("COMPDAT" , 1);
|
||||
|
||||
const auto wells = schedule.getWells( 0 );
|
||||
auto completions = Completion::fromCOMPDAT( grid, eclipseProperties, COMPDAT1, wells, ParseContext(), schedule );
|
||||
auto completions = Connection::fromCOMPDAT( grid, eclipseProperties, COMPDAT1, wells, ParseContext(), schedule );
|
||||
BOOST_CHECK_EQUAL( 3U , completions.size() );
|
||||
|
||||
BOOST_CHECK( completions.find("W_1") != completions.end() );
|
||||
@@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE( CreateCompletionsFromKeyword ) {
|
||||
BOOST_CHECK_EQUAL( 5U , completions.find("W_2")->second.size() );
|
||||
BOOST_CHECK_EQUAL( 5U , completions.find("W_3")->second.size() );
|
||||
|
||||
std::vector<Completion> W_3Completions = completions.find("W_3")->second;
|
||||
std::vector<Connection> W_3Completions = completions.find("W_3")->second;
|
||||
|
||||
const auto& completion0 = W_3Completions[0];
|
||||
const auto& completion4 = W_3Completions[4];
|
||||
@@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE( CreateCompletionsFromKeyword ) {
|
||||
BOOST_CHECK_EQUAL (well2->getStatus(0) , WellCommon::StatusEnum::SHUT);
|
||||
|
||||
// Check saturation table number for connection
|
||||
std::vector<Completion> W_1Completions = completions.find("W_1")->second;
|
||||
std::vector<Connection> W_1Completions = completions.find("W_1")->second;
|
||||
const auto& W1_completion0 = W_1Completions[0];
|
||||
const auto& W1_completion3 = W_1Completions[3];
|
||||
const auto& W1_completion4 = W_1Completions[4];
|
||||
|
||||
@@ -576,25 +576,25 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) {
|
||||
const auto& completions = well->getCompletions(0);
|
||||
BOOST_CHECK_EQUAL(7U, completions.size());
|
||||
|
||||
const Completion& completion5 = completions.get(4);
|
||||
const Connection& completion5 = completions.get(4);
|
||||
const int seg_number_completion5 = completion5.getSegmentNumber();
|
||||
const double completion5_depth = completion5.getCenterDepth();
|
||||
BOOST_CHECK_EQUAL(seg_number_completion5, 6);
|
||||
BOOST_CHECK_CLOSE(completion5_depth, 2538.83, 0.001);
|
||||
|
||||
const Completion& completion6 = completions.get(5);
|
||||
const Connection& completion6 = completions.get(5);
|
||||
const int seg_number_completion6 = completion6.getSegmentNumber();
|
||||
const double completion6_depth = completion6.getCenterDepth();
|
||||
BOOST_CHECK_EQUAL(seg_number_completion6, 6);
|
||||
BOOST_CHECK_CLOSE(completion6_depth, 2537.83, 0.001);
|
||||
|
||||
const Completion& completion1 = completions.get(0);
|
||||
const Connection& completion1 = completions.get(0);
|
||||
const int seg_number_completion1 = completion1.getSegmentNumber();
|
||||
const double completion1_depth = completion1.getCenterDepth();
|
||||
BOOST_CHECK_EQUAL(seg_number_completion1, 1);
|
||||
BOOST_CHECK_EQUAL(completion1_depth, 2512.5);
|
||||
|
||||
const Completion& completion3 = completions.get(2);
|
||||
const Connection& completion3 = completions.get(2);
|
||||
const int seg_number_completion3 = completion3.getSegmentNumber();
|
||||
const double completion3_depth = completion3.getCenterDepth();
|
||||
BOOST_CHECK_EQUAL(seg_number_completion3, 3);
|
||||
|
||||
Reference in New Issue
Block a user