flow: refactor the specializations

The motivation for this PR is that currently the build fails on my
Ubuntu 17.10 laptop with two processes because that machine "only" has
8 GB of RAM (granted, the optimization options may have been a bit too
excessive). under the new scheme, each specialization of the simulator
is put into a separate compile unit which is part of
libopmsimulators. this has the advantages that the specialized
simulators and the main binary automatically stay consistent, the
compilation is faster (2m25s vs 4m16s on my machine) because all
compile units can be built in parallel and that compilation takes up
less RAM because there is no need to instantiate all specializations
in a single compile unit.

on the minus side, all specializations must now always be compiled,
the approach means slightly more work for the maintainers and the
flow_* startup code gets even more complicated.
This commit is contained in:
Andreas Lauser 2017-10-05 16:55:30 +02:00
parent 0c92c24dcb
commit cede806bd5
17 changed files with 519 additions and 213 deletions

View File

@ -62,6 +62,11 @@ list (APPEND MAIN_SOURCE_FILES
opm/polymer/TransportSolverTwophaseCompressiblePolymer.cpp
opm/polymer/TransportSolverTwophasePolymer.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/SimulatorCompressibleTwophase.cpp
opm/simulators/SimulatorIncompTwophase.cpp
@ -273,6 +278,11 @@ list (APPEND PUBLIC_HEADER_FILES
opm/polymer/fullyimplicit/SimulatorFullyImplicitBlackoilPolymer.hpp
opm/polymer/fullyimplicit/SimulatorFullyImplicitBlackoilPolymer_impl.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/ParallelFileMerger.hpp
opm/simulators/SimulatorCompressibleTwophase.hpp

View File

@ -18,69 +18,28 @@
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#if HAVE_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/common/ResetLocale.hpp>
#include <opm/parser/eclipse/Deck/Deck.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/IOConfig/IOConfig.hpp>
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
// Define making clear that the simulator supports AMG
#define FLOW_SUPPORT_AMG 1
#include <ewoms/models/blackoil/blackoiltwophaseindices.hh>
#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
#if HAVE_DUNE_FEM
#include <dune/fem/misc/mpimanager.hh>
#else
#include <dune/common/parallel/mpihelper.hh>
#endif
namespace detail
{
@ -191,14 +150,14 @@ int main(int argc, char** argv)
// oil-gas
if (phases.active( Opm::Phase::GAS ))
{
Opm::FlowMainEbos<TTAG(EclFlowGasOilProblem)> mainfunc;
return mainfunc.execute(argc, argv, deck, eclipseState );
Opm::flowEbosGasOilSetDeck(*deck, *eclipseState);
return Opm::flowEbosGasOilMain(argc, argv);
}
// oil-water
else if ( phases.active( Opm::Phase::WATER ) )
{
Opm::FlowMainEbos<TTAG(EclFlowOilWaterProblem)> mainfunc;
return mainfunc.execute(argc, argv, deck, eclipseState );
Opm::flowEbosOilWaterSetDeck(*deck, *eclipseState);
return Opm::flowEbosOilWaterMain(argc, argv);
}
else {
if (outputCout)
@ -208,20 +167,18 @@ int main(int argc, char** argv)
}
// Polymer case
else if ( phases.active( Opm::Phase::POLYMER ) ) {
Opm::FlowMainEbos<TTAG(EclFlowPolymerProblem)> mainfunc;
return mainfunc.execute(argc, argv, deck, eclipseState );
Opm::flowEbosPolymerSetDeck(*deck, *eclipseState);
return Opm::flowEbosPolymerMain(argc, argv);
}
// Solvent case
else if ( phases.active( Opm::Phase::SOLVENT ) ) {
Opm::FlowMainEbos<TTAG(EclFlowSolventProblem)> mainfunc;
return mainfunc.execute(argc, argv, deck, eclipseState );
Opm::flowEbosSolventSetDeck(*deck, *eclipseState);
return Opm::flowEbosSolventMain(argc, argv);
}
// Blackoil case
else if( phases.size() == 3 ) {
Opm::FlowMainEbos<TTAG(EclFlowProblem)> mainfunc;
return mainfunc.execute(argc, argv, deck, eclipseState );
Opm::flowEbosBlackoilSetDeck(*deck, *eclipseState);
return Opm::flowEbosBlackoilMain(argc, argv);
}
else
{

View File

@ -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).
OPM is free software: you can redistribute it and/or modify
@ -18,39 +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/>.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
// Define making clear that the simulator supports AMG
#define FLOW_SUPPORT_AMG 1
#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
#include <opm/simulators/flow_ebos_blackoil.hpp>
// ----------------- Main program -----------------
int main(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);
return Opm::flowEbosBlackoilMain(argc, argv);
}

View File

@ -1,6 +1,4 @@
/*
Copyright 2017 IRIS AS
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
@ -16,49 +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/>.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
// Define making clear that the simulator supports AMG
#define FLOW_SUPPORT_AMG 1
#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(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>);
}}
#include <opm/simulators/flow_ebos_oilwater.hpp>
// ----------------- Main program -----------------
int main(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(EclFlowTwoPhaseProblem)> mainfunc;
return mainfunc.execute(argc, argv);
return Opm::flowEbosOilWaterMain(argc, argv);
}

View File

@ -1,6 +1,4 @@
/*
Copyright 2017 IRIS AS
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
@ -16,44 +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/>.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
#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);
}}
#include <opm/simulators/flow_ebos_polymer.hpp>
// ----------------- Main program -----------------
int main(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);
const int myRank = Dune::Fem::MPIManager::rank();
#else
const int myRank = Dune::MPIHelper::instance(argc, argv).rank();
#endif
Opm::FlowMainEbos<TTAG(EclFlowPolymerProblem)> mainfunc;
return mainfunc.execute(argc, argv);
return Opm::flowEbosPolymerMain(argc, argv);
}

View File

@ -1,6 +1,4 @@
/*
Copyright 2017 IRIS AS
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
@ -16,44 +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/>.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
#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);
}}
#include <opm/simulators/flow_ebos_solvent.hpp>
// ----------------- Main program -----------------
int main(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);
const int myRank = Dune::Fem::MPIManager::rank();
#else
const int myRank = Dune::MPIHelper::instance(argc, argv).rank();
#endif
Opm::FlowMainEbos<TTAG(EclFlowSolventProblem)> mainfunc;
return mainfunc.execute(argc, argv);
return Opm::flowEbosSolventMain(argc, argv);
}

View File

@ -78,7 +78,6 @@ namespace Opm
public:
typedef typename GET_PROP(TypeTag, MaterialLaw)::EclMaterialLawManager MaterialLawManager;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) EbosSimulator;
typedef typename GET_PROP_TYPE(TypeTag, SimulatorParameter) EbosSimulatorParameter;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
@ -419,10 +418,9 @@ namespace Opm
char* ptr[2];
ptr[ 0 ] = const_cast< char * > (progName.c_str());
ptr[ 1 ] = const_cast< char * > (deckFile.c_str());
EbosSimulatorParameter simParam( dck, eclipseState );
EbosSimulator::registerParameters();
Ewoms::setupParameters_< TypeTag > ( 2, ptr );
ebosSimulator_.reset(new EbosSimulator(simParam, /*verbose=*/false));
ebosSimulator_.reset(new EbosSimulator(/*verbose=*/false));
ebosSimulator_->model().applyInitialSolution();
// Create a grid with a global view.

View 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);
}
}

View 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

View 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);
}
}

View 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

View 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);
}
}

View 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

View 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);
}
}

View 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

View 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);
}
}

View 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