Add keyword NTG to Cell props struct

This commit is contained in:
Daniel 2021-11-09 10:16:09 +01:00
parent c3a55cb03b
commit 11ddf673f0
2 changed files with 11 additions and 1 deletions

View File

@ -39,6 +39,7 @@ public:
double permz;
int satnum;
int pvtnum;
double ntg;
bool operator==(const Props& other) const{
return this->active_index == other.active_index &&
@ -46,7 +47,8 @@ public:
this->permy == other.permy &&
this->permz == other.permz &&
this->satnum == other.satnum &&
this->pvtnum == other.pvtnum;
this->pvtnum == other.pvtnum &&
this->ntg == other.ntg;
}
};

View File

@ -41,6 +41,13 @@ namespace {
else
throw std::logic_error(fmt::format("FieldPropsManager is missing keyword '{}'", kw));
}
double try_get_ntg_value(const Opm::FieldPropsManager& fp, const std::string& kw, std::size_t active_index){
if (fp.has_double(kw))
return fp.try_get<double>(kw)->at(active_index);
else
return 1.0;
}
}
const Opm::CompletedCells::Cell& Opm::ScheduleGrid::get_cell(std::size_t i, std::size_t j, std::size_t k) const {
@ -58,6 +65,7 @@ const Opm::CompletedCells::Cell& Opm::ScheduleGrid::get_cell(std::size_t i, std:
props.permz = try_get_value(*this->fp, "PERMZ", props.active_index);
props.satnum = this->fp->get_int("SATNUM").at(props.active_index);
props.pvtnum = this->fp->get_int("PVTNUM").at(props.active_index);
props.ntg = try_get_ntg_value(*this->fp, "NTG", props.active_index);
cell.props = props;
}
}