Merge pull request #2145 from joakim-hove/improve-error-message

Improve error message for connection in inactive cell
This commit is contained in:
Joakim Hove 2020-12-02 08:29:55 +01:00 committed by GitHub
commit f5cc5bc3f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View File

@ -63,7 +63,7 @@ namespace Opm {
const Connection::CTFKind ctf_kind = Connection::CTFKind::DeckValue,
const std::size_t seqIndex = 0,
const bool defaultSatTabId = true);
void loadCOMPDAT(const DeckRecord& record, const EclipseGrid& grid, const FieldPropsManager& field_properties, const KeywordLocation& location);
void loadCOMPDAT(const DeckRecord& record, const EclipseGrid& grid, const FieldPropsManager& field_properties, const std::string& wname, const KeywordLocation& location);
using const_iterator = std::vector< Connection >::const_iterator;
@ -156,6 +156,7 @@ namespace Opm {
const std::vector<double>* permy,
const std::vector<double>* permz,
const std::vector<double>& ntg,
const std::string& wname,
const KeywordLocation& location);
size_t findClosestConnection(int oi, int oj, double oz, size_t start_pos);

View File

@ -153,7 +153,7 @@ namespace {
for (const auto& name : wellnames) {
auto well2 = std::shared_ptr<Well>(new Well( this->getWell(name, handlerContext.currentStep)));
auto connections = std::shared_ptr<WellConnections>( new WellConnections( well2->getConnections()));
connections->loadCOMPDAT(record, handlerContext.grid, handlerContext.fieldPropsManager, handlerContext.keyword.location());
connections->loadCOMPDAT(record, handlerContext.grid, handlerContext.fieldPropsManager, name, handlerContext.keyword.location());
if (well2->updateConnections(connections, handlerContext.grid, handlerContext.fieldPropsManager.get_int("PVTNUM"))) {
this->updateWell(std::move(well2), handlerContext.currentStep);
wells.insert( name );

View File

@ -271,14 +271,14 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
defaultSatTabId);
}
void WellConnections::loadCOMPDAT(const DeckRecord& record, const EclipseGrid& grid, const FieldPropsManager& field_properties, const KeywordLocation& location) {
void WellConnections::loadCOMPDAT(const DeckRecord& record, const EclipseGrid& grid, const FieldPropsManager& field_properties, const std::string& wname, const KeywordLocation& location) {
const auto permx = field_properties.try_get<double>("PERMX");
const auto permy = field_properties.try_get<double>("PERMY");
const auto permz = field_properties.try_get<double>("PERMZ");
const auto& ntg = field_properties.get_double("NTG");
const auto& satnum_data = field_properties.get_int("SATNUM");
this->loadCOMPDAT(record, grid, satnum_data, permx, permy, permz, ntg, location);
this->loadCOMPDAT(record, grid, satnum_data, permx, permy, permz, ntg, wname, location);
}
void WellConnections::loadCOMPDAT(const DeckRecord& record,
@ -288,6 +288,7 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
const std::vector<double>* permy,
const std::vector<double>* permz,
const std::vector<double>& ntg,
const std::string& wname,
const KeywordLocation& location) {
const auto& itemI = record.getItem( "I" );
@ -331,7 +332,7 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
if (!grid.cellActive(I, J, k)) {
auto msg = fmt::format("Problem with COMPDAT keyword\n"
"In {} line {}\n"
"The cell ({},{},{}) is not active and the connection will be ignored", location.filename, location.lineno, I,J,k);
"The cell ({},{},{}) in well {} is not active and the connection will be ignored", location.filename, location.lineno, I,J,k, wname);
OpmLog::warning(msg);
continue;
}

View File

@ -62,7 +62,7 @@ Opm::WellConnections loadCOMPDAT(const std::string& compdat_keyword) {
const auto& keyword = deck.getKeyword("COMPDAT", 0);
Opm::WellConnections connections(Opm::Connection::Order::TRACK, 10,10);
for (const auto& rec : keyword)
connections.loadCOMPDAT(rec, grid, field_props, {});
connections.loadCOMPDAT(rec, grid, field_props, "WELL", {});
return connections;
}