From 2400cf03cea9c9d0252ac4f9bfb62f018076a9f5 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 1 Jul 2024 14:13:14 +0200 Subject: [PATCH] changed: move the VtkMultiPhaseModule parameters to Opm::Parameters --- examples/problems/co2ptflashproblem.hh | 18 ++- examples/problems/lensproblem.hh | 9 +- examples/problems/powerinjectionproblem.hh | 9 +- opm/models/immiscible/immisciblemodel.hh | 28 +++-- opm/models/io/vtkmultiphasemodule.hh | 138 +++++++++++++-------- 5 files changed, 122 insertions(+), 80 deletions(-) diff --git a/examples/problems/co2ptflashproblem.hh b/examples/problems/co2ptflashproblem.hh index 24c7af475..fe421a1fa 100644 --- a/examples/problems/co2ptflashproblem.hh +++ b/examples/problems/co2ptflashproblem.hh @@ -175,16 +175,6 @@ struct LinearSolverAbsTolerance { }; // output -template -struct VtkWriteFilterVelocities { - static constexpr bool value = true; -}; - -template -struct VtkWritePotentialGradients { - static constexpr bool value = true; -}; - template struct VtkWriteTotalMassFractions { static constexpr bool value = true; @@ -303,10 +293,18 @@ template struct VtkWriteEquilibriumConstants { static constexpr bool value = true; }; +template +struct VtkWriteFilterVelocities +{ static constexpr bool value = true; }; + template struct VtkWriteLiquidMoleFractions { static constexpr bool value = true; }; +template +struct VtkWritePotentialGradients +{ static constexpr bool value = true; }; + } // namespace Opm::Parameters namespace Opm { diff --git a/examples/problems/lensproblem.hh b/examples/problems/lensproblem.hh index 65ba80862..d0a75925a 100644 --- a/examples/problems/lensproblem.hh +++ b/examples/problems/lensproblem.hh @@ -175,10 +175,6 @@ struct LensUpperRightZ static constexpr type value = 1.0; }; -// By default, include the intrinsic permeability tensor to the VTK output files -template -struct VtkWriteIntrinsicPermeabilities { static constexpr bool value = true; }; - } // namespace Opm::Properties namespace Opm::Parameters { @@ -247,6 +243,11 @@ template struct NewtonWriteConvergence { static constexpr bool value = false; }; +// By default, include the intrinsic permeability tensor to the VTK output files +template +struct VtkWriteIntrinsicPermeabilities +{ static constexpr bool value = true; }; + } // namespace Opm::Parameters namespace Opm { diff --git a/examples/problems/powerinjectionproblem.hh b/examples/problems/powerinjectionproblem.hh index 24aa69364..18a639b71 100644 --- a/examples/problems/powerinjectionproblem.hh +++ b/examples/problems/powerinjectionproblem.hh @@ -119,10 +119,6 @@ public: using type = Opm::EffToAbsLaw; }; -// Write out the filter velocities for this problem -template -struct VtkWriteFilterVelocities { static constexpr bool value = true; }; - // Disable gravity template struct EnableGravity { static constexpr bool value = false; }; @@ -181,6 +177,11 @@ struct InitialTimeStepSize static constexpr type value = 1e-3; }; +// Write out the filter velocities for this problem +template +struct VtkWriteFilterVelocities +{ static constexpr bool value = true; }; + } // namespace Opm::Parameters namespace Opm { diff --git a/opm/models/immiscible/immisciblemodel.hh b/opm/models/immiscible/immisciblemodel.hh index ab414342b..450c3b12f 100644 --- a/opm/models/immiscible/immisciblemodel.hh +++ b/opm/models/immiscible/immisciblemodel.hh @@ -129,15 +129,6 @@ public: using type = Opm::LiquidPhase >; }; -// disable output of a few quantities which make sense in a -// multi-phase but not in a single-phase context -template -struct VtkWriteSaturations { static constexpr bool value = false; }; -template -struct VtkWriteMobilities { static constexpr bool value = false; }; -template -struct VtkWriteRelativePermeabilities { static constexpr bool value = false; }; - ///////////////////// // set slightly different properties for the two-phase case ///////////////////// @@ -173,9 +164,26 @@ public: using type = Opm::TwoPhaseImmiscibleFluidSystem; }; - } // 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 +struct VtkWriteSaturations +{ static constexpr bool value = false; }; + +template +struct VtkWriteMobilities +{ static constexpr bool value = false; }; + +template +struct VtkWriteRelativePermeabilities +{ static constexpr bool value = false; }; + +} // namespace Opm::Parameters + namespace Opm { /*! diff --git a/opm/models/io/vtkmultiphasemodule.hh b/opm/models/io/vtkmultiphasemodule.hh index a8b947769..5417b19e4 100644 --- a/opm/models/io/vtkmultiphasemodule.hh +++ b/opm/models/io/vtkmultiphasemodule.hh @@ -42,66 +42,100 @@ #include -namespace Opm::Properties { - -namespace TTag { +namespace Opm::Properties::TTag { // create new type tag for the VTK multi-phase output struct VtkMultiPhase {}; -} // namespace TTag +} // namespace Opm::Properties::TTag + +namespace Opm::Parameters { // create the property tags needed for the multi phase module template -struct VtkWriteExtrusionFactor { using type = UndefinedProperty; }; +struct VtkWriteExtrusionFactor { using type = Properties::UndefinedProperty; }; + template -struct VtkWritePressures { using type = UndefinedProperty; }; +struct VtkWritePressures { using type = Properties::UndefinedProperty; }; + template -struct VtkWriteDensities { using type = UndefinedProperty; }; +struct VtkWriteDensities { using type = Properties::UndefinedProperty; }; + template -struct VtkWriteSaturations { using type = UndefinedProperty; }; +struct VtkWriteSaturations { using type = Properties::UndefinedProperty; }; + template -struct VtkWriteMobilities { using type = UndefinedProperty; }; +struct VtkWriteMobilities { using type = Properties::UndefinedProperty; }; + template -struct VtkWriteRelativePermeabilities { using type = UndefinedProperty; }; +struct VtkWriteRelativePermeabilities { using type = Properties::UndefinedProperty; }; + template -struct VtkWriteViscosities { using type = UndefinedProperty; }; +struct VtkWriteViscosities { using type = Properties::UndefinedProperty; }; + template -struct VtkWriteAverageMolarMasses { using type = UndefinedProperty; }; +struct VtkWriteAverageMolarMasses { using type = Properties::UndefinedProperty; }; + template -struct VtkWritePorosity { using type = UndefinedProperty; }; +struct VtkWritePorosity { using type = Properties::UndefinedProperty; }; + template -struct VtkWriteIntrinsicPermeabilities { using type = UndefinedProperty; }; +struct VtkWriteIntrinsicPermeabilities { using type = Properties::UndefinedProperty; }; + template -struct VtkWritePotentialGradients { using type = UndefinedProperty; }; +struct VtkWritePotentialGradients { using type = Properties::UndefinedProperty; }; + template -struct VtkWriteFilterVelocities { using type = UndefinedProperty; }; +struct VtkWriteFilterVelocities { using type = Properties::UndefinedProperty; }; // set default values for what quantities to output template -struct VtkWriteExtrusionFactor { static constexpr bool value = false; }; +struct VtkWriteExtrusionFactor +{ static constexpr bool value = false; }; + template -struct VtkWritePressures { static constexpr bool value = true; }; +struct VtkWritePressures +{ static constexpr bool value = true; }; + template -struct VtkWriteDensities { static constexpr bool value = true; }; +struct VtkWriteDensities +{ static constexpr bool value = true; }; + template -struct VtkWriteSaturations { static constexpr bool value = true; }; +struct VtkWriteSaturations +{ static constexpr bool value = true; }; + template -struct VtkWriteMobilities { static constexpr bool value = false; }; +struct VtkWriteMobilities +{ static constexpr bool value = false; }; + template -struct VtkWriteRelativePermeabilities { static constexpr bool value = true; }; +struct VtkWriteRelativePermeabilities +{ static constexpr bool value = true; }; + template -struct VtkWriteViscosities { static constexpr bool value = false; }; +struct VtkWriteViscosities +{ static constexpr bool value = false; }; + template -struct VtkWriteAverageMolarMasses { static constexpr bool value = false; }; +struct VtkWriteAverageMolarMasses +{ static constexpr bool value = false; }; + template -struct VtkWritePorosity { static constexpr bool value = true; }; +struct VtkWritePorosity +{ static constexpr bool value = true; }; + template -struct VtkWriteIntrinsicPermeabilities { static constexpr bool value = false; }; +struct VtkWriteIntrinsicPermeabilities +{ static constexpr bool value = false; }; + template -struct VtkWritePotentialGradients { static constexpr bool value = false; }; +struct VtkWritePotentialGradients +{ static constexpr bool value = false; }; + template -struct VtkWriteFilterVelocities { static constexpr bool value = false; }; +struct VtkWriteFilterVelocities +{ static constexpr bool value = false; }; } // namespace Opm::Properties @@ -163,29 +197,29 @@ public: */ static void registerParameters() { - Parameters::registerParam + Parameters::registerParam ("Include the extrusion factor of the degrees of freedom into the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include the phase pressures in the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include the phase densities in the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include the phase saturations in the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include the phase mobilities in the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include the phase relative permeabilities in the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include component phase viscosities in the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include the average phase mass in the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include the porosity in the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include the intrinsic permeability in the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include in the filter velocities of the phases the VTK output files"); - Parameters::registerParam + Parameters::registerParam ("Include the phase pressure potential gradients in the VTK output files"); } @@ -419,73 +453,73 @@ public: private: static bool extrusionFactorOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool pressureOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool densityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool saturationOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool mobilityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool relativePermeabilityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool viscosityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool averageMolarMassOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool porosityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool intrinsicPermeabilityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool velocityOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; } static bool potentialGradientOutput_() { - static bool val = Parameters::get(); + static bool val = Parameters::get(); return val; }