Merge pull request #4142 from atgeirr/rename-sims

Rename flow_blackoil to flow_blackoil_legacyassembly and flow_blackoil_tpfa to flow_blackoil
This commit is contained in:
Bård Skaflestad
2022-10-04 12:54:13 +02:00
committed by GitHub
13 changed files with 147 additions and 122 deletions
+1 -1
View File
@@ -424,7 +424,7 @@ set(FLOW_MODELS blackoil brine energy extbo foam gasoil gaswater
oilwater_polymer_injectivity micp polymer solvent
gasoil_energy brine_saltprecipitation
gaswater_saltprec_vapwat brine_precsalt_vapwat
blackoil_tpfa gasoildiffuse)
blackoil_legacyassembly gasoildiffuse)
set(FLOW_VARIANT_MODELS brine_energy onephase onephase_energy)
set(FLOW_TGTS)
+4 -3
View File
@@ -14,11 +14,12 @@
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <flow/flow_ebos_blackoil.hpp>
#include "config.h"
#include <flow/flow_ebos_blackoil.hpp>
int main(int argc, char** argv)
{
return Opm::flowEbosBlackoilMainStandalone(argc, argv);
return Opm::flowEbosBlackoilTpfaMainStandalone(argc, argv);
}
@@ -14,12 +14,11 @@
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <flow/flow_ebos_blackoil_legacyassembly.hpp>
#include <flow/flow_ebos_blackoil_tpfa.hpp>
int main(int argc, char** argv)
{
return Opm::flowEbosBlackoilTpfaMainStandalone(argc, argv);
return Opm::flowEbosBlackoilMainStandalone(argc, argv);
}
+35 -10
View File
@@ -19,34 +19,59 @@
#include <flow/flow_ebos_blackoil.hpp>
#include <opm/material/common/ResetLocale.hpp>
#include <opm/grid/CpGrid.hpp>
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp>
#include <opm/simulators/flow/Main.hpp>
namespace Opm {
#include <opm/models/blackoil/blackoillocalresidualtpfa.hh>
#include <opm/models/discretization/common/tpfalinearizer.hh>
std::unique_ptr<FlowMainEbos<Properties::TTag::EclFlowProblem>>
flowEbosBlackoilMainInit(int argc, char** argv, bool outputCout, bool outputFiles)
namespace Opm {
namespace Properties {
template<class TypeTag>
struct Linearizer<TypeTag, TTag::EclFlowProblemTPFA> { using type = TpfaLinearizer<TypeTag>; };
template<class TypeTag>
struct LocalResidual<TypeTag, TTag::EclFlowProblemTPFA> { using type = BlackOilLocalResidualTPFA<TypeTag>; };
template<class TypeTag>
struct EnableDiffusion<TypeTag, TTag::EclFlowProblemTPFA> { static constexpr bool value = false; };
}
}
namespace Opm
{
std::unique_ptr<FlowMainEbos<Properties::TTag::EclFlowProblemTPFA>>
flowEbosBlackoilTpfaMainInit(int argc, char** argv, bool outputCout, bool outputFiles)
{
// we always want to use the default locale, and thus spare us the trouble
// with incorrect locale settings.
resetLocale();
return std::make_unique<FlowMainEbos<Properties::TTag::EclFlowProblem>>(
return std::make_unique<FlowMainEbos<Properties::TTag::EclFlowProblemTPFA>>(
argc, argv, outputCout, outputFiles);
}
// ----------------- Main program -----------------
int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles)
int flowEbosBlackoilTpfaMain(int argc, char** argv, bool outputCout, bool outputFiles)
{
auto mainfunc = flowEbosBlackoilMainInit(argc, argv, outputCout, outputFiles);
return mainfunc->execute();
// we always want to use the default locale, and thus spare us the trouble
// with incorrect locale settings.
resetLocale();
FlowMainEbos<Properties::TTag::EclFlowProblemTPFA>
mainfunc {argc, argv, outputCout, outputFiles};
return mainfunc.execute();
}
int flowEbosBlackoilMainStandalone(int argc, char** argv)
int flowEbosBlackoilTpfaMainStandalone(int argc, char** argv)
{
using TypeTag = Properties::TTag::EclFlowProblem;
using TypeTag = Properties::TTag::EclFlowProblemTPFA;
auto mainObject = Opm::Main(argc, argv);
return mainObject.runStatic<TypeTag>();
}
}
} // namespace Opm
+25 -15
View File
@@ -14,30 +14,40 @@
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FLOW_EBOS_BLACKOIL_HPP
#define FLOW_EBOS_BLACKOIL_HPP
#ifndef FLOW_EBOS_BLACKOIL_TPFA_HPP
#define FLOW_EBOS_BLACKOIL_TPFA_HPP
#include <memory>
namespace Opm {
namespace Properties {
namespace TTag {
struct EclFlowProblem;
struct EclFlowProblemTPFA {
using InheritsFrom = std::tuple<EclFlowProblem>;
};
}
}
}
namespace Opm {
//! \brief Main function used in flow binary.
int flowEbosBlackoilTpfaMain(int argc, char** argv, bool outputCout, bool outputFiles);
template<class TypeTag> class FlowMainEbos;
namespace Action {
class State;
}
namespace Properties { namespace TTag { struct EclFlowProblem; } }
//! \brief Main function used in flow binary.
int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles);
//! \brief Initialization function used in flow binary and python simulator.
std::unique_ptr<FlowMainEbos<Properties::TTag::EclFlowProblem>>
flowEbosBlackoilMainInit(int argc, char** argv, bool outputCout, bool outputFiles);
std::unique_ptr<FlowMainEbos<Properties::TTag::EclFlowProblemTPFA>>
flowEbosBlackoilTpfaMainInit(int argc, char** argv, bool outputCout, bool outputFiles);
//! \brief Main function used in flow_blackoil binary.
int flowEbosBlackoilMainStandalone(int argc, char** argv);
//! \brief Main function used in flow_brine binary.
int flowEbosBlackoilTpfaMainStandalone(int argc, char** argv);
}
#endif // FLOW_EBOS_BLACKOIL_HPP
#endif // FLOW_EBOS_BLACKOIL_TPFA_HPP
@@ -0,0 +1,52 @@
/*
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 "config.h"
#include <flow/flow_ebos_blackoil_legacyassembly.hpp>
#include <opm/material/common/ResetLocale.hpp>
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp>
#include <opm/simulators/flow/Main.hpp>
namespace Opm {
std::unique_ptr<FlowMainEbos<Properties::TTag::EclFlowProblem>>
flowEbosBlackoilMainInit(int argc, char** argv, bool outputCout, bool outputFiles)
{
// we always want to use the default locale, and thus spare us the trouble
// with incorrect locale settings.
resetLocale();
return std::make_unique<FlowMainEbos<Properties::TTag::EclFlowProblem>>(
argc, argv, outputCout, outputFiles);
}
// ----------------- Main program -----------------
int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles)
{
auto mainfunc = flowEbosBlackoilMainInit(argc, argv, outputCout, outputFiles);
return mainfunc->execute();
}
int flowEbosBlackoilMainStandalone(int argc, char** argv)
{
using TypeTag = Properties::TTag::EclFlowProblem;
auto mainObject = Opm::Main(argc, argv);
return mainObject.runStatic<TypeTag>();
}
}
@@ -14,17 +14,30 @@
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FLOW_EBOS_BLACKOIL_TPFA_HPP
#define FLOW_EBOS_BLACKOIL_TPFA_HPP
#ifndef FLOW_EBOS_BLACKOIL_HPP
#define FLOW_EBOS_BLACKOIL_HPP
#include <memory>
namespace Opm {
//! \brief Main function used in flow binary.
int flowEbosBlackoilTpfaMain(int argc, char** argv, bool outputCout, bool outputFiles);
template<class TypeTag> class FlowMainEbos;
//! \brief Main function used in flow_brine binary.
int flowEbosBlackoilTpfaMainStandalone(int argc, char** argv);
namespace Action {
class State;
}
namespace Properties { namespace TTag { struct EclFlowProblem; } }
//! \brief Main function used in flow binary.
int flowEbosBlackoilMain(int argc, char** argv, bool outputCout, bool outputFiles);
//! \brief Initialization function used in flow binary and python simulator.
std::unique_ptr<FlowMainEbos<Properties::TTag::EclFlowProblem>>
flowEbosBlackoilMainInit(int argc, char** argv, bool outputCout, bool outputFiles);
//! \brief Main function used in flow_blackoil binary.
int flowEbosBlackoilMainStandalone(int argc, char** argv);
}
#endif // FLOW_EBOS_BLACKOIL_TPFA_HPP
#endif // FLOW_EBOS_BLACKOIL_HPP
-77
View File
@@ -1,77 +0,0 @@
/*
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 "config.h"
#include <flow/flow_ebos_blackoil_tpfa.hpp>
#include <opm/material/common/ResetLocale.hpp>
#include <opm/grid/CpGrid.hpp>
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp>
#include <opm/simulators/flow/Main.hpp>
#include <opm/models/blackoil/blackoillocalresidualtpfa.hh>
#include <opm/models/discretization/common/tpfalinearizer.hh>
namespace Opm {
namespace Properties {
namespace TTag {
struct EclFlowProblemTPFA {
using InheritsFrom = std::tuple<EclFlowProblem>;
};
}
}
}
namespace Opm {
namespace Properties {
template<class TypeTag>
struct Linearizer<TypeTag, TTag::EclFlowProblemTPFA> { using type = TpfaLinearizer<TypeTag>; };
template<class TypeTag>
struct LocalResidual<TypeTag, TTag::EclFlowProblemTPFA> { using type = BlackOilLocalResidualTPFA<TypeTag>; };
template<class TypeTag>
struct EnableDiffusion<TypeTag, TTag::EclFlowProblemTPFA> { static constexpr bool value = false; };
}
}
namespace Opm
{
// ----------------- Main program -----------------
int flowEbosBlackoilTpfaMain(int argc, char** argv, bool outputCout, bool outputFiles)
{
// we always want to use the default locale, and thus spare us the trouble
// with incorrect locale settings.
resetLocale();
FlowMainEbos<Properties::TTag::EclFlowProblemTPFA>
mainfunc {argc, argv, outputCout, outputFiles};
return mainfunc.execute();
}
int flowEbosBlackoilTpfaMainStandalone(int argc, char** argv)
{
using TypeTag = Properties::TTag::EclFlowProblemTPFA;
auto mainObject = Opm::Main(argc, argv);
return mainObject.runStatic<TypeTag>();
}
} // namespace Opm
+1
View File
@@ -29,6 +29,7 @@
#include <opm/simulators/utils/ParallelFileMerger.hpp>
#include <opm/simulators/utils/moduleVersion.hpp>
#include <opm/simulators/utils/ParallelEclipseState.hpp>
#include <flow/flow_ebos_blackoil.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/EclipseState/IOConfig/IOConfig.hpp>
+3 -3
View File
@@ -23,7 +23,7 @@
#define OPM_MAIN_HEADER_INCLUDED
#include <flow/flow_ebos_blackoil.hpp>
#include <flow/flow_ebos_blackoil_tpfa.hpp>
#include <flow/flow_ebos_blackoil_legacyassembly.hpp>
#include <flow/flow_ebos_gasoil.hpp>
#include <flow/flow_ebos_gasoildiffuse.hpp>
@@ -235,7 +235,7 @@ public:
return exitCode;
}
using FlowMainEbosType = FlowMainEbos<Properties::TTag::EclFlowProblem>;
using FlowMainEbosType = FlowMainEbos<Properties::TTag::EclFlowProblemTPFA>;
// To be called from the Python interface code. Only do the
// initialization and then return a pointer to the FlowEbosMain
// object that can later be accessed directly from the Python interface
@@ -255,7 +255,7 @@ public:
std::move(this->actionState_),
std::move(this->wtestState_),
summaryConfig_);
return flowEbosBlackoilMainInit(
return flowEbosBlackoilTpfaMainInit(
argc_, argv_, outputCout_, outputFiles_);
} else {
//NOTE: exitCode was set by initialize_() above;
@@ -33,7 +33,7 @@ namespace Opm::Pybind {
class PyBlackOilSimulator
{
private:
using TypeTag = Opm::Properties::TTag::EclFlowProblem;
using TypeTag = Opm::Properties::TTag::EclFlowProblemTPFA;
using Simulator = Opm::GetPropType<TypeTag, Opm::Properties::Simulator>;
public:
+1 -1
View File
@@ -32,7 +32,7 @@ namespace Opm::Pybind {
class BlackOilSimulator
{
private:
using TypeTag = Opm::Properties::TTag::EclFlowProblem;
using TypeTag = Opm::Properties::TTag::EclFlowProblemTpfa;
using Simulator = Opm::GetPropType<TypeTag, Opm::Properties::Simulator>;
public:
+2 -1
View File
@@ -24,6 +24,7 @@
#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/simulators/flow/Main.hpp>
#include <opm/simulators/flow/FlowMainEbos.hpp>
#include <flow/flow_ebos_blackoil.hpp>
// NOTE: EXIT_SUCCESS, EXIT_FAILURE is defined in cstdlib
#include <cstdlib>
#include <iostream>
@@ -79,7 +80,7 @@ py::array_t<double> PyBlackOilSimulator::getPorosity()
int PyBlackOilSimulator::run()
{
auto mainObject = Opm::Main( deckFilename_ );
return mainObject.runStatic<Opm::Properties::TTag::EclFlowProblem>();
return mainObject.runStatic<Opm::Properties::TTag::EclFlowProblemTPFA>();
}
void PyBlackOilSimulator::setPorosity( py::array_t<double,