Fixed small reading bug in well structure
This commit is contained in:
parent
017bf98208
commit
54a8f7335c
@ -333,6 +333,33 @@ namespace Opm
|
|||||||
THROW("Failed creating Wells struct.");
|
THROW("Failed creating Wells struct.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Classify wells
|
||||||
|
if (deck.hasField("WCONINJE")) {
|
||||||
|
const std::vector<WconinjeLine>& lines = deck.getWCONINJE().wconinje;
|
||||||
|
for (size_t i = 0 ; i < lines.size(); ++i) {
|
||||||
|
const std::map<std::string, int>::const_iterator it = well_names_to_index.find(lines[i].well_);
|
||||||
|
if (it != well_names_to_index.end()) {
|
||||||
|
const int well_index = it->second;
|
||||||
|
well_data[well_index].type = INJECTOR;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
THROW("Unseen well name: " << lines[i].well_ << " first seen in WCONINJE");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (deck.hasField("WCONPROD")) {
|
||||||
|
const std::vector<WconprodLine>& lines = deck.getWCONPROD().wconprod;
|
||||||
|
for (size_t i = 0; i < lines.size(); ++i) {
|
||||||
|
const std::map<std::string, int>::const_iterator it = well_names_to_index.find(lines[i].well_);
|
||||||
|
if (it != well_names_to_index.end()) {
|
||||||
|
const int well_index = it->second;
|
||||||
|
} else {
|
||||||
|
THROW("Unseen well name: " << lines[i].well_ << " first seen in WCONPROD");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add wells.
|
// Add wells.
|
||||||
for (int w = 0; w < num_wells; ++w) {
|
for (int w = 0; w < num_wells; ++w) {
|
||||||
const int w_num_perf = wellperf_data[w].size();
|
const int w_num_perf = wellperf_data[w].size();
|
||||||
|
@ -1313,7 +1313,7 @@ struct GCONPROD : public SpecialBase
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Class holding a data line of keyword WCONPROD
|
/// Class holding a data line of keyword WGRUPCON
|
||||||
struct WgrupconLine
|
struct WgrupconLine
|
||||||
{
|
{
|
||||||
std::string well_; // Well name
|
std::string well_; // Well name
|
||||||
@ -1467,12 +1467,12 @@ struct WCONPROD : public SpecialBase
|
|||||||
wconprod_line.well_ = wellname;
|
wconprod_line.well_ = wellname;
|
||||||
wconprod_line.open_shut_flag_ = readString(is);
|
wconprod_line.open_shut_flag_ = readString(is);
|
||||||
wconprod_line.control_mode_ = readString(is);
|
wconprod_line.control_mode_ = readString(is);
|
||||||
std::vector<double> double_data(9, -1.0E20);
|
std::vector<double> double_data(14, -1.0E20);
|
||||||
double_data[5] = wconprod_line.BHP_limit_;
|
double_data[5] = wconprod_line.BHP_limit_;
|
||||||
double_data[6] = wconprod_line.THP_limit_;
|
double_data[6] = wconprod_line.THP_limit_;
|
||||||
double_data[7] = wconprod_line.VFP_table_number_;
|
double_data[7] = wconprod_line.VFP_table_number_;
|
||||||
double_data[8] = wconprod_line.artif_lift_quantity_;
|
double_data[8] = wconprod_line.artif_lift_quantity_;
|
||||||
const int num_to_read = 9;
|
const int num_to_read = 14;
|
||||||
int num_read = readDefaultedVectorData(is, double_data, num_to_read);
|
int num_read = readDefaultedVectorData(is, double_data, num_to_read);
|
||||||
wconprod_line.oil_max_rate_ = double_data[0];
|
wconprod_line.oil_max_rate_ = double_data[0];
|
||||||
wconprod_line.water_max_rate_ = double_data[1];
|
wconprod_line.water_max_rate_ = double_data[1];
|
||||||
|
Loading…
Reference in New Issue
Block a user