move VtkPtFlashModule parameters to TypeTag-free parameter system

This commit is contained in:
Arne Morten Kvarving
2024-07-05 17:49:51 +02:00
parent f011bb517f
commit 5c108be7f3
3 changed files with 13 additions and 39 deletions

View File

@@ -202,14 +202,6 @@ struct SimulationName<TypeTag, Properties::TTag::CO2PTBaseProblem>
static constexpr type value = 423.25; // TODO
};
template <class TypeTag>
struct VtkWriteEquilibriumConstants<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
template <class TypeTag>
struct VtkWriteLiquidMoleFractions<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters
namespace Opm {
@@ -350,6 +342,8 @@ public:
Parameters::SetDefault<Parameters::VtkWritePotentialGradients>(true);
Parameters::SetDefault<Parameters::VtkWriteTotalMassFractions>(true);
Parameters::SetDefault<Parameters::VtkWriteTotalMoleFractions>(true);
Parameters::SetDefault<Parameters::VtkWriteEquilibriumConstants>(true);
Parameters::SetDefault<Parameters::VtkWriteLiquidMoleFractions>(true);
}
/*!

View File

@@ -27,40 +27,21 @@
#ifndef OPM_VTK_PTFLASH_MODULE_HH
#define OPM_VTK_PTFLASH_MODULE_HH
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/material/common/MathToolbox.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/io/baseoutputmodule.hh>
#include <opm/models/io/vtkmultiwriter.hh>
#include <opm/models/utils/parametersystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK PTFlash output
struct VtkPTFlash {};
} // namespace Opm::Properties::TTag
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Parameters {
// create the property tags needed for the composition module
template<class TypeTag, class MyTypeTag>
struct VtkWriteLiquidMoleFractions { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteEquilibriumConstants { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output
template<class TypeTag>
struct VtkWriteLiquidMoleFractions<TypeTag, Properties::TTag::VtkPTFlash>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteEquilibriumConstants<TypeTag, Properties::TTag::VtkPTFlash>
{ static constexpr bool value = false; };
struct VtkWriteLiquidMoleFractions { static constexpr bool value = false; };
struct VtkWriteEquilibriumConstants { static constexpr bool value = false; };
} // namespace Opm::Parameters
@@ -105,9 +86,9 @@ public:
*/
static void registerParameters()
{
Parameters::registerParam<TypeTag, Parameters::VtkWriteLiquidMoleFractions>
Parameters::Register<Parameters::VtkWriteLiquidMoleFractions>
("Include liquid mole fractions (L) in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteEquilibriumConstants>
Parameters::Register<Parameters::VtkWriteEquilibriumConstants>
("Include equilibrium constants (K) in the VTK output files");
}
@@ -169,13 +150,13 @@ public:
private:
static bool LOutput_()
{
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteLiquidMoleFractions>();
static bool val = Parameters::Get<Parameters::VtkWriteLiquidMoleFractions>();
return val;
}
static bool equilConstOutput_()
{
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteEquilibriumConstants>();
static bool val = Parameters::Get<Parameters::VtkWriteEquilibriumConstants>();
return val;
}

View File

@@ -69,8 +69,7 @@ namespace Opm::Properties {
namespace TTag {
//! The type tag for the isothermal single phase problems
struct FlashModel { using InheritsFrom = std::tuple<VtkPTFlash,
MultiPhaseBaseModel>; };
struct FlashModel { using InheritsFrom = std::tuple<MultiPhaseBaseModel>; };
} // namespace TTag
//! Use the FlashLocalResidual function for the flash model