Move direction enum to Connection class
This commit is contained in:
@@ -29,22 +29,12 @@ namespace Opm {
|
|||||||
namespace WellCompletion {
|
namespace WellCompletion {
|
||||||
|
|
||||||
|
|
||||||
enum DirectionEnum {
|
|
||||||
X = 1,
|
|
||||||
Y = 2,
|
|
||||||
Z = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
enum CompletionOrderEnum{
|
enum CompletionOrderEnum{
|
||||||
DEPTH,
|
DEPTH,
|
||||||
INPUT,
|
INPUT,
|
||||||
TRACK
|
TRACK
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string DirectionEnum2String(const DirectionEnum enumValue);
|
|
||||||
DirectionEnum DirectionEnumFromString(const std::string& stringValue);
|
|
||||||
|
|
||||||
|
|
||||||
const std::string CompletionOrderEnum2String( CompletionOrderEnum enumValue );
|
const std::string CompletionOrderEnum2String( CompletionOrderEnum enumValue );
|
||||||
CompletionOrderEnum CompletionOrderEnumFromString(const std::string& comporderStringValue);
|
CompletionOrderEnum CompletionOrderEnumFromString(const std::string& comporderStringValue);
|
||||||
|
|||||||
@@ -48,6 +48,18 @@ namespace Opm {
|
|||||||
static const std::string State2String( State enumValue );
|
static const std::string State2String( State enumValue );
|
||||||
static State StateFromString( const std::string& stringValue );
|
static State StateFromString( const std::string& stringValue );
|
||||||
|
|
||||||
|
enum class Direction{
|
||||||
|
X = 1,
|
||||||
|
Y = 2,
|
||||||
|
Z = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string Direction2String(const Direction enumValue);
|
||||||
|
static Direction DirectionFromString(const std::string& stringValue);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Connection(int i, int j , int k ,
|
Connection(int i, int j , int k ,
|
||||||
int complnum,
|
int complnum,
|
||||||
@@ -59,7 +71,7 @@ namespace Opm {
|
|||||||
double r0,
|
double r0,
|
||||||
double skin_factor,
|
double skin_factor,
|
||||||
const int satTableId,
|
const int satTableId,
|
||||||
const WellCompletion::DirectionEnum direction,
|
const Direction direction,
|
||||||
const std::size_t seqIndex,
|
const std::size_t seqIndex,
|
||||||
const double segDistStart,
|
const double segDistStart,
|
||||||
const double segDistEnd,
|
const double segDistEnd,
|
||||||
@@ -72,7 +84,7 @@ namespace Opm {
|
|||||||
int getJ() const;
|
int getJ() const;
|
||||||
int getK() const;
|
int getK() const;
|
||||||
State state() const;
|
State state() const;
|
||||||
WellCompletion::DirectionEnum dir() const;
|
Direction dir() const;
|
||||||
double depth() const;
|
double depth() const;
|
||||||
int satTableId() const;
|
int satTableId() const;
|
||||||
int complnum() const;
|
int complnum() const;
|
||||||
@@ -102,7 +114,7 @@ namespace Opm {
|
|||||||
bool operator==( const Connection& ) const;
|
bool operator==( const Connection& ) const;
|
||||||
bool operator!=( const Connection& ) const;
|
bool operator!=( const Connection& ) const;
|
||||||
private:
|
private:
|
||||||
WellCompletion::DirectionEnum direction;
|
Direction direction;
|
||||||
double center_depth;
|
double center_depth;
|
||||||
State open_state;
|
State open_state;
|
||||||
int sat_tableId;
|
int sat_tableId;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Opm {
|
|||||||
double r0,
|
double r0,
|
||||||
double skin_factor,
|
double skin_factor,
|
||||||
const int satTableId,
|
const int satTableId,
|
||||||
const WellCompletion::DirectionEnum direction = WellCompletion::DirectionEnum::Z,
|
const Connection::Direction direction = Connection::Direction::Z,
|
||||||
const std::size_t seqIndex = 0,
|
const std::size_t seqIndex = 0,
|
||||||
const double segDistStart= 0.0,
|
const double segDistStart= 0.0,
|
||||||
const double segDistEnd= 0.0,
|
const double segDistEnd= 0.0,
|
||||||
@@ -89,7 +89,7 @@ namespace Opm {
|
|||||||
double r0,
|
double r0,
|
||||||
double skin_factor,
|
double skin_factor,
|
||||||
const int satTableId,
|
const int satTableId,
|
||||||
const WellCompletion::DirectionEnum direction = WellCompletion::DirectionEnum::Z,
|
const Connection::Direction direction = Connection::Direction::Z,
|
||||||
const std::size_t seqIndex = 0,
|
const std::size_t seqIndex = 0,
|
||||||
const double segDistStart= 0.0,
|
const double segDistStart= 0.0,
|
||||||
const double segDistEnd= 0.0,
|
const double segDistEnd= 0.0,
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ namespace {
|
|||||||
iConn[Ix::ComplNum] = std::abs(conn.complnum());
|
iConn[Ix::ComplNum] = std::abs(conn.complnum());
|
||||||
//iConn[Ix::ComplNum] = iConn[Ix::SeqIndex];
|
//iConn[Ix::ComplNum] = iConn[Ix::SeqIndex];
|
||||||
|
|
||||||
iConn[Ix::ConnDir] = conn.dir();
|
iConn[Ix::ConnDir] = static_cast<int>(conn.dir());
|
||||||
iConn[Ix::Segment] = conn.attachedToSegment()
|
iConn[Ix::Segment] = conn.attachedToSegment()
|
||||||
? conn.segment() : 0;
|
? conn.segment() : 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Opm {
|
|||||||
|
|
||||||
|
|
||||||
Compsegs::Compsegs(int i_in, int j_in, int k_in, int branch_number_in, double distance_start_in, double distance_end_in,
|
Compsegs::Compsegs(int i_in, int j_in, int k_in, int branch_number_in, double distance_start_in, double distance_end_in,
|
||||||
WellCompletion::DirectionEnum dir_in, double center_depth_in, int segment_number_in, size_t seqIndex_in)
|
Connection::Direction dir_in, double center_depth_in, int segment_number_in, size_t seqIndex_in)
|
||||||
: m_i(i_in),
|
: m_i(i_in),
|
||||||
m_j(j_in),
|
m_j(j_in),
|
||||||
m_k(k_in),
|
m_k(k_in),
|
||||||
@@ -116,9 +116,9 @@ namespace Opm {
|
|||||||
* Defaulted well connection. Must be non-defaulted if DISTANCE_END
|
* Defaulted well connection. Must be non-defaulted if DISTANCE_END
|
||||||
* is set or a range is specified. If not this is effectively ignored.
|
* is set or a range is specified. If not this is effectively ignored.
|
||||||
*/
|
*/
|
||||||
WellCompletion::DirectionEnum direction = WellCompletion::X;
|
auto direction = Connection::Direction::X;
|
||||||
if( record.getItem< ParserKeywords::COMPSEGS::DIRECTION >().hasValue( 0 ) ) {
|
if( record.getItem< ParserKeywords::COMPSEGS::DIRECTION >().hasValue( 0 ) ) {
|
||||||
direction = WellCompletion::DirectionEnumFromString(record.getItem<ParserKeywords::COMPSEGS::DIRECTION>().get< std::string >(0));
|
direction = Connection::DirectionFromString(record.getItem<ParserKeywords::COMPSEGS::DIRECTION>().get< std::string >(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
double center_depth;
|
double center_depth;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp>
|
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
@@ -45,8 +46,8 @@ namespace Opm {
|
|||||||
int m_branch_number;
|
int m_branch_number;
|
||||||
double m_distance_start;
|
double m_distance_start;
|
||||||
double m_distance_end;
|
double m_distance_end;
|
||||||
|
Connection::Direction m_dir;
|
||||||
|
|
||||||
WellCompletion::DirectionEnum m_dir;
|
|
||||||
double center_depth;
|
double center_depth;
|
||||||
// we do not handle thermal length for the moment
|
// we do not handle thermal length for the moment
|
||||||
// double m_thermal_length;
|
// double m_thermal_length;
|
||||||
@@ -54,7 +55,7 @@ namespace Opm {
|
|||||||
std::size_t m_seqIndex;
|
std::size_t m_seqIndex;
|
||||||
|
|
||||||
Compsegs(int i_in, int j_in, int k_in, int branch_number_in, double distance_start_in, double distance_end_in,
|
Compsegs(int i_in, int j_in, int k_in, int branch_number_in, double distance_start_in, double distance_end_in,
|
||||||
WellCompletion::DirectionEnum dir_in, double center_depth_in, int segment_number_in, std::size_t seqIndex_in);
|
Connection::Direction dir_in, double center_depth_in, int segment_number_in, std::size_t seqIndex_in);
|
||||||
|
|
||||||
void calculateCenterDepthWithSegments(const WellSegments& segment_set);
|
void calculateCenterDepthWithSegments(const WellSegments& segment_set);
|
||||||
|
|
||||||
@@ -66,7 +67,7 @@ namespace Opm {
|
|||||||
|
|
||||||
// update the segment related information for Connections
|
// update the segment related information for Connections
|
||||||
static void updateConnectionsWithSegment(const std::vector< Compsegs >& compsegs,
|
static void updateConnectionsWithSegment(const std::vector< Compsegs >& compsegs,
|
||||||
const EclipseGrid& grid,
|
const EclipseGrid& grid,
|
||||||
WellConnections& connection_set);
|
WellConnections& connection_set);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,44 +26,6 @@ namespace Opm {
|
|||||||
|
|
||||||
namespace WellCompletion {
|
namespace WellCompletion {
|
||||||
|
|
||||||
std::string
|
|
||||||
DirectionEnum2String(const DirectionEnum enumValue)
|
|
||||||
{
|
|
||||||
std::string stringValue;
|
|
||||||
|
|
||||||
switch (enumValue) {
|
|
||||||
case DirectionEnum::X:
|
|
||||||
stringValue = "X";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DirectionEnum::Y:
|
|
||||||
stringValue = "Y";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DirectionEnum::Z:
|
|
||||||
stringValue = "Z";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return stringValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
DirectionEnum
|
|
||||||
DirectionEnumFromString(const std::string& s )
|
|
||||||
{
|
|
||||||
DirectionEnum direction;
|
|
||||||
|
|
||||||
if (s == "X") { direction = DirectionEnum::X; }
|
|
||||||
else if (s == "Y") { direction = DirectionEnum::Y; }
|
|
||||||
else if (s == "Z") { direction = DirectionEnum::Z; }
|
|
||||||
else {
|
|
||||||
std::string msg = "Unsupported completion direction " + s;
|
|
||||||
throw std::invalid_argument(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return direction;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const std::string CompletionOrderEnum2String( CompletionOrderEnum enumValue ) {
|
const std::string CompletionOrderEnum2String( CompletionOrderEnum enumValue ) {
|
||||||
switch( enumValue ) {
|
switch( enumValue ) {
|
||||||
|
|||||||
@@ -47,12 +47,11 @@ namespace Opm {
|
|||||||
double r0,
|
double r0,
|
||||||
double skin_factor,
|
double skin_factor,
|
||||||
const int satTableId,
|
const int satTableId,
|
||||||
const WellCompletion::DirectionEnum directionArg,
|
const Direction directionArg,
|
||||||
const std::size_t seqIndex,
|
const std::size_t seqIndex,
|
||||||
const double segDistStart,
|
const double segDistStart,
|
||||||
const double segDistEnd,
|
const double segDistEnd,
|
||||||
const bool defaultSatTabId
|
const bool defaultSatTabId)
|
||||||
)
|
|
||||||
: direction(directionArg),
|
: direction(directionArg),
|
||||||
center_depth(depth),
|
center_depth(depth),
|
||||||
open_state(stateArg),
|
open_state(stateArg),
|
||||||
@@ -70,14 +69,6 @@ namespace Opm {
|
|||||||
m_defaultSatTabId(defaultSatTabId)
|
m_defaultSatTabId(defaultSatTabId)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/*bool Connection::sameCoordinate(const Connection& other) const {
|
|
||||||
if ((m_i == other.m_i) &&
|
|
||||||
(m_j == other.m_j) &&
|
|
||||||
(m_k == other.m_k))
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
bool Connection::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 ((ijk[0] == i) && (ijk[1] == j) && (ijk[2] == k)) {
|
if ((ijk[0] == i) && (ijk[1] == j) && (ijk[2] == k)) {
|
||||||
@@ -87,8 +78,6 @@ namespace Opm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Connection::getI() const {
|
int Connection::getI() const {
|
||||||
return ijk[0];
|
return ijk[0];
|
||||||
}
|
}
|
||||||
@@ -117,7 +106,7 @@ namespace Opm {
|
|||||||
return m_compSeg_seqIndex;
|
return m_compSeg_seqIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
WellCompletion::DirectionEnum Connection::dir() const {
|
Connection::Direction Connection::dir() const {
|
||||||
return this->direction;
|
return this->direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,7 +211,7 @@ namespace Opm {
|
|||||||
ss << "kh " << this->m_Kh << std::endl;
|
ss << "kh " << this->m_Kh << std::endl;
|
||||||
ss << "sat_tableId " << this->sat_tableId << std::endl;
|
ss << "sat_tableId " << this->sat_tableId << std::endl;
|
||||||
ss << "open_state " << Connection::State2String(this->open_state) << std::endl;
|
ss << "open_state " << Connection::State2String(this->open_state) << std::endl;
|
||||||
ss << "direction " << this->direction << std::endl;
|
ss << "direction " << Connection::Direction2String(this->direction) << std::endl;
|
||||||
ss << "segment_nr " << this->segment_number << std::endl;
|
ss << "segment_nr " << this->segment_number << std::endl;
|
||||||
ss << "center_depth " << this->center_depth << std::endl;
|
ss << "center_depth " << this->center_depth << std::endl;
|
||||||
ss << "seqIndex " << this->m_seqIndex << std::endl;
|
ss << "seqIndex " << this->m_seqIndex << std::endl;
|
||||||
@@ -285,6 +274,44 @@ Connection::State Connection::StateFromString( const std::string& stringValue )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string Connection::Direction2String(const Direction enumValue)
|
||||||
|
{
|
||||||
|
std::string stringValue;
|
||||||
|
|
||||||
|
switch (enumValue) {
|
||||||
|
case Direction::X:
|
||||||
|
stringValue = "X";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Direction::Y:
|
||||||
|
stringValue = "Y";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Direction::Z:
|
||||||
|
stringValue = "Z";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return stringValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Connection::Direction Connection::DirectionFromString(const std::string& s )
|
||||||
|
{
|
||||||
|
Direction direction;
|
||||||
|
|
||||||
|
if (s == "X") { direction = Direction::X; }
|
||||||
|
else if (s == "Y") { direction = Direction::Y; }
|
||||||
|
else if (s == "Z") { direction = Direction::Z; }
|
||||||
|
else {
|
||||||
|
std::string msg = "Unsupported completion direction " + s;
|
||||||
|
throw std::invalid_argument(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,16 +37,16 @@ namespace {
|
|||||||
// direction. First two elements of return value are directions
|
// direction. First two elements of return value are directions
|
||||||
// perpendicular to completion while last element is direction
|
// perpendicular to completion while last element is direction
|
||||||
// along completion.
|
// along completion.
|
||||||
inline std::array< size_t, 3> directionIndices(const Opm::WellCompletion::DirectionEnum direction)
|
inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction direction)
|
||||||
{
|
{
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
case Opm::WellCompletion::DirectionEnum::X:
|
case Opm::Connection::Direction::X:
|
||||||
return {{ 1,2,0 }};
|
return {{ 1,2,0 }};
|
||||||
|
|
||||||
case Opm::WellCompletion::DirectionEnum::Y:
|
case Opm::Connection::Direction::Y:
|
||||||
return {{ 2,0,1}};
|
return {{ 2,0,1}};
|
||||||
|
|
||||||
case Opm::WellCompletion::DirectionEnum::Z:
|
case Opm::Connection::Direction::Z:
|
||||||
return {{ 0,1,2 }};
|
return {{ 0,1,2 }};
|
||||||
}
|
}
|
||||||
// All enum values should be handled above. Therefore
|
// All enum values should be handled above. Therefore
|
||||||
@@ -59,7 +59,7 @@ namespace {
|
|||||||
// Permute (diagonal) permeability components according to
|
// Permute (diagonal) permeability components according to
|
||||||
// completion's direction.
|
// completion's direction.
|
||||||
inline std::array<double,3>
|
inline std::array<double,3>
|
||||||
permComponents(const Opm::WellCompletion::DirectionEnum direction,
|
permComponents(const Opm::Connection::Direction direction,
|
||||||
const std::array<double,3>& perm)
|
const std::array<double,3>& perm)
|
||||||
{
|
{
|
||||||
const auto p = directionIndices(direction);
|
const auto p = directionIndices(direction);
|
||||||
@@ -75,9 +75,9 @@ namespace {
|
|||||||
// Note: 'extent' is intentionally accepted by modifiable value
|
// Note: 'extent' is intentionally accepted by modifiable value
|
||||||
// rather than reference-to-const to support NTG manipulation.
|
// rather than reference-to-const to support NTG manipulation.
|
||||||
inline std::array<double,3>
|
inline std::array<double,3>
|
||||||
effectiveExtent(const Opm::WellCompletion::DirectionEnum direction,
|
effectiveExtent(const Opm::Connection::Direction direction,
|
||||||
const double ntg,
|
const double ntg,
|
||||||
std::array<double,3> extent)
|
std::array<double,3> extent)
|
||||||
{
|
{
|
||||||
// Vertical extent affected by net-to-gross ratio.
|
// Vertical extent affected by net-to-gross ratio.
|
||||||
extent[2] *= ntg;
|
extent[2] *= ntg;
|
||||||
@@ -143,7 +143,7 @@ namespace {
|
|||||||
double r0,
|
double r0,
|
||||||
double skin_factor,
|
double skin_factor,
|
||||||
const int satTableId,
|
const int satTableId,
|
||||||
const WellCompletion::DirectionEnum direction,
|
const Connection::Direction direction,
|
||||||
const std::size_t seqIndex,
|
const std::size_t seqIndex,
|
||||||
const double segDistStart,
|
const double segDistStart,
|
||||||
const double segDistEnd,
|
const double segDistEnd,
|
||||||
@@ -166,7 +166,7 @@ namespace {
|
|||||||
double r0,
|
double r0,
|
||||||
double skin_factor,
|
double skin_factor,
|
||||||
const int satTableId,
|
const int satTableId,
|
||||||
const WellCompletion::DirectionEnum direction,
|
const Connection::Direction direction,
|
||||||
const std::size_t seqIndex,
|
const std::size_t seqIndex,
|
||||||
const double segDistStart,
|
const double segDistStart,
|
||||||
const double segDistEnd,
|
const double segDistEnd,
|
||||||
@@ -218,7 +218,7 @@ namespace {
|
|||||||
const auto& KhItem = record.getItem("Kh");
|
const auto& KhItem = record.getItem("Kh");
|
||||||
const auto& satTableIdItem = record.getItem("SAT_TABLE");
|
const auto& satTableIdItem = record.getItem("SAT_TABLE");
|
||||||
const auto& r0Item = record.getItem("PR");
|
const auto& r0Item = record.getItem("PR");
|
||||||
const WellCompletion::DirectionEnum direction = WellCompletion::DirectionEnumFromString(record.getItem("DIR").getTrimmedString(0));
|
const auto direction = Connection::DirectionFromString(record.getItem("DIR").getTrimmedString(0));
|
||||||
double skin_factor = record.getItem("SKIN").getSIDouble(0);
|
double skin_factor = record.getItem("SKIN").getSIDouble(0);
|
||||||
double rw;
|
double rw;
|
||||||
double r0=0.0;
|
double r0=0.0;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE(CreateWellConnectionsOK) {
|
|||||||
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(AddCompletionSizeCorrect) {
|
BOOST_AUTO_TEST_CASE(AddCompletionSizeCorrect) {
|
||||||
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
|
auto dir = Opm::Connection::Direction::Z;
|
||||||
Opm::WellConnections completionSet(1,1);
|
Opm::WellConnections completionSet(1,1);
|
||||||
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::Connection::State::OPEN , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true);
|
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::Connection::State::OPEN , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true);
|
||||||
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::Connection::State::SHUT , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true);
|
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::Connection::State::SHUT , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true);
|
||||||
@@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE(AddCompletionSizeCorrect) {
|
|||||||
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(WellConnectionsGetOutOfRangeThrows) {
|
BOOST_AUTO_TEST_CASE(WellConnectionsGetOutOfRangeThrows) {
|
||||||
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
|
auto dir = Opm::Connection::Direction::Z;
|
||||||
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::Connection::State::OPEN , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::Connection::State::OPEN , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
||||||
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::Connection::State::SHUT , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::Connection::State::SHUT , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
||||||
Opm::WellConnections completionSet(1,1);
|
Opm::WellConnections completionSet(1,1);
|
||||||
@@ -100,8 +100,8 @@ BOOST_AUTO_TEST_CASE(WellConnectionsGetOutOfRangeThrows) {
|
|||||||
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(AddCompletionCopy) {
|
BOOST_AUTO_TEST_CASE(AddCompletionCopy) {
|
||||||
Opm::WellConnections completionSet(10,10);
|
Opm::WellConnections completionSet(10,10);
|
||||||
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
|
auto dir = Opm::Connection::Direction::Z;
|
||||||
|
|
||||||
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::Connection::State::OPEN , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::Connection::State::OPEN , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
||||||
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::Connection::State::SHUT , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::Connection::State::SHUT , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
||||||
@@ -123,7 +123,7 @@ BOOST_AUTO_TEST_CASE(AddCompletionCopy) {
|
|||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(ActiveCompletions) {
|
BOOST_AUTO_TEST_CASE(ActiveCompletions) {
|
||||||
Opm::EclipseGrid grid(10,20,20);
|
Opm::EclipseGrid grid(10,20,20);
|
||||||
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
|
auto dir = Opm::Connection::Direction::Z;
|
||||||
Opm::WellConnections completions(10,10);
|
Opm::WellConnections completions(10,10);
|
||||||
Opm::Connection completion1( 0,0,0, 1, 0.0, Opm::Connection::State::OPEN , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
Opm::Connection completion1( 0,0,0, 1, 0.0, Opm::Connection::State::OPEN , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
||||||
Opm::Connection completion2( 0,0,1, 1, 0.0, Opm::Connection::State::SHUT , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
Opm::Connection completion2( 0,0,1, 1, 0.0, Opm::Connection::State::SHUT , 99.88, 355.113, 0.25, 0.0, 0.0, 0, dir,0,0., 0., true);
|
||||||
|
|||||||
@@ -41,17 +41,17 @@
|
|||||||
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp>
|
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp>
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(MultisegmentWellTest) {
|
BOOST_AUTO_TEST_CASE(MultisegmentWellTest) {
|
||||||
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
|
auto dir = Opm::Connection::Direction::Z;
|
||||||
Opm::WellConnections connection_set(10,10);
|
Opm::WellConnections connection_set(10,10);
|
||||||
Opm::EclipseGrid grid(20,20,20);
|
Opm::EclipseGrid grid(20,20,20);
|
||||||
connection_set.add(Opm::Connection( 19, 0, 0, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 19, 0, 0, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 19, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 19, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 19, 0, 2, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 19, 0, 2, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
||||||
|
|
||||||
connection_set.add(Opm::Connection( 18, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 18, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 17, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 17, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 16, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 16, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 15, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 15, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL( 7U , connection_set.size() );
|
BOOST_CHECK_EQUAL( 7U , connection_set.size() );
|
||||||
|
|
||||||
@@ -129,17 +129,17 @@ BOOST_AUTO_TEST_CASE(MultisegmentWellTest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(WrongDistanceCOMPSEGS) {
|
BOOST_AUTO_TEST_CASE(WrongDistanceCOMPSEGS) {
|
||||||
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
|
auto dir = Opm::Connection::Direction::Z;
|
||||||
Opm::WellConnections connection_set(10,10);
|
Opm::WellConnections connection_set(10,10);
|
||||||
Opm::EclipseGrid grid(20,20,20);
|
Opm::EclipseGrid grid(20,20,20);
|
||||||
connection_set.add(Opm::Connection( 19, 0, 0, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 19, 0, 0, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 19, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 19, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 19, 0, 2, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 19, 0, 2, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
||||||
|
|
||||||
connection_set.add(Opm::Connection( 18, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 18, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 17, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 17, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 16, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 16, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 15, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 15, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL( 7U , connection_set.size() );
|
BOOST_CHECK_EQUAL( 7U , connection_set.size() );
|
||||||
|
|
||||||
@@ -186,17 +186,17 @@ BOOST_AUTO_TEST_CASE(WrongDistanceCOMPSEGS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(NegativeDepthCOMPSEGS) {
|
BOOST_AUTO_TEST_CASE(NegativeDepthCOMPSEGS) {
|
||||||
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
|
auto dir = Opm::Connection::Direction::Z;
|
||||||
Opm::WellConnections connection_set(10,10);
|
Opm::WellConnections connection_set(10,10);
|
||||||
Opm::EclipseGrid grid(20,20,20);
|
Opm::EclipseGrid grid(20,20,20);
|
||||||
connection_set.add(Opm::Connection( 19, 0, 0, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 19, 0, 0, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 19, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 19, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 19, 0, 2, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 19, 0, 2, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, dir,0, 0., 0., true) );
|
||||||
|
|
||||||
connection_set.add(Opm::Connection( 18, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 18, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 17, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 17, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 16, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 16, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
connection_set.add(Opm::Connection( 15, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::WellCompletion::DirectionEnum::X,0, 0., 0., true) );
|
connection_set.add(Opm::Connection( 15, 0, 1, 1, 0.0, Opm::Connection::State::OPEN , 200, 17.29, 0.25, 0.0, 0.0, 0, Opm::Connection::Direction::X,0, 0., 0., true) );
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL( 7U , connection_set.size() );
|
BOOST_CHECK_EQUAL( 7U , connection_set.size() );
|
||||||
|
|
||||||
|
|||||||
@@ -2357,33 +2357,33 @@ BOOST_AUTO_TEST_CASE(TestCompletionDirectionEnum2String)
|
|||||||
{
|
{
|
||||||
using namespace WellCompletion;
|
using namespace WellCompletion;
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL("X", DirectionEnum2String(DirectionEnum::X));
|
BOOST_CHECK("X" == Connection::Direction2String(Connection::Direction::X));
|
||||||
BOOST_CHECK_EQUAL("Y", DirectionEnum2String(DirectionEnum::Y));
|
BOOST_CHECK("Y" == Connection::Direction2String(Connection::Direction::Y));
|
||||||
BOOST_CHECK_EQUAL("Z", DirectionEnum2String(DirectionEnum::Z));
|
BOOST_CHECK("Z" == Connection::Direction2String(Connection::Direction::Z));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(TestCompletionDirectionEnumFromString)
|
BOOST_AUTO_TEST_CASE(TestCompletionDirectionEnumFromString)
|
||||||
{
|
{
|
||||||
using namespace WellCompletion;
|
using namespace WellCompletion;
|
||||||
|
|
||||||
BOOST_CHECK_THROW(DirectionEnumFromString("XXX"), std::invalid_argument);
|
BOOST_CHECK_THROW(Connection::DirectionFromString("XXX"), std::invalid_argument);
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL(DirectionEnum::X, DirectionEnumFromString("X"));
|
BOOST_CHECK(Connection::Direction::X == Connection::DirectionFromString("X"));
|
||||||
BOOST_CHECK_EQUAL(DirectionEnum::Y, DirectionEnumFromString("Y"));
|
BOOST_CHECK(Connection::Direction::Y == Connection::DirectionFromString("Y"));
|
||||||
BOOST_CHECK_EQUAL(DirectionEnum::Z, DirectionEnumFromString("Z"));
|
BOOST_CHECK(Connection::Direction::Z == Connection::DirectionFromString("Z"));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(TestCompletionDirectionEnumLoop)
|
BOOST_AUTO_TEST_CASE(TestCompletionConnectionDirectionLoop)
|
||||||
{
|
{
|
||||||
using namespace WellCompletion;
|
using namespace WellCompletion;
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL(DirectionEnum::X, DirectionEnumFromString(DirectionEnum2String(DirectionEnum::X)));
|
BOOST_CHECK(Connection::Direction::X == Connection::DirectionFromString(Connection::Direction2String(Connection::Direction::X)));
|
||||||
BOOST_CHECK_EQUAL(DirectionEnum::Y, DirectionEnumFromString(DirectionEnum2String(DirectionEnum::Y)));
|
BOOST_CHECK(Connection::Direction::Y == Connection::DirectionFromString(Connection::Direction2String(Connection::Direction::Y)));
|
||||||
BOOST_CHECK_EQUAL(DirectionEnum::Z, DirectionEnumFromString(DirectionEnum2String(DirectionEnum::Z)));
|
BOOST_CHECK(Connection::Direction::Z == Connection::DirectionFromString(Connection::Direction2String(Connection::Direction::Z)));
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL("X", DirectionEnum2String(DirectionEnumFromString("X")));
|
BOOST_CHECK("X" == Connection::Direction2String(Connection::DirectionFromString("X")));
|
||||||
BOOST_CHECK_EQUAL("Y", DirectionEnum2String(DirectionEnumFromString("Y")));
|
BOOST_CHECK("Y" == Connection::Direction2String(Connection::DirectionFromString("Y")));
|
||||||
BOOST_CHECK_EQUAL("Z", DirectionEnum2String(DirectionEnumFromString("Z")));
|
BOOST_CHECK("Z" == Connection::Direction2String(Connection::DirectionFromString("Z")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************/
|
/*****************************************************************/
|
||||||
|
|||||||
Reference in New Issue
Block a user