Merge pull request #426 from joakim-hove/rename-connection-set

Rename connectionset and wellset
This commit is contained in:
Joakim Hove 2018-06-21 08:14:08 +02:00 committed by GitHub
commit aa04fee73f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 153 additions and 153 deletions

View File

@ -74,14 +74,14 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.cpp
src/opm/parser/eclipse/EclipseState/Runspec.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Connection.cpp
src/opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.cpp
src/opm/parser/eclipse/EclipseState/Schedule/WellConnections.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Group.cpp
src/opm/parser/eclipse/EclipseState/Schedule/GroupTree.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MessageLimits.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Compsegs.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.cpp
src/opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.cpp
src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp
src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
@ -456,12 +456,12 @@ if(ENABLE_ECL_INPUT)
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
opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp
opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp
opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp
opm/parser/eclipse/EclipseState/Schedule/WellTestConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/WellTestState.hpp
opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp
opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp
opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp
opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.hpp

View File

@ -30,13 +30,13 @@ namespace Opm {
class DeckKeyword;
class SegmentSet {
class WellSegments {
public:
SegmentSet() = default;
WellSegments() = default;
std::string wellName() const;
int numberBranch() const;
int numberSegment() const;
int size() const;
double depthTopSegment() const;
double lengthTopSegment() const;
double volumeTopSegment() const;
@ -59,8 +59,8 @@ namespace Opm {
void processABS();
void processINC(const bool first_time);
bool operator==( const SegmentSet& ) const;
bool operator!=( const SegmentSet& ) const;
bool operator==( const WellSegments& ) const;
bool operator!=( const WellSegments& ) const;
private:

View File

@ -22,11 +22,11 @@
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp>
namespace Opm {
ConnectionSet updatingConnectionsWithSegments(const DeckKeyword& compsegs, const ConnectionSet& input_connections, const SegmentSet& segments);
WellConnections updatingConnectionsWithSegments(const DeckKeyword& compsegs, const WellConnections& input_connections, const WellSegments& segments);
}
#endif

View File

@ -27,13 +27,13 @@
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellEconProductionLimits.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellPolymerProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
namespace Opm {
@ -41,9 +41,9 @@ namespace Opm {
template< typename > class DynamicState;
class COnnection;
class ConnectionSet;
class WellConnections;
class Segment;
class SegmentSet;
class WellSegments;
class TimeMap;
class EclipseGrid;
@ -95,10 +95,10 @@ namespace Opm {
void addWELSPECS(const DeckRecord& deckRecord);
void addConnections(size_t time_step, const std::vector< Connection >& );
void addConnectionSet(size_t time_step, ConnectionSet );
const ConnectionSet& getConnections(size_t timeStep) const;
const ConnectionSet& getConnections() const;
ConnectionSet getActiveConnections(size_t timeStep, const EclipseGrid& grid) const;
void addWellConnections(size_t time_step, WellConnections );
const WellConnections& getConnections(size_t timeStep) const;
const WellConnections& getConnections() const;
WellConnections getActiveConnections(size_t timeStep, const EclipseGrid& grid) const;
/* The rate of a given phase under the following assumptions:
* * Returns zero if production is requested for an injector (and vice
@ -157,9 +157,9 @@ namespace Opm {
// for multi-segment wells
bool isMultiSegment(size_t time_step) const;
const SegmentSet& getSegmentSet(size_t time_step) const;
const WellSegments& getWellSegments(size_t time_step) const;
void addSegmentSet(size_t time_step, SegmentSet new_segmentset);
void addWellSegments(size_t time_step, WellSegments new_segmentset);
const Events& getEvents() const;
void addEvent(ScheduleEvents::Events event, size_t reportStep);
@ -183,7 +183,7 @@ namespace Opm {
DynamicState< double > m_efficiencyFactors;
DynamicState< int > m_isProducer;
DynamicState< ConnectionSet > m_completions;
DynamicState< WellConnections > m_completions;
DynamicState< WellProductionProperties > m_productionProperties;
DynamicState< WellInjectionProperties > m_injectionProperties;
DynamicState< WellPolymerProperties > m_polymerProperties;
@ -203,7 +203,7 @@ namespace Opm {
bool m_automaticShutIn;
// WELSEGS DATA - for mutli-segment wells
// flag indicating if the well is a multi-segment well
DynamicState< SegmentSet > m_segmentset;
DynamicState< WellSegments > m_segmentset;
size_t timesteps;
Events events;
};

View File

@ -26,12 +26,12 @@
namespace Opm {
class EclipseGrid;
class ConnectionSet {
class WellConnections {
public:
ConnectionSet() = default;
WellConnections() = default;
// cppcheck-suppress noExplicitConstructor
ConnectionSet( std::initializer_list< Connection > );
ConnectionSet(const ConnectionSet& src, const EclipseGrid& grid);
WellConnections( std::initializer_list< Connection > );
WellConnections(const WellConnections& src, const EclipseGrid& grid);
using const_iterator = std::vector< Connection >::const_iterator;
@ -58,8 +58,8 @@ namespace Opm {
/// \param[in] grid EclipseGrid object, used for cell depths
void orderConnections(size_t well_i, size_t well_j);
bool operator==( const ConnectionSet& ) const;
bool operator!=( const ConnectionSet& ) const;
bool operator==( const WellConnections& ) const;
bool operator!=( const WellConnections& ) const;
private:
std::vector< Connection > m_connections;

View File

@ -33,7 +33,7 @@
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>

View File

@ -18,7 +18,7 @@
*/
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp>

View File

@ -22,8 +22,8 @@
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/C.hpp>
@ -135,7 +135,7 @@ namespace Opm {
return compsegs;
}
void Compsegs::processCOMPSEGS(std::vector< Compsegs >& compsegs, const SegmentSet& segment_set) {
void Compsegs::processCOMPSEGS(std::vector< Compsegs >& compsegs, const WellSegments& segment_set) {
// for the current cases we have at the moment, the distance information is specified explicitly,
// while the depth information is defaulted though, which need to be obtained from the related segment
for( auto& compseg : compsegs ) {
@ -148,7 +148,7 @@ namespace Opm {
int segment_number = 0;
double min_distance_difference = 1.e100; // begin with a big value
for (int i_segment = 0; i_segment < segment_set.numberSegment(); ++i_segment) {
for (int i_segment = 0; i_segment < segment_set.size(); ++i_segment) {
const Segment& current_segment = segment_set[i_segment];
if( branch_number != current_segment.branchNumber() ) continue;
@ -178,7 +178,7 @@ namespace Opm {
}
}
void Compsegs::calculateCenterDepthWithSegments(const SegmentSet& segment_set) {
void Compsegs::calculateCenterDepthWithSegments(const WellSegments& segment_set) {
// the depth and distance of the segment to the well head
const Segment& segment = segment_set.getFromSegmentNumber(m_segment_number);
@ -231,7 +231,7 @@ namespace Opm {
}
void Compsegs::updateConnectionsWithSegment(const std::vector< Compsegs >& compsegs,
ConnectionSet& connection_set) {
WellConnections& connection_set) {
for( const auto& compseg : compsegs ) {
const int i = compseg.m_i;

View File

@ -28,9 +28,9 @@
namespace Opm {
class ConnectionSet;
class WellConnections;
class DeckKeyword;
class SegmentSet;
class WellSegments;
struct Compsegs {
int m_i;
@ -52,16 +52,16 @@ namespace Opm {
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);
void calculateCenterDepthWithSegments(const SegmentSet& segment_set);
void calculateCenterDepthWithSegments(const WellSegments& segment_set);
static std::vector< Compsegs > compsegsFromCOMPSEGSKeyword( const DeckKeyword& compsegsKeyword );
// get the segment number information and depth information based on the information from SegmentSet
static void processCOMPSEGS(std::vector< Compsegs >& compsegs, const SegmentSet& segment_set );
// get the segment number information and depth information based on the information from WellSegments
static void processCOMPSEGS(std::vector< Compsegs >& compsegs, const WellSegments& segment_set );
// update the segment related information for Connections
static void updateConnectionsWithSegment(const std::vector< Compsegs >& compsegs,
ConnectionSet& connection_set);
WellConnections& connection_set);
};
}

View File

@ -30,52 +30,52 @@
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp>
namespace Opm {
std::string SegmentSet::wellName() const {
std::string WellSegments::wellName() const {
return m_well_name;
}
int SegmentSet::numberBranch() const {
int WellSegments::numberBranch() const {
return m_number_branch;
}
int SegmentSet::numberSegment() const {
int WellSegments::size() const {
return m_segments.size();
}
double SegmentSet::depthTopSegment() const {
double WellSegments::depthTopSegment() const {
return m_depth_top;
}
double SegmentSet::lengthTopSegment() const {
double WellSegments::lengthTopSegment() const {
return m_length_top;
}
double SegmentSet::volumeTopSegment() const {
double WellSegments::volumeTopSegment() const {
return m_volume_top;
}
WellSegment::LengthDepthEnum SegmentSet::lengthDepthType() const {
WellSegment::LengthDepthEnum WellSegments::lengthDepthType() const {
return m_length_depth_type;
}
WellSegment::CompPressureDropEnum SegmentSet::compPressureDrop() const {
WellSegment::CompPressureDropEnum WellSegments::compPressureDrop() const {
return m_comp_pressure_drop;
}
WellSegment::MultiPhaseModelEnum SegmentSet::multiPhaseModel() const {
WellSegment::MultiPhaseModelEnum WellSegments::multiPhaseModel() const {
return m_multiphase_model;
}
const Segment& SegmentSet::operator[](size_t idx) const {
const Segment& WellSegments::operator[](size_t idx) const {
return m_segments[idx];
}
int SegmentSet::segmentNumberToIndex(const int segment_number) const {
int WellSegments::segmentNumberToIndex(const int segment_number) const {
const auto it = m_segment_number_to_index.find(segment_number);
if (it != m_segment_number_to_index.end()) {
return it->second;
@ -84,21 +84,21 @@ namespace Opm {
}
}
void SegmentSet::addSegment( Segment new_segment ) {
void WellSegments::addSegment( Segment new_segment ) {
// decide whether to push_back or insert
const int segment_number = new_segment.segmentNumber();
const int segment_index = segmentNumberToIndex(segment_number);
if (segment_index < 0) { // it is a new segment
m_segment_number_to_index[segment_number] = numberSegment();
m_segment_number_to_index[segment_number] = size();
m_segments.push_back(new_segment);
} else { // the segment already exists
m_segments[segment_index] = new_segment;
}
}
void SegmentSet::segmentsFromWELSEGSKeyword( const DeckKeyword& welsegsKeyword ) {
void WellSegments::segmentsFromWELSEGSKeyword( const DeckKeyword& welsegsKeyword ) {
// for the first record, which provides the information for the top segment
// and information for the whole segment set
@ -218,7 +218,7 @@ namespace Opm {
}
const Segment& SegmentSet::getFromSegmentNumber(const int segment_number) const {
const Segment& WellSegments::getFromSegmentNumber(const int segment_number) const {
// the index of segment in the vector of segments
const int segment_index = segmentNumberToIndex(segment_number);
if (segment_index < 0) {
@ -228,13 +228,13 @@ namespace Opm {
return m_segments[segment_index];
}
void SegmentSet::processABS() {
void WellSegments::processABS() {
const double invalid_value = Segment::invalidValue(); // meaningless value to indicate unspecified/uncompleted values
orderSegments();
int current_index= 1;
while (current_index< numberSegment()) {
while (current_index< size()) {
if (m_segments[current_index].dataReady()) {
current_index++;
continue;
@ -247,13 +247,13 @@ namespace Opm {
assert(m_segments[outlet_index].dataReady() == true);
int range_end = range_begin + 1;
for (; range_end < numberSegment(); ++range_end) {
for (; range_end < size(); ++range_end) {
if (m_segments[range_end].dataReady() == true) {
break;
}
}
if (range_end >= numberSegment()) {
if (range_end >= size()) {
throw std::logic_error(" One range records in WELSEGS is wrong. ");
}
@ -290,7 +290,7 @@ namespace Opm {
// then update the volume for all the segments except the top segment
// this is for the segments specified individually while the volume is not specified.
for (int i = 1; i < numberSegment(); ++i) {
for (int i = 1; i < size(); ++i) {
assert(m_segments[i].dataReady());
if (m_segments[i].volume() == invalid_value) {
Segment new_segment = m_segments[i];
@ -304,9 +304,9 @@ namespace Opm {
}
}
void SegmentSet::processINC(const bool first_time) {
void WellSegments::processINC(const bool first_time) {
// update the information inside the SegmentSet to be in ABS way
// update the information inside the WellSegments to be in ABS way
if (first_time) {
Segment new_top_segment = (*this)[0];
new_top_segment.setDepthAndLength(depthTopSegment(), lengthTopSegment());
@ -316,7 +316,7 @@ namespace Opm {
orderSegments();
// begin with the second segment
for (int i_index= 1; i_index< numberSegment(); ++i_index) {
for (int i_index= 1; i_index< size(); ++i_index) {
if( m_segments[i_index].dataReady() ) continue;
// find its outlet segment
@ -339,7 +339,7 @@ namespace Opm {
}
}
void SegmentSet::orderSegments() {
void WellSegments::orderSegments() {
// re-ordering the segments to make later use easier.
// two principles
// 1. the index of the outlet segment will be stored in the lower index than the segment.
@ -354,14 +354,14 @@ namespace Opm {
// for the top segment
m_segment_number_to_index[1] = 0;
while (current_index< numberSegment()) {
while (current_index< size()) {
// the branch number of the last segment that is done re-ordering
const int last_branch_number = m_segments[current_index-1].branchNumber();
// the one need to be swapped to the current_index.
int target_segment_index= -1;
// looking for target_segment_index
for (int i_index= current_index; i_index< numberSegment(); ++i_index) {
for (int i_index= current_index; i_index< size(); ++i_index) {
const int outlet_segment_number = m_segments[i_index].outletSegment();
const int outlet_segment_index = segmentNumberToIndex(outlet_segment_number);
if (outlet_segment_index < 0) { // not found the outlet_segment in the done re-ordering segments
@ -395,7 +395,7 @@ namespace Opm {
}
}
bool SegmentSet::operator==( const SegmentSet& rhs ) const {
bool WellSegments::operator==( const WellSegments& rhs ) const {
return this->m_well_name == rhs.m_well_name
&& this->m_number_branch == rhs.m_number_branch
&& this->m_depth_top == rhs.m_depth_top
@ -414,7 +414,7 @@ namespace Opm {
rhs.m_segment_number_to_index.begin() );
}
bool SegmentSet::operator!=( const SegmentSet& rhs ) const {
bool WellSegments::operator!=( const WellSegments& rhs ) const {
return !( *this == rhs );
}
}

View File

@ -23,11 +23,11 @@
namespace Opm {
ConnectionSet updatingConnectionsWithSegments(const DeckKeyword& compsegs,
const ConnectionSet& input_connections,
const SegmentSet& segment_set)
WellConnections updatingConnectionsWithSegments(const DeckKeyword& compsegs,
const WellConnections& input_connections,
const WellSegments& segment_set)
{
ConnectionSet new_connection_set(input_connections);
WellConnections new_connection_set(input_connections);
std::vector<Compsegs> compsegs_vector = Compsegs::compsegsFromCOMPSEGSKeyword( compsegs );
Compsegs::processCOMPSEGS(compsegs_vector, segment_set);

View File

@ -36,13 +36,13 @@
#include <opm/parser/eclipse/Parser/ParserKeywords/W.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp>
@ -559,9 +559,9 @@ namespace Opm {
double wellPi = record.getItem("WELLPI").get< double >(0);
for( auto* well : getWells( wellNamePattern ) ) {
const auto& currentConnectionSet = well->getConnections(currentStep);
const auto& currentWellConnections = well->getConnections(currentStep);
ConnectionSet newConnectionSet;
WellConnections newWellConnections;
Opm::Value<int> I = getValueItem(record.getItem("I"));
Opm::Value<int> J = getValueItem(record.getItem("J"));
@ -569,20 +569,20 @@ namespace Opm {
Opm::Value<int> FIRST = getValueItem(record.getItem("FIRST"));
Opm::Value<int> LAST = getValueItem(record.getItem("LAST"));
size_t completionSize = currentConnectionSet.size();
size_t completionSize = currentWellConnections.size();
for(size_t i = 0; i < completionSize;i++) {
const auto& currentConnection = currentConnectionSet.get(i);
const auto& currentConnection = currentWellConnections.get(i);
if (FIRST.hasValue()) {
if (i < (size_t) FIRST.getValue()) {
newConnectionSet.add(currentConnection);
newWellConnections.add(currentConnection);
continue;
}
}
if (LAST.hasValue()) {
if (i > (size_t) LAST.getValue()) {
newConnectionSet.add(currentConnection);
newWellConnections.add(currentConnection);
continue;
}
}
@ -592,24 +592,24 @@ namespace Opm {
int ck = currentConnection.getK();
if (I.hasValue() && (!(I.getValue() == ci) )) {
newConnectionSet.add(currentConnection);
newWellConnections.add(currentConnection);
continue;
}
if (J.hasValue() && (!(J.getValue() == cj) )) {
newConnectionSet.add(currentConnection);
newWellConnections.add(currentConnection);
continue;
}
if (K.hasValue() && (!(K.getValue() == ck) )) {
newConnectionSet.add(currentConnection);
newWellConnections.add(currentConnection);
continue;
}
newConnectionSet.add( Connection{ currentConnection, wellPi } );
newWellConnections.add( Connection{ currentConnection, wellPi } );
}
well->addConnectionSet(currentStep, newConnectionSet);
well->addWellConnections(currentStep, newWellConnections);
}
}
}
@ -945,11 +945,11 @@ namespace Opm {
};
for( auto& well : this->getWells( wellname ) ) {
ConnectionSet new_completions;
WellConnections new_completions;
for( const auto& completion : well->getConnections( timestep ) )
new_completions.add( new_completion( completion ) );
well->addConnectionSet( timestep, new_completions );
well->addWellConnections( timestep, new_completions );
}
}
}
@ -1032,11 +1032,11 @@ namespace Opm {
};
for( auto* well : wells ) {
ConnectionSet new_completions;
WellConnections new_completions;
for( const auto& c : well->getConnections( currentStep ) )
new_completions.add( new_completion( c ) );
well->addConnectionSet( currentStep, new_completions );
well->addWellConnections( currentStep, new_completions );
m_events.addEvent( ScheduleEvents::COMPLETION_CHANGE, currentStep );
}
}
@ -1435,14 +1435,14 @@ namespace Opm {
}
void Schedule::handleWELSEGS( const DeckKeyword& keyword, size_t currentStep) {
SegmentSet newSegmentset;
WellSegments newSegmentset;
newSegmentset.segmentsFromWELSEGSKeyword(keyword);
const std::string& well_name = newSegmentset.wellName();
auto& well = this->m_wells.get( well_name );
// update multi-segment related information for the well
well.addSegmentSet(currentStep, newSegmentset);
well.addWellSegments(currentStep, newSegmentset);
}
void Schedule::handleCOMPSEGS( const DeckKeyword& keyword, size_t currentStep) {
@ -1450,11 +1450,11 @@ namespace Opm {
const std::string& well_name = record1.getItem("WELL").getTrimmedString(0);
auto& well = this->m_wells.get( well_name );
const auto& segment_set = well.getSegmentSet(currentStep);
const auto& segment_set = well.getWellSegments(currentStep);
const auto& completion_set = well.getConnections( currentStep );
const ConnectionSet new_completion_set = updatingConnectionsWithSegments(keyword, completion_set, segment_set);
const WellConnections new_completion_set = updatingConnectionsWithSegments(keyword, completion_set, segment_set);
well.addConnectionSet(currentStep, new_completion_set);
well.addWellConnections(currentStep, new_completion_set);
}
void Schedule::handleWGRUPCON( const DeckKeyword& keyword, size_t currentStep) {

View File

@ -23,9 +23,9 @@
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/SegmentSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
@ -48,7 +48,7 @@ namespace Opm {
m_guideRateScalingFactor( timeMap, 1.0 ),
m_efficiencyFactors (timeMap, 1.0 ),
m_isProducer( timeMap, true ) ,
m_completions( timeMap, ConnectionSet{} ),
m_completions( timeMap, WellConnections{} ),
m_productionProperties( timeMap, WellProductionProperties() ),
m_injectionProperties( timeMap, WellInjectionProperties() ),
m_polymerProperties( timeMap, WellPolymerProperties() ),
@ -64,7 +64,7 @@ namespace Opm {
m_comporder(completionOrdering),
m_allowCrossFlow(allowCrossFlow),
m_automaticShutIn(automaticShutIn),
m_segmentset( timeMap, SegmentSet{} ),
m_segmentset( timeMap, WellSegments{} ),
timesteps( timeMap.numTimesteps() ),
events( timeMap )
{
@ -347,15 +347,15 @@ namespace Opm {
return m_preferredPhase;
}
const ConnectionSet& Well::getConnections(size_t timeStep) const {
const WellConnections& Well::getConnections(size_t timeStep) const {
return m_completions.get( timeStep );
}
ConnectionSet Well::getActiveConnections(size_t timeStep, const EclipseGrid& grid) const {
return ConnectionSet(this->getConnections(timeStep), grid);
WellConnections Well::getActiveConnections(size_t timeStep, const EclipseGrid& grid) const {
return WellConnections(this->getConnections(timeStep), grid);
}
const ConnectionSet& Well::getConnections() const {
const WellConnections& Well::getConnections() const {
return m_completions.back();
}
@ -383,10 +383,10 @@ namespace Opm {
else ++prev_size;
}
this->addConnectionSet( time_step, new_set );
this->addWellConnections( time_step, new_set );
}
void Well::addConnectionSet(size_t time_step, ConnectionSet new_set ){
void Well::addWellConnections(size_t time_step, WellConnections new_set ){
if( getWellConnectionOrdering() == WellCompletion::TRACK) {
const auto headI = this->m_headI[ time_step ];
const auto headJ = this->m_headJ[ time_step ];
@ -532,15 +532,15 @@ namespace Opm {
}
const SegmentSet& Well::getSegmentSet(size_t time_step) const {
const WellSegments& Well::getWellSegments(size_t time_step) const {
return m_segmentset.get(time_step);
}
bool Well::isMultiSegment(size_t time_step) const {
return (getSegmentSet(time_step).numberSegment() > 0);
return (getWellSegments(time_step).size() > 0);
}
void Well::addSegmentSet(size_t time_step, SegmentSet new_segmentset ) {
void Well::addWellSegments(size_t time_step, WellSegments new_segmentset ) {
// to see if it is the first time entering WELSEGS input to this well.
// if the well is not multi-segment well, it will be the first time
// not sure if a well can switch between mutli-segment well and other
@ -582,7 +582,7 @@ namespace Opm {
void Well::filterConnections(const EclipseGrid& grid) {
/*
The m_completions member variable is DynamicState<ConnectionSet>
The m_completions member variable is DynamicState<WellConnections>
instance, hence this for loop is over all timesteps.
*/
for (auto& completions : m_completions)

View File

@ -24,31 +24,31 @@
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
namespace Opm {
ConnectionSet::ConnectionSet( std::initializer_list< Connection > cs ) {
WellConnections::WellConnections( std::initializer_list< Connection > cs ) {
for( auto&& c : cs ) this->add( c );
}
ConnectionSet::ConnectionSet(const ConnectionSet& src, const EclipseGrid& grid) {
WellConnections::WellConnections(const WellConnections& src, const EclipseGrid& grid) {
for (const auto& c : src) {
if (grid.cellActive(c.getI(), c.getJ(), c.getK()))
this->add(c);
}
}
size_t ConnectionSet::size() const {
size_t WellConnections::size() const {
return m_connections.size();
}
const Connection& ConnectionSet::get(size_t index) const {
const Connection& WellConnections::get(size_t index) const {
return this->m_connections.at( index );
}
const Connection& ConnectionSet::getFromIJK(const int i, const int j, const int k) const {
const Connection& WellConnections::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,7 +58,7 @@ namespace Opm {
}
void ConnectionSet::add( Connection connection ) {
void WellConnections::add( Connection connection ) {
auto same = [&]( const Connection& c ) {
return c.sameCoordinate( connection );
};
@ -76,7 +76,7 @@ namespace Opm {
m_connections.emplace_back( connection );
}
bool ConnectionSet::allConnectionsShut( ) const {
bool WellConnections::allConnectionsShut( ) const {
auto shut = []( const Connection& c ) {
return c.getState() == WellCompletion::StateEnum::SHUT;
};
@ -88,7 +88,7 @@ namespace Opm {
void ConnectionSet::orderConnections(size_t well_i, size_t well_j)
void WellConnections::orderConnections(size_t well_i, size_t well_j)
{
if (m_connections.empty()) {
return;
@ -117,7 +117,7 @@ namespace Opm {
size_t ConnectionSet::findClosestConnection(int oi, int oj, double oz, size_t start_pos)
size_t WellConnections::findClosestConnection(int oi, int oj, double oz, size_t start_pos)
{
size_t closest = std::numeric_limits<size_t>::max();
int min_ijdist2 = std::numeric_limits<int>::max();
@ -146,17 +146,17 @@ namespace Opm {
return closest;
}
bool ConnectionSet::operator==( const ConnectionSet& rhs ) const {
bool WellConnections::operator==( const WellConnections& rhs ) const {
return this->size() == rhs.size()
&& std::equal( this->begin(), this->end(), rhs.begin() );
}
bool ConnectionSet::operator!=( const ConnectionSet& rhs ) const {
bool WellConnections::operator!=( const WellConnections& rhs ) const {
return !( *this == rhs );
}
void ConnectionSet::filter(const EclipseGrid& grid) {
void WellConnections::filter(const EclipseGrid& grid) {
auto new_end = std::remove_if(m_connections.begin(),
m_connections.end(),
[&grid](const Connection& c) { return !grid.cellActive(c.getI(), c.getJ(), c.getK()); });

View File

@ -29,7 +29,7 @@
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>

View File

@ -33,7 +33,7 @@
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
@ -43,7 +43,7 @@ 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 ConnectionSet& cs ) {
inline std::ostream& operator<<( std::ostream& stream, const WellConnections& cs ) {
stream << "{ ";
for( const auto& c : cs ) stream << c << " ";
return stream << "}";
@ -85,15 +85,15 @@ BOOST_AUTO_TEST_CASE(CompletionTestssameCoordinate) {
BOOST_CHECK_EQUAL( false , completion1.sameCoordinate( completion5 ));
}
BOOST_AUTO_TEST_CASE(CreateConnectionSetOK) {
Opm::ConnectionSet completionSet;
BOOST_AUTO_TEST_CASE(CreateWellConnectionsOK) {
Opm::WellConnections completionSet;
BOOST_CHECK_EQUAL( 0U , completionSet.size() );
}
BOOST_AUTO_TEST_CASE(AddCompletionSizeCorrect) {
Opm::ConnectionSet completionSet;
Opm::WellConnections completionSet;
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 );
@ -106,8 +106,8 @@ BOOST_AUTO_TEST_CASE(AddCompletionSizeCorrect) {
}
BOOST_AUTO_TEST_CASE(ConnectionSetGetOutOfRangeThrows) {
Opm::ConnectionSet completionSet;
BOOST_AUTO_TEST_CASE(WellConnectionsGetOutOfRangeThrows) {
Opm::WellConnections completionSet;
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 );
@ -123,7 +123,7 @@ BOOST_AUTO_TEST_CASE(ConnectionSetGetOutOfRangeThrows) {
BOOST_AUTO_TEST_CASE(AddCompletionSameCellUpdates) {
Opm::ConnectionSet completionSet;
Opm::WellConnections completionSet;
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);
@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(AddCompletionSameCellUpdates) {
BOOST_AUTO_TEST_CASE(AddCompletionCopy) {
Opm::ConnectionSet completionSet;
Opm::WellConnections completionSet;
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);
@ -160,7 +160,7 @@ BOOST_AUTO_TEST_CASE(AddCompletionCopy) {
BOOST_AUTO_TEST_CASE(ActiveCompletions) {
Opm::EclipseGrid grid(10,10,10);
Opm::ConnectionSet completions;
Opm::WellConnections completions;
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);
@ -173,7 +173,7 @@ BOOST_AUTO_TEST_CASE(ActiveCompletions) {
actnum[0] = 0;
grid.resetACTNUM( actnum.data() );
Opm::ConnectionSet active_completions(completions, grid);
Opm::WellConnections active_completions(completions, grid);
BOOST_CHECK_EQUAL( active_completions.size() , 2);
BOOST_CHECK_EQUAL( completion2, active_completions.get(0));
BOOST_CHECK_EQUAL( completion3, active_completions.get(1));

View File

@ -21,7 +21,7 @@
#include <iostream>
#include <boost/filesystem.hpp>
#define BOOST_TEST_MODULE ConnectionSetTests
#define BOOST_TEST_MODULE WellConnectionsTests
#include <boost/test/unit_test.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
@ -33,7 +33,7 @@
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Connection.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
@ -42,7 +42,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp>
BOOST_AUTO_TEST_CASE(MultisegmentWellTest) {
Opm::ConnectionSet connection_set;
Opm::WellConnections connection_set;
connection_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) );
connection_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) );
connection_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) );
@ -80,13 +80,13 @@ BOOST_AUTO_TEST_CASE(MultisegmentWellTest) {
const Opm::DeckKeyword compsegs = deck.getKeyword("COMPSEGS");
BOOST_CHECK_EQUAL( 8U, compsegs.size() );
Opm::SegmentSet segment_set;
Opm::WellSegments segment_set;
const Opm::DeckKeyword welsegs = deck.getKeyword("WELSEGS");
segment_set.segmentsFromWELSEGSKeyword(welsegs);
BOOST_CHECK_EQUAL(6U, segment_set.numberSegment());
BOOST_CHECK_EQUAL(6U, segment_set.size());
const Opm::ConnectionSet new_connection_set = Opm::updatingConnectionsWithSegments(compsegs, connection_set, segment_set);
const Opm::WellConnections new_connection_set = Opm::updatingConnectionsWithSegments(compsegs, connection_set, segment_set);
BOOST_CHECK_EQUAL(7U, new_connection_set.size());

View File

@ -31,7 +31,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>

View File

@ -28,7 +28,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/WellTestConfig.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>

View File

@ -33,7 +33,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/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
@ -395,11 +395,11 @@ BOOST_AUTO_TEST_CASE(CompletionOrder) {
auto c2 = connection(5, 5, 9);
auto c3 = connection(5, 5, 1);
auto c4 = connection(5, 5, 0);
Opm::ConnectionSet cv1 = { c1, c2 };
well.addConnectionSet(1, cv1);
Opm::WellConnections cv1 = { c1, c2 };
well.addWellConnections(1, cv1);
BOOST_CHECK_EQUAL(well.getConnections(1).get(0), c1);
Opm::ConnectionSet cv2 = { c3, c4 };
well.addConnectionSet(2, cv2);
Opm::WellConnections cv2 = { c3, c4 };
well.addWellConnections(2, cv2);
BOOST_CHECK_EQUAL(well.getConnections(1).get(0), c1);
BOOST_CHECK_EQUAL(well.getConnections(2).get(0), c4);
}

View File

@ -34,7 +34,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
#include <opm/parser/eclipse/Units/Units.hpp>

View File

@ -25,7 +25,7 @@
#include <opm/output/eclipse/EclipseIO.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>