-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34ea12e
commit c09263f
Showing
10 changed files
with
189 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
Copyright 2024 Equinor ASA. | ||
This file is part of the Open Porous Media project (OPM). | ||
OPM is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OPM is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with OPM. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#include <opm/input/eclipse/Schedule/ResCoup/ReadCouplingFile.hpp> | ||
#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp> | ||
#include <opm/input/eclipse/Schedule/ScheduleState.hpp> | ||
#include <opm/input/eclipse/Parser/ParserKeywords/U.hpp> | ||
#include <opm/common/OpmLog/OpmLog.hpp> | ||
#include <opm/common/utility/OpmInputError.hpp> | ||
#include "../HandlerContext.hpp" | ||
|
||
|
||
namespace Opm { | ||
|
||
void handleUSECUPL(HandlerContext& handlerContext) | ||
{ | ||
auto& schedule_state = handlerContext.state(); | ||
auto rescoup = schedule_state.rescoup(); | ||
const auto& keyword = handlerContext.keyword; | ||
// Opm::Parser::parseFile() (see readDeck.cpp in opm-simulators) will throw an exception if there | ||
// is more than one record for this keyword, so we can assume that there is exactly one record here. | ||
auto record = keyword[0]; | ||
{ | ||
auto deck_item = record.getItem<ParserKeywords::USECUPL::BASE>(); | ||
if (deck_item.defaultApplied(0)) { | ||
throw OpmInputError("Root name of coupling file (item 1) cannot be defaulted.", keyword.location()); | ||
} | ||
auto root_name = deck_item.getTrimmedString(0); | ||
rescoup.readCouplingFileName(root_name); | ||
} | ||
{ | ||
auto deck_item = record.getItem<ParserKeywords::USECUPL::FMT>(); | ||
if (deck_item.defaultApplied(0)) { | ||
throw OpmInputError("Format of coupling file (item 2) cannot be defaulted.", keyword.location()); | ||
} | ||
auto flag_str = deck_item.getTrimmedString(0); | ||
auto coupling_file_flag = ReservoirCoupling::CouplingInfo::couplingFileFlagFromString( | ||
flag_str, keyword); | ||
rescoup.readCouplingFileFlag(coupling_file_flag); | ||
} | ||
schedule_state.rescoup.update( std::move( rescoup )); | ||
} | ||
|
||
} // namespace Opm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
Copyright 2024 Equinor ASA. | ||
This file is part of the Open Porous Media project (OPM). | ||
OPM is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OPM is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with OPM. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
#ifndef OPM_READ_RESERVOIR_COUPLING_FILE_HPP | ||
#define OPM_READ_RESERVOIR_COUPLING_FILE_HPP | ||
namespace Opm { | ||
|
||
class HandlerContext; | ||
|
||
extern void handleUSECUPL(HandlerContext& handlerContext); | ||
|
||
} // namespace Opm | ||
#endif // OPM_READ_RESERVOIR_COUPLING_FILE_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
"sections": [ | ||
"SCHEDULE" | ||
], | ||
"size": 1, | ||
"items": [ | ||
{ | ||
"name": "BASE", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters