2021-05-05 05:13:25 -05:00
|
|
|
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
// vi: set et ts=4 sw=4 sts=4:
|
|
|
|
/*
|
|
|
|
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 2 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/>.
|
|
|
|
|
|
|
|
Consult the COPYING file in the top-level source directory of this
|
|
|
|
module for the precise wording of the license and the list of
|
|
|
|
copyright holders.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
2024-05-06 07:02:39 -05:00
|
|
|
#include <opm/simulators/flow/FlowGenericVanguard.hpp>
|
2021-05-05 05:13:25 -05:00
|
|
|
|
2024-08-15 02:26:02 -05:00
|
|
|
#include <dune/common/version.hh>
|
|
|
|
#include <dune/common/parallel/mpihelper.hh>
|
|
|
|
#include <dune/common/timer.hh>
|
|
|
|
|
2023-01-31 05:38:54 -06:00
|
|
|
#include <opm/common/utility/MemPacker.hpp>
|
|
|
|
#include <opm/common/utility/Serializer.hpp>
|
|
|
|
|
2021-05-05 05:13:25 -05:00
|
|
|
#include <opm/common/ErrorMacros.hpp>
|
2024-05-06 07:02:39 -05:00
|
|
|
|
2021-05-05 05:13:25 -05:00
|
|
|
#include <opm/common/utility/TimeService.hpp>
|
2024-05-06 07:02:39 -05:00
|
|
|
|
2021-12-14 01:30:15 -06:00
|
|
|
#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp>
|
|
|
|
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
2024-05-06 07:02:39 -05:00
|
|
|
#include <opm/input/eclipse/EclipseState/Runspec.hpp>
|
|
|
|
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
|
|
|
|
|
|
|
#include <opm/input/eclipse/Python/Python.hpp>
|
|
|
|
|
2023-01-31 05:38:54 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/Action/Actions.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Action/ASTNode.hpp>
|
2021-12-14 01:30:15 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/Action/State.hpp>
|
2023-01-31 05:38:54 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Group/GConSale.hpp>
|
2023-08-07 05:39:26 -05:00
|
|
|
#include <opm/input/eclipse/Schedule/Group/GroupEconProductionLimits.hpp>
|
2023-01-31 05:38:54 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/Group/GConSump.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Group/GuideRateConfig.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Network/Balance.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
|
2021-12-14 01:30:15 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/OilVaporizationProperties.hpp>
|
2023-01-31 05:38:54 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/RFTConfig.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/RPTConfig.hpp>
|
2021-12-14 01:30:15 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/Schedule.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/SummaryState.hpp>
|
2023-01-31 05:38:54 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/UDQ/UDQActive.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/UDQ/UDQASTNode.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/UDQ/UDQConfig.hpp>
|
2024-05-06 07:02:39 -05:00
|
|
|
#include <opm/input/eclipse/Schedule/UDQ/UDQParams.hpp>
|
2021-12-14 01:30:15 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp>
|
2023-01-31 05:38:54 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/Well/NameOrder.hpp>
|
2023-08-23 01:35:26 -05:00
|
|
|
#include <opm/input/eclipse/Schedule/Well/WDFAC.hpp>
|
2023-01-31 05:38:54 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Well/WellBrineProperties.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Well/WellEconProductionLimits.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Well/WellFoamProperties.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Well/WellMICPProperties.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Well/WellPolymerProperties.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Well/WellTracerProperties.hpp>
|
|
|
|
#include <opm/input/eclipse/Schedule/Well/WListManager.hpp>
|
2023-06-01 05:18:01 -05:00
|
|
|
#include <opm/input/eclipse/Schedule/Well/WVFPDP.hpp>
|
2023-01-31 05:38:54 -06:00
|
|
|
#include <opm/input/eclipse/Schedule/Well/WVFPEXP.hpp>
|
2024-05-06 07:02:39 -05:00
|
|
|
|
|
|
|
#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
|
|
|
|
|
2024-09-02 05:56:18 -05:00
|
|
|
#include <opm/models/utils/parametersystem.hpp>
|
2021-05-05 05:13:25 -05:00
|
|
|
|
2024-08-15 02:26:02 -05:00
|
|
|
#include <opm/simulators/flow/BlackoilModelParameters.hpp>
|
|
|
|
#include <opm/simulators/utils/readDeck.hpp>
|
2021-05-05 05:13:25 -05:00
|
|
|
|
|
|
|
#if HAVE_MPI
|
|
|
|
#include <mpi.h>
|
|
|
|
#endif // HAVE_MPI
|
|
|
|
|
2021-11-01 06:31:40 -05:00
|
|
|
#include <filesystem>
|
2021-05-06 03:26:01 -05:00
|
|
|
#include <stdexcept>
|
|
|
|
|
2021-05-05 05:13:25 -05:00
|
|
|
namespace Opm {
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
std::unique_ptr<Parallel::Communication> FlowGenericVanguard::comm_;
|
|
|
|
FlowGenericVanguard::SimulationModelParams FlowGenericVanguard::modelParams_;
|
2021-05-05 05:13:25 -05:00
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
FlowGenericVanguard::FlowGenericVanguard()
|
|
|
|
: FlowGenericVanguard(std::move(modelParams_))
|
2023-01-31 05:38:54 -06:00
|
|
|
{}
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
FlowGenericVanguard::FlowGenericVanguard(SimulationModelParams&& params)
|
2021-05-05 05:13:25 -05:00
|
|
|
: python(std::make_shared<Python>())
|
|
|
|
{
|
2023-01-31 05:38:54 -06:00
|
|
|
defineSimulationModel(std::move(params));
|
|
|
|
}
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
FlowGenericVanguard::SimulationModelParams
|
|
|
|
FlowGenericVanguard::serializationTestParams()
|
2023-01-31 05:38:54 -06:00
|
|
|
{
|
|
|
|
SimulationModelParams result;
|
2024-06-06 08:24:20 -05:00
|
|
|
result.setupTime_ = 1.234;
|
2023-01-31 05:38:54 -06:00
|
|
|
result.actionState_ = std::make_unique<Action::State>(Action::State::serializationTestObject());
|
|
|
|
result.eclSchedule_ = std::make_unique<Schedule>(Schedule::serializationTestObject());
|
|
|
|
result.summaryState_ = std::make_unique<SummaryState>(SummaryState::serializationTestObject());
|
|
|
|
result.udqState_ = std::make_unique<UDQState>(UDQState::serializationTestObject());
|
2024-06-06 08:24:20 -05:00
|
|
|
// Remaining members left as null pointers: wtestState_, eclState_ and eclSummaryConfig_.
|
2023-01-31 05:38:54 -06:00
|
|
|
|
|
|
|
return result;
|
2021-05-05 05:13:25 -05:00
|
|
|
}
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
FlowGenericVanguard::~FlowGenericVanguard() = default;
|
2021-05-05 05:13:25 -05:00
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
void FlowGenericVanguard::defineSimulationModel(SimulationModelParams&& params)
|
2021-09-20 18:13:39 -05:00
|
|
|
{
|
2023-02-01 03:35:20 -06:00
|
|
|
actionState_ = std::move(params.actionState_);
|
|
|
|
eclSchedule_ = std::move(params.eclSchedule_);
|
|
|
|
eclState_ = std::move(params.eclState_);
|
|
|
|
eclSummaryConfig_ = std::move(params.eclSummaryConfig_);
|
|
|
|
setupTime_ = params.setupTime_;
|
|
|
|
udqState_ = std::move(params.udqState_);
|
|
|
|
wtestState_ = std::move(params.wtestState_);
|
2023-01-31 05:38:54 -06:00
|
|
|
summaryState_ = std::move(params.summaryState_);
|
2021-10-11 07:38:41 -05:00
|
|
|
}
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
void FlowGenericVanguard::readDeck(const std::string& filename)
|
2022-06-14 07:25:46 -05:00
|
|
|
{
|
|
|
|
Dune::Timer setupTimer;
|
|
|
|
setupTimer.start();
|
|
|
|
|
2023-01-31 05:38:54 -06:00
|
|
|
Opm::readDeck(comm(),
|
2023-02-01 03:35:20 -06:00
|
|
|
filename,
|
|
|
|
modelParams_.eclState_,
|
|
|
|
modelParams_.eclSchedule_,
|
|
|
|
modelParams_.udqState_,
|
|
|
|
modelParams_.actionState_,
|
|
|
|
modelParams_.wtestState_,
|
|
|
|
modelParams_.eclSummaryConfig_,
|
2024-08-20 01:45:15 -05:00
|
|
|
nullptr, "normal", "normal", "100", false, false, {});
|
2023-02-01 03:35:20 -06:00
|
|
|
modelParams_.setupTime_ = setupTimer.stop();
|
2022-06-14 07:25:46 -05:00
|
|
|
}
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
std::string FlowGenericVanguard::canonicalDeckPath(const std::string& caseName)
|
2021-05-05 05:13:25 -05:00
|
|
|
{
|
2021-11-01 06:31:40 -05:00
|
|
|
const auto fileExists = [](const std::filesystem::path& f) -> bool
|
2021-05-05 05:13:25 -05:00
|
|
|
{
|
2021-11-01 06:31:40 -05:00
|
|
|
if (!std::filesystem::exists(f))
|
2021-05-05 05:13:25 -05:00
|
|
|
return false;
|
|
|
|
|
2021-11-01 06:31:40 -05:00
|
|
|
if (std::filesystem::is_regular_file(f))
|
2021-05-05 05:13:25 -05:00
|
|
|
return true;
|
|
|
|
|
2021-11-01 06:31:40 -05:00
|
|
|
return std::filesystem::is_symlink(f) && std::filesystem::is_regular_file(std::filesystem::read_symlink(f));
|
2021-05-05 05:13:25 -05:00
|
|
|
};
|
|
|
|
|
2021-11-01 06:31:40 -05:00
|
|
|
auto simcase = std::filesystem::path(caseName);
|
2021-05-05 05:13:25 -05:00
|
|
|
if (fileExists(simcase))
|
|
|
|
return simcase.string();
|
|
|
|
|
|
|
|
for (const auto& ext : { std::string("data"), std::string("DATA") }) {
|
|
|
|
if (fileExists(simcase.replace_extension(ext)))
|
|
|
|
return simcase.string();
|
|
|
|
}
|
|
|
|
|
|
|
|
throw std::invalid_argument("Cannot find input case '"+caseName+"'");
|
|
|
|
}
|
|
|
|
|
2024-07-31 06:35:56 -05:00
|
|
|
void FlowGenericVanguard::updateNOSIM_(std::string_view dryRunString)
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
// Possible to force initialization only behavior (NOSIM).
|
|
|
|
if (dryRunString != "" && dryRunString != "auto") {
|
|
|
|
bool enableDryRun;
|
|
|
|
if (dryRunString == "true"
|
|
|
|
|| dryRunString == "t"
|
|
|
|
|| dryRunString == "1")
|
|
|
|
enableDryRun = true;
|
|
|
|
else if (dryRunString == "false"
|
|
|
|
|| dryRunString == "f"
|
|
|
|
|| dryRunString == "0")
|
|
|
|
enableDryRun = false;
|
|
|
|
else
|
|
|
|
throw std::invalid_argument("Invalid value for parameter EnableDryRun: '"
|
|
|
|
+ std::string(dryRunString) + "'");
|
|
|
|
auto& ioConfig = eclState().getIOConfig();
|
|
|
|
ioConfig.overrideNOSIM(enableDryRun);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (const std::invalid_argument& e) {
|
|
|
|
std::cerr << "Failed to create valid EclipseState object" << std::endl;
|
|
|
|
std::cerr << "Exception caught: " << e.what() << std::endl;
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
void FlowGenericVanguard::updateOutputDir_(std::string outputDir,
|
|
|
|
bool enableEclCompatFile)
|
2021-05-05 05:13:25 -05:00
|
|
|
{
|
|
|
|
// update the location for output
|
|
|
|
auto& ioConfig = eclState_->getIOConfig();
|
|
|
|
if (outputDir.empty())
|
|
|
|
// If no output directory parameter is specified, use the output directory
|
|
|
|
// which Opm::IOConfig thinks that should be used. Normally this is the
|
|
|
|
// directory in which the input files are located.
|
|
|
|
outputDir = ioConfig.getOutputDir();
|
|
|
|
|
|
|
|
// ensure that the output directory exists and that it is a directory
|
2021-11-01 06:31:40 -05:00
|
|
|
if (!std::filesystem::is_directory(outputDir)) {
|
2021-05-05 05:13:25 -05:00
|
|
|
try {
|
2021-11-01 06:31:40 -05:00
|
|
|
std::filesystem::create_directories(outputDir);
|
2021-05-05 05:13:25 -05:00
|
|
|
}
|
|
|
|
catch (...) {
|
|
|
|
throw std::runtime_error("Creation of output directory '"+outputDir+"' failed\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// specify the directory output. This is not a very nice mechanism because
|
|
|
|
// the eclState is supposed to be immutable here, IMO.
|
|
|
|
ioConfig.setOutputDir(outputDir);
|
|
|
|
|
|
|
|
ioConfig.setEclCompatibleRST(enableEclCompatFile);
|
|
|
|
}
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
void FlowGenericVanguard::init()
|
2021-05-05 05:13:25 -05:00
|
|
|
{
|
|
|
|
// Make proper case name.
|
|
|
|
{
|
|
|
|
if (fileName_.empty())
|
|
|
|
throw std::runtime_error("No input deck file has been specified as a command line argument,"
|
|
|
|
" or via '--ecl-deck-file-name=CASE.DATA'");
|
|
|
|
|
|
|
|
fileName_ = canonicalDeckPath(fileName_);
|
|
|
|
|
|
|
|
// compute the base name of the input file name
|
|
|
|
const char directorySeparator = '/';
|
|
|
|
long int i;
|
|
|
|
for (i = fileName_.size(); i >= 0; -- i)
|
|
|
|
if (fileName_[i] == directorySeparator)
|
|
|
|
break;
|
|
|
|
std::string baseName = fileName_.substr(i + 1, fileName_.size());
|
|
|
|
|
|
|
|
// remove the extension from the input file
|
|
|
|
for (i = baseName.size(); i >= 0; -- i)
|
|
|
|
if (baseName[i] == '.')
|
|
|
|
break;
|
|
|
|
std::string rawCaseName;
|
|
|
|
if (i < 0)
|
|
|
|
rawCaseName = baseName;
|
|
|
|
else
|
|
|
|
rawCaseName = baseName.substr(0, i);
|
|
|
|
|
|
|
|
// transform the result to ALL_UPPERCASE
|
|
|
|
caseName_ = rawCaseName;
|
|
|
|
std::transform(caseName_.begin(), caseName_.end(), caseName_.begin(), ::toupper);
|
|
|
|
}
|
|
|
|
|
2023-02-28 14:59:04 -06:00
|
|
|
// set communicator if not set as in opm flow
|
|
|
|
if(!comm_){
|
2024-02-02 03:46:44 -06:00
|
|
|
FlowGenericVanguard::setCommunication(std::make_unique<Parallel::Communication>());
|
2023-02-28 14:59:04 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// set eclState if not already set as in opm flow
|
|
|
|
// it means that setParams is called
|
|
|
|
if(!eclState_){
|
|
|
|
this->readDeck(fileName_);
|
|
|
|
this->defineSimulationModel(std::move(this->modelParams_));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-05-06 07:02:39 -05:00
|
|
|
if (!this->summaryState_) {
|
|
|
|
this->summaryState_ = std::make_unique<SummaryState>
|
|
|
|
(TimeService::from_time_t(this->eclSchedule_->getStartTime()),
|
|
|
|
this->eclState_->runspec().udqParams().undefinedValue());
|
|
|
|
}
|
2021-05-05 05:13:25 -05:00
|
|
|
|
|
|
|
// Initialize parallelWells with all local wells
|
|
|
|
const auto& schedule_wells = schedule().getWellsatEnd();
|
|
|
|
parallelWells_.reserve(schedule_wells.size());
|
|
|
|
|
|
|
|
for (const auto& well: schedule_wells)
|
|
|
|
{
|
|
|
|
parallelWells_.emplace_back(well.name(), true);
|
|
|
|
}
|
|
|
|
std::sort(parallelWells_.begin(), parallelWells_.end());
|
|
|
|
|
|
|
|
// Check whether allowing distribute wells makes sense
|
|
|
|
if (enableDistributedWells() )
|
|
|
|
{
|
|
|
|
int hasMsWell = false;
|
2024-02-02 03:46:44 -06:00
|
|
|
const auto& comm = FlowGenericVanguard::comm();
|
2021-05-05 05:13:25 -05:00
|
|
|
|
|
|
|
if (useMultisegmentWell_)
|
|
|
|
{
|
2021-10-05 07:24:33 -05:00
|
|
|
if (comm.rank() == 0)
|
2021-05-05 05:13:25 -05:00
|
|
|
{
|
|
|
|
const auto& wells = this->schedule().getWellsatEnd();
|
2023-01-31 05:38:54 -06:00
|
|
|
for (const auto& well : wells)
|
2021-05-05 05:13:25 -05:00
|
|
|
{
|
|
|
|
hasMsWell = hasMsWell || well.isMultiSegment();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-05-25 05:57:11 -05:00
|
|
|
|
2021-05-05 05:13:25 -05:00
|
|
|
hasMsWell = comm.max(hasMsWell);
|
|
|
|
|
|
|
|
if (hasMsWell)
|
|
|
|
{
|
2021-10-05 07:24:33 -05:00
|
|
|
if (comm.rank() == 0)
|
2021-05-05 05:13:25 -05:00
|
|
|
{
|
|
|
|
std::string message =
|
|
|
|
std::string("Option --allow-distributed-wells=true is only allowed if model\n")
|
|
|
|
+ "only has only standard wells. You need to provide option \n"
|
|
|
|
+ " with --enable-multisegement-wells=false to treat existing \n"
|
|
|
|
+ "multisegment wells as standard wells.";
|
|
|
|
OpmLog::error(message);
|
|
|
|
}
|
|
|
|
comm.barrier();
|
|
|
|
OPM_THROW(std::invalid_argument, "All wells need to be standard wells!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
bool FlowGenericVanguard::drsdtconEnabled() const
|
2021-05-05 05:13:25 -05:00
|
|
|
{
|
|
|
|
for (const auto& schIt : this->schedule()) {
|
|
|
|
const auto& oilVaporizationControl = schIt.oilvap();
|
|
|
|
if (oilVaporizationControl.getType() == OilVaporizationProperties::OilVaporization::DRSDTCON) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
std::unordered_map<size_t, const NumericalAquiferCell*>
|
|
|
|
FlowGenericVanguard::allAquiferCells() const
|
2021-05-05 05:13:25 -05:00
|
|
|
{
|
|
|
|
return this->eclState_->aquifer().numericalAquifers().allAquiferCells();
|
|
|
|
}
|
|
|
|
|
2023-01-31 05:38:54 -06:00
|
|
|
template<>
|
2024-02-02 03:46:44 -06:00
|
|
|
void FlowGenericVanguard::
|
2023-01-31 05:38:54 -06:00
|
|
|
serializeOp<Serializer<Serialization::MemPacker>>(Serializer<Serialization::MemPacker>& serializer)
|
|
|
|
{
|
|
|
|
serializer(*summaryState_);
|
|
|
|
serializer(*udqState_);
|
|
|
|
serializer(*actionState_);
|
|
|
|
serializer(*eclSchedule_);
|
|
|
|
}
|
|
|
|
|
2024-02-02 03:46:44 -06:00
|
|
|
bool FlowGenericVanguard::operator==(const FlowGenericVanguard& rhs) const
|
2023-01-31 05:38:54 -06:00
|
|
|
{
|
|
|
|
auto cmp_ptr = [](const auto& a, const auto& b)
|
|
|
|
{
|
|
|
|
if (!a && !b) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (a && b) {
|
|
|
|
return *a == *b;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
return cmp_ptr(this->summaryState_, rhs.summaryState_);
|
|
|
|
cmp_ptr(this->udqState_, rhs.udqState_) &&
|
|
|
|
cmp_ptr(this->actionState_, rhs.actionState_) &&
|
|
|
|
cmp_ptr(this->eclSchedule_, rhs.eclSchedule_);
|
|
|
|
}
|
|
|
|
|
2024-08-15 02:26:02 -05:00
|
|
|
template<class Scalar>
|
|
|
|
void FlowGenericVanguard::registerParameters_()
|
|
|
|
{
|
|
|
|
Parameters::Register<Parameters::EclDeckFileName>
|
|
|
|
("The name of the file which contains the ECL deck to be simulated");
|
|
|
|
Parameters::Register<Parameters::EclOutputInterval>
|
|
|
|
("The number of report steps that ought to be skipped between two writes of ECL results");
|
|
|
|
Parameters::Register<Parameters::EnableDryRun>
|
|
|
|
("Specify if the simulation ought to be actually run, or just pretended to be");
|
|
|
|
Parameters::Register<Parameters::EnableOpmRstFile>
|
|
|
|
("Include OPM-specific keywords in the ECL restart file to "
|
|
|
|
"enable restart of OPM simulators from these files");
|
|
|
|
Parameters::Register<Parameters::IgnoreKeywords>
|
|
|
|
("List of Eclipse keywords which should be ignored. As a ':' separated string.");
|
|
|
|
Parameters::Register<Parameters::ParsingStrictness>
|
|
|
|
("Set strictness of parsing process. Available options are "
|
|
|
|
"normal (stop for critical errors), "
|
|
|
|
"high (stop for all errors) and "
|
|
|
|
"low (as normal, except do not stop due to unsupported "
|
|
|
|
"keywords even if marked critical");
|
2024-08-20 01:45:15 -05:00
|
|
|
Parameters::Register<Parameters::ActionParsingStrictness>
|
|
|
|
("Set strictness of parsing process for ActionX and PyAction. Available options are "
|
|
|
|
"normal (do not apply keywords that have not been tested for ActionX or PyAction) and "
|
|
|
|
"low (try to apply all keywords, beware: the simulation outcome might be incorrect).");
|
2024-08-15 02:26:02 -05:00
|
|
|
Parameters::Register<Parameters::InputSkipMode>
|
|
|
|
("Set compatibility mode for the SKIP100/SKIP300 keywords. Options are "
|
|
|
|
"100 (skip SKIP100..ENDSKIP, keep SKIP300..ENDSKIP) [default], "
|
|
|
|
"300 (skip SKIP300..ENDSKIP, keep SKIP100..ENDSKIP) and "
|
|
|
|
"all (skip both SKIP100..ENDSKIP and SKIP300..ENDSKIP) ");
|
|
|
|
Parameters::Register<Parameters::SchedRestart>
|
|
|
|
("When restarting: should we try to initialize wells and "
|
|
|
|
"groups from historical SCHEDULE section.");
|
|
|
|
Parameters::Register<Parameters::EdgeWeightsMethod>
|
|
|
|
("Choose edge-weighing strategy: 0=uniform, 1=trans, 2=log(trans).");
|
|
|
|
|
|
|
|
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
|
|
|
|
Parameters::Register<Parameters::NumJacobiBlocks>
|
|
|
|
("Number of blocks to be created for the Block-Jacobi preconditioner.");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
Parameters::Register<Parameters::OwnerCellsFirst>
|
|
|
|
("Order cells owned by rank before ghost/overlap cells.");
|
|
|
|
#if HAVE_MPI
|
|
|
|
Parameters::Register<Parameters::PartitionMethod>
|
|
|
|
("Choose partitioning strategy: 0=simple, 1=Zoltan, 2=METIS.");
|
|
|
|
Parameters::Register<Parameters::SerialPartitioning>
|
|
|
|
("Perform partitioning for parallel runs on a single process.");
|
|
|
|
Parameters::Register<Parameters::ZoltanImbalanceTol<Scalar>>
|
|
|
|
("Tolerable imbalance of the loadbalancing provided by Zoltan. DEPRECATED: Use --imbalance-tol instead");
|
|
|
|
Parameters::Register<Parameters::ZoltanParams>
|
|
|
|
("Configuration of Zoltan partitioner. "
|
|
|
|
"Valid options are: graph, hypergraph or scotch. "
|
|
|
|
"Alternatively, you can request a configuration to be read "
|
|
|
|
"from a JSON file by giving the filename here, ending with '.json.' "
|
|
|
|
"See https://sandialabs.github.io/Zoltan/ug_html/ug.html "
|
|
|
|
"for available Zoltan options.");
|
|
|
|
Parameters::Register<Parameters::ImbalanceTol<Scalar>>
|
|
|
|
("Tolerable imbalance of the loadbalancing (default: 1.1).");
|
|
|
|
Parameters::Register<Parameters::MetisParams>
|
|
|
|
("Configuration of Metis partitioner. "
|
|
|
|
"You can request a configuration to be read "
|
|
|
|
"from a JSON file by giving the filename here, ending with '.json.' "
|
|
|
|
"See http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/manual.pdf"
|
|
|
|
"for available METIS options.");
|
|
|
|
Parameters::Register<Parameters::ExternalPartition>
|
|
|
|
("Name of file from which to load an externally generated "
|
|
|
|
"partitioning of the model's active cells for MPI "
|
|
|
|
"distribution purposes. If empty, the built-in partitioning "
|
|
|
|
"method will be employed.");
|
|
|
|
Parameters::Hide<Parameters::ExternalPartition>();
|
2024-08-19 01:49:35 -05:00
|
|
|
|
|
|
|
Parameters::Hide<Parameters::ZoltanImbalanceTol<Scalar>>();
|
|
|
|
Parameters::Hide<Parameters::ZoltanParams>();
|
2024-08-15 02:26:02 -05:00
|
|
|
#endif
|
|
|
|
Parameters::Register<Parameters::AllowDistributedWells>
|
|
|
|
("Allow the perforations of a well to be distributed to interior of multiple processes");
|
|
|
|
// register here for the use in the tests without BlackoilModelParameters
|
|
|
|
Parameters::Register<Parameters::UseMultisegmentWell>
|
|
|
|
("Use the well model for multi-segment wells instead of the one for single-segment wells");
|
|
|
|
}
|
|
|
|
|
|
|
|
template void FlowGenericVanguard::registerParameters_<double>();
|
|
|
|
|
2024-04-16 07:28:48 -05:00
|
|
|
#if FLOW_INSTANTIATE_FLOAT
|
|
|
|
template void FlowGenericVanguard::registerParameters_<float>();
|
|
|
|
#endif
|
|
|
|
|
2021-05-05 05:13:25 -05:00
|
|
|
} // namespace Opm
|