splitting Blackoil related to FlowProblemBlackoil

so FlowProblem can be used for compositional or other setting
This commit is contained in:
Kai Bao 2024-09-11 14:25:34 +02:00
parent ec15bad996
commit 85513754bc
17 changed files with 1666 additions and 1351 deletions

View File

@ -750,14 +750,16 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/flow/ExtraConvergenceOutputThread.hpp
opm/simulators/flow/FemCpGridCompat.hpp
opm/simulators/flow/FIBlackoilModel.hpp
opm/simulators/flow/FlowBaseProblemProperties.hpp
opm/simulators/flow/FlowBaseVanguard.hpp
opm/simulators/flow/FlowGenericProblem.hpp
opm/simulators/flow/FlowGenericProblem_impl.hpp
opm/simulators/flow/FlowGenericVanguard.hpp
opm/simulators/flow/FlowMain.hpp
opm/simulators/flow/FlowProblem.hpp
opm/simulators/flow/FlowProblemBlackoil.hpp
opm/simulators/flow/FlowProblemParameters.hpp
opm/simulators/flow/FlowProblemProperties.hpp
opm/simulators/flow/FlowProblemBlackoilProperties.hpp
opm/simulators/flow/FlowUtils.hpp
opm/simulators/flow/FlowsData.hpp
opm/simulators/flow/FlowThresholdPressure.hpp

View File

@ -37,8 +37,8 @@
#include <opm/simulators/aquifers/BlackoilAquiferModel.hpp>
#include <opm/simulators/flow/FlowProblem.hpp>
#include <opm/simulators/flow/FlowProblemProperties.hpp>
#include <opm/simulators/flow/FlowProblemBlackoil.hpp>
#include <opm/simulators/flow/FlowProblemBlackoilProperties.hpp>
#include <opm/simulators/linalg/ISTLSolver.hpp>
@ -57,7 +57,7 @@ namespace TTag {
struct FlowExpTypeTag
{
using InheritsFrom = std::tuple<FlowBaseProblem, BlackOilModel>;
using InheritsFrom = std::tuple<FlowBaseProblemBlackoil, BlackOilModel>;
};
}
@ -126,9 +126,9 @@ struct LinearSolverBackend<TypeTag, TTag::FlowExpTypeTag> {
namespace Opm {
template <class TypeTag>
class FlowExpProblem : public FlowProblem<TypeTag> //, public FvBaseProblem<TypeTag>
class FlowExpProblem : public FlowProblemBlackoil<TypeTag> //, public FvBaseProblem<TypeTag>
{
typedef FlowProblem<TypeTag> ParentType;
typedef FlowProblemBlackoil<TypeTag> ParentType;
using BaseType = ParentType; // GetPropType<TypeTag, Properties::BaseProblem>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
@ -203,7 +203,7 @@ public:
}
// inherit the constructors
using ParentType::FlowProblem;
using ParentType::FlowProblemBlackoil;
};
}

View File

@ -23,7 +23,7 @@
#include <opm/models/discretization/common/tpfalinearizer.hh>
#include <opm/models/utils/parametersystem.hpp>
#include <opm/simulators/flow/Main.hpp>
#include <opm/simulators/flow/FlowProblem.hpp>
#include <opm/simulators/flow/FlowProblemBlackoil.hpp>
#include "BlackOilIntensiveQuantitiesGlobalIndex.hpp"
#include "FIBlackOilModelNoCache.hpp"

View File

@ -108,6 +108,13 @@ public:
unsigned) const
{ }
void addToSource(RateVector&,
unsigned,
unsigned) const
{ }
/*!
* \brief This method is called after each Newton-Raphson successful iteration.
*

View File

@ -38,7 +38,7 @@
#include <opm/simulators/flow/BlackoilModelNldd.hpp>
#include <opm/simulators/flow/BlackoilModelParameters.hpp>
#include <opm/simulators/flow/countGlobalCells.hpp>
#include <opm/simulators/flow/FlowProblem.hpp>
#include <opm/simulators/flow/FlowProblemBlackoil.hpp>
#include <opm/simulators/flow/NonlinearSolver.hpp>
#include <opm/simulators/flow/RSTConv.hpp>
#include <opm/simulators/timestepping/AdaptiveTimeStepping.hpp>
@ -77,7 +77,7 @@ namespace Opm::Properties {
namespace TTag {
struct FlowProblem { using InheritsFrom = std::tuple<FlowBaseProblem, BlackOilModel>; };
struct FlowProblem { using InheritsFrom = std::tuple<FlowBaseProblemBlackoil, BlackOilModel>; };
}

View File

@ -23,12 +23,12 @@
/*!
* \file
*
* \copydoc Opm::FlowProblem
* \copydoc Opm::FlowBaseProblem
*/
#ifndef OPM_FLOW_PROBLEM_PROPERTIES_HPP
#define OPM_FLOW_PROBLEM_PROPERTIES_HPP
#ifndef OPM_FLOW_BASE_PROBLEM_PROPERTIES_HPP
#define OPM_FLOW_BASE_PROBLEM_PROPERTIES_HPP
#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
#include <opm/material/thermal/EclThermalLawManager.hpp>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
@ -39,10 +39,7 @@
#include <opm/simulators/flow/DummyGradientCalculator.hpp>
#include <opm/simulators/flow/EclWriter.hpp>
#include <opm/simulators/flow/FlowProblemParameters.hpp>
#include <opm/simulators/flow/FIBlackoilModel.hpp>
#include <opm/simulators/flow/NewTranFluxModule.hpp>
#include <opm/simulators/flow/OutputBlackoilModule.hpp>
#include <opm/simulators/flow/VtkTracerModule.hpp>
#include <opm/simulators/flow/TracerModel.hpp>
#if HAVE_DAMARIS
#include <opm/simulators/flow/DamarisWriter.hpp>
@ -50,11 +47,6 @@
#include <tuple>
namespace Opm {
template <class TypeTag>
class FlowProblem;
}
namespace Opm::Properties {
namespace TTag {
@ -89,14 +81,14 @@ struct EnableThermalFluxBoundaries { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct WellModel { using type = UndefinedProperty; };
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::FlowBaseProblem>
{ using type = FlowProblem<TypeTag>; };
// Tracer might be moved to the blackoil side
// The class that deals with the tracer
template<class TypeTag, class MyTypeTag>
struct TracerModel { using type = UndefinedProperty; };
template<class TypeTag>
struct Model<TypeTag, TTag::FlowBaseProblem>
{ using type = FIBlackOilModel<TypeTag>; };
template <class TypeTag>
struct TracerModel<TypeTag, TTag::FlowBaseProblem>
{ using type = ::Opm::TracerModel<TypeTag>; };
// Select the element centered finite volume method as spatial discretization
template<class TypeTag>
@ -123,25 +115,6 @@ template<class TypeTag>
struct GridView<TypeTag, TTag::FlowBaseProblem>
{ using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; };
// Set the material law for fluid fluxes
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::FlowBaseProblem>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
using Traits = ThreePhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::waterPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::oilPhaseIdx,
/*gasPhaseIdx=*/FluidSystem::gasPhaseIdx>;
public:
using EclMaterialLawManager = ::Opm::EclMaterialLawManager<Traits>;
using type = typename EclMaterialLawManager::MaterialLaw;
};
// Set the material law for energy storage in rock
template<class TypeTag>
struct SolidEnergyLaw<TypeTag, TTag::FlowBaseProblem>
@ -212,16 +185,6 @@ template<class TypeTag>
struct EnableApiTracking<TypeTag, TTag::FlowBaseProblem>
{ static constexpr bool value = false; };
// Use the "velocity module" which uses the Eclipse "NEWTRAN" transmissibilities
template<class TypeTag>
struct FluxModule<TypeTag, TTag::FlowBaseProblem>
{ using type = NewTranFluxModule<TypeTag>; };
// Use the dummy gradient calculator in order not to do unnecessary work.
template<class TypeTag>
struct GradientCalculator<TypeTag, TTag::FlowBaseProblem>
{ using type = DummyGradientCalculator<TypeTag>; };
// store temperature (but do not conserve energy, as long as EnableEnergy is false)
template<class TypeTag>
struct EnableTemperature<TypeTag, TTag::FlowBaseProblem>
@ -275,4 +238,4 @@ struct EnableDebuggingChecks<TypeTag, TTag::FlowBaseProblem>
} // namespace Opm::Properties
#endif // OPM_FLOW_PROBLEM_PROPERTIES_HPP
#endif // OPM_BASE_FLOW_PROBLEM_PROPERTIES_HPP

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,99 @@
// -*- 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
*
* \copydoc Opm::FlowBaseProblemBlackoil
*/
#ifndef OPM_FLOW_BASE_PROBLEM_BLACKOIL_PROPERTIES_HPP
#define OPM_FLOW_BASE_PROBLEM_BLACKOIL_PROPERTIES_HPP
#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
#include <opm/models/utils/propertysystem.hh>
#include <opm/simulators/flow/FlowBaseProblemProperties.hpp>
#include <opm/simulators/flow/FIBlackoilModel.hpp>
#include <opm/simulators/flow/NewTranFluxModule.hpp>
#include <opm/simulators/flow/OutputBlackoilModule.hpp>
#include <tuple>
namespace Opm {
template <class TypeTag>
class FlowProblemBlackoil;
}
namespace Opm::Properties {
namespace TTag {
struct FlowBaseProblemBlackoil {
using InheritsFrom = std::tuple<FlowBaseProblem>;
};
}
// Set the problem property
template<class TypeTag>
struct Problem<TypeTag, TTag::FlowBaseProblemBlackoil>
{ using type = FlowProblemBlackoil<TypeTag>; };
template<class TypeTag>
struct Model<TypeTag, TTag::FlowBaseProblemBlackoil>
{ using type = FIBlackOilModel<TypeTag>; };
// Set the material law for fluid fluxes
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::FlowBaseProblem>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
using Traits = ThreePhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::waterPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::oilPhaseIdx,
/*gasPhaseIdx=*/FluidSystem::gasPhaseIdx>;
public:
using EclMaterialLawManager = ::Opm::EclMaterialLawManager<Traits>;
using type = typename EclMaterialLawManager::MaterialLaw;
};
// Use the "velocity module" which uses the Eclipse "NEWTRAN" transmissibilities
template<class TypeTag>
struct FluxModule<TypeTag, TTag::FlowBaseProblemBlackoil>
{ using type = NewTranFluxModule<TypeTag>; };
// Use the dummy gradient calculator in order not to do unnecessary work.
template<class TypeTag>
struct GradientCalculator<TypeTag, TTag::FlowBaseProblemBlackoil>
{ using type = DummyGradientCalculator<TypeTag>; };
} // namespace Opm::Properties
#endif // OPM_FLOW_BASE_PROBLEM_BLACKOIL_PROPERTIES_HPP

View File

@ -23,7 +23,7 @@
/*!
* \file
*
* \copydoc Opm::FlowProblem
* \copydoc Opm::FlowProblemBlackoil
*/
#include <config.h>

View File

@ -23,7 +23,7 @@
/*!
* \file
*
* \copydoc Opm::FlowProblem
* \copydoc Opm::FlowProblemBlackoil
*/
#ifndef OPM_MIXING_RATE_CONTROLS_HPP
#define OPM_MIXING_RATE_CONTROLS_HPP
@ -40,7 +40,7 @@ namespace Opm {
class EclipseState;
//! \brief Class handling mixing rate controls for a FlowProblem.
//! \brief Class handling mixing rate controls for a FlowProblemBlackoil.
template<class FluidSystem>
class MixingRateControls
{

View File

@ -35,7 +35,7 @@
#include <opm/models/utils/propertysystem.hh>
#include <opm/simulators/flow/BlackoilModelParameters.hpp>
#include <opm/simulators/flow/FlowBaseVanguard.hpp>
#include <opm/simulators/flow/FlowProblemProperties.hpp>
#include <opm/simulators/flow/FlowBaseProblemProperties.hpp>
#include <opm/simulators/linalg/ExtractParallelGridInformationToISTL.hpp>
#include <opm/simulators/linalg/FlowLinearSolverParameters.hpp>
#include <opm/simulators/linalg/matrixblock.hh>

View File

@ -31,7 +31,7 @@
#include <opm/models/utils/start.hh>
#include <opm/simulators/aquifers/BlackoilAquiferModel.hpp>
#include <opm/simulators/flow/FlowProblemProperties.hpp>
#include <opm/simulators/flow/FlowProblemBlackoilProperties.hpp>
#include <opm/simulators/linalg/ISTLSolver.hpp>
#include <opm/simulators/timestepping/EclTimeSteppingParams.hpp>
#include <opm/simulators/wells/BlackoilWellModel.hpp>
@ -42,7 +42,7 @@ namespace TTag {
struct TestTypeTag
{
using InheritsFrom = std::tuple<FlowBaseProblem,
using InheritsFrom = std::tuple<FlowBaseProblemBlackoil,
BlackOilModel>;
};
@ -51,7 +51,7 @@ struct TestTypeTag
// Set the problem class
template<class TypeTag>
struct Problem<TypeTag, TTag::TestTypeTag> {
using type = FlowProblem<TypeTag>;
using type = FlowProblemBlackoil<TypeTag>;
};
// Enable experimental features for ebos: ebos is the research simulator of the OPM

View File

@ -38,7 +38,7 @@
#include <opm/simulators/flow/FemCpGridCompat.hpp>
#include <opm/simulators/flow/FlowGenericVanguard.hpp>
#include <opm/simulators/flow/FlowProblem.hpp>
#include <opm/simulators/flow/FlowProblemBlackoil.hpp>
#include <opm/simulators/timestepping/AdaptiveTimeStepping.hpp>
#include <opm/simulators/timestepping/SimulatorReport.hpp>
#include <opm/simulators/timestepping/SimulatorTimer.hpp>

View File

@ -37,7 +37,8 @@
#include <opm/simulators/flow/BlackoilModelParameters.hpp>
#include <opm/simulators/flow/FlowGenericVanguard.hpp>
#include <opm/simulators/flow/FlowProblem.hpp>
#include <opm/simulators/flow/FlowProblemBlackoil.hpp>
#include <opm/simulators/flow/FlowProblemBlackoilProperties.hpp>
#include <opm/simulators/flow/equil/EquilibrationHelpers.hpp>
#include <opm/simulators/linalg/parallelbicgstabbackend.hh>
#include <opm/simulators/wells/BlackoilWellModel.hpp>
@ -72,11 +73,11 @@ namespace TTag {
struct TestEquilTypeTag {
using InheritsFrom = std::tuple<FlowBaseProblem,
using InheritsFrom = std::tuple<FlowBaseProblemBlackoil,
BlackOilModel>;
};
struct TestEquilVapwatTypeTag {
using InheritsFrom = std::tuple<FlowBaseProblem,
using InheritsFrom = std::tuple<FlowBaseProblemBlackoil,
BlackOilModel>;
};
}

View File

@ -34,7 +34,7 @@
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/simulators/flow/BlackoilModel.hpp>
#include <opm/simulators/flow/FlowProblem.hpp>
#include <opm/simulators/flow/FlowProblemBlackoil.hpp>
#include <opm/simulators/flow/equil/EquilibrationHelpers.hpp>
#include <opm/simulators/wells/BlackoilWellModel.hpp>
#include <opm/simulators/wells/StandardWell.hpp>
@ -123,7 +123,7 @@ BOOST_GLOBAL_FIXTURE(GliftFixture);
BOOST_AUTO_TEST_CASE(G1)
{
//using TypeTag = Opm::Properties::TTag::FlowProblem;
//using TypeTag = Opm::Properties::TTag::FlowProblemBlackoil;
using TypeTag = Opm::Properties::TTag::TestGliftTypeTag;
//using EclProblem = Opm::EclProblem<TypeTag>;
//using EclWellModel = typename EclProblem::EclWellModel;

View File

@ -47,7 +47,7 @@
#include <opm/grid/GridHelpers.hpp>
#include <opm/simulators/flow/FlowMain.hpp>
#include <opm/simulators/flow/BlackoilModel.hpp>
#include <opm/simulators/flow/FlowProblem.hpp>
#include <opm/simulators/flow/FlowProblemBlackoil.hpp>
#include <opm/models/utils/start.hh>