mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2015 Update opm-flowdiagnostics-applications to 64d079b736cd70c7139d5e79fb0080233f47db4b
This commit is contained in:
parent
9449bbff20
commit
39dc4c0c06
@ -225,7 +225,7 @@ namespace example {
|
|||||||
|
|
||||||
bool selectReportStep(const int step)
|
bool selectReportStep(const int step)
|
||||||
{
|
{
|
||||||
if (this->available_steps.count(step) == 0) {
|
if (!this->available_steps.empty() && this->available_steps.count(step) == 0) {
|
||||||
// Requested report step not amongst those stored in the
|
// Requested report step not amongst those stored in the
|
||||||
// result set.
|
// result set.
|
||||||
return false;
|
return false;
|
||||||
|
@ -305,6 +305,11 @@ Opm::ECLCaseUtilities::ResultSet::reportStepIDs() const
|
|||||||
ecl_file_open(rsspec_fn.generic_string().c_str(), open_flags)
|
ecl_file_open(rsspec_fn.generic_string().c_str(), open_flags)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// If spec file was not found, return empty vector.
|
||||||
|
if (!rsspec) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
auto* globView = ecl_file_get_global_view(rsspec.get());
|
auto* globView = ecl_file_get_global_view(rsspec.get());
|
||||||
|
|
||||||
const auto* ITIME_kw = "ITIME";
|
const auto* ITIME_kw = "ITIME";
|
||||||
|
@ -205,12 +205,18 @@ namespace Opm
|
|||||||
if (std::fabs(well_reservoir_inflow_rate) < rate_threshold_) {
|
if (std::fabs(well_reservoir_inflow_rate) < rate_threshold_) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// Skip if well has no connections (for example, if this
|
||||||
|
// is a sector model wells that are outside this sector
|
||||||
|
// will have -1 for ncon).
|
||||||
|
const int ncon = iwel[well * ih.niwel + IWEL_CONNECTIONS_INDEX];
|
||||||
|
if (ncon < 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// Otherwise: add data for this well.
|
// Otherwise: add data for this well.
|
||||||
WellData wd;
|
WellData wd;
|
||||||
wd.name = trimSpacesRight(zwel[well * ih.nzwel]);
|
wd.name = trimSpacesRight(zwel[well * ih.nzwel]);
|
||||||
const bool is_producer = (iwel[well * ih.niwel + IWEL_TYPE_INDEX] == IWEL_TYPE_PRODUCER);
|
const bool is_producer = (iwel[well * ih.niwel + IWEL_TYPE_INDEX] == IWEL_TYPE_PRODUCER);
|
||||||
wd.is_injector_well = !is_producer;
|
wd.is_injector_well = !is_producer;
|
||||||
const int ncon = iwel[well * ih.niwel + IWEL_CONNECTIONS_INDEX];
|
|
||||||
wd.completions.reserve(ncon);
|
wd.completions.reserve(ncon);
|
||||||
for (int comp_index = 0; comp_index < ncon; ++comp_index) {
|
for (int comp_index = 0; comp_index < ncon; ++comp_index) {
|
||||||
const int icon_offset = (well*ih.ncwma + comp_index) * ih.nicon;
|
const int icon_offset = (well*ih.ncwma + comp_index) * ih.nicon;
|
||||||
|
Loading…
Reference in New Issue
Block a user