-
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.
Showing
7 changed files
with
353 additions
and
108 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
58 changes: 58 additions & 0 deletions
58
opm/input/eclipse/Schedule/ResCoup/MasterMinimumTimeStep.cpp
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,58 @@ | ||
/* | ||
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/MasterMinimumTimeStep.hpp> | ||
#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp> | ||
#include <opm/input/eclipse/Schedule/ScheduleState.hpp> | ||
#include <opm/input/eclipse/Parser/ParserKeywords/R.hpp> | ||
#include <opm/common/OpmLog/OpmLog.hpp> | ||
#include <opm/common/utility/OpmInputError.hpp> | ||
#include "../HandlerContext.hpp" | ||
|
||
|
||
namespace Opm { | ||
|
||
void handleRCMASTS(HandlerContext& handlerContext) | ||
{ | ||
auto& schedule_state = handlerContext.state(); | ||
auto rescoup = schedule_state.rescoup(); | ||
auto tuning = schedule_state.tuning(); | ||
const auto& keyword = handlerContext.keyword; | ||
if (keyword.size() != 1) { | ||
throw OpmInputError("RCMASTS keyword requires exactly one record.", keyword.location()); | ||
} | ||
auto record = keyword[0]; | ||
auto deck_item = record.getItem<ParserKeywords::RCMASTS::MIN_TSTEP>(); | ||
if (deck_item.defaultApplied(0)) { | ||
// The default value is the current value TSMINZ | ||
rescoup.masterMinTimeStep(tuning.TSMINZ); | ||
} | ||
else { | ||
auto tstep = deck_item.getSIDouble(0); | ||
if (tstep < 0.0) { | ||
throw OpmInputError("Negative value for RCMASTS is not allowed.", keyword.location()); | ||
} | ||
rescoup.masterMinTimeStep(tstep); | ||
} | ||
schedule_state.rescoup.update( std::move( rescoup )); | ||
} | ||
|
||
} // namespace Opm | ||
|
28 changes: 28 additions & 0 deletions
28
opm/input/eclipse/Schedule/ResCoup/MasterMinimumTimeStep.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
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 RESERVOIR_COUPLING_MASTER_MINIMUM_TIMESTEP_HPP | ||
#define RESERVOIR_COUPLING_MASTER_MINIMUM_TIMESTEP_HPP | ||
namespace Opm { | ||
|
||
class HandlerContext; | ||
|
||
extern void handleRCMASTS(HandlerContext& handlerContext); | ||
|
||
} // namespace Opm | ||
#endif // RESERVOIR_COUPLING_MASTER_MINIMUM_TIMESTEP_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
Oops, something went wrong.