changed: move the VtkMultiPhaseModule parameters to Opm::Parameters

This commit is contained in:
Arne Morten Kvarving 2024-07-01 14:13:14 +02:00
parent 218960a71d
commit 2400cf03ce
5 changed files with 122 additions and 80 deletions

View File

@ -175,16 +175,6 @@ struct LinearSolverAbsTolerance<TypeTag, TTag::CO2PTBaseProblem> {
}; };
// output // output
template <class TypeTag>
struct VtkWriteFilterVelocities<TypeTag, TTag::CO2PTBaseProblem> {
static constexpr bool value = true;
};
template <class TypeTag>
struct VtkWritePotentialGradients<TypeTag, TTag::CO2PTBaseProblem> {
static constexpr bool value = true;
};
template <class TypeTag> template <class TypeTag>
struct VtkWriteTotalMassFractions<TypeTag, TTag::CO2PTBaseProblem> { struct VtkWriteTotalMassFractions<TypeTag, TTag::CO2PTBaseProblem> {
static constexpr bool value = true; static constexpr bool value = true;
@ -303,10 +293,18 @@ template <class TypeTag>
struct VtkWriteEquilibriumConstants<TypeTag, Properties::TTag::CO2PTBaseProblem> struct VtkWriteEquilibriumConstants<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; }; { static constexpr bool value = true; };
template <class TypeTag>
struct VtkWriteFilterVelocities<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
template <class TypeTag> template <class TypeTag>
struct VtkWriteLiquidMoleFractions<TypeTag, Properties::TTag::CO2PTBaseProblem> struct VtkWriteLiquidMoleFractions<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; }; { static constexpr bool value = true; };
template <class TypeTag>
struct VtkWritePotentialGradients<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
namespace Opm { namespace Opm {

View File

@ -175,10 +175,6 @@ struct LensUpperRightZ<TypeTag, TTag::LensBaseProblem>
static constexpr type value = 1.0; static constexpr type value = 1.0;
}; };
// By default, include the intrinsic permeability tensor to the VTK output files
template<class TypeTag>
struct VtkWriteIntrinsicPermeabilities<TypeTag, TTag::LensBaseProblem> { static constexpr bool value = true; };
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters { namespace Opm::Parameters {
@ -247,6 +243,11 @@ template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::LensBaseProblem> struct NewtonWriteConvergence<TypeTag, Properties::TTag::LensBaseProblem>
{ static constexpr bool value = false; }; { static constexpr bool value = false; };
// By default, include the intrinsic permeability tensor to the VTK output files
template<class TypeTag>
struct VtkWriteIntrinsicPermeabilities<TypeTag, Properties::TTag::LensBaseProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
namespace Opm { namespace Opm {

View File

@ -119,10 +119,6 @@ public:
using type = Opm::EffToAbsLaw<EffectiveLaw>; using type = Opm::EffToAbsLaw<EffectiveLaw>;
}; };
// Write out the filter velocities for this problem
template<class TypeTag>
struct VtkWriteFilterVelocities<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr bool value = true; };
// Disable gravity // Disable gravity
template<class TypeTag> template<class TypeTag>
struct EnableGravity<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr bool value = false; }; struct EnableGravity<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr bool value = false; };
@ -181,6 +177,11 @@ struct InitialTimeStepSize<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
static constexpr type value = 1e-3; static constexpr type value = 1e-3;
}; };
// Write out the filter velocities for this problem
template<class TypeTag>
struct VtkWriteFilterVelocities<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
namespace Opm { namespace Opm {

View File

@ -129,15 +129,6 @@ public:
using type = Opm::LiquidPhase<Scalar, Opm::NullComponent<Scalar> >; using type = Opm::LiquidPhase<Scalar, Opm::NullComponent<Scalar> >;
}; };
// disable output of a few quantities which make sense in a
// multi-phase but not in a single-phase context
template<class TypeTag>
struct VtkWriteSaturations<TypeTag, TTag::ImmiscibleSinglePhaseModel> { static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteMobilities<TypeTag, TTag::ImmiscibleSinglePhaseModel> { static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteRelativePermeabilities<TypeTag, TTag::ImmiscibleSinglePhaseModel> { static constexpr bool value = false; };
///////////////////// /////////////////////
// set slightly different properties for the two-phase case // set slightly different properties for the two-phase case
///////////////////// /////////////////////
@ -173,9 +164,26 @@ public:
using type = Opm::TwoPhaseImmiscibleFluidSystem<Scalar, WettingPhase, NonwettingPhase>; using type = Opm::TwoPhaseImmiscibleFluidSystem<Scalar, WettingPhase, NonwettingPhase>;
}; };
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// disable output of a few quantities which make sense in a
// multi-phase but not in a single-phase context
template<class TypeTag>
struct VtkWriteSaturations<TypeTag, Properties::TTag::ImmiscibleSinglePhaseModel>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteMobilities<TypeTag, Properties::TTag::ImmiscibleSinglePhaseModel>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteRelativePermeabilities<TypeTag, Properties::TTag::ImmiscibleSinglePhaseModel>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!

View File

@ -42,66 +42,100 @@
#include <cstdio> #include <cstdio>
namespace Opm::Properties { namespace Opm::Properties::TTag {
namespace TTag {
// create new type tag for the VTK multi-phase output // create new type tag for the VTK multi-phase output
struct VtkMultiPhase {}; struct VtkMultiPhase {};
} // namespace TTag } // namespace Opm::Properties::TTag
namespace Opm::Parameters {
// create the property tags needed for the multi phase module // create the property tags needed for the multi phase module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWriteExtrusionFactor { using type = UndefinedProperty; }; struct VtkWriteExtrusionFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWritePressures { using type = UndefinedProperty; }; struct VtkWritePressures { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWriteDensities { using type = UndefinedProperty; }; struct VtkWriteDensities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWriteSaturations { using type = UndefinedProperty; }; struct VtkWriteSaturations { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWriteMobilities { using type = UndefinedProperty; }; struct VtkWriteMobilities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWriteRelativePermeabilities { using type = UndefinedProperty; }; struct VtkWriteRelativePermeabilities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWriteViscosities { using type = UndefinedProperty; }; struct VtkWriteViscosities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWriteAverageMolarMasses { using type = UndefinedProperty; }; struct VtkWriteAverageMolarMasses { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWritePorosity { using type = UndefinedProperty; }; struct VtkWritePorosity { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWriteIntrinsicPermeabilities { using type = UndefinedProperty; }; struct VtkWriteIntrinsicPermeabilities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWritePotentialGradients { using type = UndefinedProperty; }; struct VtkWritePotentialGradients { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct VtkWriteFilterVelocities { using type = UndefinedProperty; }; struct VtkWriteFilterVelocities { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> template<class TypeTag>
struct VtkWriteExtrusionFactor<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = false; }; struct VtkWriteExtrusionFactor<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag> template<class TypeTag>
struct VtkWritePressures<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = true; }; struct VtkWritePressures<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = true; };
template<class TypeTag> template<class TypeTag>
struct VtkWriteDensities<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = true; }; struct VtkWriteDensities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = true; };
template<class TypeTag> template<class TypeTag>
struct VtkWriteSaturations<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = true; }; struct VtkWriteSaturations<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = true; };
template<class TypeTag> template<class TypeTag>
struct VtkWriteMobilities<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = false; }; struct VtkWriteMobilities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag> template<class TypeTag>
struct VtkWriteRelativePermeabilities<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = true; }; struct VtkWriteRelativePermeabilities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = true; };
template<class TypeTag> template<class TypeTag>
struct VtkWriteViscosities<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = false; }; struct VtkWriteViscosities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag> template<class TypeTag>
struct VtkWriteAverageMolarMasses<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = false; }; struct VtkWriteAverageMolarMasses<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag> template<class TypeTag>
struct VtkWritePorosity<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = true; }; struct VtkWritePorosity<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = true; };
template<class TypeTag> template<class TypeTag>
struct VtkWriteIntrinsicPermeabilities<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = false; }; struct VtkWriteIntrinsicPermeabilities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag> template<class TypeTag>
struct VtkWritePotentialGradients<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = false; }; struct VtkWritePotentialGradients<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag> template<class TypeTag>
struct VtkWriteFilterVelocities<TypeTag, TTag::VtkMultiPhase> { static constexpr bool value = false; }; struct VtkWriteFilterVelocities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
} // namespace Opm::Properties } // namespace Opm::Properties
@ -163,29 +197,29 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Properties::VtkWriteExtrusionFactor> Parameters::registerParam<TypeTag, Parameters::VtkWriteExtrusionFactor>
("Include the extrusion factor of the degrees of freedom into the VTK output files"); ("Include the extrusion factor of the degrees of freedom into the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWritePressures> Parameters::registerParam<TypeTag, Parameters::VtkWritePressures>
("Include the phase pressures in the VTK output files"); ("Include the phase pressures in the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWriteDensities> Parameters::registerParam<TypeTag, Parameters::VtkWriteDensities>
("Include the phase densities in the VTK output files"); ("Include the phase densities in the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWriteSaturations> Parameters::registerParam<TypeTag, Parameters::VtkWriteSaturations>
("Include the phase saturations in the VTK output files"); ("Include the phase saturations in the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWriteMobilities> Parameters::registerParam<TypeTag, Parameters::VtkWriteMobilities>
("Include the phase mobilities in the VTK output files"); ("Include the phase mobilities in the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWriteRelativePermeabilities> Parameters::registerParam<TypeTag, Parameters::VtkWriteRelativePermeabilities>
("Include the phase relative permeabilities in the VTK output files"); ("Include the phase relative permeabilities in the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWriteViscosities> Parameters::registerParam<TypeTag, Parameters::VtkWriteViscosities>
("Include component phase viscosities in the VTK output files"); ("Include component phase viscosities in the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWriteAverageMolarMasses> Parameters::registerParam<TypeTag, Parameters::VtkWriteAverageMolarMasses>
("Include the average phase mass in the VTK output files"); ("Include the average phase mass in the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWritePorosity> Parameters::registerParam<TypeTag, Parameters::VtkWritePorosity>
("Include the porosity in the VTK output files"); ("Include the porosity in the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWriteIntrinsicPermeabilities> Parameters::registerParam<TypeTag, Parameters::VtkWriteIntrinsicPermeabilities>
("Include the intrinsic permeability in the VTK output files"); ("Include the intrinsic permeability in the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWriteFilterVelocities> Parameters::registerParam<TypeTag, Parameters::VtkWriteFilterVelocities>
("Include in the filter velocities of the phases the VTK output files"); ("Include in the filter velocities of the phases the VTK output files");
Parameters::registerParam<TypeTag, Properties::VtkWritePotentialGradients> Parameters::registerParam<TypeTag, Parameters::VtkWritePotentialGradients>
("Include the phase pressure potential gradients in the VTK output files"); ("Include the phase pressure potential gradients in the VTK output files");
} }
@ -419,73 +453,73 @@ public:
private: private:
static bool extrusionFactorOutput_() static bool extrusionFactorOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWriteExtrusionFactor>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWriteExtrusionFactor>();
return val; return val;
} }
static bool pressureOutput_() static bool pressureOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWritePressures>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWritePressures>();
return val; return val;
} }
static bool densityOutput_() static bool densityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWriteDensities>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWriteDensities>();
return val; return val;
} }
static bool saturationOutput_() static bool saturationOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSaturations>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSaturations>();
return val; return val;
} }
static bool mobilityOutput_() static bool mobilityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWriteMobilities>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWriteMobilities>();
return val; return val;
} }
static bool relativePermeabilityOutput_() static bool relativePermeabilityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWriteRelativePermeabilities>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWriteRelativePermeabilities>();
return val; return val;
} }
static bool viscosityOutput_() static bool viscosityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWriteViscosities>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWriteViscosities>();
return val; return val;
} }
static bool averageMolarMassOutput_() static bool averageMolarMassOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWriteAverageMolarMasses>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWriteAverageMolarMasses>();
return val; return val;
} }
static bool porosityOutput_() static bool porosityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWritePorosity>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWritePorosity>();
return val; return val;
} }
static bool intrinsicPermeabilityOutput_() static bool intrinsicPermeabilityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWriteIntrinsicPermeabilities>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWriteIntrinsicPermeabilities>();
return val; return val;
} }
static bool velocityOutput_() static bool velocityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFilterVelocities>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFilterVelocities>();
return val; return val;
} }
static bool potentialGradientOutput_() static bool potentialGradientOutput_()
{ {
static bool val = Parameters::get<TypeTag, Properties::VtkWritePotentialGradients>(); static bool val = Parameters::get<TypeTag, Parameters::VtkWritePotentialGradients>();
return val; return val;
} }