mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-16 10:52:07 -06:00
Merge pull request #2066 from dr-robertk/PR/ebos-oilwaterpolymer
[feature][ebos] Adding oil-water-polymer option of ebos.
This commit is contained in:
commit
3cccb47847
@ -213,7 +213,7 @@ endif()
|
||||
# the research oriented general-purpose ECL simulator ("ebos" == &ecl
|
||||
# &black-&oil &simulator)
|
||||
set(MEBOS_TARGETS "")
|
||||
foreach(OBJ blackoil solvent polymer foam gasoil oilwater thermal)
|
||||
foreach(OBJ blackoil solvent polymer foam gasoil oilwater oilwaterpolymer thermal)
|
||||
add_library(ebos_lib${OBJ} OBJECT EXCLUDE_FROM_ALL ebos/ebos_${OBJ}.cc)
|
||||
list(APPEND MEBOS_TARGETS $<TARGET_OBJECTS:ebos_lib${OBJ}>)
|
||||
endforeach()
|
||||
@ -237,7 +237,7 @@ else()
|
||||
set(EBOS_EXTENSIONS_DEFAULT_ENABLE_IF "TRUE")
|
||||
endif()
|
||||
|
||||
foreach(OBJ solvent polymer foam gasoil oilwater thermal)
|
||||
foreach(OBJ solvent polymer foam gasoil oilwater oilwaterpolymer thermal)
|
||||
opm_add_test(ebos_${OBJ}
|
||||
ONLY_COMPILE
|
||||
DEFAULT_ENABLE_IF ${EBOS_EXTENSIONS_DEFAULT_ENABLE_IF}
|
||||
@ -277,7 +277,7 @@ opm_add_test(ebos_plain
|
||||
LIBRARIES opmsimulators)
|
||||
|
||||
if (BUILD_EBOS_EXTENSIONS)
|
||||
foreach(TGT ebos_solvent ebos_polymer ebos_foam ebos_gasoil ebos_oilwater ebos_thermal mebos)
|
||||
foreach(TGT ebos_solvent ebos_polymer ebos_foam ebos_gasoil ebos_oilwater ebos_oilwaterpolymer ebos_thermal mebos)
|
||||
install(TARGETS ${TGT} DESTINATION bin)
|
||||
opm_add_bash_completion(${TGT})
|
||||
endforeach()
|
||||
|
81
ebos/ebos_oilwaterpolymer.cc
Normal file
81
ebos/ebos_oilwaterpolymer.cc
Normal file
@ -0,0 +1,81 @@
|
||||
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
// vi: set et ts=4 sw=4 sts=4:
|
||||
/*
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Consult the COPYING file in the top-level source directory of this
|
||||
module for the precise wording of the license and the list of
|
||||
copyright holders.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
*
|
||||
* \brief A general-purpose simulator for ECL decks using the black-oil model.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include "startEbos.hh"
|
||||
|
||||
BEGIN_PROPERTIES
|
||||
|
||||
NEW_TYPE_TAG(EbosOilWaterPolymerTypeTag, INHERITS_FROM(EbosTypeTag));
|
||||
|
||||
// enable the polymer extension of the black oil model
|
||||
SET_BOOL_PROP(EbosOilWaterPolymerTypeTag, EnablePolymer, true);
|
||||
|
||||
//! The indices indices which only enable oil and water
|
||||
SET_PROP(EbosOilWaterPolymerTypeTag, Indices)
|
||||
{
|
||||
private:
|
||||
// it is unfortunately not possible to simply use 'TypeTag' here because this leads
|
||||
// to cyclic definitions of some properties. if this happens the compiler error
|
||||
// messages unfortunately are *really* confusing and not really helpful.
|
||||
typedef typename GET_PROP_TYPE(TTAG(EbosTypeTag), FluidSystem) FluidSystem;
|
||||
|
||||
public:
|
||||
typedef Opm::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
|
||||
GET_PROP_VALUE(TypeTag, EnablePolymer),
|
||||
GET_PROP_VALUE(TypeTag, EnableEnergy),
|
||||
GET_PROP_VALUE(TypeTag, EnableFoam),
|
||||
/*PVOffset=*/0,
|
||||
/*disabledCompIdx=*/FluidSystem::gasCompIdx> type;
|
||||
};
|
||||
|
||||
END_PROPERTIES
|
||||
|
||||
namespace Opm {
|
||||
|
||||
void ebosOilWaterPolymerSetDeck(Opm::Deck* deck,
|
||||
Opm::ParseContext* parseContext,
|
||||
Opm::ErrorGuard* errorGuard,
|
||||
double externalSetupTime)
|
||||
{
|
||||
typedef TTAG(EbosOilWaterPolymerTypeTag) ProblemTypeTag;
|
||||
typedef GET_PROP_TYPE(ProblemTypeTag, Vanguard) Vanguard;
|
||||
|
||||
Vanguard::setExternalSetupTime(externalSetupTime);
|
||||
Vanguard::setExternalParseContext(parseContext);
|
||||
Vanguard::setExternalErrorGuard(errorGuard);
|
||||
Vanguard::setExternalDeck(deck);
|
||||
}
|
||||
|
||||
int ebosOilWaterPolymerMain(int argc, char **argv)
|
||||
{
|
||||
typedef TTAG(EbosOilWaterPolymerTypeTag) ProblemTypeTag;
|
||||
return Opm::startEbos<ProblemTypeTag>(argc, argv);
|
||||
}
|
||||
|
||||
}
|
44
ebos/ebos_oilwaterpolymer.hh
Normal file
44
ebos/ebos_oilwaterpolymer.hh
Normal file
@ -0,0 +1,44 @@
|
||||
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
// vi: set et ts=4 sw=4 sts=4:
|
||||
/*
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Consult the COPYING file in the top-level source directory of this
|
||||
module for the precise wording of the license and the list of
|
||||
copyright holders.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
*
|
||||
* \brief The function prototypes required to start the oil-water variant of ebos
|
||||
*/
|
||||
#ifndef EBOS_OIL_WATER_POLYMER_HH
|
||||
#define EBOS_OIL_WATER_POLYMER_HH
|
||||
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
|
||||
|
||||
namespace Opm {
|
||||
void ebosOilWaterPolymerSetDeck(Opm::Deck* deck,
|
||||
Opm::ParseContext* parseContext,
|
||||
Opm::ErrorGuard* errorGuard,
|
||||
double externalSetupTime);
|
||||
|
||||
int ebosOilWaterPolymerMain(int argc, char** argv);
|
||||
}
|
||||
|
||||
#endif
|
37
ebos/ebos_oilwaterpolymer_main.cc
Normal file
37
ebos/ebos_oilwaterpolymer_main.cc
Normal file
@ -0,0 +1,37 @@
|
||||
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
// vi: set et ts=4 sw=4 sts=4:
|
||||
/*
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Consult the COPYING file in the top-level source directory of this
|
||||
module for the precise wording of the license and the list of
|
||||
copyright holders.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
*
|
||||
* \brief The main function for the stand alone oil-water plus polymer variant of ebos.
|
||||
*
|
||||
* This only calls the ebosOilWaterPolymerMain() function.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include "ebos_oilwaterpolymer.hh"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return Opm::ebosOilWaterPolymerMain(argc, argv);
|
||||
}
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include "ebos_blackoil.hh"
|
||||
#include "ebos_oilwater.hh"
|
||||
#include "ebos_oilwaterpolymer.hh"
|
||||
#include "ebos_gasoil.hh"
|
||||
// TODO (?): #include "ebos_watergas.hh"
|
||||
#include "ebos_thermal.hh"
|
||||
@ -119,6 +120,16 @@ int main(int argc, char **argv)
|
||||
std::abort();
|
||||
}
|
||||
|
||||
if (polymerActive && oilActive && waterActive) {
|
||||
if (myRank == 0)
|
||||
std::cout << "Using oil-water-polymer mode" << std::endl;
|
||||
Opm::ebosOilWaterPolymerSetDeck(deck.get(),
|
||||
parseContext.get(),
|
||||
errorGuard.get(),
|
||||
externalSetupTimer.elapsed());
|
||||
return Opm::ebosOilWaterPolymerMain(argc, argv);
|
||||
}
|
||||
|
||||
if (polymerActive) {
|
||||
notSupportedErrorStream << "\n"
|
||||
<< "combining twophase and polymer is not supported by the multiplexed simulator\n";
|
||||
|
Loading…
Reference in New Issue
Block a user