2017-10-05 16:55:30 +02:00
|
|
|
/*
|
|
|
|
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"
|
|
|
|
|
2024-02-01 13:39:45 +01:00
|
|
|
#include <flow/flow_oilwater.hpp>
|
2017-10-05 16:55:30 +02:00
|
|
|
|
2018-02-07 10:27:32 +01:00
|
|
|
#include <opm/material/common/ResetLocale.hpp>
|
2019-09-16 11:22:14 +02:00
|
|
|
#include <opm/models/blackoil/blackoiltwophaseindices.hh>
|
2017-10-05 16:55:30 +02:00
|
|
|
|
2018-02-09 13:42:16 +01:00
|
|
|
#include <opm/grid/CpGrid.hpp>
|
2024-01-31 14:14:50 +01:00
|
|
|
#include <opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp>
|
2021-11-01 08:33:17 +01:00
|
|
|
#include <opm/simulators/flow/Main.hpp>
|
2017-10-05 16:55:30 +02:00
|
|
|
|
2022-09-02 12:25:12 +02:00
|
|
|
#include <opm/models/blackoil/blackoillocalresidualtpfa.hh>
|
|
|
|
#include <opm/models/discretization/common/tpfalinearizer.hh>
|
|
|
|
|
2019-09-05 17:04:39 +02:00
|
|
|
namespace Opm {
|
2017-10-05 16:55:30 +02:00
|
|
|
namespace Properties {
|
2020-08-27 10:30:29 +02:00
|
|
|
namespace TTag {
|
2024-02-06 14:47:31 +01:00
|
|
|
struct FlowOilWaterProblem {
|
2024-02-06 14:47:31 +01:00
|
|
|
using InheritsFrom = std::tuple<FlowProblem>;
|
2020-08-27 10:30:29 +02:00
|
|
|
};
|
|
|
|
}
|
2018-01-30 11:53:30 +01:00
|
|
|
|
2022-09-02 12:25:12 +02:00
|
|
|
template<class TypeTag>
|
2024-02-06 14:47:31 +01:00
|
|
|
struct Linearizer<TypeTag, TTag::FlowOilWaterProblem> { using type = TpfaLinearizer<TypeTag>; };
|
2022-09-02 12:25:12 +02:00
|
|
|
|
|
|
|
template<class TypeTag>
|
2024-02-06 14:47:31 +01:00
|
|
|
struct LocalResidual<TypeTag, TTag::FlowOilWaterProblem> { using type = BlackOilLocalResidualTPFA<TypeTag>; };
|
2022-09-02 12:25:12 +02:00
|
|
|
|
|
|
|
template<class TypeTag>
|
2024-02-06 14:47:31 +01:00
|
|
|
struct EnableDiffusion<TypeTag, TTag::FlowOilWaterProblem> { static constexpr bool value = false; };
|
2022-09-02 12:25:12 +02:00
|
|
|
|
|
|
|
|
2017-10-05 16:55:30 +02:00
|
|
|
//! The indices required by the model
|
2020-08-27 11:38:38 +02:00
|
|
|
template<class TypeTag>
|
2024-02-06 14:47:31 +01:00
|
|
|
struct Indices<TypeTag, TTag::FlowOilWaterProblem>
|
2018-01-30 11:53:30 +01:00
|
|
|
{
|
|
|
|
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.
|
2024-02-06 14:47:31 +01:00
|
|
|
using BaseTypeTag = TTag::FlowProblem;
|
2020-08-26 10:49:52 +02:00
|
|
|
using FluidSystem = GetPropType<BaseTypeTag, Properties::FluidSystem>;
|
2018-01-30 11:53:30 +01:00
|
|
|
|
|
|
|
public:
|
2024-02-06 14:47:31 +01:00
|
|
|
using type = BlackOilTwoPhaseIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
|
|
|
|
getPropValue<TypeTag, Properties::EnableExtbo>(),
|
|
|
|
getPropValue<TypeTag, Properties::EnablePolymer>(),
|
|
|
|
getPropValue<TypeTag, Properties::EnableEnergy>(),
|
|
|
|
getPropValue<TypeTag, Properties::EnableFoam>(),
|
|
|
|
getPropValue<TypeTag, Properties::EnableBrine>(),
|
|
|
|
/*PVOffset=*/0,
|
|
|
|
/*disabledCompIdx=*/FluidSystem::gasCompIdx,
|
|
|
|
getPropValue<TypeTag, Properties::EnableMICP>()>;
|
2018-01-30 11:53:30 +01:00
|
|
|
};
|
2017-10-05 16:55:30 +02:00
|
|
|
}}
|
|
|
|
|
|
|
|
namespace Opm {
|
|
|
|
|
|
|
|
// ----------------- Main program -----------------
|
2024-02-01 10:54:43 +01:00
|
|
|
int flowOilWaterMain(int argc, char** argv, bool outputCout, bool outputFiles)
|
2017-10-05 16:55:30 +02:00
|
|
|
{
|
|
|
|
// we always want to use the default locale, and thus spare us the trouble
|
|
|
|
// with incorrect locale settings.
|
2021-05-05 11:22:44 +02:00
|
|
|
resetLocale();
|
2017-10-05 16:55:30 +02:00
|
|
|
|
2024-02-06 14:47:31 +01:00
|
|
|
FlowMain<Properties::TTag::FlowOilWaterProblem>
|
2020-06-25 20:04:19 +02:00
|
|
|
mainfunc {argc, argv, outputCout, outputFiles};
|
|
|
|
return mainfunc.execute();
|
2017-10-05 16:55:30 +02:00
|
|
|
}
|
|
|
|
|
2024-02-01 10:54:43 +01:00
|
|
|
int flowOilWaterMainStandalone(int argc, char** argv)
|
2021-11-01 08:33:17 +01:00
|
|
|
{
|
2024-02-06 14:47:31 +01:00
|
|
|
using TypeTag = Properties::TTag::FlowOilWaterProblem;
|
2023-07-19 13:20:03 +02:00
|
|
|
auto mainObject = std::make_unique<Opm::Main>(argc, argv);
|
|
|
|
auto ret = mainObject->runStatic<TypeTag>();
|
|
|
|
// Destruct mainObject as the destructor calls MPI_Finalize!
|
|
|
|
mainObject.reset();
|
|
|
|
return ret;
|
2021-11-01 08:33:17 +01:00
|
|
|
}
|
|
|
|
|
2017-10-05 16:55:30 +02:00
|
|
|
}
|