trying to add the functionality to handle oil/water polymer

This commit is contained in:
Kai Bao 2018-02-27 11:18:56 +01:00
parent 10887ddaca
commit 635f6c7db2
4 changed files with 123 additions and 2 deletions

View File

@ -31,6 +31,7 @@ list (APPEND MAIN_SOURCE_FILES
opm/simulators/flow_ebos_oilwater.cpp
opm/simulators/flow_ebos_polymer.cpp
opm/simulators/flow_ebos_solvent.cpp
opm/simulators/flow_ebos_oilwater_polymer.cpp
opm/autodiff/Compat.cpp
opm/autodiff/ExtractParallelGridInformationToISTL.cpp
@ -444,6 +445,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/flow_ebos_oilwater.hpp
opm/simulators/flow_ebos_polymer.hpp
opm/simulators/flow_ebos_solvent.hpp
opm/simulators/flow_ebos_oilwater_polymer.hpp
opm/simulators/ensureDirectoryExists.hpp
opm/simulators/ParallelFileMerger.hpp
opm/simulators/SimulatorCompressibleTwophase.hpp

View File

@ -25,6 +25,7 @@
#include <opm/simulators/flow_ebos_oilwater.hpp>
#include <opm/simulators/flow_ebos_solvent.hpp>
#include <opm/simulators/flow_ebos_polymer.hpp>
#include <opm/simulators/flow_ebos_oilwater_polymer.hpp>
#include <opm/autodiff/MissingFeatures.hpp>
#include <opm/common/utility/parameters/ParameterGroup.hpp>
@ -166,8 +167,21 @@ int main(int argc, char** argv)
}
// Polymer case
else if ( phases.active( Opm::Phase::POLYMER ) ) {
Opm::flowEbosPolymerSetDeck(*deck, *eclipseState, *schedule, *summary_config);
return Opm::flowEbosPolymerMain(argc, argv);
if ( !phases.active( Opm::Phase::WATER) ) {
if (outputCout)
std::cerr << "No valid configuration is found for polymer simulation, valid options include "
<< "oilwater + polymer and blackoil + polymer" << std::endl;
return EXIT_FAILURE;
}
if ( phases.size() == 3 ) { // oil water polymer case
Opm::flowEbosOilWaterPolymerSetDeck(*deck, *eclipseState, *schedule, *summary_config);
return Opm::flowEbosOilWaterPolymerMain(argc, argv);
} else {
Opm::flowEbosPolymerSetDeck(*deck, *eclipseState, *schedule, *summary_config);
return Opm::flowEbosPolymerMain(argc, argv);
}
}
// Solvent case
else if ( phases.active( Opm::Phase::SOLVENT ) ) {

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_oilwater_polymer.hpp>
#include <opm/material/common/ResetLocale.hpp>
#include <ewoms/models/blackoil/blackoiltwophaseindices.hh>
#include <opm/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(EclFlowOilWaterPolymerProblem, INHERITS_FROM(EclFlowProblem));
SET_BOOL_PROP(EclFlowOilWaterPolymerProblem, EnablePolymer, true);
//! The indices required by the model
SET_TYPE_PROP(EclFlowOilWaterPolymerProblem, Indices,
Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent)?1:0,
GET_PROP_VALUE(TypeTag, EnablePolymer)?1:0,
/*PVOffset=*/0, /*disabledCompIdx=*/2>);
}}
namespace Opm {
void flowEbosOilWaterPolymerSetDeck(Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summaryConfig)
{
typedef TTAG(EclFlowOilWaterPolymerProblem) TypeTag;
typedef GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
Vanguard::setExternalDeck(&deck, &eclState, &schedule, &summaryConfig);
}
// ----------------- Main program -----------------
int flowEbosOilWaterPolymerMain(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(EclFlowOilWaterPolymerProblem)> mainfunc;
return mainfunc.execute(argc, argv);
}
}

View File

@ -0,0 +1,31 @@
/*
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_POLYMER_HPP
#define FLOW_EBOS_OILWATER_POLYMER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
namespace Opm {
void flowEbosOilWaterPolymerSetDeck(Deck &deck, EclipseState& eclState, Schedule& schedule, SummaryConfig& summary_config);
int flowEbosOilWaterPolymerMain(int argc, char** argv);
}
#endif // FLOW_EBOS_OILWATER_POLYMER_HPP