mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1287 from andlaus/improve_polymorphic_flow
Improve polymorphic flow
This commit is contained in:
commit
67401d7d63
@ -62,6 +62,11 @@ list (APPEND MAIN_SOURCE_FILES
|
|||||||
opm/polymer/TransportSolverTwophaseCompressiblePolymer.cpp
|
opm/polymer/TransportSolverTwophaseCompressiblePolymer.cpp
|
||||||
opm/polymer/TransportSolverTwophasePolymer.cpp
|
opm/polymer/TransportSolverTwophasePolymer.cpp
|
||||||
opm/polymer/fullyimplicit/PolymerPropsAd.cpp
|
opm/polymer/fullyimplicit/PolymerPropsAd.cpp
|
||||||
|
opm/simulators/flow_ebos_blackoil.cpp
|
||||||
|
opm/simulators/flow_ebos_gasoil.cpp
|
||||||
|
opm/simulators/flow_ebos_oilwater.cpp
|
||||||
|
opm/simulators/flow_ebos_polymer.cpp
|
||||||
|
opm/simulators/flow_ebos_solvent.cpp
|
||||||
opm/simulators/ensureDirectoryExists.cpp
|
opm/simulators/ensureDirectoryExists.cpp
|
||||||
opm/simulators/SimulatorCompressibleTwophase.cpp
|
opm/simulators/SimulatorCompressibleTwophase.cpp
|
||||||
opm/simulators/SimulatorIncompTwophase.cpp
|
opm/simulators/SimulatorIncompTwophase.cpp
|
||||||
@ -273,6 +278,11 @@ list (APPEND PUBLIC_HEADER_FILES
|
|||||||
opm/polymer/fullyimplicit/SimulatorFullyImplicitBlackoilPolymer.hpp
|
opm/polymer/fullyimplicit/SimulatorFullyImplicitBlackoilPolymer.hpp
|
||||||
opm/polymer/fullyimplicit/SimulatorFullyImplicitBlackoilPolymer_impl.hpp
|
opm/polymer/fullyimplicit/SimulatorFullyImplicitBlackoilPolymer_impl.hpp
|
||||||
opm/polymer/fullyimplicit/WellStateFullyImplicitBlackoilPolymer.hpp
|
opm/polymer/fullyimplicit/WellStateFullyImplicitBlackoilPolymer.hpp
|
||||||
|
opm/simulators/flow_ebos_blackoil.hpp
|
||||||
|
opm/simulators/flow_ebos_gasoil.hpp
|
||||||
|
opm/simulators/flow_ebos_oilwater.hpp
|
||||||
|
opm/simulators/flow_ebos_polymer.hpp
|
||||||
|
opm/simulators/flow_ebos_solvent.hpp
|
||||||
opm/simulators/ensureDirectoryExists.hpp
|
opm/simulators/ensureDirectoryExists.hpp
|
||||||
opm/simulators/ParallelFileMerger.hpp
|
opm/simulators/ParallelFileMerger.hpp
|
||||||
opm/simulators/SimulatorCompressibleTwophase.hpp
|
opm/simulators/SimulatorCompressibleTwophase.hpp
|
||||||
|
@ -18,68 +18,28 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif // HAVE_CONFIG_H
|
|
||||||
|
|
||||||
#include <memory>
|
#include <opm/simulators/flow_ebos_blackoil.hpp>
|
||||||
|
#include <opm/simulators/flow_ebos_gasoil.hpp>
|
||||||
|
#include <opm/simulators/flow_ebos_oilwater.hpp>
|
||||||
|
#include <opm/simulators/flow_ebos_solvent.hpp>
|
||||||
|
#include <opm/simulators/flow_ebos_polymer.hpp>
|
||||||
|
|
||||||
|
#include <opm/autodiff/MissingFeatures.hpp>
|
||||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||||
|
#include <opm/common/ResetLocale.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
|
|
||||||
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
|
||||||
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
||||||
|
|
||||||
// Define making clear that the simulator supports AMG
|
#if HAVE_DUNE_FEM
|
||||||
#define FLOW_SUPPORT_AMG 1
|
#include <dune/fem/misc/mpimanager.hh>
|
||||||
|
#else
|
||||||
#include <opm/material/densead/Evaluation.hpp>
|
#include <dune/common/parallel/mpihelper.hh>
|
||||||
#include <ewoms/models/blackoil/blackoiltwophaseindices.hh>
|
#endif
|
||||||
|
|
||||||
#include <opm/autodiff/DuneMatrix.hpp>
|
|
||||||
#include <opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp>
|
|
||||||
#include <opm/autodiff/FlowMainEbos.hpp>
|
|
||||||
|
|
||||||
namespace Ewoms {
|
|
||||||
namespace Properties {
|
|
||||||
|
|
||||||
///////////////////////////////////
|
|
||||||
// Twophase case
|
|
||||||
///////////////////////////////////
|
|
||||||
|
|
||||||
NEW_TYPE_TAG(EclFlowOilWaterProblem, INHERITS_FROM(EclFlowProblem));
|
|
||||||
//! The indices required by the model
|
|
||||||
SET_TYPE_PROP(EclFlowOilWaterProblem, Indices,
|
|
||||||
Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent)?1:0, GET_PROP_VALUE(TypeTag, EnablePolymer)?1:0, /*PVOffset=*/0, /*disabledCompIdx=*/2>);
|
|
||||||
|
|
||||||
|
|
||||||
NEW_TYPE_TAG(EclFlowGasOilProblem, INHERITS_FROM(EclFlowProblem));
|
|
||||||
//! The indices required by the model
|
|
||||||
SET_TYPE_PROP(EclFlowGasOilProblem, Indices,
|
|
||||||
Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent)?1:0, GET_PROP_VALUE(TypeTag, EnablePolymer)?1:0, /*PVOffset=*/0, /*disabledCompIdx=*/1>);
|
|
||||||
|
|
||||||
///////////////////////////////////
|
|
||||||
// Polymer case
|
|
||||||
///////////////////////////////////
|
|
||||||
|
|
||||||
NEW_TYPE_TAG(EclFlowPolymerProblem, INHERITS_FROM(EclFlowProblem));
|
|
||||||
SET_BOOL_PROP(EclFlowPolymerProblem, EnablePolymer, true);
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////
|
|
||||||
// Solvent case
|
|
||||||
///////////////////////////////////
|
|
||||||
|
|
||||||
NEW_TYPE_TAG(EclFlowSolventProblem, INHERITS_FROM(EclFlowProblem));
|
|
||||||
SET_BOOL_PROP(EclFlowSolventProblem, EnableSolvent, true);
|
|
||||||
|
|
||||||
}} // end namespaces
|
|
||||||
|
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
@ -116,18 +76,31 @@ namespace detail
|
|||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
// MPI setup.
|
// MPI setup.
|
||||||
// Must ensure an instance of the helper is created to initialise MPI.
|
#if HAVE_DUNE_FEM
|
||||||
// For a build without MPI the Dune::FakeMPIHelper is used, so rank will
|
Dune::Fem::MPIManager::initialize(argc, argv);
|
||||||
// be 0 and size 1.
|
int mpiRank = Dune::Fem::MPIManager::rank();
|
||||||
const Dune::MPIHelper& mpi_helper = Dune::MPIHelper::instance(argc, argv);
|
#else
|
||||||
const bool outputCout = mpi_helper.rank() == 0;
|
// the design of the plain dune MPIHelper class is quite flawed: there is no way to
|
||||||
|
// get the instance without having the argc and argv parameters available and it is
|
||||||
|
// not possible to determine the MPI rank and size without an instance. (IOW: the
|
||||||
|
// rank() and size() methods are supposed to be static.)
|
||||||
|
const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv);
|
||||||
|
int mpiRank = mpiHelper.rank();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const bool outputCout = (mpiRank == 0);
|
||||||
|
|
||||||
|
// we always want to use the default locale, and thus spare us the trouble
|
||||||
|
// with incorrect locale settings.
|
||||||
|
Opm::resetLocale();
|
||||||
|
|
||||||
Opm::ParameterGroup param(argc, argv, false, outputCout);
|
Opm::ParameterGroup param(argc, argv, false, outputCout);
|
||||||
|
|
||||||
// See if a deck was specified on the command line.
|
// See if a deck was specified on the command line.
|
||||||
if (!param.unhandledArguments().empty()) {
|
if (!param.unhandledArguments().empty()) {
|
||||||
if (param.unhandledArguments().size() != 1) {
|
if (param.unhandledArguments().size() != 1) {
|
||||||
std::cerr << "You can only specify a single input deck on the command line.\n";
|
if (outputCout)
|
||||||
|
std::cerr << "You can only specify a single input deck on the command line.\n";
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
} else {
|
} else {
|
||||||
const auto casename = detail::simulationCaseName( param.unhandledArguments()[ 0 ] );
|
const auto casename = detail::simulationCaseName( param.unhandledArguments()[ 0 ] );
|
||||||
@ -137,11 +110,12 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
// We must have an input deck. Grid and props will be read from that.
|
// We must have an input deck. Grid and props will be read from that.
|
||||||
if (!param.has("deck_filename")) {
|
if (!param.has("deck_filename")) {
|
||||||
std::cerr << "This program must be run with an input deck.\n"
|
if (outputCout)
|
||||||
"Specify the deck filename either\n"
|
std::cerr << "This program must be run with an input deck.\n"
|
||||||
" a) as a command line argument by itself\n"
|
"Specify the deck filename either\n"
|
||||||
" b) as a command line parameter with the syntax deck_filename=<path to your deck>, or\n"
|
" a) as a command line argument by itself\n"
|
||||||
" c) as a parameter in a parameter file (.param or .xml) passed to the program.\n";
|
" b) as a command line parameter with the syntax deck_filename=<path to your deck>, or\n"
|
||||||
|
" c) as a parameter in a parameter file (.param or .xml) passed to the program.\n";
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +134,8 @@ int main(int argc, char** argv)
|
|||||||
Opm::ParseContext parseContext(tmp);
|
Opm::ParseContext parseContext(tmp);
|
||||||
|
|
||||||
std::shared_ptr<Opm::Deck> deck = std::make_shared< Opm::Deck >( parser.parseFile(deckFilename , parseContext) );
|
std::shared_ptr<Opm::Deck> deck = std::make_shared< Opm::Deck >( parser.parseFile(deckFilename , parseContext) );
|
||||||
Opm::checkDeck(*deck, parser);
|
|
||||||
if ( outputCout ) {
|
if ( outputCout ) {
|
||||||
|
Opm::checkDeck(*deck, parser);
|
||||||
Opm::MissingFeatures::checkKeywords(*deck);
|
Opm::MissingFeatures::checkKeywords(*deck);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,52 +145,54 @@ int main(int argc, char** argv)
|
|||||||
Opm::Runspec runspec( *deck );
|
Opm::Runspec runspec( *deck );
|
||||||
const auto& phases = runspec.phases();
|
const auto& phases = runspec.phases();
|
||||||
|
|
||||||
// Twophase case
|
// Twophase cases
|
||||||
if( phases.size() == 2 ) {
|
if( phases.size() == 2 ) {
|
||||||
// oil-gas
|
// oil-gas
|
||||||
if (phases.active( Opm::Phase::GAS ))
|
if (phases.active( Opm::Phase::GAS ))
|
||||||
{
|
{
|
||||||
Opm::FlowMainEbos<TTAG(EclFlowGasOilProblem)> mainfunc;
|
Opm::flowEbosGasOilSetDeck(*deck, *eclipseState);
|
||||||
return mainfunc.execute(argc, argv, deck, eclipseState );
|
return Opm::flowEbosGasOilMain(argc, argv);
|
||||||
}
|
}
|
||||||
// oil-water
|
// oil-water
|
||||||
else if ( phases.active( Opm::Phase::WATER ) )
|
else if ( phases.active( Opm::Phase::WATER ) )
|
||||||
{
|
{
|
||||||
Opm::FlowMainEbos<TTAG(EclFlowOilWaterProblem)> mainfunc;
|
Opm::flowEbosOilWaterSetDeck(*deck, *eclipseState);
|
||||||
return mainfunc.execute(argc, argv, deck, eclipseState );
|
return Opm::flowEbosOilWaterMain(argc, argv);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
std::cerr << "No suitable configuration found, valid are Twophase (oilwater and oilgas), polymer, solvent, or blackoil" << std::endl;
|
if (outputCout)
|
||||||
|
std::cerr << "No suitable configuration found, valid are Twophase (oilwater and oilgas), polymer, solvent, or blackoil" << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Polymer case
|
// Polymer case
|
||||||
else if ( phases.active( Opm::Phase::POLYMER ) ) {
|
else if ( phases.active( Opm::Phase::POLYMER ) ) {
|
||||||
Opm::FlowMainEbos<TTAG(EclFlowPolymerProblem)> mainfunc;
|
Opm::flowEbosPolymerSetDeck(*deck, *eclipseState);
|
||||||
return mainfunc.execute(argc, argv, deck, eclipseState );
|
return Opm::flowEbosPolymerMain(argc, argv);
|
||||||
|
|
||||||
}
|
}
|
||||||
// Solvent case
|
// Solvent case
|
||||||
else if ( phases.active( Opm::Phase::SOLVENT ) ) {
|
else if ( phases.active( Opm::Phase::SOLVENT ) ) {
|
||||||
Opm::FlowMainEbos<TTAG(EclFlowSolventProblem)> mainfunc;
|
Opm::flowEbosSolventSetDeck(*deck, *eclipseState);
|
||||||
return mainfunc.execute(argc, argv, deck, eclipseState );
|
return Opm::flowEbosSolventMain(argc, argv);
|
||||||
|
|
||||||
}
|
}
|
||||||
// Blackoil case
|
// Blackoil case
|
||||||
else if( phases.size() == 3 ) {
|
else if( phases.size() == 3 ) {
|
||||||
Opm::FlowMainEbos<TTAG(EclFlowProblem)> mainfunc;
|
Opm::flowEbosBlackoilSetDeck(*deck, *eclipseState);
|
||||||
return mainfunc.execute(argc, argv, deck, eclipseState );
|
return Opm::flowEbosBlackoilMain(argc, argv);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cerr << "No suitable configuration found, valid are Twophase, polymer, solvent, or blackoil" << std::endl;
|
if (outputCout)
|
||||||
|
std::cerr << "No suitable configuration found, valid are Twophase, polymer, solvent, or blackoil" << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const std::invalid_argument& e)
|
catch (const std::invalid_argument& e)
|
||||||
{
|
{
|
||||||
std::cerr << "Failed to create valid EclipseState object." << std::endl;
|
if (outputCout) {
|
||||||
std::cerr << "Exception caught: " << e.what() << std::endl;
|
std::cerr << "Failed to create valid EclipseState object." << std::endl;
|
||||||
|
std::cerr << "Exception caught: " << e.what() << std::endl;
|
||||||
|
}
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2013, 2014, 2015 SINTEF ICT, Applied Mathematics.
|
|
||||||
Copyright 2014 Dr. Blatt - HPC-Simulation-Software & Services
|
|
||||||
Copyright 2015 IRIS AS
|
|
||||||
|
|
||||||
This file is part of the Open Porous Media project (OPM).
|
This file is part of the Open Porous Media project (OPM).
|
||||||
|
|
||||||
OPM is free software: you can redistribute it and/or modify
|
OPM is free software: you can redistribute it and/or modify
|
||||||
@ -18,25 +14,12 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif // HAVE_CONFIG_H
|
|
||||||
|
|
||||||
// Define making clear that the simulator supports AMG
|
|
||||||
#define FLOW_SUPPORT_AMG 1
|
|
||||||
|
|
||||||
#include <opm/material/densead/Evaluation.hpp>
|
|
||||||
#include <opm/autodiff/DuneMatrix.hpp>
|
|
||||||
#include <dune/grid/CpGrid.hpp>
|
|
||||||
#include <opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp>
|
|
||||||
#include <opm/autodiff/FlowMainEbos.hpp>
|
|
||||||
|
|
||||||
|
#include <opm/simulators/flow_ebos_blackoil.hpp>
|
||||||
|
|
||||||
// ----------------- Main program -----------------
|
// ----------------- Main program -----------------
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
Opm::FlowMainEbos<TTAG(EclFlowProblem)> mainfunc;
|
return Opm::flowEbosBlackoilMain(argc, argv);
|
||||||
return mainfunc.execute(argc, argv);
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2017 IRIS AS
|
|
||||||
|
|
||||||
This file is part of the Open Porous Media project (OPM).
|
This file is part of the Open Porous Media project (OPM).
|
||||||
|
|
||||||
OPM is free software: you can redistribute it and/or modify
|
OPM is free software: you can redistribute it and/or modify
|
||||||
@ -16,34 +14,12 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif // HAVE_CONFIG_H
|
|
||||||
|
|
||||||
// Define making clear that the simulator supports AMG
|
#include <opm/simulators/flow_ebos_oilwater.hpp>
|
||||||
#define FLOW_SUPPORT_AMG 1
|
|
||||||
|
|
||||||
#include <opm/material/densead/Evaluation.hpp>
|
|
||||||
#include <ewoms/models/blackoil/blackoiltwophaseindices.hh>
|
|
||||||
|
|
||||||
#include <opm/autodiff/DuneMatrix.hpp>
|
|
||||||
#include <dune/grid/CpGrid.hpp>
|
|
||||||
#include <opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp>
|
|
||||||
#include <opm/autodiff/FlowMainEbos.hpp>
|
|
||||||
|
|
||||||
namespace Ewoms {
|
|
||||||
namespace Properties {
|
|
||||||
NEW_TYPE_TAG(EclFlowTwoPhaseProblem, INHERITS_FROM(EclFlowProblem));
|
|
||||||
//! The indices required by the model
|
|
||||||
SET_TYPE_PROP(EclFlowTwoPhaseProblem, Indices,
|
|
||||||
Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent)?1:0, GET_PROP_VALUE(TypeTag, EnablePolymer)?1:0, /*PVOffset=*/0, /*disabledCompIdx=*/2>);
|
|
||||||
}}
|
|
||||||
|
|
||||||
// ----------------- Main program -----------------
|
// ----------------- Main program -----------------
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
Opm::FlowMainEbos<TTAG(EclFlowTwoPhaseProblem)> mainfunc;
|
return Opm::flowEbosOilWaterMain(argc, argv);
|
||||||
return mainfunc.execute(argc, argv);
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2017 IRIS AS
|
|
||||||
|
|
||||||
This file is part of the Open Porous Media project (OPM).
|
This file is part of the Open Porous Media project (OPM).
|
||||||
|
|
||||||
OPM is free software: you can redistribute it and/or modify
|
OPM is free software: you can redistribute it and/or modify
|
||||||
@ -16,27 +14,12 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif // HAVE_CONFIG_H
|
|
||||||
|
|
||||||
#include <opm/material/densead/Evaluation.hpp>
|
#include <opm/simulators/flow_ebos_polymer.hpp>
|
||||||
#include <opm/autodiff/DuneMatrix.hpp>
|
|
||||||
#include <dune/grid/CpGrid.hpp>
|
|
||||||
#include <opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp>
|
|
||||||
#include <opm/autodiff/FlowMainEbos.hpp>
|
|
||||||
|
|
||||||
namespace Ewoms {
|
|
||||||
namespace Properties {
|
|
||||||
NEW_TYPE_TAG(EclFlowPolymerProblem, INHERITS_FROM(EclFlowProblem));
|
|
||||||
SET_BOOL_PROP(EclFlowPolymerProblem, EnablePolymer, true);
|
|
||||||
}}
|
|
||||||
|
|
||||||
// ----------------- Main program -----------------
|
// ----------------- Main program -----------------
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
Opm::FlowMainEbos<TTAG(EclFlowPolymerProblem)> mainfunc;
|
return Opm::flowEbosPolymerMain(argc, argv);
|
||||||
return mainfunc.execute(argc, argv);
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2017 IRIS AS
|
|
||||||
|
|
||||||
This file is part of the Open Porous Media project (OPM).
|
This file is part of the Open Porous Media project (OPM).
|
||||||
|
|
||||||
OPM is free software: you can redistribute it and/or modify
|
OPM is free software: you can redistribute it and/or modify
|
||||||
@ -16,27 +14,12 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_CONFIG_H
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif // HAVE_CONFIG_H
|
|
||||||
|
|
||||||
#include <opm/material/densead/Evaluation.hpp>
|
#include <opm/simulators/flow_ebos_solvent.hpp>
|
||||||
#include <opm/autodiff/DuneMatrix.hpp>
|
|
||||||
#include <dune/grid/CpGrid.hpp>
|
|
||||||
#include <opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp>
|
|
||||||
#include <opm/autodiff/FlowMainEbos.hpp>
|
|
||||||
|
|
||||||
namespace Ewoms {
|
|
||||||
namespace Properties {
|
|
||||||
NEW_TYPE_TAG(EclFlowSolventProblem, INHERITS_FROM(EclFlowProblem));
|
|
||||||
SET_BOOL_PROP(EclFlowSolventProblem, EnableSolvent, true);
|
|
||||||
}}
|
|
||||||
|
|
||||||
// ----------------- Main program -----------------
|
// ----------------- Main program -----------------
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
Opm::FlowMainEbos<TTAG(EclFlowSolventProblem)> mainfunc;
|
return Opm::flowEbosSolventMain(argc, argv);
|
||||||
return mainfunc.execute(argc, argv);
|
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,10 @@ SET_BOOL_PROP(EclFlowProblem, UseVolumetricResidual, false);
|
|||||||
// SWATINIT is done by the flow part of flow_ebos. this can be removed once the legacy
|
// SWATINIT is done by the flow part of flow_ebos. this can be removed once the legacy
|
||||||
// code for fluid and satfunc handling gets fully retired.
|
// code for fluid and satfunc handling gets fully retired.
|
||||||
SET_BOOL_PROP(EclFlowProblem, EnableSwatinit, false);
|
SET_BOOL_PROP(EclFlowProblem, EnableSwatinit, false);
|
||||||
|
|
||||||
|
// Silence the deprecation warnings about the SimulatorParameter mechanism. This needs to
|
||||||
|
// be removed once the SimulatorParameter mechanism bites the dust!
|
||||||
|
SET_TYPE_PROP(EclFlowProblem, SimulatorParameter, Ewoms::EmptySimulationParameters);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||||
#include <opm/common/OpmLog/EclipsePRTLog.hpp>
|
#include <opm/common/OpmLog/EclipsePRTLog.hpp>
|
||||||
#include <opm/common/OpmLog/LogUtil.hpp>
|
#include <opm/common/OpmLog/LogUtil.hpp>
|
||||||
#include <opm/common/ResetLocale.hpp>
|
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
@ -55,7 +54,11 @@
|
|||||||
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
||||||
|
|
||||||
#include <ewoms/version.hh>
|
#if HAVE_DUNE_FEM
|
||||||
|
#include <dune/fem/misc/mpimanager.hh>
|
||||||
|
#else
|
||||||
|
#include <dune/common/parallel/mpihelper.hh>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
@ -75,9 +78,8 @@ namespace Opm
|
|||||||
public:
|
public:
|
||||||
typedef typename GET_PROP(TypeTag, MaterialLaw)::EclMaterialLawManager MaterialLawManager;
|
typedef typename GET_PROP(TypeTag, MaterialLaw)::EclMaterialLawManager MaterialLawManager;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, Simulator) EbosSimulator;
|
typedef typename GET_PROP_TYPE(TypeTag, Simulator) EbosSimulator;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, SimulatorParameter) EbosSimulatorParameter;
|
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, ElementMapper) ElementMapper;
|
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
|
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
|
||||||
|
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
|
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||||
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
||||||
@ -91,23 +93,17 @@ namespace Opm
|
|||||||
/// simulator classes, based on user command-line input. The
|
/// simulator classes, based on user command-line input. The
|
||||||
/// content of this function used to be in the main() function of
|
/// content of this function used to be in the main() function of
|
||||||
/// flow.cpp.
|
/// flow.cpp.
|
||||||
int execute(int argc, char** argv,
|
int execute(int argc, char** argv)
|
||||||
std::shared_ptr<Opm::Deck> deck = std::shared_ptr<Opm::Deck>(),
|
|
||||||
std::shared_ptr<Opm::EclipseState> eclipseState = std::shared_ptr<Opm::EclipseState>() )
|
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
// we always want to use the default locale, and thus spare us the trouble
|
setupParallelism();
|
||||||
// with incorrect locale settings.
|
|
||||||
resetLocale();
|
|
||||||
|
|
||||||
setupParallelism(argc, argv);
|
|
||||||
printStartupMessage();
|
printStartupMessage();
|
||||||
const bool ok = setupParameters(argc, argv);
|
const bool ok = setupParameters(argc, argv);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
setupEbosSimulator( deck, eclipseState );
|
setupEbosSimulator();
|
||||||
setupOutput();
|
setupOutput();
|
||||||
setupLogging();
|
setupLogging();
|
||||||
printPRTHeader();
|
printPRTHeader();
|
||||||
@ -147,15 +143,18 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setupParallelism(int argc, char** argv)
|
void setupParallelism()
|
||||||
{
|
{
|
||||||
// MPI setup.
|
// determine the rank of the current process and the number of processes
|
||||||
// Must ensure an instance of the helper is created to initialise MPI.
|
// involved in the simulation. MPI must have already been initialized here.
|
||||||
// For a build without MPI the Dune::FakeMPIHelper is used, so rank will
|
#if HAVE_MPI
|
||||||
// be 0 and size 1.
|
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank_);
|
||||||
const Dune::MPIHelper& mpi_helper = Dune::MPIHelper::instance(argc, argv);
|
int mpi_size;
|
||||||
mpi_rank_ = mpi_helper.rank();
|
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
|
||||||
const int mpi_size = mpi_helper.size();
|
#else
|
||||||
|
mpi_rank_ = 0;
|
||||||
|
const int mpi_size = 1;
|
||||||
|
#endif
|
||||||
output_cout_ = ( mpi_rank_ == 0 );
|
output_cout_ = ( mpi_rank_ == 0 );
|
||||||
must_distribute_ = ( mpi_size > 1 );
|
must_distribute_ = ( mpi_size > 1 );
|
||||||
|
|
||||||
@ -409,7 +408,7 @@ namespace Opm
|
|||||||
detail::ParallelFileMerger(output_path, deck_filename.stem().string()));
|
detail::ParallelFileMerger(output_path, deck_filename.stem().string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupEbosSimulator( std::shared_ptr<Opm::Deck>& dck, std::shared_ptr<Opm::EclipseState>& eclipseState)
|
void setupEbosSimulator()
|
||||||
{
|
{
|
||||||
std::string progName("flow_ebos");
|
std::string progName("flow_ebos");
|
||||||
std::string deckFile("--ecl-deck-file-name=");
|
std::string deckFile("--ecl-deck-file-name=");
|
||||||
@ -417,10 +416,9 @@ namespace Opm
|
|||||||
char* ptr[2];
|
char* ptr[2];
|
||||||
ptr[ 0 ] = const_cast< char * > (progName.c_str());
|
ptr[ 0 ] = const_cast< char * > (progName.c_str());
|
||||||
ptr[ 1 ] = const_cast< char * > (deckFile.c_str());
|
ptr[ 1 ] = const_cast< char * > (deckFile.c_str());
|
||||||
EbosSimulatorParameter simParam( dck, eclipseState );
|
|
||||||
EbosSimulator::registerParameters();
|
EbosSimulator::registerParameters();
|
||||||
Ewoms::setupParameters_< TypeTag > ( 2, ptr );
|
Ewoms::setupParameters_< TypeTag > ( 2, ptr );
|
||||||
ebosSimulator_.reset(new EbosSimulator(simParam, /*verbose=*/false));
|
ebosSimulator_.reset(new EbosSimulator(/*verbose=*/false));
|
||||||
ebosSimulator_->model().applyInitialSolution();
|
ebosSimulator_->model().applyInitialSolution();
|
||||||
|
|
||||||
// Create a grid with a global view.
|
// Create a grid with a global view.
|
||||||
@ -808,6 +806,8 @@ namespace Opm
|
|||||||
|
|
||||||
const Grid& globalGrid = this->globalGrid();
|
const Grid& globalGrid = this->globalGrid();
|
||||||
const auto& globalGridView = globalGrid.leafGridView();
|
const auto& globalGridView = globalGrid.leafGridView();
|
||||||
|
typedef typename Grid::LeafGridView GridView;
|
||||||
|
typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout> ElementMapper;
|
||||||
ElementMapper globalElemMapper(globalGridView);
|
ElementMapper globalElemMapper(globalGridView);
|
||||||
const auto& cartesianCellIdx = globalGrid.globalCell();
|
const auto& cartesianCellIdx = globalGrid.globalCell();
|
||||||
|
|
||||||
@ -881,6 +881,8 @@ namespace Opm
|
|||||||
|
|
||||||
const Grid& globalGrid = this->globalGrid();
|
const Grid& globalGrid = this->globalGrid();
|
||||||
const auto& globalGridView = globalGrid.leafGridView();
|
const auto& globalGridView = globalGrid.leafGridView();
|
||||||
|
typedef typename Grid::LeafGridView GridView;
|
||||||
|
typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout> ElementMapper;
|
||||||
ElementMapper globalElemMapper(globalGridView);
|
ElementMapper globalElemMapper(globalGridView);
|
||||||
|
|
||||||
const auto* globalTrans = &(ebosSimulator_->gridManager().globalTransmissibility());
|
const auto* globalTrans = &(ebosSimulator_->gridManager().globalTransmissibility());
|
||||||
|
@ -461,7 +461,7 @@ public:
|
|||||||
{ return ebosSimulator_.gridManager().grid(); }
|
{ return ebosSimulator_.gridManager().grid(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void handleAdditionalWellInflow(SimulatorTimer& timer,
|
void handleAdditionalWellInflow(SimulatorTimer& /*timer*/,
|
||||||
WellsManager& /* wells_manager */,
|
WellsManager& /* wells_manager */,
|
||||||
WellState& /* well_state */,
|
WellState& /* well_state */,
|
||||||
const Wells* /* wells */)
|
const Wells* /* wells */)
|
||||||
@ -958,6 +958,9 @@ protected:
|
|||||||
if ( active[Water] ) {
|
if ( active[Water] ) {
|
||||||
fluidState.setSaturation(FluidSystem::waterPhaseIdx, saturations[cellIdx*numPhases + pu.phase_pos[Water]]);
|
fluidState.setSaturation(FluidSystem::waterPhaseIdx, saturations[cellIdx*numPhases + pu.phase_pos[Water]]);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
fluidState.setSaturation(FluidSystem::waterPhaseIdx, 0.0);
|
||||||
|
}
|
||||||
fluidState.setSaturation(FluidSystem::oilPhaseIdx, saturations[cellIdx*numPhases + pu.phase_pos[Oil]]);
|
fluidState.setSaturation(FluidSystem::oilPhaseIdx, saturations[cellIdx*numPhases + pu.phase_pos[Oil]]);
|
||||||
fluidState.setSaturation(FluidSystem::gasPhaseIdx, saturations[cellIdx*numPhases + pu.phase_pos[Gas]]);
|
fluidState.setSaturation(FluidSystem::gasPhaseIdx, saturations[cellIdx*numPhases + pu.phase_pos[Gas]]);
|
||||||
|
|
||||||
|
62
opm/simulators/flow_ebos_blackoil.cpp
Normal file
62
opm/simulators/flow_ebos_blackoil.cpp
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
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"
|
||||||
|
|
||||||
|
// Define making clear that the simulator supports AMG
|
||||||
|
#define FLOW_SUPPORT_AMG 1
|
||||||
|
|
||||||
|
#include <opm/simulators/flow_ebos_blackoil.hpp>
|
||||||
|
|
||||||
|
#include <opm/common/ResetLocale.hpp>
|
||||||
|
#include <dune/grid/CpGrid.hpp>
|
||||||
|
#include <opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp>
|
||||||
|
#include <opm/autodiff/FlowMainEbos.hpp>
|
||||||
|
|
||||||
|
#if HAVE_DUNE_FEM
|
||||||
|
#include <dune/fem/misc/mpimanager.hh>
|
||||||
|
#else
|
||||||
|
#include <dune/common/parallel/mpihelper.hh>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
|
||||||
|
void flowEbosBlackoilSetDeck(Deck &deck, EclipseState& eclState)
|
||||||
|
{
|
||||||
|
typedef TTAG(EclFlowProblem) TypeTag;
|
||||||
|
typedef GET_PROP_TYPE(TypeTag, GridManager) GridManager;
|
||||||
|
|
||||||
|
GridManager::setExternalDeck(&deck, &eclState);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------- Main program -----------------
|
||||||
|
int flowEbosBlackoilMain(int argc, char** argv)
|
||||||
|
{
|
||||||
|
// we always want to use the default locale, and thus spare us the trouble
|
||||||
|
// with incorrect locale settings.
|
||||||
|
Opm::resetLocale();
|
||||||
|
|
||||||
|
#if HAVE_DUNE_FEM
|
||||||
|
Dune::Fem::MPIManager::initialize(argc, argv);
|
||||||
|
#else
|
||||||
|
Dune::MPIHelper::instance(argc, argv);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Opm::FlowMainEbos<TTAG(EclFlowProblem)> mainfunc;
|
||||||
|
return mainfunc.execute(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
28
opm/simulators/flow_ebos_blackoil.hpp
Normal file
28
opm/simulators/flow_ebos_blackoil.hpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
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 FLOW_EBOS_BLACKOIL_HPP
|
||||||
|
#define FLOW_EBOS_BLACKOIL_HPP
|
||||||
|
|
||||||
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
void flowEbosBlackoilSetDeck(Deck &deck, EclipseState& eclState);
|
||||||
|
int flowEbosBlackoilMain(int argc, char** argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // FLOW_EBOS_BLACKOIL_HPP
|
74
opm/simulators/flow_ebos_gasoil.cpp
Normal file
74
opm/simulators/flow_ebos_gasoil.cpp
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
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"
|
||||||
|
|
||||||
|
// Define making clear that the simulator supports AMG
|
||||||
|
#define FLOW_SUPPORT_AMG 1
|
||||||
|
|
||||||
|
#include <opm/simulators/flow_ebos_gasoil.hpp>
|
||||||
|
|
||||||
|
#include <opm/common/ResetLocale.hpp>
|
||||||
|
#include <ewoms/models/blackoil/blackoiltwophaseindices.hh>
|
||||||
|
|
||||||
|
#include <dune/grid/CpGrid.hpp>
|
||||||
|
#include <opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp>
|
||||||
|
#include <opm/autodiff/FlowMainEbos.hpp>
|
||||||
|
|
||||||
|
#if HAVE_DUNE_FEM
|
||||||
|
#include <dune/fem/misc/mpimanager.hh>
|
||||||
|
#else
|
||||||
|
#include <dune/common/parallel/mpihelper.hh>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Ewoms {
|
||||||
|
namespace Properties {
|
||||||
|
NEW_TYPE_TAG(EclFlowGasOilProblem, INHERITS_FROM(EclFlowProblem));
|
||||||
|
//! The indices required by the model
|
||||||
|
SET_TYPE_PROP(EclFlowGasOilProblem, Indices,
|
||||||
|
Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent)?1:0,
|
||||||
|
GET_PROP_VALUE(TypeTag, EnablePolymer)?1:0,
|
||||||
|
/*PVOffset=*/0, /*disabledCompIdx=*/1>);
|
||||||
|
}}
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
void flowEbosGasOilSetDeck(Deck &deck, EclipseState& eclState)
|
||||||
|
{
|
||||||
|
typedef TTAG(EclFlowGasOilProblem) TypeTag;
|
||||||
|
typedef GET_PROP_TYPE(TypeTag, GridManager) GridManager;
|
||||||
|
|
||||||
|
GridManager::setExternalDeck(&deck, &eclState);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ----------------- Main program -----------------
|
||||||
|
int flowEbosGasOilMain(int argc, char** argv)
|
||||||
|
{
|
||||||
|
// we always want to use the default locale, and thus spare us the trouble
|
||||||
|
// with incorrect locale settings.
|
||||||
|
Opm::resetLocale();
|
||||||
|
|
||||||
|
#if HAVE_DUNE_FEM
|
||||||
|
Dune::Fem::MPIManager::initialize(argc, argv);
|
||||||
|
#else
|
||||||
|
Dune::MPIHelper::instance(argc, argv);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Opm::FlowMainEbos<TTAG(EclFlowGasOilProblem)> mainfunc;
|
||||||
|
return mainfunc.execute(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
28
opm/simulators/flow_ebos_gasoil.hpp
Normal file
28
opm/simulators/flow_ebos_gasoil.hpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
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 FLOW_EBOS_GASOIL_HPP
|
||||||
|
#define FLOW_EBOS_GASOIL_HPP
|
||||||
|
|
||||||
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
void flowEbosGasOilSetDeck(Deck &deck, EclipseState& eclState);
|
||||||
|
int flowEbosGasOilMain(int argc, char** argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // FLOW_EBOS_GASOIL_HPP
|
73
opm/simulators/flow_ebos_oilwater.cpp
Normal file
73
opm/simulators/flow_ebos_oilwater.cpp
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
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"
|
||||||
|
|
||||||
|
// Define making clear that the simulator supports AMG
|
||||||
|
#define FLOW_SUPPORT_AMG 1
|
||||||
|
|
||||||
|
#include <opm/simulators/flow_ebos_oilwater.hpp>
|
||||||
|
|
||||||
|
#include <opm/common/ResetLocale.hpp>
|
||||||
|
#include <ewoms/models/blackoil/blackoiltwophaseindices.hh>
|
||||||
|
|
||||||
|
#include <dune/grid/CpGrid.hpp>
|
||||||
|
#include <opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp>
|
||||||
|
#include <opm/autodiff/FlowMainEbos.hpp>
|
||||||
|
|
||||||
|
#if HAVE_DUNE_FEM
|
||||||
|
#include <dune/fem/misc/mpimanager.hh>
|
||||||
|
#else
|
||||||
|
#include <dune/common/parallel/mpihelper.hh>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Ewoms {
|
||||||
|
namespace Properties {
|
||||||
|
NEW_TYPE_TAG(EclFlowOilWaterProblem, INHERITS_FROM(EclFlowProblem));
|
||||||
|
//! The indices required by the model
|
||||||
|
SET_TYPE_PROP(EclFlowOilWaterProblem, Indices,
|
||||||
|
Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent)?1:0,
|
||||||
|
GET_PROP_VALUE(TypeTag, EnablePolymer)?1:0,
|
||||||
|
/*PVOffset=*/0, /*disabledCompIdx=*/2>);
|
||||||
|
}}
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
void flowEbosOilWaterSetDeck(Deck &deck, EclipseState& eclState)
|
||||||
|
{
|
||||||
|
typedef TTAG(EclFlowOilWaterProblem) TypeTag;
|
||||||
|
typedef GET_PROP_TYPE(TypeTag, GridManager) GridManager;
|
||||||
|
|
||||||
|
GridManager::setExternalDeck(&deck, &eclState);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------- Main program -----------------
|
||||||
|
int flowEbosOilWaterMain(int argc, char** argv)
|
||||||
|
{
|
||||||
|
// we always want to use the default locale, and thus spare us the trouble
|
||||||
|
// with incorrect locale settings.
|
||||||
|
Opm::resetLocale();
|
||||||
|
|
||||||
|
#if HAVE_DUNE_FEM
|
||||||
|
Dune::Fem::MPIManager::initialize(argc, argv);
|
||||||
|
#else
|
||||||
|
Dune::MPIHelper::instance(argc, argv);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Opm::FlowMainEbos<TTAG(EclFlowOilWaterProblem)> mainfunc;
|
||||||
|
return mainfunc.execute(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
28
opm/simulators/flow_ebos_oilwater.hpp
Normal file
28
opm/simulators/flow_ebos_oilwater.hpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
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 FLOW_EBOS_OILWATER_HPP
|
||||||
|
#define FLOW_EBOS_OILWATER_HPP
|
||||||
|
|
||||||
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
void flowEbosOilWaterSetDeck(Deck &deck, EclipseState& eclState);
|
||||||
|
int flowEbosOilWaterMain(int argc, char** argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // FLOW_EBOS_OILWATER_HPP
|
65
opm/simulators/flow_ebos_polymer.cpp
Normal file
65
opm/simulators/flow_ebos_polymer.cpp
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
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 <opm/simulators/flow_ebos_polymer.hpp>
|
||||||
|
|
||||||
|
#include <opm/common/ResetLocale.hpp>
|
||||||
|
#include <dune/grid/CpGrid.hpp>
|
||||||
|
#include <opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp>
|
||||||
|
#include <opm/autodiff/FlowMainEbos.hpp>
|
||||||
|
|
||||||
|
#if HAVE_DUNE_FEM
|
||||||
|
#include <dune/fem/misc/mpimanager.hh>
|
||||||
|
#else
|
||||||
|
#include <dune/common/parallel/mpihelper.hh>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Ewoms {
|
||||||
|
namespace Properties {
|
||||||
|
NEW_TYPE_TAG(EclFlowPolymerProblem, INHERITS_FROM(EclFlowProblem));
|
||||||
|
SET_BOOL_PROP(EclFlowPolymerProblem, EnablePolymer, true);
|
||||||
|
}}
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
void flowEbosPolymerSetDeck(Deck &deck, EclipseState& eclState)
|
||||||
|
{
|
||||||
|
typedef TTAG(EclFlowPolymerProblem) TypeTag;
|
||||||
|
typedef GET_PROP_TYPE(TypeTag, GridManager) GridManager;
|
||||||
|
|
||||||
|
GridManager::setExternalDeck(&deck, &eclState);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------- Main program -----------------
|
||||||
|
int flowEbosPolymerMain(int argc, char** argv)
|
||||||
|
{
|
||||||
|
// we always want to use the default locale, and thus spare us the trouble
|
||||||
|
// with incorrect locale settings.
|
||||||
|
Opm::resetLocale();
|
||||||
|
|
||||||
|
// initialize MPI, finalize is done automatically on exit
|
||||||
|
#if HAVE_DUNE_FEM
|
||||||
|
Dune::Fem::MPIManager::initialize(argc, argv);
|
||||||
|
#else
|
||||||
|
Dune::MPIHelper::instance(argc, argv).rank();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Opm::FlowMainEbos<TTAG(EclFlowPolymerProblem)> mainfunc;
|
||||||
|
return mainfunc.execute(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
28
opm/simulators/flow_ebos_polymer.hpp
Normal file
28
opm/simulators/flow_ebos_polymer.hpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
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 FLOW_EBOS_POLYMER_HPP
|
||||||
|
#define FLOW_EBOS_POLYMER_HPP
|
||||||
|
|
||||||
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
void flowEbosPolymerSetDeck(Deck &deck, EclipseState& eclState);
|
||||||
|
int flowEbosPolymerMain(int argc, char** argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // FLOW_EBOS_POLYMER_HPP
|
65
opm/simulators/flow_ebos_solvent.cpp
Normal file
65
opm/simulators/flow_ebos_solvent.cpp
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
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 <opm/simulators/flow_ebos_solvent.hpp>
|
||||||
|
|
||||||
|
#include <opm/common/ResetLocale.hpp>
|
||||||
|
#include <dune/grid/CpGrid.hpp>
|
||||||
|
#include <opm/autodiff/SimulatorFullyImplicitBlackoilEbos.hpp>
|
||||||
|
#include <opm/autodiff/FlowMainEbos.hpp>
|
||||||
|
|
||||||
|
#if HAVE_DUNE_FEM
|
||||||
|
#include <dune/fem/misc/mpimanager.hh>
|
||||||
|
#else
|
||||||
|
#include <dune/common/parallel/mpihelper.hh>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace Ewoms {
|
||||||
|
namespace Properties {
|
||||||
|
NEW_TYPE_TAG(EclFlowSolventProblem, INHERITS_FROM(EclFlowProblem));
|
||||||
|
SET_BOOL_PROP(EclFlowSolventProblem, EnableSolvent, true);
|
||||||
|
}}
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
void flowEbosSolventSetDeck(Deck &deck, EclipseState& eclState)
|
||||||
|
{
|
||||||
|
typedef TTAG(EclFlowSolventProblem) TypeTag;
|
||||||
|
typedef GET_PROP_TYPE(TypeTag, GridManager) GridManager;
|
||||||
|
|
||||||
|
GridManager::setExternalDeck(&deck, &eclState);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------- Main program -----------------
|
||||||
|
int flowEbosSolventMain(int argc, char** argv)
|
||||||
|
{
|
||||||
|
// we always want to use the default locale, and thus spare us the trouble
|
||||||
|
// with incorrect locale settings.
|
||||||
|
Opm::resetLocale();
|
||||||
|
|
||||||
|
// initialize MPI, finalize is done automatically on exit
|
||||||
|
#if HAVE_DUNE_FEM
|
||||||
|
Dune::Fem::MPIManager::initialize(argc, argv);
|
||||||
|
#else
|
||||||
|
Dune::MPIHelper::instance(argc, argv).rank();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Opm::FlowMainEbos<TTAG(EclFlowSolventProblem)> mainfunc;
|
||||||
|
return mainfunc.execute(argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
28
opm/simulators/flow_ebos_solvent.hpp
Normal file
28
opm/simulators/flow_ebos_solvent.hpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
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 FLOW_EBOS_SOLVENT_HPP
|
||||||
|
#define FLOW_EBOS_SOLVENT_HPP
|
||||||
|
|
||||||
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
|
||||||
|
namespace Opm {
|
||||||
|
void flowEbosSolventSetDeck(Deck &deck, EclipseState& eclState);
|
||||||
|
int flowEbosSolventMain(int argc, char** argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // FLOW_EBOS_SOLVENT_HPP
|
@ -74,11 +74,10 @@ namespace Opm {
|
|||||||
|
|
||||||
// AdaptiveTimeStepping
|
// AdaptiveTimeStepping
|
||||||
//---------------------
|
//---------------------
|
||||||
|
inline AdaptiveTimeStepping::AdaptiveTimeStepping( const Tuning& tuning,
|
||||||
AdaptiveTimeStepping::AdaptiveTimeStepping( const Tuning& tuning,
|
size_t time_step,
|
||||||
size_t time_step,
|
const ParameterGroup& param,
|
||||||
const ParameterGroup& param,
|
const bool terminal_output )
|
||||||
const bool terminal_output )
|
|
||||||
: timeStepControl_()
|
: timeStepControl_()
|
||||||
, restart_factor_( tuning.getTSFCNV(time_step) )
|
, restart_factor_( tuning.getTSFCNV(time_step) )
|
||||||
, growth_factor_(tuning.getTFDIFF(time_step) )
|
, growth_factor_(tuning.getTFDIFF(time_step) )
|
||||||
@ -97,8 +96,8 @@ namespace Opm {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AdaptiveTimeStepping::AdaptiveTimeStepping( const ParameterGroup& param,
|
inline AdaptiveTimeStepping::AdaptiveTimeStepping( const ParameterGroup& param,
|
||||||
const bool terminal_output )
|
const bool terminal_output )
|
||||||
: timeStepControl_()
|
: timeStepControl_()
|
||||||
, restart_factor_( param.getDefault("solver.restartfactor", double(0.33) ) )
|
, restart_factor_( param.getDefault("solver.restartfactor", double(0.33) ) )
|
||||||
, growth_factor_( param.getDefault("solver.growthfactor", double(2) ) )
|
, growth_factor_( param.getDefault("solver.growthfactor", double(2) ) )
|
||||||
@ -116,7 +115,7 @@ namespace Opm {
|
|||||||
init(param);
|
init(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdaptiveTimeStepping::
|
inline void AdaptiveTimeStepping::
|
||||||
init(const ParameterGroup& param)
|
init(const ParameterGroup& param)
|
||||||
{
|
{
|
||||||
// valid are "pid" and "pid+iteration"
|
// valid are "pid" and "pid+iteration"
|
||||||
|
Loading…
Reference in New Issue
Block a user