diff --git a/dumux/common/properties.hh b/dumux/common/properties.hh index ed6e59bcfd146e4905ffbe00f4da15cd16026646..dafc61396f82e5f55cae93f0f56a5b2f18eb65de 100644 --- a/dumux/common/properties.hh +++ b/dumux/common/properties.hh @@ -45,10 +45,13 @@ NEW_PROP_TAG(PrimaryVariables); //!< A vector of primary variables NEW_PROP_TAG(NumEqVector); //!< A vector of size number equations that can be used for Neumann fluxes, sources, residuals, ... NEW_PROP_TAG(GridView); //!< The type of the grid view according to the grid type NEW_PROP_TAG(ModelTraits); //!< Traits class encapsulating model specifications +NEW_PROP_TAG(BaseModelTraits); //!< Model traits to be used as a base for nonisothermal, mineralization ... models NEW_PROP_TAG(Problem); //!< Property to specify the type of a problem which has to be solved NEW_PROP_TAG(PointSource); //!< Property defining the type of point source used NEW_PROP_TAG(PointSourceHelper); //!< Property defining the class that computes which sub control volume point sources belong to +// TODO: Remove deprecated property VtkOutputFields NEW_PROP_TAG(VtkOutputFields); //!< A class helping models to define default vtk output parameters +NEW_PROP_TAG(IOFields); //!< A class helping models to define input and output fields NEW_PROP_TAG(BaseLocalResidual); //!< The type of the base class of the local residual (specific to a discretization scheme) NEW_PROP_TAG(JacobianMatrix); //!< Type of the global jacobian matrix NEW_PROP_TAG(SolutionVector); //!< Vector containing all primary variable vector of the grid @@ -172,7 +175,7 @@ NEW_PROP_TAG(PressureFormulation); //! the formulation of the pressure e.g most NEW_PROP_TAG(EquilibriumModelTraits); NEW_PROP_TAG(EquilibriumLocalResidual); NEW_PROP_TAG(EquilibriumIndices); -NEW_PROP_TAG(EquilibriumVtkOutputFields); +NEW_PROP_TAG(EquilibriumIOFields); NEW_PROP_TAG(NumEqBalance); NEW_PROP_TAG(EnableThermalNonEquilibrium); NEW_PROP_TAG(EnableChemicalNonEquilibrium); diff --git a/dumux/common/properties/model.hh b/dumux/common/properties/model.hh index ab3b92df8757746a1eeb313e09ddb29425e2d253..ce267a1174f6efe856f573673426be2c5dd0480f 100644 --- a/dumux/common/properties/model.hh +++ b/dumux/common/properties/model.hh @@ -25,10 +25,11 @@ #define DUMUX_MODEL_PROPERTIES_HH #include <dune/common/fvector.hh> +#include <dune/common/deprecated.hh> #include <dumux/common/properties.hh> #include <dumux/common/balanceequationopts.hh> -#include <dumux/io/defaultvtkoutputfields.hh> +#include <dumux/io/defaultiofields.hh> // Forward declaration namespace Dune { class ParameterTree; } @@ -54,8 +55,13 @@ SET_PROP(ModelProperties, ModelDefaultParameters) static void defaultParams(Dune::ParameterTree& tree, const std::string& group = "") { } }; -//! Set the default to a function throwing a NotImplemented error -SET_TYPE_PROP(ModelProperties, VtkOutputFields, DefaultVtkOutputFields); +//! \todo this property is deprecated use IOFields instead! +SET_PROP(ModelProperties, VtkOutputFields) { + using type DUNE_DEPRECATED_MSG("This property is deprecated use property IOFields instead") = typename GET_PROP_TYPE(TypeTag, IOFields); +}; + +//! Set the default to an implementation throwing a NotImplemented error +SET_TYPE_PROP(ModelProperties, IOFields, DefaultIOFields); //! Set the default class for the balance equation options SET_TYPE_PROP(ModelProperties, BalanceEqOpts, BalanceEquationOptions<TypeTag>); diff --git a/dumux/freeflow/compositional/CMakeLists.txt b/dumux/freeflow/compositional/CMakeLists.txt index 68fce2bb0bda388599118c42d673130d9b872ac7..cf75ae49ba45dcff458f81d542cc93919f817a56 100644 --- a/dumux/freeflow/compositional/CMakeLists.txt +++ b/dumux/freeflow/compositional/CMakeLists.txt @@ -10,6 +10,6 @@ lowrekepsilonncmodel.hh navierstokesncmodel.hh oneeqncmodel.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh zeroeqncmodel.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/compositional) diff --git a/dumux/freeflow/compositional/vtkoutputfields.hh b/dumux/freeflow/compositional/iofields.hh similarity index 51% rename from dumux/freeflow/compositional/vtkoutputfields.hh rename to dumux/freeflow/compositional/iofields.hh index 8c311dc65581f92fa46724fa9329ac23673aedcd..895eefc9ffa4dc75771c01106d33d8ca83543db1 100644 --- a/dumux/freeflow/compositional/vtkoutputfields.hh +++ b/dumux/freeflow/compositional/iofields.hh @@ -19,52 +19,69 @@ /*! * \file * \ingroup FreeflowNCModel - * \copydoc Dumux::FreeflowNCVtkOutputFields + * \copydoc Dumux::FreeflowNCIOFields */ -#ifndef DUMUX_FREEFLOW_NC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_FREEFLOW_NC_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_FREEFLOW_NC_IO_FIELDS_HH +#define DUMUX_FREEFLOW_NC_IO_FIELDS_HH -#include <dumux/freeflow/navierstokes/vtkoutputfields.hh> +#include <dune/common/deprecated.hh> + +#include <dumux/io/name.hh> +#include <dumux/freeflow/navierstokes/iofields.hh> namespace Dumux { /*! * \ingroup FreeflowNCModel - * \brief Adds vtk output fields specific to the FreeflowNC model + * \brief Adds I/O fields specific to the FreeflowNC model */ -template<class BaseVtkOutputFields, class ModelTraits, class FVGridGeometry, class FluidSystem> -class FreeflowNCVtkOutputFields +template<class BaseOutputFields, bool turbulenceModel = false> +struct FreeflowNCIOFields { - -public: - //! Initialize the FreeflowNC specific vtk output fields. - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + //! Initialize the FreeflowNC specific output fields. + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - BaseVtkOutputFields::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the FreeflowNC specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! Initialize the FreeflowNC specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { + BaseOutputFields::initOutputModule(out); + + using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem; for (int j = 0; j < FluidSystem::numComponents; ++j) { - vtk.addVolumeVariable([j](const auto& v){ return v.massFraction(j); }, "X^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); - vtk.addVolumeVariable([j](const auto& v){ return v.moleFraction(j); }, "x^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); + out.addVolumeVariable([j](const auto& v){ return v.massFraction(j); }, IOName::massFraction<FluidSystem>(0, j)); + out.addVolumeVariable([j](const auto& v){ return v.moleFraction(j); }, IOName::moleFraction<FluidSystem>(0, j)); if (j != FluidSystem::getMainComponent(0)) { - vtk.addVolumeVariable([j](const auto& v){ return v.diffusionCoefficient(0, j); }, "D^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); + out.addVolumeVariable([j](const auto& v){ return v.diffusionCoefficient(0, j); }, "D^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); // the eddy diffusivity is recalculated for an arbitrary component which is not the phase component - if (ModelTraits::usesTurbulenceModel()) - vtk.addVolumeVariable([j](const auto& v){ return v.effectiveDiffusivity(0, j) - v.diffusionCoefficient(0, j); }, "D_t"); + if (turbulenceModel) + out.addVolumeVariable([j](const auto& v){ return v.effectiveDiffusivity(0, j) - v.diffusionCoefficient(0, j); }, "D_t"); } } } + + //! return the names of the primary variables + template <class ModelTraits, class FluidSystem> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + // priVars: v_0, ..., v_dim-1, p, x_0, ..., x_numComp-1, otherPv ..., T + if (pvIdx > ModelTraits::dim() && pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + return ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(0, pvIdx - ModelTraits::dim()) + : IOName::massFraction<FluidSystem>(0, pvIdx - ModelTraits::dim()); + else + return BaseOutputFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); + + } }; } // end namespace Dumux diff --git a/dumux/freeflow/compositional/kepsilonncmodel.hh b/dumux/freeflow/compositional/kepsilonncmodel.hh index 48a5d5c4ec02e40d5459bd5494572d18efe72956..5b2ad1784d40fd91f35e3780fef3805168ab92b4 100644 --- a/dumux/freeflow/compositional/kepsilonncmodel.hh +++ b/dumux/freeflow/compositional/kepsilonncmodel.hh @@ -30,10 +30,10 @@ #include <dumux/common/properties.hh> #include <dumux/freeflow/compositional/navierstokesncmodel.hh> -#include <dumux/freeflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/freeflow/nonisothermal/iofields.hh> #include <dumux/freeflow/rans/twoeq/kepsilon/model.hh> -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -69,19 +69,6 @@ struct KEpsilonNCModelTraits : NavierStokesNCModelTraits<dimension, nComp, useMo //! the indices using Indices = KEpsilonIndices<dimension, nComp>; - - //! return the names of the primary variables in cells - template <class FluidSystem> - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = NavierStokesNCModelTraits<dimension, nComp, useMoles, replaceCompEqIdx>; - if (pvIdx < nComp) - return ParentType::template primaryVariableNameCell<FluidSystem>(pvIdx, state); - else if (pvIdx == nComp) - return "k"; - else - return "epsilon"; - } }; //!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model @@ -136,17 +123,8 @@ public: using type = KEpsilonFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(KEpsilonNC, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SinglePhaseVtkOutputFields = KEpsilonVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNCVtkOutputFields<SinglePhaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; -}; +//! The specific I/O fields +SET_TYPE_PROP(KEpsilonNC, IOFields, FreeflowNCIOFields<KEpsilonIOFields, true/*turbulenceModel*/>); ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component k-epsilon model @@ -208,17 +186,13 @@ public: using type = KEpsilonFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(KEpsilonNCNI, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KEpsilonNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = KEpsilonVtkOutputFields<FVGridGeometry>; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields<BaseVtkOutputFields, ModelTraits>; + using IsothermalIOFields = FreeflowNCIOFields<KEpsilonIOFields, true/*turbulenceModel*/>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNonIsothermalIOFields<IsothermalIOFields, true/*turbulenceModel*/>; }; // \} diff --git a/dumux/freeflow/compositional/komegancmodel.hh b/dumux/freeflow/compositional/komegancmodel.hh index 216f8018aa0815bcb6c58a8ec78bfa83d4424983..79843e06efc8a06ed52aa60e42874bff522cbb78 100644 --- a/dumux/freeflow/compositional/komegancmodel.hh +++ b/dumux/freeflow/compositional/komegancmodel.hh @@ -30,10 +30,10 @@ #include <dumux/common/properties.hh> #include <dumux/freeflow/compositional/navierstokesncmodel.hh> -#include <dumux/freeflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/freeflow/nonisothermal/iofields.hh> #include <dumux/freeflow/rans/twoeq/komega/model.hh> -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -141,17 +141,8 @@ public: using type = KOmegaFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(KOmegaNC, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SinglePhaseVtkOutputFields = KOmegaVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNCVtkOutputFields<SinglePhaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; -}; +//! The specific I/O fields +SET_TYPE_PROP(KOmegaNC, IOFields, FreeflowNCIOFields<KOmegaIOFields, true/*turbulenceModel*/>); ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component k-omega model @@ -213,17 +204,13 @@ public: using type = KOmegaFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(KOmegaNCNI, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KOmegaNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = KOmegaVtkOutputFields<FVGridGeometry>; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields<BaseVtkOutputFields, ModelTraits>; + using IsothermalIOFields = FreeflowNCIOFields<KOmegaIOFields, true/*turbulenceModel*/>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNonIsothermalIOFields<IsothermalIOFields, true/*turbulenceModel*/>; }; // \} diff --git a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh index 8a69f8cb5d0947e5a22a434ab0831374d19982ff..5859f653380010cfd7448981dab7f55cc632a727 100644 --- a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh +++ b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh @@ -30,10 +30,10 @@ #include <dumux/common/properties.hh> #include <dumux/freeflow/compositional/navierstokesncmodel.hh> -#include <dumux/freeflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/freeflow/nonisothermal/iofields.hh> #include <dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh> -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -74,19 +74,6 @@ struct LowReKEpsilonNCModelTraits : NavierStokesNCModelTraits<dimension, nComp, //! the indices using Indices = LowReKEpsilonIndices<dimension, nComp>; - - //! return the names of the primary variables in cells - template <class FluidSystem> - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = NavierStokesNCModelTraits<dimension, nComp, useMoles, replaceCompEqIdx>; - if (pvIdx < nComp) - return ParentType::template primaryVariableNameCell<FluidSystem>(pvIdx, state); - else if (pvIdx == nComp) - return "k"; - else - return "epsilon"; - } }; //!< states some specifics of the isothermal multi-component low-Reynolds k-epsilon model @@ -141,17 +128,8 @@ public: using type = LowReKEpsilonFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(LowReKEpsilonNC, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SinglePhaseVtkOutputFields = LowReKEpsilonVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNCVtkOutputFields<SinglePhaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; -}; +//! The specific I/O fields +SET_TYPE_PROP(LowReKEpsilonNC, IOFields, FreeflowNCIOFields<LowReKEpsilonIOFields, true/*turbulenceModel*/>); ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component low-Re k-epsilon model @@ -213,17 +191,13 @@ public: using type = LowReKEpsilonFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(LowReKEpsilonNCNI, VtkOutputFields) +//! The specific I/O fields +SET_PROP(LowReKEpsilonNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = LowReKEpsilonVtkOutputFields<FVGridGeometry>; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields<BaseVtkOutputFields, ModelTraits>; + using IsothermalIOFields = FreeflowNCIOFields<LowReKEpsilonIOFields, true/*turbulenceModel*/>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNonIsothermalIOFields<IsothermalIOFields, true/*turbulenceModel*/>; }; // \} diff --git a/dumux/freeflow/compositional/navierstokesncmodel.hh b/dumux/freeflow/compositional/navierstokesncmodel.hh index 8b1e608675c5a6fedc4a37f1eba55b7473bd4345..27b91f3765dee5f705f38da1c7158bb8127caefb 100644 --- a/dumux/freeflow/compositional/navierstokesncmodel.hh +++ b/dumux/freeflow/compositional/navierstokesncmodel.hh @@ -55,14 +55,14 @@ #include <dumux/freeflow/navierstokes/model.hh> #include <dumux/freeflow/nonisothermal/model.hh> #include <dumux/freeflow/nonisothermal/indices.hh> -#include <dumux/freeflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/freeflow/nonisothermal/iofields.hh> #include <dumux/discretization/fickslaw.hh> #include <dumux/discretization/fourierslaw.hh> #include "volumevariables.hh" #include "localresidual.hh" #include "fluxvariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include <dumux/assembly/staggeredlocalresidual.hh> #include <dumux/material/fluidsystems/1pgas.hh> @@ -102,18 +102,6 @@ struct NavierStokesNCModelTraits : NavierStokesModelTraits<dimension> //! the indices using Indices = NavierStokesIndices<dimension>; - - //! return the names of the primary variables in cells - template <class FluidSystem> - static std::string primaryVariableNameCell(int pvIdx = 0, int state = 0) - { - const std::string xString = useMoles() ? "x" : "X"; - if (pvIdx == 0) - return NavierStokesModelTraits<dimension>::template primaryVariableNameCell<FluidSystem>(pvIdx, state); - else - return xString + "^" + FluidSystem::componentName(pvIdx) - + "_" + FluidSystem::phaseName(0); - } }; /////////////////////////////////////////////////////////////////////////// @@ -182,17 +170,8 @@ SET_TYPE_PROP(NavierStokesNC, FluxVariables, FreeflowNCFluxVariables<TypeTag>); //! The flux variables cache class, by default the one for free flow SET_TYPE_PROP(NavierStokesNC, FluxVariablesCache, FreeFlowFluxVariablesCache<TypeTag>); -//! The specific vtk output fields -SET_PROP(NavierStokesNC, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = NavierStokesVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNCVtkOutputFields<BaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; -}; +//! The specific I/O fields +SET_TYPE_PROP(NavierStokesNC, IOFields, FreeflowNCIOFields<NavierStokesIOFields>); /*! * \brief The fluid state which is used by the volume variables to @@ -231,17 +210,13 @@ public: using type = FreeflowNIModelTraits<IsothermalModelTraits>; }; -//! The non-isothermal vtk output fields -SET_PROP(NavierStokesNCNI, VtkOutputFields) +//! The non-isothermal I/O fields +SET_PROP(NavierStokesNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = NavierStokesVtkOutputFields<FVGridGeometry>; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields<BaseVtkOutputFields, ModelTraits>; + using IsothermalIOFields = FreeflowNCIOFields<NavierStokesIOFields>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNonIsothermalIOFields<IsothermalIOFields>; }; //! Use Fourier's Law as default heat conduction type diff --git a/dumux/freeflow/compositional/oneeqncmodel.hh b/dumux/freeflow/compositional/oneeqncmodel.hh index 031cabcac55b0833acf14ec0149b21c184a49649..5673309cfce64cda1a5387031280aceaebd9579f 100644 --- a/dumux/freeflow/compositional/oneeqncmodel.hh +++ b/dumux/freeflow/compositional/oneeqncmodel.hh @@ -30,10 +30,10 @@ #include <dumux/common/properties.hh> #include <dumux/freeflow/compositional/navierstokesncmodel.hh> -#include <dumux/freeflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/freeflow/nonisothermal/iofields.hh> #include <dumux/freeflow/rans/oneeq/model.hh> -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -139,17 +139,8 @@ public: using type = OneEqFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(OneEqNC, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using SinglePhaseVtkOutputFields = OneEqVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNCVtkOutputFields<SinglePhaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; -}; +//! The specific I/O fields +SET_TYPE_PROP(OneEqNC, IOFields, FreeflowNCIOFields<OneEqIOFields, true/*turbulenceModel*/>); ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component one-equation model @@ -211,17 +202,13 @@ public: using type = OneEqFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(OneEqNCNI, VtkOutputFields) +//! The specific I/O fields +SET_PROP(OneEqNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = OneEqVtkOutputFields<FVGridGeometry>; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields<BaseVtkOutputFields, ModelTraits>; + using IsothermalIOFields = FreeflowNCIOFields<OneEqIOFields, true/*turbulenceModel*/>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNonIsothermalIOFields<IsothermalIOFields, true/*turbulenceModel*/>; }; // \} diff --git a/dumux/freeflow/compositional/zeroeqncmodel.hh b/dumux/freeflow/compositional/zeroeqncmodel.hh index c55ed9b71cc3f9f2e65c60b35cf57dc644284d41..8974cf29ae4c69935b3f61681c19aeebe937d9dc 100644 --- a/dumux/freeflow/compositional/zeroeqncmodel.hh +++ b/dumux/freeflow/compositional/zeroeqncmodel.hh @@ -30,10 +30,10 @@ #include <dumux/common/properties.hh> #include <dumux/freeflow/compositional/navierstokesncmodel.hh> -#include <dumux/freeflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/freeflow/nonisothermal/iofields.hh> #include <dumux/freeflow/rans/zeroeq/model.hh> -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -98,17 +98,8 @@ public: using type = ZeroEqVolumeVariables<Traits, CompositionalVolVars>; }; -//! The specific vtk output fields -SET_PROP(ZeroEqNC, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = RANSVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNCVtkOutputFields<BaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; -}; +//! The specific I/O fields +SET_TYPE_PROP(ZeroEqNC, IOFields, FreeflowNCIOFields<RANSIOFields, true/*turbulenceModel*/>); ////////////////////////////////////////////////////////////////////////// // Property values for non-isothermal multi-component ZeroEq model @@ -152,17 +143,13 @@ public: using type = ZeroEqVolumeVariables<Traits, NCVolVars>; }; -//! The specific vtk output fields -SET_PROP(ZeroEqNCNI, VtkOutputFields) +//! The specific I/O fields +SET_PROP(ZeroEqNCNI, IOFields) { private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using BaseVtkOutputFields = RANSVtkOutputFields<FVGridGeometry>; - using NonIsothermalFields = FreeflowNonIsothermalVtkOutputFields<BaseVtkOutputFields, ModelTraits>; + using IsothermalIOFields = FreeflowNCIOFields<RANSIOFields, true/*turbulenceModel*/>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNonIsothermalIOFields<IsothermalIOFields, true/*turbulenceModel*/>; }; // \} diff --git a/dumux/freeflow/navierstokes/CMakeLists.txt b/dumux/freeflow/navierstokes/CMakeLists.txt index 15433fa7434c7f74f7a5f7e0b0400bdfb4f297c3..8d5d0f4cfa1b2b13afa64fee3ca724c49c2f759e 100644 --- a/dumux/freeflow/navierstokes/CMakeLists.txt +++ b/dumux/freeflow/navierstokes/CMakeLists.txt @@ -8,5 +8,5 @@ localresidual.hh model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/navierstokes) diff --git a/dumux/freeflow/navierstokes/iofields.hh b/dumux/freeflow/navierstokes/iofields.hh new file mode 100644 index 0000000000000000000000000000000000000000..0e2f927966f632f44e5c6da509111b43af22a748 --- /dev/null +++ b/dumux/freeflow/navierstokes/iofields.hh @@ -0,0 +1,164 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup NavierStokesModel + * \copydoc Dumux::NavierStokesIOFields + */ +#ifndef DUMUX_NAVIER_STOKES_IO_FIELDS_HH +#define DUMUX_NAVIER_STOKES_IO_FIELDS_HH + +#include <dune/common/fvector.hh> +#include <dune/common/deprecated.hh> +#include <dune/common/indices.hh> +#include <dune/istl/multitypeblockvector.hh> // TODO: needed? or is forward declare enough? + +#include <dumux/common/parameters.hh> +#include <dumux/discretization/methods.hh> +#include <dumux/io/name.hh> + +namespace Dumux +{ + +/*! + * \ingroup InputOutput + * \ingroup NavierStokesModel + * \brief helper function to determine the names of cell-centered primary variables of a model with staggered grid discretization + * \note use this as input for the load solution function + */ +template<class IOFields, class PrimaryVariables, class ModelTraits, class FluidSystem> +std::function<std::string(int,int)> createCellCenterPVNameFunction(const std::string& paramGroup = "") +{ + static constexpr auto offset = ModelTraits::numEq() - PrimaryVariables::dimension; + + if (hasParamInGroup(paramGroup, "LoadSolution.CellCenterPriVarNames")) + { + const auto pvName = getParamFromGroup<std::vector<std::string>>(paramGroup, "LoadSolution.CellCenterPriVarNames"); + return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; + } + else + // add an offset to the pvIdx so that the velocities are skipped + return [](int pvIdx, int state = 0){ return IOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx + offset, state); }; +} + +/*! + * \ingroup InputOutput + * \ingroup NavierStokesModel + * \brief helper function to determine the names of primary variables on the cell faces of a model with staggered grid discretization + * \note use this as input for the load solution function + */ +template<class IOFields, class PrimaryVariables, class ModelTraits, class FluidSystem> +std::function<std::string(int,int)> createFacePVNameFunction(const std::string& paramGroup = "") +{ + if (hasParamInGroup(paramGroup, "LoadSolution.FacePriVarNames")) + { + const auto pvName = getParamFromGroup<std::vector<std::string>>(paramGroup, "LoadSolution.FacePriVarNames"); + return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; + } + else + // there is only one scalar-type primary variable called "v" living on the faces + return [](int pvIdx, int state = 0){ return IOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx , state); }; +} + +// forward declare +template<class T, class U> +class StaggeredVtkOutputModule; + +/*! + * \ingroup NavierStokesModel + * \brief Adds I/O fields for the Navier-Stokes model + */ +class NavierStokesIOFields +{ + //! Helper strcuts to determine whether a staggered grid discretization is used + template<class T> + struct isStaggered : public std::false_type {}; + + template<class... Args> + struct isStaggered<StaggeredVtkOutputModule<Args...>> + : public std::true_type {}; + +public: + //! Initialize the Navier-Stokes specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + out.addVolumeVariable([](const auto& v){ return v.pressure(); }, IOName::pressure()); + out.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, IOName::molarDensity()); + out.addVolumeVariable([](const auto& v){ return v.density(); }, IOName::density()); + + // add discretization-specific fields + additionalOutput_(out, isStaggered<OutputModule>()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + //! return the names of the primary variables + template <class ModelTraits, class FluidSystem = void> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + if (pvIdx < ModelTraits::dim()) + return "v"; + else + return IOName::pressure(); + } + +private: + + //! Adds discretization-specific fields (nothing by default). + template <class OutputModule> + static void additionalOutput_(OutputModule& out) + { } + + //! Adds discretization-specific fields (velocity vectors on the faces for the staggered discretization). + template <class OutputModule> + static void additionalOutput_(OutputModule& out, std::true_type) + { + const bool writeFaceVars = getParamFromGroup<bool>(out.paramGroup(), "Vtk.WriteFaceData", false); + if(writeFaceVars) + { + auto faceVelocityVector = [](const auto& scvf, const auto& faceVars) + { + using VelocityVector = std::decay_t<decltype(scvf.unitOuterNormal())>; + + VelocityVector velocity(0.0); + velocity[scvf.directionIndex()] = faceVars.velocitySelf(); + return velocity; + }; + + out.addFaceVariable(faceVelocityVector, "faceVelocity"); + + auto faceNormalVelocity = [](const auto& faceVars) + { + return faceVars.velocitySelf(); + }; + + out.addFaceVariable(faceNormalVelocity, "v"); + } + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh index 0cac3cf664da088ddc581604ef9430fdaeaea0be..6b0275aaa502aec1cd53e8b7289f576133d191d9 100644 --- a/dumux/freeflow/navierstokes/model.hh +++ b/dumux/freeflow/navierstokes/model.hh @@ -52,14 +52,14 @@ #include <dumux/freeflow/properties.hh> #include <dumux/freeflow/nonisothermal/model.hh> #include <dumux/freeflow/nonisothermal/indices.hh> -#include <dumux/freeflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/freeflow/nonisothermal/iofields.hh> #include "localresidual.hh" #include "volumevariables.hh" #include "fluxvariables.hh" #include "fluxvariablescache.hh" #include "indices.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include <dumux/material/fluidstates/immiscible.hh> #include <dumux/discretization/methods.hh> @@ -103,20 +103,6 @@ struct NavierStokesModelTraits //! the indices using Indices = NavierStokesIndices<dim()>; - - //! return the names of the primary variables in cells - template <class FluidSystem = void> - static std::string primaryVariableNameCell(int pvIdx = 0, int state = 0) - { - return "p"; - } - - //! return the names of the primary variables on faces - template <class FluidSystem = void> - static std::string primaryVariableNameFace(int pvIdx = 0, int state = 0) - { - return "v"; - } }; /*! @@ -212,14 +198,9 @@ SET_TYPE_PROP(NavierStokes, FluxVariables, NavierStokesFluxVariables<TypeTag>); //! The flux variables cache class, by default the one for free flow SET_TYPE_PROP(NavierStokes, FluxVariablesCache, FreeFlowFluxVariablesCache<TypeTag>); -//! The specific vtk output fields -SET_PROP(NavierStokes, VtkOutputFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = NavierStokesVtkOutputFields<FVGridGeometry>; -}; +//! The specific I/O fields +SET_TYPE_PROP(NavierStokes, IOFields, NavierStokesIOFields); + ////////////////////////////////////////////////////////////////// // Property values for non-isothermal Navier-Stokes model ////////////////////////////////////////////////////////////////// @@ -235,16 +216,8 @@ public: using type = FreeflowNIModelTraits<IsothermalTraits>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(NavierStokesNI, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = NavierStokesVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; -}; +//! The specific non-isothermal I/O fields +SET_TYPE_PROP(NavierStokesNI, IOFields, FreeflowNonIsothermalIOFields<NavierStokesIOFields>); // \} } diff --git a/dumux/freeflow/navierstokes/vtkoutputfields.hh b/dumux/freeflow/navierstokes/vtkoutputfields.hh deleted file mode 100644 index 6a6a156f2910ad02a84ac042cd34d3e6fe585b55..0000000000000000000000000000000000000000 --- a/dumux/freeflow/navierstokes/vtkoutputfields.hh +++ /dev/null @@ -1,96 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program 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. * - * * - * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup NavierStokesModel - * \copydoc Dumux::NavierStokesVtkOutputFields - */ -#ifndef DUMUX_NAVIER_STOKES_VTK_OUTPUT_FIELDS_HH -#define DUMUX_NAVIER_STOKES_VTK_OUTPUT_FIELDS_HH - -#include <dune/common/fvector.hh> -#include <dumux/common/parameters.hh> -#include <dumux/discretization/methods.hh> - -namespace Dumux -{ - -/*! - * \ingroup NavierStokesModel - * \brief Adds vtk output fields for the Navier-Stokes model - */ -template<class FVGridGeometry> -class NavierStokesVtkOutputFields -{ - // Helper type used for tag dispatching (to add discretization-specific fields). - template<DiscretizationMethod discMethod> - using discMethodTag = std::integral_constant<DiscretizationMethod, discMethod>; - -public: - //! Initialize the Navier-Stokes specific vtk output fields. - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - vtk.addVolumeVariable([](const auto& v){ return v.pressure(); }, "p"); - vtk.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, "rhoMolar"); - vtk.addVolumeVariable([](const auto& v){ return v.density(); }, "rho"); - - // add discretization-specific fields - additionalOutput_(vtk, discMethodTag<FVGridGeometry::discMethod>{}); - } - -private: - - //! Adds discretization-specific fields (nothing by default). - template <class VtkOutputModule, class AnyMethod> - static void additionalOutput_(VtkOutputModule& vtk, AnyMethod) - { } - - //! Adds discretization-specific fields (velocity vectors on the faces for the staggered discretization). - template <class VtkOutputModule> - static void additionalOutput_(VtkOutputModule& vtk, discMethodTag<DiscretizationMethod::staggered>) - { - const bool writeFaceVars = getParamFromGroup<bool>(vtk.paramGroup(), "Vtk.WriteFaceData", false); - if(writeFaceVars) - { - auto faceVelocityVector = [](const typename FVGridGeometry::SubControlVolumeFace& scvf, const auto& faceVars) - { - using Scalar = typename VtkOutputModule::VolumeVariables::PrimaryVariables::value_type; - using VelocityVector = Dune::FieldVector<Scalar, FVGridGeometry::GridView::dimensionworld>; - - VelocityVector velocity(0.0); - velocity[scvf.directionIndex()] = faceVars.velocitySelf(); - return velocity; - }; - - vtk.addFaceVariable(faceVelocityVector, "faceVelocity"); - - auto faceNormalVelocity = [](const auto& faceVars) - { - return faceVars.velocitySelf(); - }; - - vtk.addFaceVariable(faceNormalVelocity, "v"); - } - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/freeflow/nonisothermal/CMakeLists.txt b/dumux/freeflow/nonisothermal/CMakeLists.txt index 32acf8d65002420cd0cf13dd37f0785d0e115c71..5383f6d3976a7a6f4fd885993d624930a1d365a3 100644 --- a/dumux/freeflow/nonisothermal/CMakeLists.txt +++ b/dumux/freeflow/nonisothermal/CMakeLists.txt @@ -2,5 +2,5 @@ install(FILES indices.hh localresidual.hh model.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/nonisothermal) diff --git a/dumux/freeflow/nonisothermal/vtkoutputfields.hh b/dumux/freeflow/nonisothermal/iofields.hh similarity index 53% rename from dumux/freeflow/nonisothermal/vtkoutputfields.hh rename to dumux/freeflow/nonisothermal/iofields.hh index 8e6bb42dac94af1d9a302a3904e1a2eb4f7d4d23..06c4d268c81f666a432bdaf33fbda98dd5a3f141 100644 --- a/dumux/freeflow/nonisothermal/vtkoutputfields.hh +++ b/dumux/freeflow/nonisothermal/iofields.hh @@ -19,39 +19,53 @@ /*! * \file * \ingroup FreeflowNIModel - * \copydoc Dumux::FreeflowNonIsothermalVtkOutputFields + * \copydoc Dumux::FreeflowNonIsothermalIOFields */ -#ifndef DUMUX_FREEFLOW_NI_OUTPUT_FIELDS_HH -#define DUMUX_FREEFLOW_NI_OUTPUT_FIELDS_HH +#ifndef DUMUX_FREEFLOW_NI_IO_FIELDS_HH +#define DUMUX_FREEFLOW_NI_IO_FIELDS_HH + +#include <dune/common/deprecated.hh> + +#include <dumux/io/name.hh> namespace Dumux { /*! * \ingroup FreeflowNIModel - * \brief Adds vtk output fields specific to non-isothermal free-flow models + * \brief Adds I/O fields specific to non-isothermal free-flow models */ -template<class IsothermalVtkOutputFields, class ModelTraits> -class FreeflowNonIsothermalVtkOutputFields +template<class IsothermalIOFields, bool turbulenceModel = false> +struct FreeflowNonIsothermalIOFields { + //! Initialize the non-isothermal specific output fields. + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } -public: - //! Initialize the non-isothermal specific vtk output fields. - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + //! Add the non-isothermal specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - IsothermalVtkOutputFields::init(vtk); - add(vtk); + IsothermalIOFields::initOutputModule(out); + + out.addVolumeVariable([](const auto& v){ return v.temperature(); }, IOName::temperature()); + out.addVolumeVariable([](const auto& v){ return v.thermalConductivity(); }, "lambda"); + if (turbulenceModel) + out.addVolumeVariable([](const auto& v){ return v.effectiveThermalConductivity() - v.thermalConductivity(); }, "lambda_t"); } - //! Add the non-isothermal specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! return the names of the primary variables + template<class ModelTraits, class FluidSystem = void> + static std::string primaryVariableName(int pvIdx, int state = 0) { - vtk.addVolumeVariable([](const auto& v){ return v.temperature(); }, "T"); - vtk.addVolumeVariable([](const auto& v){ return v.thermalConductivity(); }, "lambda"); - if (ModelTraits::usesTurbulenceModel()) - vtk.addVolumeVariable([](const auto& v){ return v.effectiveThermalConductivity() - v.thermalConductivity(); }, "lambda_t"); + if (pvIdx < ModelTraits::numEq() - 1) + return IsothermalIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); + else + return IOName::temperature(); } }; diff --git a/dumux/freeflow/rans/CMakeLists.txt b/dumux/freeflow/rans/CMakeLists.txt index 100f4e5776f112ebcd701507517e8b3c6974bbea..8f2c48e20d9000aa70b29f52875291a5c66f4b9e 100644 --- a/dumux/freeflow/rans/CMakeLists.txt +++ b/dumux/freeflow/rans/CMakeLists.txt @@ -6,5 +6,5 @@ install(FILES model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/rans) diff --git a/dumux/freeflow/rans/vtkoutputfields.hh b/dumux/freeflow/rans/iofields.hh similarity index 52% rename from dumux/freeflow/rans/vtkoutputfields.hh rename to dumux/freeflow/rans/iofields.hh index 4f8541bac29bd58b1bf8ba3e21b3602569e84206..cbe45478edbfbe966ef71f1bfd47ae497dfa796a 100644 --- a/dumux/freeflow/rans/vtkoutputfields.hh +++ b/dumux/freeflow/rans/iofields.hh @@ -19,50 +19,57 @@ /*! * \file * \ingroup RANSModel - * \copydoc Dumux::RANSVtkOutputFields + * \copydoc Dumux::RANSIOFields */ -#ifndef DUMUX_RANS_VTK_OUTPUT_FIELDS_HH -#define DUMUX_RANS_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_RANS_IO_FIELDS_HH +#define DUMUX_RANS_IO_FIELDS_HH -#include <dumux/freeflow/navierstokes/vtkoutputfields.hh> +#include <dumux/freeflow/navierstokes/iofields.hh> +#include <dune/common/deprecated.hh> namespace Dumux { /*! * \ingroup RANSModel - * \brief Adds vtk output fields for the Reynolds-Averaged Navier-Stokes model + * \brief Adds I/O fields for the Reynolds-Averaged Navier-Stokes model */ -template<class FVGridGeometry> -class RANSVtkOutputFields : public NavierStokesVtkOutputFields<FVGridGeometry> +struct RANSIOFields { - enum { dim = FVGridGeometry::GridView::dimension }; - -public: - //! Initialize the Navier-Stokes specific vtk output fields. - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - NavierStokesVtkOutputFields<FVGridGeometry>::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the RANS specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! Initialize the RANS specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.velocity()[0] / v.velocityMaximum()[0]; }, "v_x/v_x,max"); - vtk.addVolumeVariable([](const auto& v){ return v.velocityGradients()[0]; }, "dv_x/dx_"); + NavierStokesIOFields::initOutputModule(out); + + static constexpr auto dim = decltype(std::declval<typename OutputModule::VolumeVariables>().velocity())::dimension; + + out.addVolumeVariable([](const auto& v){ return v.velocity()[0] / v.velocityMaximum()[0]; }, "v_x/v_x,max"); + out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[0]; }, "dv_x/dx_"); if (dim > 1) - vtk.addVolumeVariable([](const auto& v){ return v.velocityGradients()[1]; }, "dv_y/dx_"); + out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[1]; }, "dv_y/dx_"); if (dim > 2) - vtk.addVolumeVariable([](const auto& v){ return v.velocityGradients()[2]; }, "dv_z/dx_"); - vtk.addVolumeVariable([](const auto& v){ return v.pressure() - 1e5; }, "p_rel"); - vtk.addVolumeVariable([](const auto& v){ return v.viscosity() / v.density(); }, "nu"); - vtk.addVolumeVariable([](const auto& v){ return v.kinematicEddyViscosity(); }, "nu_t"); - vtk.addVolumeVariable([](const auto& v){ return v.wallDistance(); }, "l_w"); - vtk.addVolumeVariable([](const auto& v){ return v.yPlus(); }, "y^+"); - vtk.addVolumeVariable([](const auto& v){ return v.uPlus(); }, "u^+"); + out.addVolumeVariable([](const auto& v){ return v.velocityGradients()[2]; }, "dv_z/dx_"); + out.addVolumeVariable([](const auto& v){ return v.pressure() - 1e5; }, "p_rel"); + out.addVolumeVariable([](const auto& v){ return v.viscosity() / v.density(); }, "nu"); + out.addVolumeVariable([](const auto& v){ return v.kinematicEddyViscosity(); }, "nu_t"); + out.addVolumeVariable([](const auto& v){ return v.wallDistance(); }, "l_w"); + out.addVolumeVariable([](const auto& v){ return v.yPlus(); }, "y^+"); + out.addVolumeVariable([](const auto& v){ return v.uPlus(); }, "u^+"); + } + + //! return the names of the primary variables + template <class ModelTraits, class FluidSystem> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + return NavierStokesIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); } }; diff --git a/dumux/freeflow/rans/model.hh b/dumux/freeflow/rans/model.hh index 62232a86d3bf0ac8f827b626f4b7110a426638c2..d03900ccd018a4084d6989d16495713798749062 100644 --- a/dumux/freeflow/rans/model.hh +++ b/dumux/freeflow/rans/model.hh @@ -40,7 +40,7 @@ #include <dumux/common/properties.hh> #include <dumux/freeflow/navierstokes/model.hh> -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -83,14 +83,8 @@ public: using type = RANSModelTraits<dim>; }; -//! The specific vtk output fields -SET_PROP(RANS, VtkOutputFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = RANSVtkOutputFields<FVGridGeometry>; -}; +//! The specific I/O fields +SET_TYPE_PROP(RANS, IOFields, RANSIOFields); ////////////////////////////////////////////////////////////////// // Property values for non-isothermal Reynolds-averaged Navier-Stokes model @@ -111,16 +105,8 @@ public: using type = FreeflowNIModelTraits<IsothermalTraits>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(RANSNI, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = RANSVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; -}; +//! The specific non-isothermal I/O fields +SET_TYPE_PROP(RANSNI, IOFields, FreeflowNonIsothermalIOFields<RANSIOFields, true/*turbulenceModel*/>); //! Use Fourier's Law as default heat conduction type SET_TYPE_PROP(RANSNI, HeatConductionType, FouriersLaw<TypeTag>); diff --git a/dumux/freeflow/rans/oneeq/CMakeLists.txt b/dumux/freeflow/rans/oneeq/CMakeLists.txt index 46d8713f6a1e514e6682ae9af2fb82f045731008..1be711afb0eed401a148d18f418ad84e1f136bed 100644 --- a/dumux/freeflow/rans/oneeq/CMakeLists.txt +++ b/dumux/freeflow/rans/oneeq/CMakeLists.txt @@ -7,5 +7,5 @@ localresidual.hh model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/rans/oneeq) diff --git a/dumux/freeflow/rans/oneeq/vtkoutputfields.hh b/dumux/freeflow/rans/oneeq/iofields.hh similarity index 60% rename from dumux/freeflow/rans/oneeq/vtkoutputfields.hh rename to dumux/freeflow/rans/oneeq/iofields.hh index be9d913e2fd0ff150df1d19625187a2bc50ca678..82e1bb64d1ce9c548717d6b192a1c423f0f39033 100644 --- a/dumux/freeflow/rans/oneeq/vtkoutputfields.hh +++ b/dumux/freeflow/rans/oneeq/iofields.hh @@ -19,39 +19,45 @@ /*! * \file * \ingroup OneEqModel - * \copydoc Dumux::OneEqVtkOutputFields + * \copydoc Dumux::OneEqIOFields */ -#ifndef DUMUX_ONEEQ_VTK_OUTPUT_FIELDS_HH -#define DUMUX_ONEEQ_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_ONEEQ_IO_FIELDS_HH +#define DUMUX_ONEEQ_IO_FIELDS_HH -#include <dumux/freeflow/rans/vtkoutputfields.hh> +#include <dumux/freeflow/rans/iofields.hh> namespace Dumux { /*! * \ingroup OneEqModel - * \brief Adds vtk output fields for the one-equation turbulence model by Spalart-Allmaras + * \brief Adds I/O fields for the one-equation turbulence model by Spalart-Allmaras */ -template<class FVGridGeometry> -class OneEqVtkOutputFields : public RANSVtkOutputFields<FVGridGeometry> +struct OneEqIOFields { - enum { dim = FVGridGeometry::GridView::dimension }; + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } -public: - //! Initialize the Reynolds-averaged Navier-Stokes specific vtk output fields. - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + //! Initialize the OneEq specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - RANSVtkOutputFields<FVGridGeometry>::init(vtk); - add(vtk); + RANSIOFields::initOutputModule(out); + out.addVolumeVariable([](const auto& v){ return v.viscosityTilde(); }, "nu_tilde"); } - //! Add the OneEq specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! return the names of the primary variables + template <class ModelTraits, class FluidSystem> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - vtk.addVolumeVariable([](const auto& v){ return v.viscosityTilde(); }, "nu_tilde"); + if (pvIdx < ModelTraits::dim() + 1) + return RANSIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); + else + return "nu_tilde"; } }; diff --git a/dumux/freeflow/rans/oneeq/model.hh b/dumux/freeflow/rans/oneeq/model.hh index 02c14b9a0a6e5213b046193856eec8d120f30324..18e8e56c8d1cde1e5a6681fa194a0589e7ca4d88 100644 --- a/dumux/freeflow/rans/oneeq/model.hh +++ b/dumux/freeflow/rans/oneeq/model.hh @@ -80,12 +80,13 @@ #include <dumux/common/properties.hh> #include <dumux/freeflow/properties.hh> #include <dumux/freeflow/rans/model.hh> +#include <dumux/freeflow/nonisothermal/iofields.hh> #include "fluxvariables.hh" #include "indices.hh" #include "localresidual.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -112,17 +113,6 @@ struct OneEqModelTraits : RANSModelTraits<dimension> //! the indices using Indices = OneEqIndices<dim(), numComponents()>; - - //! return the names of the primary variables in cells - template <class FluidSystem = void> - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = RANSModelTraits<dimension>; - if (pvIdx == 0) - return ParentType::template primaryVariableNameCell<FluidSystem>(pvIdx, state); - else - return "nu_tilde"; - } }; /////////////////////////////////////////////////////////////////////////// @@ -179,14 +169,8 @@ public: using type = OneEqVolumeVariables<Traits, NSVolVars>; }; -//! The specific vtk output fields -SET_PROP(OneEq, VtkOutputFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = OneEqVtkOutputFields<FVGridGeometry>; -}; +//! The specific I/O fields +SET_TYPE_PROP(OneEq, IOFields, OneEqIOFields); ////////////////////////////////////////////////////////////////// // default property values for the non-isothermal Spalart-Allmaras model @@ -225,16 +209,8 @@ public: using type = OneEqVolumeVariables<Traits, NSVolVars>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(OneEqNI, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = OneEqVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; -}; +//! The specific non-isothermal I/O fields +SET_TYPE_PROP(OneEqNI, IOFields, FreeflowNonIsothermalIOFields<OneEqIOFields, true/*turbulenceModel*/>); // \} } diff --git a/dumux/freeflow/rans/twoeq/kepsilon/CMakeLists.txt b/dumux/freeflow/rans/twoeq/kepsilon/CMakeLists.txt index 667725cb2d4109e848d48cf20e1320bbc317271d..2e0405c5a6824d63a46d9769950e1101428d1d93 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/CMakeLists.txt +++ b/dumux/freeflow/rans/twoeq/kepsilon/CMakeLists.txt @@ -7,5 +7,5 @@ localresidual.hh model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/rans/twoeq/kepsilon) diff --git a/dumux/freeflow/rans/twoeq/kepsilon/vtkoutputfields.hh b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh similarity index 52% rename from dumux/freeflow/rans/twoeq/kepsilon/vtkoutputfields.hh rename to dumux/freeflow/rans/twoeq/kepsilon/iofields.hh index 7808fa069c76272116f2bb28c744c0959aa0a9dc..59b31fc03b7b895917caaa304f4e1fc19ddf6a4b 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/vtkoutputfields.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh @@ -19,44 +19,55 @@ /*! * \file * \ingroup KEpsilonModel - * \copydoc Dumux::KEpsilonVtkOutputFields + * \copydoc Dumux::KEpsilonIOFields */ -#ifndef DUMUX_KEPSILON_VTK_OUTPUT_FIELDS_HH -#define DUMUX_KEPSILON_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_KEPSILON_IO_FIELDS_HH +#define DUMUX_KEPSILON_IO_FIELDS_HH -#include <dumux/freeflow/rans/vtkoutputfields.hh> +#include <dumux/freeflow/rans/iofields.hh> +#include <dune/common/deprecated.hh> namespace Dumux { /*! * \ingroup KEpsilonModel - * \brief Adds vtk output fields for the k-epsilon turbulence model + * \brief Adds I/O fields for the k-epsilon turbulence model */ -template<class FVGridGeometry> -class KEpsilonVtkOutputFields : public RANSVtkOutputFields<FVGridGeometry> +struct KEpsilonIOFields { - enum { dim = FVGridGeometry::GridView::dimension }; + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } -public: - //! Initialize the Reynolds-averaged Navier-Stokes specific vtk output fields. - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + //! Initialize the KEpsilon specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - RANSVtkOutputFields<FVGridGeometry>::init(vtk); - add(vtk); + RANSIOFields::initOutputModule(out); + + out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); + out.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "epsilon"); + out.addVolumeVariable([](const auto& v){ return v.yPlusNominal(); }, "y^+_nom"); + out.addVolumeVariable([](const auto& v){ return v.uPlusNominal(); }, "u^+_nom"); + out.addVolumeVariable([](const auto& v){ return v.inNearWallRegion(); }, "inNearWallRegion"); + out.addVolumeVariable([](const auto& v){ return v.isMatchingPoint(); }, "isMatchingPoint"); } - //! Add the KEpsilon specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! return the names of the primary variables + template <class ModelTraits, class FluidSystem> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - vtk.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); - vtk.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "epsilon"); - vtk.addVolumeVariable([](const auto& v){ return v.yPlusNominal(); }, "y^+_nom"); - vtk.addVolumeVariable([](const auto& v){ return v.uPlusNominal(); }, "u^+_nom"); - vtk.addVolumeVariable([](const auto& v){ return v.inNearWallRegion(); }, "inNearWallRegion"); - vtk.addVolumeVariable([](const auto& v){ return v.isMatchingPoint(); }, "isMatchingPoint"); + std::cout << "kepsi called with " << pvIdx << std::endl; + if (pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + return RANSIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); + else if (pvIdx == ModelTraits::dim() + ModelTraits::numComponents()) + return "k"; + else + return "epsilon"; } }; diff --git a/dumux/freeflow/rans/twoeq/kepsilon/model.hh b/dumux/freeflow/rans/twoeq/kepsilon/model.hh index d3bcfd46aae0e9f2f8610c5bdfcdca448d31019b..e0ea1338b075f5e412d14fe0e04a45ba507bbd3e 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/model.hh @@ -72,7 +72,7 @@ #include "indices.hh" #include "localresidual.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -99,21 +99,6 @@ struct KEpsilonModelTraits : RANSModelTraits<dimension> //! the indices using Indices = KEpsilonIndices<dim(), numComponents()>; - - //! return the names of the primary variables in cells - template<class FluidSystem = void> - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = RANSModelTraits<dimension>; - switch (pvIdx) { - case 0: - return ParentType::template primaryVariableNameCell<FluidSystem>(pvIdx, state); - case 1: - return "k"; - default: - return "epsilon"; - } - } }; /////////////////////////////////////////////////////////////////////////// @@ -170,14 +155,8 @@ public: using type = KEpsilonVolumeVariables<Traits, NSVolVars>; }; -//! The specific vtk output fields -SET_PROP(KEpsilon, VtkOutputFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = KEpsilonVtkOutputFields<FVGridGeometry>; -}; +//! The specific I/O fields +SET_TYPE_PROP(KEpsilon, IOFields, KEpsilonIOFields); ////////////////////////////////////////////////////////////////// // default property values for the non-isothermal k-epsilon model @@ -216,16 +195,8 @@ public: using type = KEpsilonVolumeVariables<Traits, NSVolVars>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(KEpsilonNI, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = KEpsilonVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; -}; +//! The specific non-isothermal I/O fields +SET_TYPE_PROP(KEpsilonNI, IOFields, FreeflowNonIsothermalIOFields<KEpsilonIOFields, true/*turbulenceModel*/>); // \} } diff --git a/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt b/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt index e6d5c4dc0305cac2463a5b66def96319831c234e..4463faa9f1d4fa03d66d123b2fb085abd6a90fe7 100644 --- a/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt +++ b/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt @@ -7,5 +7,5 @@ localresidual.hh model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/rans/twoeq/komega) diff --git a/dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh b/dumux/freeflow/rans/twoeq/komega/iofields.hh similarity index 55% rename from dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh rename to dumux/freeflow/rans/twoeq/komega/iofields.hh index 95987da43f5787e17d2ad00d5dca26c3a8c579aa..8f0a7fff434109211d05eb5c16613cc764075e02 100644 --- a/dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh +++ b/dumux/freeflow/rans/twoeq/komega/iofields.hh @@ -19,40 +19,50 @@ /*! * \file * \ingroup KOmegaModel - * \copydoc Dumux::KOmegaVtkOutputFields + * \copydoc Dumux::KOmegaIOFields */ -#ifndef DUMUX_KOMEGA_VTK_OUTPUT_FIELDS_HH -#define DUMUX_KOMEGA_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_KOMEGA_IO_FIELDS_HH +#define DUMUX_KOMEGA_IO_FIELDS_HH -#include <dumux/freeflow/rans/vtkoutputfields.hh> +#include <dumux/freeflow/rans/iofields.hh> +#include <dune/common/deprecated.hh> namespace Dumux { /*! * \ingroup KOmegaModel - * \brief Adds vtk output fields for the Reynolds-Averaged Navier-Stokes model + * \brief Adds I/O fields for the Reynolds-Averaged Navier-Stokes model */ -template<class FVGridGeometry> -class KOmegaVtkOutputFields : public RANSVtkOutputFields<FVGridGeometry> +struct KOmegaIOFields { - enum { dim = FVGridGeometry::GridView::dimension }; + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } -public: - //! Initialize the Navier-Stokes specific vtk output fields. - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + //! Initialize the KOmegaModel specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - RANSVtkOutputFields<FVGridGeometry>::init(vtk); - add(vtk); + RANSIOFields::initOutputModule(out); + + out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); + out.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega"); } - //! Add the KOmegaModel specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! return the names of the primary variables + template <class ModelTraits, class FluidSystem> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - vtk.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); - vtk.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega"); + if (pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + return RANSIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); + else if (pvIdx == ModelTraits::dim() + ModelTraits::numComponents()) + return "k"; + else + return "omega"; } }; diff --git a/dumux/freeflow/rans/twoeq/komega/model.hh b/dumux/freeflow/rans/twoeq/komega/model.hh index 718d2c1c5acf5288efabc6009de174adb7ae1897..7cfebf2463bc07a4cc35b384b528145f30ddeb3e 100644 --- a/dumux/freeflow/rans/twoeq/komega/model.hh +++ b/dumux/freeflow/rans/twoeq/komega/model.hh @@ -79,7 +79,7 @@ #include "indices.hh" #include "localresidual.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -106,21 +106,6 @@ struct KOmegaModelTraits : RANSModelTraits<dimension> //! The indices using Indices = KOmegaIndices<dim(), numComponents()>; - - //! return the names of the primary variables in cells - template<class FluidSystem = void> - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = RANSModelTraits<dimension>; - switch (pvIdx) { - case 0: - return ParentType::template primaryVariableNameCell<FluidSystem>(pvIdx, state); - case 1: - return "k"; - default: - return "omega"; - } - } }; /////////////////////////////////////////////////////////////////////////// @@ -177,14 +162,8 @@ public: using type = KOmegaVolumeVariables<Traits, NSVolVars>; }; -//! The specific vtk output fields -SET_PROP(KOmega, VtkOutputFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = KOmegaVtkOutputFields<FVGridGeometry>; -}; +//! The specific I/O fields +SET_TYPE_PROP(KOmega, IOFields, KOmegaIOFields); /////////////////////////////////////////////////////////////////////////// // default property values for the non-isothermal k-omega single phase model @@ -224,16 +203,8 @@ public: using type = KOmegaVolumeVariables<Traits, NSVolVars>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(KOmegaNI, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = KOmegaVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; -}; +//! The specific non-isothermal I/O fields +SET_TYPE_PROP(KOmegaNI, IOFields, FreeflowNonIsothermalIOFields<KOmegaIOFields, true/*turbulenceModel*/>); // \} } diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/CMakeLists.txt b/dumux/freeflow/rans/twoeq/lowrekepsilon/CMakeLists.txt index 5d7f7ab24335663949b164e94fbc06e6964f63ea..4103b27301ff79c6e302a467341ac2d4cade5686 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/CMakeLists.txt +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/CMakeLists.txt @@ -7,5 +7,5 @@ localresidual.hh model.hh problem.hh volumevariables.hh -vtkoutputfields.hh +iofields.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/rans/twoeq/lowrekepsilon) diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/vtkoutputfields.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh similarity index 55% rename from dumux/freeflow/rans/twoeq/lowrekepsilon/vtkoutputfields.hh rename to dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh index 6ba9d9f2feafae1addf812901f3b38e79336e7e3..3c66ddb0b92ae8fee7c7f99cb079d8efd6a8f649 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/vtkoutputfields.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh @@ -19,40 +19,49 @@ /*! * \file * \ingroup LowReKEpsilonModel - * \copydoc Dumux::LowReKEpsilonVtkOutputFields + * \copydoc Dumux::LowReKEpsilonIOFields */ -#ifndef DUMUX_LOWREKEPSILON_VTK_OUTPUT_FIELDS_HH -#define DUMUX_LOWREKEPSILON_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_LOWREKEPSILON_IO_FIELDS_HH +#define DUMUX_LOWREKEPSILON_IO_FIELDS_HH -#include <dumux/freeflow/rans/vtkoutputfields.hh> +#include <dumux/freeflow/rans/iofields.hh> +#include <dune/common/deprecated.hh> namespace Dumux { /*! * \ingroup LowReKEpsilonModel - * \brief Adds vtk output fields for the low-Re k-epsilon turbulence model + * \brief Adds I/O fields for the low-Re k-epsilon turbulence model */ -template<class FVGridGeometry> -class LowReKEpsilonVtkOutputFields : public RANSVtkOutputFields<FVGridGeometry> +struct LowReKEpsilonIOFields { - enum { dim = FVGridGeometry::GridView::dimension }; + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } -public: - //! Initialize the Reynolds-averagedNavier-Stokes specific vtk output fields. - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + //! Initialize the LowReKEpsilon specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - RANSVtkOutputFields<FVGridGeometry>::init(vtk); - add(vtk); + RANSIOFields::initOutputModule(out); + out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); + out.addVolumeVariable([](const auto& v){ return v.dissipationTilde(); }, "epsilon"); } - //! Add the LowReKEpsilon specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! return the names of the primary variables + template <class ModelTraits, class FluidSystem> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - vtk.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); - vtk.addVolumeVariable([](const auto& v){ return v.dissipationTilde(); }, "epsilon"); + if (pvIdx < ModelTraits::dim() + ModelTraits::numComponents()) + return RANSIOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); + else if (pvIdx == ModelTraits::dim() + ModelTraits::numComponents()) + return "k"; + else + return "epsilon"; } }; diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh index 1fa9cd6cf7a3e8296601570e8ea75cbe067a4ddf..6b178aa20f6254c5275ba6f2df4de406a21d468e 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh @@ -88,7 +88,7 @@ #include "indices.hh" #include "localresidual.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -115,21 +115,6 @@ struct LowReKEpsilonModelTraits : RANSModelTraits<dimension> //! the indices using Indices = LowReKEpsilonIndices<dim(), numComponents()>; - - //! return the names of the primary variables in cells - template<class FluidSystem = void> - static std::string primaryVariableNameCell(int pvIdx, int state = 0) - { - using ParentType = RANSModelTraits<dimension>; - switch (pvIdx) { - case 0: - return ParentType::template primaryVariableNameCell<FluidSystem>(pvIdx, state); - case 1: - return "k"; - default: - return "epsilon"; - } - } }; /////////////////////////////////////////////////////////////////////////// @@ -186,14 +171,8 @@ public: using type = LowReKEpsilonVolumeVariables<Traits, NSVolVars>; }; -//! The specific vtk output fields -SET_PROP(LowReKEpsilon, VtkOutputFields) -{ -private: - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); -public: - using type = LowReKEpsilonVtkOutputFields<FVGridGeometry>; -}; +//! The specific I/O fields +SET_TYPE_PROP(LowReKEpsilon, IOFields, LowReKEpsilonIOFields); ////////////////////////////////////////////////////////////////// // default property values for the non-isothermal low-Reynolds k-epsilon model @@ -232,16 +211,8 @@ public: using type = LowReKEpsilonVolumeVariables<Traits, NSVolVars>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(LowReKEpsilonNI, VtkOutputFields) -{ -private: - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = LowReKEpsilonVtkOutputFields<FVGridGeometry>; -public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; -}; +//! The specific non-isothermal I/O fields +SET_TYPE_PROP(LowReKEpsilonNI, IOFields, FreeflowNonIsothermalIOFields<LowReKEpsilonIOFields, true/*turbulenceModel*/>); // \} } diff --git a/dumux/geomechanics/poroelastic/vtkoutputfields.hh b/dumux/geomechanics/poroelastic/iofields.hh similarity index 65% rename from dumux/geomechanics/poroelastic/vtkoutputfields.hh rename to dumux/geomechanics/poroelastic/iofields.hh index 8a96a6e4be5b9b8f0d296dcdc5b7e5b6c000bbbf..262475c5b646c5df52e5b75657b432d66e7bf854 100644 --- a/dumux/geomechanics/poroelastic/vtkoutputfields.hh +++ b/dumux/geomechanics/poroelastic/iofields.hh @@ -19,25 +19,36 @@ /*! * \file * \ingroup PoroElastic - * \brief Adds vtk output fields specific to the poro-elastic model + * \brief Adds I/O fields specific to the poro-elastic model */ -#ifndef DUMUX_POROELASTIC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_POROELASTIC_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_POROELASTIC_IO_FIELDS_HH +#define DUMUX_POROELASTIC_IO_FIELDS_HH + +#include <dumux/io/name.hh> namespace Dumux { /*! * \ingroup PoroElastic - * \brief Adds vtk output fields specific to the poro-elastic model + * \brief Adds I/O fields specific to the poro-elastic model */ -class PoroElasticVtkOutputFields +class PoroElasticIOFields { public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + out.addVolumeVariable([](const auto& volVars){ return volVars.displacement(); }, + IOName::displacement()); + out.addVolumeVariable([](const auto& volVars){ return volVars.porosity(); }, + IOName::porosity()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - vtk.addVolumeVariable([](const auto& volVars){ return volVars.displacement(); }, "u"); - vtk.addVolumeVariable([](const auto& volVars){ return volVars.porosity(); }, "porosity"); + initOutputModule(out); } }; diff --git a/dumux/geomechanics/poroelastic/model.hh b/dumux/geomechanics/poroelastic/model.hh index 4ea6e0494ffef92aad7cc1505d813fdf6735d089..e63a4eaf77500935eb56858b36be9b475f2f3cc4 100644 --- a/dumux/geomechanics/poroelastic/model.hh +++ b/dumux/geomechanics/poroelastic/model.hh @@ -37,7 +37,7 @@ #include "localresidual.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -73,7 +73,7 @@ NEW_TYPE_TAG(PoroElastic, INHERITS_FROM(Elastic)); SET_TYPE_PROP(PoroElastic, LocalResidual, PoroElasticLocalResidual<TypeTag>); //! default vtk output fields specific to this model -SET_TYPE_PROP(PoroElastic, VtkOutputFields, PoroElasticVtkOutputFields); +SET_TYPE_PROP(PoroElastic, IOFields, PoroElasticIOFields); //! The deault model traits of the poro-elastic model SET_PROP(PoroElastic, ModelTraits) diff --git a/dumux/io/CMakeLists.txt b/dumux/io/CMakeLists.txt index 72dd61cd9347ab14497b374db3a8218a566e4647..334ce60e140c265078f57246ce92bb3e88b62f28 100644 --- a/dumux/io/CMakeLists.txt +++ b/dumux/io/CMakeLists.txt @@ -5,7 +5,8 @@ add_subdirectory(xml) install(FILES adaptivegridrestart.hh container.hh -defaultvtkoutputfields.hh +defaultiofields.hh +fieldnames.hh gnuplotinterface.hh loadsolution.hh ploteffectivediffusivitymodel.hh diff --git a/dumux/io/defaultvtkoutputfields.hh b/dumux/io/defaultiofields.hh similarity index 72% rename from dumux/io/defaultvtkoutputfields.hh rename to dumux/io/defaultiofields.hh index 11ed8ff6f5770e4ff8bdf051de0b8f990f9fd276..b54c2802be0da3eeecd2177edc46930d128835bf 100644 --- a/dumux/io/defaultvtkoutputfields.hh +++ b/dumux/io/defaultiofields.hh @@ -19,28 +19,33 @@ /*! * \file * \ingroup InputOutput - * \brief Adds vtk output fields specific to a model, this is the default if a + * \brief Adds output fields to a given output module, this is the default if a model doesn't implement this functionality */ -#ifndef DUMUX_DEFAULT_VTK_OUTPUT_FIELDS_HH -#define DUMUX_DEFAULT_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_IO_DEFAULT_IO_FIELDS_HH +#define DUMUX_IO_DEFAULT_IO_FIELDS_HH #include <dune/common/exceptions.hh> -namespace Dumux -{ +namespace Dumux { /*! * \ingroup InputOutput - * \brief Adds vtk output fields specific to a model + * \brief Adds output fields to a given output module */ -class DefaultVtkOutputFields +class DefaultIOFields { public: - template<class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template<class OutputModule> + static void initOutputModule(OutputModule& out) + { + DUNE_THROW(Dune::NotImplemented, "This model doesn't implement default output fields!"); + } + + template <class FluidSystem = void, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - DUNE_THROW(Dune::NotImplemented, "This model doesn't implement default vtk fields!"); + DUNE_THROW(Dune::NotImplemented, "This model doesn't implement primaryVariableName!"); } }; diff --git a/dumux/io/loadsolution.hh b/dumux/io/loadsolution.hh index e01e338230950fa7705f58cd69de46c688b6a987..da1c8640c5edd6aac3bffffda33ae94c2276b677 100644 --- a/dumux/io/loadsolution.hh +++ b/dumux/io/loadsolution.hh @@ -232,8 +232,9 @@ auto loadSolutionFromVtkFile(SolutionVector& sol, * \brief helper function to determine the primary variable names of a model with privar state * \note use this as input for the load solution function */ -template<class ModelTraits, class FluidSystem = void, class SolidSystem = void> -std::function<std::string(int,int)> createPVNameFunctionWithState(const std::string& paramGroup = "") +template<class IOFields, class PrimaryVariables, class ModelTraits = void, class FluidSystem = void, class SolidSystem = void> +auto createPVNameFunction(const std::string& paramGroup = "") +-> typename std::enable_if_t<decltype(isValid(Detail::hasState())(PrimaryVariables(0)))::value, std::function<std::string(int,int)>> { return [paramGroup](int pvIdx, int state = 0) { @@ -250,7 +251,7 @@ std::function<std::string(int,int)> createPVNameFunctionWithState(const std::str return pvName[pvIdx]; } else - return ModelTraits::template primaryVariableName<FluidSystem, SolidSystem>(pvIdx, state); + return IOFields::template primaryVariableName<ModelTraits, FluidSystem, SolidSystem>(pvIdx, state); }; } @@ -259,8 +260,9 @@ std::function<std::string(int,int)> createPVNameFunctionWithState(const std::str * \brief helper function to determine the primary variable names of a model without state * \note use this as input for the load solution function */ -template<class ModelTraits, class FluidSystem = void, class SolidSystem = void> -std::function<std::string(int,int)> createPVNameFunction(const std::string& paramGroup = "") +template<class IOFields, class PrimaryVariables, class ModelTraits = void, class FluidSystem = void, class SolidSystem = void> +auto createPVNameFunction(const std::string& paramGroup = "") +-> typename std::enable_if_t<!decltype(isValid(Detail::hasState())(PrimaryVariables(0)))::value, std::function<std::string(int,int)>> { if (hasParamInGroup(paramGroup, "LoadSolution.PriVarNames")) { @@ -268,7 +270,7 @@ std::function<std::string(int,int)> createPVNameFunction(const std::string& para return [n = std::move(pvName)](int pvIdx, int state = 0){ return n[pvIdx]; }; } else - return [](int pvIdx, int state = 0){ return ModelTraits::template primaryVariableName<FluidSystem, SolidSystem>(pvIdx, state); }; + return [](int pvIdx, int state = 0){ return IOFields::template primaryVariableName<ModelTraits, FluidSystem, SolidSystem>(pvIdx, state); }; } /*! diff --git a/dumux/io/name.hh b/dumux/io/name.hh new file mode 100644 index 0000000000000000000000000000000000000000..340adf26127831f2b0f1ec1df3a693d6b098d8a6 --- /dev/null +++ b/dumux/io/name.hh @@ -0,0 +1,170 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup InputOutput + * \brief A collection of input/output field names for common physical quantities + */ +#ifndef DUMUX_IO_NAME_HH +#define DUMUX_IO_NAME_HH + +#include <string> + +namespace Dumux { +namespace IOName { + +//! I/O name of pressure for multiphase systems +template<class FluidSystem> +std::string pressure(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "p" : "p_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of pressure for singlephase systems +std::string pressure() noexcept +{ return "p"; } + +//! I/O name of saturation for multiphase systems +template<class FluidSystem> +std::string saturation(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "S" : "S_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of saturation for singlephase systems +std::string saturation() noexcept +{ return "S"; } + +//! I/O name of temperature for equilibrium models +std::string temperature() noexcept +{ return "T"; } + +//! I/O name of temperature for non-equilibrium models +template<class FluidSystem> +std::string fluidTemperature(int phaseIdx) noexcept +{ return "T_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of solid temperature for non-equilibrium models +std::string solidTemperature() noexcept +{ return "T_s"; } + +//! I/O name of density for multiphase systems +template<class FluidSystem> +std::string density(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "rho" : "rho_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of density for singlephase systems +std::string density() noexcept +{ return "rho"; } + +//! I/O name of viscosity for multiphase systems +template<class FluidSystem> +std::string viscosity(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "mu" : "mu_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of viscosity for singlephase systems +std::string viscosity() noexcept +{ return "mu"; } + +//! I/O name of molar density for multiphase systems +template<class FluidSystem> +std::string molarDensity(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "rhoMolar" : "rhoMolar_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of molar density for singlephase systems +std::string molarDensity() noexcept +{ return "rhoMolar"; } + +//! I/O name of relative permeability for multiphase systems +template<class FluidSystem> +std::string relativePermeability(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "kr" : "kr_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of relative permeability for singlephase systems +std::string relativePermeability() noexcept +{ return "kr"; } + +//! I/O name of mobility for multiphase systems +template<class FluidSystem> +std::string mobility(int phaseIdx) noexcept +{ return (FluidSystem::numPhases == 1) ? "mob" : "mob_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of mobility for singlephase systems +std::string mobility() noexcept +{ return "mob"; } + +//! I/O name of mole fraction +template<class FluidSystem> +std::string moleFraction(int phaseIdx, int compIdx) noexcept +{ return "x^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of mass fraction +template<class FluidSystem> +std::string massFraction(int phaseIdx, int compIdx) noexcept +{ return "X^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(phaseIdx); } + +//! I/O name of liquid phase +std::string liquidPhase() noexcept +{ return "liq"; } + +//! I/O name of gaseous phase +std::string gaseousPhase() noexcept +{ return "gas"; } + +//! I/O name of aqueous phase +std::string aqueousPhase() noexcept +{ return "aq"; } + +//! I/O name of napl phase +std::string naplPhase() noexcept +{ return "napl"; } + +//! I/O name of capillary pressure +std::string capillaryPressure() noexcept +{ return "pc"; } + +//! I/O name of porosity +std::string porosity() noexcept +{ return "porosity"; } + +//! I/O name of permeability +std::string permeability() noexcept +{ return "permeability"; } + +//! I/O name of phase presence +std::string phasePresence() noexcept +{ return "phase presence"; } + +//! I/O name of pressure head +std::string pressureHead() noexcept +{ return "pressure head"; } + +//! I/O name of water content +std::string waterContent() noexcept +{ return "water content"; } + +//! I/O name of solid volume fraction +template<class SolidSystem> +std::string solidVolumeFraction(int compIdx = 0) noexcept +{ return "precipitateVolumeFraction^" + SolidSystem::componentName(compIdx); } + +//! I/O name of displacement +std::string displacement() noexcept +{ return "u"; } + +} // end namespace IOName +} // end namespace Dumux + +#endif diff --git a/dumux/material/fluidsystems/1pgas.hh b/dumux/material/fluidsystems/1pgas.hh index a889a3f2d80636112301c25f811c01482a8fe173..ef8a86ac5ee1a43d3e929e90b034d17ee00e5332 100644 --- a/dumux/material/fluidsystems/1pgas.hh +++ b/dumux/material/fluidsystems/1pgas.hh @@ -31,6 +31,7 @@ #include <dumux/material/fluidsystems/base.hh> #include <dumux/material/components/componenttraits.hh> +#include <dumux/io/name.hh> namespace Dumux { namespace FluidSystems { @@ -73,7 +74,7 @@ public: * \param phaseIdx The index of the fluid phase to consider */ static std::string phaseName(int phaseIdx = 0) - { return "gas"; } + { return IOName::gaseousPhase(); } /*! * \brief A human readable name for the component. diff --git a/dumux/material/fluidsystems/1pliquid.hh b/dumux/material/fluidsystems/1pliquid.hh index 1d03e0403325675c9bd89909b56056a384b79267..a4b818749dd5813c633025fde6140a32ef2de029 100644 --- a/dumux/material/fluidsystems/1pliquid.hh +++ b/dumux/material/fluidsystems/1pliquid.hh @@ -31,6 +31,7 @@ #include <dumux/material/fluidsystems/base.hh> #include <dumux/material/components/componenttraits.hh> +#include <dumux/io/name.hh> namespace Dumux { namespace FluidSystems { @@ -73,7 +74,7 @@ public: * \param phaseIdx The index of the fluid phase to consider */ static std::string phaseName(int phaseIdx = 0) - { return "liq"; } + { return IOName::liquidPhase(); } /*! * \brief A human readable name for the component. diff --git a/dumux/material/fluidsystems/2p1c.hh b/dumux/material/fluidsystems/2p1c.hh index 4857dc4b947cb9d32bc905aa2e60f26f186b50f7..c2ccdfe78fcce1330a7c2e791ff6d721bb32facb 100644 --- a/dumux/material/fluidsystems/2p1c.hh +++ b/dumux/material/fluidsystems/2p1c.hh @@ -30,6 +30,8 @@ #include <dune/common/exceptions.hh> +#include <dumux/io/name.hh> + #include "base.hh" namespace Dumux { @@ -68,8 +70,8 @@ public: static std::string phaseName(int phaseIdx) { static std::string name[] = { - std::string("liq"), - std::string("gas"), + std::string(IOName::liquidPhase()), + std::string(IOName::gaseousPhase()), }; assert(0 <= phaseIdx && phaseIdx < numPhases); diff --git a/dumux/material/fluidsystems/2pimmiscible.hh b/dumux/material/fluidsystems/2pimmiscible.hh index 2429a039a0ca4903234fdc41903257e29e674d9e..43e96ecea9e5c74499747be43994f99d3af5e9d1 100644 --- a/dumux/material/fluidsystems/2pimmiscible.hh +++ b/dumux/material/fluidsystems/2pimmiscible.hh @@ -33,6 +33,7 @@ #include <dumux/material/fluidsystems/1pgas.hh> #include <dumux/material/fluidstates/immiscible.hh> #include <dumux/material/components/base.hh> +#include <dumux/io/name.hh> #include "base.hh" @@ -89,16 +90,16 @@ public: if (!Fluid0::isGas() && !Fluid1::isGas()) { if (phaseIdx == phase0Idx) - return Components::IsAqueous<typename Fluid0::Component>::value ? "aq" : "napl"; + return Components::IsAqueous<typename Fluid0::Component>::value ? IOName::aqueousPhase() : IOName::naplPhase(); else - return Components::IsAqueous<typename Fluid1::Component>::value ? "aq" : "napl"; + return Components::IsAqueous<typename Fluid1::Component>::value ? IOName::aqueousPhase() : IOName::naplPhase(); } else { if (phaseIdx == phase0Idx) - return Fluid0::isGas() ? "gas" : "liq"; + return Fluid0::isGas() ? IOName::gaseousPhase() : IOName::liquidPhase(); else - return Fluid1::isGas() ? "gas" : "liq"; + return Fluid1::isGas() ? IOName::gaseousPhase() : IOName::liquidPhase(); } } diff --git a/dumux/material/fluidsystems/3pimmiscible.hh b/dumux/material/fluidsystems/3pimmiscible.hh index 3d362ffad3cc27e2bf319261b84ee7b4a3caad18..885f34022d367bd9aeaf706c300f91c514cd5f20 100644 --- a/dumux/material/fluidsystems/3pimmiscible.hh +++ b/dumux/material/fluidsystems/3pimmiscible.hh @@ -34,6 +34,7 @@ #include <dumux/material/fluidsystems/1pgas.hh> #include <dumux/material/fluidstates/immiscible.hh> #include <dumux/material/components/base.hh> +#include <dumux/io/name.hh> namespace Dumux { namespace FluidSystems { @@ -93,10 +94,10 @@ public: switch (phaseIdx) { case wPhaseIdx: return Components::IsAqueous<typename WettingFluid::Component>::value - ? "aq" : "napl"; + ? IOName::aqueousPhase() : IOName::naplPhase(); case nPhaseIdx: return Components::IsAqueous<typename NonwettingFluid::Component>::value - ? "aq" : "napl"; - case gPhaseIdx: return "gas"; + ? IOName::aqueousPhase() : IOName::naplPhase(); + case gPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/brine.hh b/dumux/material/fluidsystems/brine.hh index 9bfc0769a499d02f88490aae3110de63bc36ebe8..67685a187ebcdaa5cbda4d6bd7c4c8b2d739c3db 100644 --- a/dumux/material/fluidsystems/brine.hh +++ b/dumux/material/fluidsystems/brine.hh @@ -32,6 +32,8 @@ #include <dumux/common/exceptions.hh> +#include <dumux/io/name.hh> + namespace Dumux { namespace FluidSystems { @@ -69,7 +71,7 @@ public: static const std::string phaseName(int phaseIdx = liquidPhaseIdx) { assert(phaseIdx == liquidPhaseIdx); - return "liq"; + return IOName::liquidPhase(); } /*! diff --git a/dumux/material/fluidsystems/brineair.hh b/dumux/material/fluidsystems/brineair.hh index bba23499ddc91efc1f26b975a48996e247ec3f46..65f96a9dbc997b3ea86ec73284b389b0657955e4 100644 --- a/dumux/material/fluidsystems/brineair.hh +++ b/dumux/material/fluidsystems/brineair.hh @@ -41,6 +41,8 @@ #include <dumux/common/valgrind.hh> #include <dumux/common/exceptions.hh> +#include <dumux/io/name.hh> + #include "brine.hh" namespace Dumux { @@ -148,8 +150,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return "liq"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return IOName::liquidPhase(); + case gasPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/brineco2.hh b/dumux/material/fluidsystems/brineco2.hh index 55eb96777b8e02d83e99e9104fe1840af953bc17..17b5e215e3ce2a95f0df420f64e180f83eec61a5 100644 --- a/dumux/material/fluidsystems/brineco2.hh +++ b/dumux/material/fluidsystems/brineco2.hh @@ -41,6 +41,8 @@ #include <dumux/material/binarycoefficients/brine_co2.hh> +#include <dumux/io/name.hh> + namespace Dumux { // include the default tables for CO2 @@ -195,8 +197,8 @@ public: { switch (phaseIdx) { - case liquidPhaseIdx: return "liq"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return IOName::liquidPhase(); + case gasPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oair.hh b/dumux/material/fluidsystems/h2oair.hh index 0efa87856c69ffe0a2d0274ed9ce198a771f59d0..438eb7f2d588241c3e6b4c74a38ccc3f5c188ca4 100644 --- a/dumux/material/fluidsystems/h2oair.hh +++ b/dumux/material/fluidsystems/h2oair.hh @@ -39,6 +39,8 @@ #include <dumux/common/valgrind.hh> #include <dumux/common/exceptions.hh> +#include <dumux/io/name.hh> + namespace Dumux { namespace FluidSystems { /*! @@ -104,8 +106,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return "liq"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return IOName::liquidPhase(); + case gasPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oairmesitylene.hh b/dumux/material/fluidsystems/h2oairmesitylene.hh index 3db76865d2d1028d1a5cf2f8f32e25a9213b101c..d5dafd18bff6b4e951410a8a021070c37958563a 100644 --- a/dumux/material/fluidsystems/h2oairmesitylene.hh +++ b/dumux/material/fluidsystems/h2oairmesitylene.hh @@ -37,6 +37,8 @@ #include <dumux/material/fluidsystems/base.hh> +#include <dumux/io/name.hh> + namespace Dumux { namespace FluidSystems { @@ -197,9 +199,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case wPhaseIdx: return "aq"; - case nPhaseIdx: return "napl"; - case gPhaseIdx: return "gas"; + case wPhaseIdx: return IOName::aqueousPhase(); + case nPhaseIdx: return IOName::naplPhase(); + case gPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oairxylene.hh b/dumux/material/fluidsystems/h2oairxylene.hh index 944304bb1c621a1c4dd9a8702aafe5115f3f6cd2..9fd072be019d15883fb1aa92e599d85cdc7b0227 100644 --- a/dumux/material/fluidsystems/h2oairxylene.hh +++ b/dumux/material/fluidsystems/h2oairxylene.hh @@ -36,6 +36,8 @@ #include <dumux/material/fluidsystems/base.hh> +#include <dumux/io/name.hh> + namespace Dumux { namespace FluidSystems @@ -198,9 +200,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case wPhaseIdx: return "aq"; - case nPhaseIdx: return "napl"; - case gPhaseIdx: return "gas"; + case wPhaseIdx: return IOName::aqueousPhase(); + case nPhaseIdx: return IOName::naplPhase(); + case gPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2oheavyoil.hh b/dumux/material/fluidsystems/h2oheavyoil.hh index 575b2c74f721ebe7fb18fa25584c1e82f6566243..b4e1b3437ea6c209361bdf134d6a8eea5429b271 100644 --- a/dumux/material/fluidsystems/h2oheavyoil.hh +++ b/dumux/material/fluidsystems/h2oheavyoil.hh @@ -33,6 +33,8 @@ #include <dumux/material/fluidsystems/base.hh> +#include <dumux/io/name.hh> + namespace Dumux { namespace FluidSystems { @@ -187,9 +189,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case wPhaseIdx: return "aq"; - case nPhaseIdx: return "napl"; - case gPhaseIdx: return "gas"; + case wPhaseIdx: return IOName::aqueousPhase(); + case nPhaseIdx: return IOName::naplPhase(); + case gPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2on2.hh b/dumux/material/fluidsystems/h2on2.hh index e5c75bc42b2fa21ff804f8e23df2ffa7d1b1dd3e..47d8f04e78261544d04d72eb0ff02c2bc024134e 100644 --- a/dumux/material/fluidsystems/h2on2.hh +++ b/dumux/material/fluidsystems/h2on2.hh @@ -37,6 +37,8 @@ #include <dumux/material/components/tabulatedcomponent.hh> #include <dumux/material/binarycoefficients/h2o_n2.hh> +#include <dumux/io/name.hh> + #include "base.hh" namespace Dumux { @@ -105,8 +107,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return "liq"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return IOName::liquidPhase(); + case gasPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/h2on2o2.hh b/dumux/material/fluidsystems/h2on2o2.hh index 868dbe8f85d409c59d9e45331c7ccc30521eee76..9673b9b904b94afb92a21cd8ea63ebe3f73dddd4 100644 --- a/dumux/material/fluidsystems/h2on2o2.hh +++ b/dumux/material/fluidsystems/h2on2o2.hh @@ -44,6 +44,8 @@ #include <dumux/material/binarycoefficients/h2o_o2.hh> #include <dumux/material/binarycoefficients/n2_o2.hh> +#include <dumux/io/name.hh> + namespace Dumux { namespace FluidSystems { /*! @@ -124,8 +126,8 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case liquidPhaseIdx: return "liq"; - case gasPhaseIdx: return "gas"; + case liquidPhaseIdx: return IOName::liquidPhase(); + case gasPhaseIdx: return IOName::gaseousPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/material/fluidsystems/liquidphase2c.hh b/dumux/material/fluidsystems/liquidphase2c.hh index 67e5847579475e91afda022059355708176db301..a911e6c426bc0feac2544f9719c04b63ae2029c8 100644 --- a/dumux/material/fluidsystems/liquidphase2c.hh +++ b/dumux/material/fluidsystems/liquidphase2c.hh @@ -30,6 +30,7 @@ #include <dune/common/exceptions.hh> #include <dumux/material/fluidsystems/base.hh> #include <dumux/material/binarycoefficients/h2o_constant.hh> +#include <dumux/io/name.hh> namespace Dumux { namespace FluidSystems { @@ -75,7 +76,7 @@ public: * \param phaseIdx The index of the fluid phase to consider */ static std::string phaseName(int phaseIdx = 0) - { return "liq"; } + { return IOName::liquidPhase(); } /*! * \brief Returns whether the fluids are miscible diff --git a/dumux/material/fluidsystems/spe5.hh b/dumux/material/fluidsystems/spe5.hh index b7fc35f9c4a1b61e0476ab995cebd4d84724efac..d68745b9bdff8d17ed1c43cbe22563ef69b2f30c 100644 --- a/dumux/material/fluidsystems/spe5.hh +++ b/dumux/material/fluidsystems/spe5.hh @@ -28,6 +28,7 @@ #include <dumux/common/spline.hh> #include <dumux/material/eos/pengrobinsonmixture.hh> +#include <dumux/io/name.hh> namespace Dumux { @@ -89,9 +90,9 @@ public: assert(0 <= phaseIdx && phaseIdx < numPhases); switch (phaseIdx) { - case gPhaseIdx: return "gas"; - case wPhaseIdx: return "aq"; - case oPhaseIdx: return "napl"; + case gPhaseIdx: return IOName::gaseousPhase(); + case wPhaseIdx: return IOName::aqueousPhase(); + case oPhaseIdx: return IOName::naplPhase(); } DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx); } diff --git a/dumux/porousmediumflow/1p/vtkoutputfields.hh b/dumux/porousmediumflow/1p/iofields.hh similarity index 63% rename from dumux/porousmediumflow/1p/vtkoutputfields.hh rename to dumux/porousmediumflow/1p/iofields.hh index fc5642d5246f2b0a35986b0089ba2697139b6e81..932dab29128e63313609193fc459cdc4d6bcafe7 100644 --- a/dumux/porousmediumflow/1p/vtkoutputfields.hh +++ b/dumux/porousmediumflow/1p/iofields.hh @@ -19,24 +19,42 @@ /*! * \file * \ingroup OnePModel - * \brief Adds vtk output fields specific to the one phase model + * \brief Adds I/O fields specific to the one phase model */ -#ifndef DUMUX_ONEP_VTK_OUTPUT_FIELDS_HH -#define DUMUX_ONEP_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_ONEP_IO_FIELDS_HH +#define DUMUX_ONEP_IO_FIELDS_HH + +#include <dune/common/deprecated.hh> + +#include <dumux/io/name.hh> namespace Dumux { /*! * \ingroup OnePModel - * \brief Adds vtk output fields specific to the one phase model + * \brief Adds I/O fields specific to the one phase model */ -class OnePVtkOutputFields +class OnePIOFields { public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(); }, + IOName::pressure()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits = void, class FluidSystem = void, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) { - vtk.addVolumeVariable([](const auto& volVars){ return volVars.pressure(); }, "p"); + return IOName::pressure(); } }; diff --git a/dumux/porousmediumflow/1p/model.hh b/dumux/porousmediumflow/1p/model.hh index 51b0bc168aa59ffd8cae1ead63a0f8d983a4589a..e79ed569d471e1329650f3095dc716df597d1858 100644 --- a/dumux/porousmediumflow/1p/model.hh +++ b/dumux/porousmediumflow/1p/model.hh @@ -50,11 +50,11 @@ #include <dumux/porousmediumflow/properties.hh> #include <dumux/porousmediumflow/immiscible/localresidual.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -119,9 +119,10 @@ NEW_TYPE_TAG(OnePNI, INHERITS_FROM(OneP)); /////////////////////////////////////////////////////////////////////////// // properties for the isothermal single phase model /////////////////////////////////////////////////////////////////////////// -SET_TYPE_PROP(OneP, VtkOutputFields, OnePVtkOutputFields); //!< default vtk output fields specific to this model +SET_TYPE_PROP(OneP, IOFields, OnePIOFields); //!< default I/O fields specific to this model SET_TYPE_PROP(OneP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< the local residual function -SET_TYPE_PROP(OneP, ModelTraits, OnePModelTraits); //!< states some specifics of the one-phase model +SET_TYPE_PROP(OneP, BaseModelTraits, OnePModelTraits); //!< states some specifics of the one-phase model +SET_TYPE_PROP(OneP, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits //! Set the volume variables property SET_PROP(OneP, VolumeVariables) @@ -160,7 +161,7 @@ public: /////////////////////////////////////////////////////////////////////////// //! Add temperature to the output -SET_TYPE_PROP(OnePNI, VtkOutputFields, EnergyVtkOutputFields<OnePVtkOutputFields>); +SET_TYPE_PROP(OnePNI, IOFields, EnergyIOFields<OnePIOFields>); //! The model traits of the non-isothermal model SET_TYPE_PROP(OnePNI, ModelTraits, PorousMediumFlowNIModelTraits<OnePModelTraits>); diff --git a/dumux/porousmediumflow/1pnc/vtkoutputfields.hh b/dumux/porousmediumflow/1pnc/iofields.hh similarity index 50% rename from dumux/porousmediumflow/1pnc/vtkoutputfields.hh rename to dumux/porousmediumflow/1pnc/iofields.hh index 7ac20b20b52838652d0fc3e9ab415cb6dc0f424b..c48ba433c8e4282cbbb63bef2df52d7c14af09f5 100644 --- a/dumux/porousmediumflow/1pnc/vtkoutputfields.hh +++ b/dumux/porousmediumflow/1pnc/iofields.hh @@ -19,40 +19,64 @@ /*! * \file * \ingroup OnePNCModel - * \brief Adds vtk output fields specific to the OnePNC model + * \brief Adds I/O fields specific to the OnePNC model */ -#ifndef DUMUX_ONEPNC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_ONEPNC_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_ONEPNC_IO_FIELDS_HH +#define DUMUX_ONEPNC_IO_FIELDS_HH #include <string> +#include <dumux/io/name.hh> + namespace Dumux { /*! * \ingroup OnePNCModel - * \brief Adds vtk output fields specific to the OnePNC model + * \brief Adds I/O fields specific to the OnePNC model */ -class OnePNCVtkOutputFields +class OnePNCIOFields { public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - vtk.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0); }, "p"); - vtk.addVolumeVariable([](const auto& volVars){ return volVars.density(0); }, "rho"); - vtk.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(0); }, "mu"); - vtk.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0) - 1e5; }, "delp"); + out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0); }, + IOName::pressure()); + out.addVolumeVariable([](const auto& volVars){ return volVars.density(0); }, + IOName::density()); + out.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(0); }, + IOName::viscosity()); + out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0) - 1e5; }, + "delp"); for (int i = 0; i < VolumeVariables::numComponents(); ++i) - vtk.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(0, i); }, - "x^" + std::string(FluidSystem::componentName(i)) + "_" + std::string(FluidSystem::phaseName(0))); + out.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(0, i); }, + IOName::moleFraction<FluidSystem>(0, i)); for (int i = 0; i < VolumeVariables::numComponents(); ++i) - vtk.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(0, i); }, - "X^" + std::string(FluidSystem::componentName(i))+ "_" + std::string(FluidSystem::phaseName(0))); + out.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(0, i); }, + IOName::massFraction<FluidSystem>(0, i)); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state = 0) + { + if (pvIdx == 0) + return IOName::pressure(); + else if (ModelTraits::useMoles()) + return IOName::moleFraction<FluidSystem>(0, pvIdx); + else + return IOName::massFraction<FluidSystem>(0, pvIdx); } }; diff --git a/dumux/porousmediumflow/1pnc/model.hh b/dumux/porousmediumflow/1pnc/model.hh index 0d42f0012c808deec8007e26ec18edbb541cb19d..7b9fd97c35178c4f39cdea3932aad462d3b9d1bd 100644 --- a/dumux/porousmediumflow/1pnc/model.hh +++ b/dumux/porousmediumflow/1pnc/model.hh @@ -67,12 +67,12 @@ #include <dumux/porousmediumflow/compositional/localresidual.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include <dumux/material/fluidmatrixinteractions/diffusivitymillingtonquirk.hh> #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -149,14 +149,15 @@ NEW_TYPE_TAG(OnePNCNI, INHERITS_FROM(OnePNC)); //! Set as default that no component mass balance is replaced by the total mass balance SET_INT_PROP(OnePNC, ReplaceCompEqIdx, GET_PROP_TYPE(TypeTag, FluidSystem)::numComponents); -//! The model traits. Per default, we use the number of components of the fluid system. -SET_PROP(OnePNC, ModelTraits) +//! The base model traits. Per default, we use the number of components of the fluid system. +SET_PROP(OnePNC, BaseModelTraits) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); public: using type = OnePNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; }; +SET_TYPE_PROP(OnePNC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits /*! @@ -207,14 +208,14 @@ public: }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(OnePNC, VtkOutputFields, OnePNCVtkOutputFields); +SET_TYPE_PROP(OnePNC, IOFields, OnePNCIOFields); /////////////////////////////////////////////////////////////////////////// // properties for the non-isothermal single phase model /////////////////////////////////////////////////////////////////////////// //! the non-isothermal vtk output fields -SET_TYPE_PROP(OnePNCNI, VtkOutputFields, EnergyVtkOutputFields<OnePNCVtkOutputFields>); +SET_TYPE_PROP(OnePNCNI, IOFields, EnergyIOFields<OnePNCIOFields>); //! Use the average for effective conductivities SET_TYPE_PROP(OnePNCNI, @@ -225,8 +226,7 @@ SET_TYPE_PROP(OnePNCNI, SET_PROP(OnePNCNI, ModelTraits) { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using IsothermalTraits = OnePNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; diff --git a/dumux/porousmediumflow/1pncmin/model.hh b/dumux/porousmediumflow/1pncmin/model.hh index a66415fef3f8ff19f8912b0afdf7be1724e90f2b..d03f678254f64697869f5f1ae145f427bbc96f68 100644 --- a/dumux/porousmediumflow/1pncmin/model.hh +++ b/dumux/porousmediumflow/1pncmin/model.hh @@ -76,10 +76,10 @@ v = - \frac{k_{r}}{\mu} \mbox{\bf K} #include <dumux/porousmediumflow/mineralization/model.hh> #include <dumux/porousmediumflow/mineralization/localresidual.hh> #include <dumux/porousmediumflow/mineralization/volumevariables.hh> -#include <dumux/porousmediumflow/mineralization/vtkoutputfields.hh> +#include <dumux/porousmediumflow/mineralization/iofields.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include <dumux/material/fluidmatrixinteractions/1p/thermalconductivityaverage.hh> namespace Dumux { @@ -124,9 +124,8 @@ SET_TYPE_PROP(OnePNCMin, LocalResidual, MineralizationLocalResidual<TypeTag>); SET_PROP(OnePNCMin, ModelTraits) { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using NonMinTraits = OnePNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + using NonMinTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = MineralizationModelTraits<NonMinTraits, SolidSystem::numComponents, SolidSystem::numInertComponents>; }; @@ -142,23 +141,25 @@ public: }; //! Use the mineralization vtk output fields -SET_TYPE_PROP(OnePNCMin, VtkOutputFields, MineralizationVtkOutputFields<OnePNCVtkOutputFields>); +SET_TYPE_PROP(OnePNCMin, IOFields, MineralizationIOFields<OnePNCIOFields>); ////////////////////////////////////////////////////////////////// // Properties for the non-isothermal 2pncmin model ////////////////////////////////////////////////////////////////// //! non-isothermal vtk output -//! non-isothermal vtk output -SET_TYPE_PROP(OnePNCMinNI, VtkOutputFields, EnergyVtkOutputFields<MineralizationVtkOutputFields<OnePNCVtkOutputFields>>); +SET_PROP(OnePNCMinNI, IOFields) +{ + using MineralizationIOF = MineralizationIOFields<OnePNCIOFields>; + using type = EnergyIOFields<MineralizationIOF>; +}; //! The non-isothermal model traits SET_PROP(OnePNCMinNI, ModelTraits) { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using OnePNCTraits = OnePNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + using OnePNCTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); using IsothermalTraits = MineralizationModelTraits<OnePNCTraits, SolidSystem::numComponents, SolidSystem::numInertComponents>; public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; diff --git a/dumux/porousmediumflow/2p/iofields.hh b/dumux/porousmediumflow/2p/iofields.hh new file mode 100644 index 0000000000000000000000000000000000000000..48a97cf540449137824279ef3923b417f8ce4697 --- /dev/null +++ b/dumux/porousmediumflow/2p/iofields.hh @@ -0,0 +1,87 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup TwoPModel + * \brief Adds I/O fields specific to the two-phase model + */ +#ifndef DUMUX_TWOP_IO_FIELDS_HH +#define DUMUX_TWOP_IO_FIELDS_HH + +#include <dune/common/deprecated.hh> + +#include <dumux/io/name.hh> + +#include "model.hh" + +namespace Dumux { + +/*! + * \ingroup TwoPModel + * \brief Adds I/O fields specific to the two-phase model + */ +class TwoPIOFields +{ +public: + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FS = typename VolumeVariables::FluidSystem; + + for (int phaseIdx = 0; phaseIdx < FS::numPhases; ++phaseIdx) + { + out.addVolumeVariable([phaseIdx](const VolumeVariables& v){ return v.saturation(phaseIdx); }, + IOName::saturation<FS>(phaseIdx)); + out.addVolumeVariable([phaseIdx](const VolumeVariables& v){ return v.pressure(phaseIdx); }, + IOName::pressure<FS>(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.density(phaseIdx); }, + IOName::density<FS>(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.mobility(phaseIdx); }, + IOName::mobility<FS>(phaseIdx)); + } + + out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, + IOName::capillaryPressure()); + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state = 0) + { + if (ModelTraits::priVarFormulation() == TwoPFormulation::p0s1) + return pvIdx == 0 ? IOName::pressure<FluidSystem>(FluidSystem::phase0Idx) + : IOName::saturation<FluidSystem>(FluidSystem::phase1Idx); + else + return pvIdx == 0 ? IOName::pressure<FluidSystem>(FluidSystem::phase1Idx) + : IOName::saturation<FluidSystem>(FluidSystem::phase0Idx); + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index 958309b5f12b20874d027d8591b56e1f94a3ac22..91765814dfe7a956b0189b613cc0ca4fa0b40db4 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -69,12 +69,12 @@ #include <dumux/porousmediumflow/immiscible/localresidual.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include "formulation.hh" #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "saturationreconstruction.hh" namespace Dumux @@ -103,11 +103,11 @@ struct TwoPModelTraits static std::string primaryVariableName(int pvIdx, int state = 0) { if (priVarFormulation() == TwoPFormulation::p0s1) - return pvIdx == 0 ? "p_" + FluidSystem::phaseName(FluidSystem::phase0Idx) - : "S_" + FluidSystem::phaseName(FluidSystem::phase1Idx) ; + return pvIdx == 0 ? IOName::pressure<FluidSystem>(FluidSystem::phase0Idx) + : IOName::saturation<FluidSystem>(FluidSystem::phase1Idx) ; else - return pvIdx == 0 ? "p_" + FluidSystem::phaseName(FluidSystem::phase1Idx) - : "S_" + FluidSystem::phaseName(FluidSystem::phase0Idx); + return pvIdx == 0 ? IOName::pressure<FluidSystem>(FluidSystem::phase1Idx) + : IOName::saturation<FluidSystem>(FluidSystem::phase0Idx); } }; @@ -138,6 +138,9 @@ struct TwoPVolumeVariablesTraits using SaturationReconstruction = SR; }; +// necessary for models derived from 2p +class TwoPIOFields; + //////////////////////////////// // properties //////////////////////////////// @@ -162,11 +165,12 @@ SET_PROP(TwoP, Formulation) SET_TYPE_PROP(TwoP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< Use the immiscible local residual operator for the 2p model -//! The model traits class -SET_TYPE_PROP(TwoP, ModelTraits, TwoPModelTraits<GET_PROP_VALUE(TypeTag, Formulation)>); +//! The base model traits class +SET_TYPE_PROP(TwoP, BaseModelTraits, TwoPModelTraits<GET_PROP_VALUE(TypeTag, Formulation)>); +SET_TYPE_PROP(TwoP, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits //! Set the vtk output fields specific to the twop model -SET_TYPE_PROP(TwoP, VtkOutputFields, TwoPVtkOutputFields); +SET_TYPE_PROP(TwoP, IOFields, TwoPIOFields); //! Set the volume variables property SET_PROP(TwoP, VolumeVariables) @@ -205,10 +209,10 @@ public: //////////////////////////////////////////////////////// //! The non-isothermal model traits class -SET_TYPE_PROP(TwoPNI, ModelTraits, PorousMediumFlowNIModelTraits<TwoPModelTraits<GET_PROP_VALUE(TypeTag, Formulation)>>); +SET_TYPE_PROP(TwoPNI, ModelTraits, PorousMediumFlowNIModelTraits<typename GET_PROP_TYPE(TypeTag, BaseModelTraits)>); //! Set the vtk output fields specific to the non-isothermal twop model -SET_TYPE_PROP(TwoPNI, VtkOutputFields, EnergyVtkOutputFields<TwoPVtkOutputFields>); +SET_TYPE_PROP(TwoPNI, IOFields, EnergyIOFields<TwoPIOFields>); //! Somerton is used as default model to compute the effective thermal heat conductivity SET_PROP(TwoPNI, ThermalConductivityModel) diff --git a/dumux/porousmediumflow/2p/vtkoutputfields.hh b/dumux/porousmediumflow/2p/vtkoutputfields.hh deleted file mode 100644 index a9e9b380d65cc507d7b666a4e9253f9b92f3d7dc..0000000000000000000000000000000000000000 --- a/dumux/porousmediumflow/2p/vtkoutputfields.hh +++ /dev/null @@ -1,58 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program 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. * - * * - * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup TwoPModel - * \brief Adds vtk output fields specific to the two-phase model - */ -#ifndef DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH - -namespace Dumux { - -/*! - * \ingroup TwoPModel - * \brief Adds vtk output fields specific to the two-phase model - */ -class TwoPVtkOutputFields -{ -public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(FluidSystem::phase0Idx); }, "S_"+FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(FluidSystem::phase1Idx); }, "S_"+FluidSystem::phaseName(FluidSystem::phase1Idx)); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(FluidSystem::phase0Idx); }, "p_"+FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(FluidSystem::phase1Idx); }, "p_"+FluidSystem::phaseName(FluidSystem::phase1Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase0Idx); }, "rho_"+FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase1Idx); }, "rho_"+FluidSystem::phaseName(FluidSystem::phase1Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase0Idx); },"mob_"+ FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase1Idx); },"mob_"+ FluidSystem::phaseName(FluidSystem::phase1Idx)); - - vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/2p1c/iofields.hh b/dumux/porousmediumflow/2p1c/iofields.hh new file mode 100644 index 0000000000000000000000000000000000000000..7b43bac9c8719c4745f98831b1ac29fe9051efdb --- /dev/null +++ b/dumux/porousmediumflow/2p1c/iofields.hh @@ -0,0 +1,77 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup TwoPOneCModel + * \copydoc Dumux::TwoPOneCIOFields + */ +#ifndef DUMUX_TWOP_ONEC_IO_FIELDS_HH +#define DUMUX_TWOP_ONEC_IO_FIELDS_HH + +#include <dumux/porousmediumflow/2p/iofields.hh> +#include <dumux/io/name.hh> + +namespace Dumux { + +/*! + * \ingroup TwoPOneCModel + * \brief Adds I/O fields specific to two-phase one-component model. + */ +class TwoPOneCIOFields +{ +public: + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + // use default fields from the 2p model + TwoPIOFields::initOutputModule(out); + + // output additional to TwoP output: + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, + IOName::phasePresence()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state) + { + using Indices = typename ModelTraits::Indices; + + if (ModelTraits::priVarFormulation() == TwoPFormulation::p0s1) + return (pvIdx == 0) ? IOName::pressure<FluidSystem>(FluidSystem::phase0Idx) : + (state == Indices::twoPhases) + ? IOName::saturation<FluidSystem>(FluidSystem::phase1Idx) + : IOName::temperature(); + else + return (pvIdx == 0) ? IOName::pressure<FluidSystem>(FluidSystem::phase1Idx) : + (state == Indices::twoPhases) + ? IOName::saturation<FluidSystem>(FluidSystem::phase0Idx) + : IOName::temperature(); + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/2p1c/model.hh b/dumux/porousmediumflow/2p1c/model.hh index 08f618c27e0c1e262e07b14fd6d4c174c87a4fbd..1d3a3990e9710831622b3ff85004c9066b53a4e9 100644 --- a/dumux/porousmediumflow/2p1c/model.hh +++ b/dumux/porousmediumflow/2p1c/model.hh @@ -69,10 +69,10 @@ #include <dumux/porousmediumflow/compositional/switchableprimaryvariables.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include "darcyslaw.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "localresidual.hh" #include "indices.hh" #include "volumevariables.hh" @@ -217,7 +217,7 @@ SET_TYPE_PROP(TwoPOneCNI, ThermalConductivityModel, ThermalConductivitySomerton< SET_TYPE_PROP(TwoPOneCNI, ModelTraits, TwoPOneCNIModelTraits<GET_PROP_VALUE(TypeTag, Formulation)>); //! The non-isothermal vtk output fields. -SET_TYPE_PROP(TwoPOneCNI, VtkOutputFields, EnergyVtkOutputFields<TwoPOneCVtkOutputFields>); +SET_TYPE_PROP(TwoPOneCNI, IOFields, EnergyIOFields<TwoPOneCIOFields>); } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/2p1c/vtkoutputfields.hh b/dumux/porousmediumflow/2p1c/vtkoutputfields.hh deleted file mode 100644 index 2cd6ee93b9c70b7ace01e6ab9f9533642de3c535..0000000000000000000000000000000000000000 --- a/dumux/porousmediumflow/2p1c/vtkoutputfields.hh +++ /dev/null @@ -1,51 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program 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. * - * * - * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup TwoPOneCModel - * \copydoc Dumux::TwoPOneCVtkOutputFields - */ -#ifndef DUMUX_TWOP_ONEC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TWOP_ONEC_VTK_OUTPUT_FIELDS_HH - -#include <dumux/porousmediumflow/2p/vtkoutputfields.hh> - -namespace Dumux { - -/*! - * \ingroup TwoPOneCModel - * \brief Adds vtk output fields specific to two-phase one-component model. - */ -class TwoPOneCVtkOutputFields -{ -public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - // use default fields from the 2p model - TwoPVtkOutputFields::init(vtk); - - // output additional to TwoP output: - vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/2p2c/model.hh b/dumux/porousmediumflow/2p2c/model.hh index 08f9138bb8938e1cfad8fe891faee943ee211fb2..b99b2a7e669c10d8f56e7d03468f4b5f5167b97b 100644 --- a/dumux/porousmediumflow/2p2c/model.hh +++ b/dumux/porousmediumflow/2p2c/model.hh @@ -85,7 +85,7 @@ #include <dumux/porousmediumflow/2pnc/model.hh> #include <dumux/porousmediumflow/2p/formulation.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include <dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh> #include "volumevariables.hh" @@ -141,7 +141,7 @@ NEW_TYPE_TAG(TwoPTwoCNI, INHERITS_FROM(TwoPTwoC)); /*! * \brief Set the model traits property. */ -SET_PROP(TwoPTwoC, ModelTraits) +SET_PROP(TwoPTwoC, BaseModelTraits) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); @@ -153,6 +153,7 @@ public: GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx) >; }; +SET_TYPE_PROP(TwoPTwoC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //! Use the 2p2c VolumeVariables SET_PROP(TwoPTwoC, VolumeVariables) @@ -187,19 +188,13 @@ SET_BOOL_PROP(TwoPTwoC, UseConstraintSolver, true); SET_PROP(TwoPTwoCNI, ModelTraits) { private: - //! we use the number of components specified by the fluid system here - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - static_assert(FluidSystem::numComponents == 2, "Only fluid systems with 2 components are supported by the 2p2c model!"); - static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 phases are supported by the 2p2c model!"); - using IsothermalTraits = TwoPTwoCModelTraits<GET_PROP_VALUE(TypeTag, Formulation), - GET_PROP_VALUE(TypeTag, UseMoles), - GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; //! Set non-isothermal output fields -SET_TYPE_PROP(TwoPTwoCNI, VtkOutputFields, EnergyVtkOutputFields<TwoPNCVtkOutputFields>); +SET_TYPE_PROP(TwoPTwoCNI, IOFields, EnergyIOFields<TwoPNCIOFields>); //! Somerton is used as default model to compute the effective thermal heat conductivity SET_TYPE_PROP(TwoPTwoCNI, ThermalConductivityModel, ThermalConductivitySomerton<typename GET_PROP_TYPE(TypeTag, Scalar)>); diff --git a/dumux/porousmediumflow/2pnc/iofields.hh b/dumux/porousmediumflow/2pnc/iofields.hh new file mode 100644 index 0000000000000000000000000000000000000000..aee9f5cc2334f14c72f55983f8e233c9d314ac4e --- /dev/null +++ b/dumux/porousmediumflow/2pnc/iofields.hh @@ -0,0 +1,124 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup TwoPNCModel + * \brief Adds I/O fields specific to the twop-nc model + */ +#ifndef DUMUX_TWOP_NC_IO_FIELDS_HH +#define DUMUX_TWOP_NC_IO_FIELDS_HH + +#include <dumux/porousmediumflow/2p/iofields.hh> +#include <dumux/io/name.hh> + +namespace Dumux +{ + +/*! + * \ingroup TwoPNCModel + * \brief Adds I/O fields specific to the TwoPNC model + */ +class TwoPNCIOFields +{ +public: + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FluidSystem = typename VolumeVariables::FluidSystem; + + // use default fields from the 2p model + TwoPIOFields::initOutputModule(out); + + // output additional to TwoP output: + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + { + for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + { + out.addVolumeVariable([phaseIdx,compIdx](const auto& v){ return v.moleFraction(phaseIdx,compIdx); }, + IOName::moleFraction<FluidSystem>(phaseIdx, compIdx)); + if (VolumeVariables::numComponents() < 3) + out.addVolumeVariable([phaseIdx,compIdx](const auto& v){ return v.massFraction(phaseIdx,compIdx); }, + IOName::massFraction<FluidSystem>(phaseIdx, compIdx)); + } + + out.addVolumeVariable([phaseIdx](const auto& v){ return v.molarDensity(phaseIdx); }, + IOName::molarDensity<FluidSystem>(phaseIdx)); + } + + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, + IOName::phasePresence()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state) + { + using Indices = typename ModelTraits::Indices; + static constexpr auto numStates = 3; + using StringVec = std::array<std::string, numStates>; + + int idxSecComps; + if (state == Indices::firstPhaseOnly + || (state == Indices::bothPhases && ModelTraits::setMoleFractionsForFirstPhase())) + idxSecComps = FluidSystem::phase0Idx; + else + idxSecComps = FluidSystem::phase1Idx; + + if (pvIdx > 1) + return ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(idxSecComps, pvIdx) + : IOName::massFraction<FluidSystem>(idxSecComps, pvIdx); + + static const StringVec p0s1SwitchedPvNames = { + ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(FluidSystem::phase0Idx, FluidSystem::comp1Idx) + : IOName::massFraction<FluidSystem>(FluidSystem::phase0Idx, FluidSystem::comp1Idx), + ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(FluidSystem::phase1Idx, FluidSystem::comp0Idx) + : IOName::massFraction<FluidSystem>(FluidSystem::phase1Idx, FluidSystem::comp0Idx), + IOName::saturation<FluidSystem>(FluidSystem::phase1Idx)}; + + static const StringVec p1s0SwitchedPvNames = { + ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(FluidSystem::phase0Idx, FluidSystem::comp1Idx) + : IOName::massFraction<FluidSystem>(FluidSystem::phase0Idx, FluidSystem::comp1Idx), + ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(FluidSystem::phase1Idx, FluidSystem::comp0Idx) + : IOName::massFraction<FluidSystem>(FluidSystem::phase1Idx, FluidSystem::comp0Idx), + IOName::saturation<FluidSystem>(FluidSystem::phase0Idx)}; + + switch (ModelTraits::priVarFormulation()) + { + case TwoPFormulation::p0s1: + return pvIdx == 0 ? IOName::pressure<FluidSystem>(FluidSystem::phase0Idx) + : p0s1SwitchedPvNames[state-1]; + case TwoPFormulation::p1s0: + return pvIdx == 0 ? IOName::pressure<FluidSystem>(FluidSystem::phase1Idx) + : p1s0SwitchedPvNames[state-1]; + default: DUNE_THROW(Dune::InvalidStateException, "Invalid formulation "); + } + } +}; + + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh index 120d821ef8f6b880edba650592c7f20b2352a3df..7deeeefc331ef52fc712920afcd7ad44e67dbe66 100644 --- a/dumux/porousmediumflow/2pnc/model.hh +++ b/dumux/porousmediumflow/2pnc/model.hh @@ -98,12 +98,12 @@ #include <dumux/porousmediumflow/compositional/switchableprimaryvariables.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include <dumux/porousmediumflow/2p/formulation.hh> #include "volumevariables.hh" #include "primaryvariableswitch.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "indices.hh" namespace Dumux { @@ -153,19 +153,19 @@ struct TwoPNCModelTraits const std::vector<std::string> p0s1SwitchedPvNames = { xString + "^" + FluidSystem::componentName(FluidSystem::comp1Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase0Idx), xString + "^" + FluidSystem::componentName(FluidSystem::comp0Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase1Idx), - "S_" + FluidSystem::phaseName(FluidSystem::phase1Idx)}; + IOName::saturation<FluidSystem>(FluidSystem::phase1Idx)}; const std::vector<std::string> p1s0SwitchedPvNames = { xString + "^" + FluidSystem::componentName(FluidSystem::comp1Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase0Idx), xString + "^" + FluidSystem::componentName(FluidSystem::comp0Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase1Idx), - "S_" + FluidSystem::phaseName(FluidSystem::phase0Idx)}; + IOName::saturation<FluidSystem>(FluidSystem::phase0Idx)}; switch (priVarFormulation()) { case TwoPFormulation::p0s1: - return pvIdx == 0 ? "p_" + FluidSystem::phaseName(FluidSystem::phase0Idx) + return pvIdx == 0 ? IOName::pressure<FluidSystem>(FluidSystem::phase0Idx) : p0s1SwitchedPvNames[state-1]; case TwoPFormulation::p1s0: - return pvIdx == 0 ? "p_" + FluidSystem::phaseName(FluidSystem::phase1Idx) + return pvIdx == 0 ? IOName::pressure<FluidSystem>(FluidSystem::phase1Idx) : p1s0SwitchedPvNames[state-1]; default: DUNE_THROW(Dune::InvalidStateException, "Invalid formulation "); } @@ -194,7 +194,6 @@ struct TwoPNCVolumeVariablesTraits using ModelTraits = MT; }; - namespace Properties { ////////////////////////////////////////////////////////////////// // Type tags @@ -234,8 +233,8 @@ public: using type = TwoPNCVolumeVariables<Traits>; }; -//! Set the model traits -SET_PROP(TwoPNC, ModelTraits) +//! Set the base model traits +SET_PROP(TwoPNC, BaseModelTraits) { private: //! we use the number of components specified by the fluid system here @@ -247,9 +246,10 @@ public: GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase), GET_PROP_VALUE(TypeTag, Formulation), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; }; +SET_TYPE_PROP(TwoPNC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //!< default the actually used traits to the base traits //! Set the vtk output fields specific to this model -SET_TYPE_PROP(TwoPNC, VtkOutputFields, TwoPNCVtkOutputFields); +SET_TYPE_PROP(TwoPNC, IOFields, TwoPNCIOFields); SET_TYPE_PROP(TwoPNC, LocalResidual, CompositionalLocalResidual<TypeTag>); //!< Use the compositional local residual @@ -283,19 +283,13 @@ public: SET_PROP(TwoPNCNI, ModelTraits) { private: - //! we use the number of components specified by the fluid system here - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!"); - using IsothermalTraits = TwoPNCModelTraits<FluidSystem::numComponents, - GET_PROP_VALUE(TypeTag, UseMoles), - GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase), - GET_PROP_VALUE(TypeTag, Formulation), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; //! Set non-isothermal output fields -SET_TYPE_PROP(TwoPNCNI, VtkOutputFields, EnergyVtkOutputFields<TwoPNCVtkOutputFields>); +SET_TYPE_PROP(TwoPNCNI, IOFields, EnergyIOFields<TwoPNCIOFields>); //! Somerton is used as default model to compute the effective thermal heat conductivity SET_PROP(TwoPNCNI, ThermalConductivityModel) diff --git a/dumux/porousmediumflow/2pnc/vtkoutputfields.hh b/dumux/porousmediumflow/2pnc/vtkoutputfields.hh deleted file mode 100644 index cf006918463457623ba8b0e896390cdff9aeca0e..0000000000000000000000000000000000000000 --- a/dumux/porousmediumflow/2pnc/vtkoutputfields.hh +++ /dev/null @@ -1,72 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program 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. * - * * - * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup TwoPNCModel - * \brief Adds vtk output fields specific to the twop-nc model - */ -#ifndef DUMUX_TWOP_NC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TWOP_NC_VTK_OUTPUT_FIELDS_HH - -#include <dumux/porousmediumflow/2p/vtkoutputfields.hh> - -namespace Dumux -{ - -/*! - * \ingroup TwoPNCModel - * \brief Adds vtk output fields specific to the TwoPNC model - */ -class TwoPNCVtkOutputFields -{ -public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - // use default fields from the 2p model - TwoPVtkOutputFields::init(vtk); - - //output additional to TwoP output: - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, - "x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - vtk.addVolumeVariable([i](const auto& v){ return v.molarDensity(i); }, - "rhoMolar_" + FluidSystem::phaseName(i)); - - if (VolumeVariables::numComponents() < 3){ - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); }, - "X^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - } - - vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); - } -}; - - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/2pncmin/model.hh b/dumux/porousmediumflow/2pncmin/model.hh index bf6797ee2351ea06a26ba40f2452777b2471327c..ebb7782c09cc693a79a8a0842f25ab7adfade8ed 100644 --- a/dumux/porousmediumflow/2pncmin/model.hh +++ b/dumux/porousmediumflow/2pncmin/model.hh @@ -100,10 +100,10 @@ #include <dumux/porousmediumflow/mineralization/model.hh> #include <dumux/porousmediumflow/mineralization/localresidual.hh> #include <dumux/porousmediumflow/mineralization/volumevariables.hh> -#include <dumux/porousmediumflow/mineralization/vtkoutputfields.hh> +#include <dumux/porousmediumflow/mineralization/iofields.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> namespace Dumux { namespace Properties { @@ -139,20 +139,14 @@ public: }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(TwoPNCMin, VtkOutputFields, MineralizationVtkOutputFields<TwoPNCVtkOutputFields>); +SET_TYPE_PROP(TwoPNCMin, IOFields, MineralizationIOFields<TwoPNCIOFields>); //! The 2pnc model traits define the non-mineralization part SET_PROP(TwoPNCMin, ModelTraits) { private: - //! we use the number of components specified by the fluid system here - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!"); using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using NonMineralizationTraits = TwoPNCModelTraits<FluidSystem::numComponents, - GET_PROP_VALUE(TypeTag, UseMoles), - GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase), - GET_PROP_VALUE(TypeTag, Formulation), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + using NonMineralizationTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = MineralizationModelTraits<NonMineralizationTraits, SolidSystem::numComponents, SolidSystem::numInertComponents>; }; @@ -175,14 +169,8 @@ public: SET_PROP(TwoPNCMinNI, ModelTraits) { private: - //! we use the number of components specified by the fluid system here - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - static_assert(FluidSystem::numPhases == 2, "Only fluid systems with 2 fluid phases are supported by the 2p-nc model!"); using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); - using TwoPNCTraits = TwoPNCModelTraits<FluidSystem::numComponents, - GET_PROP_VALUE(TypeTag, UseMoles), - GET_PROP_VALUE(TypeTag, SetMoleFractionsForFirstPhase), - GET_PROP_VALUE(TypeTag, Formulation), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + using TwoPNCTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); using IsothermalTraits = MineralizationModelTraits<TwoPNCTraits, SolidSystem::numComponents, SolidSystem::numInertComponents>; public: // the mineralization traits, based on 2pnc traits, are the isothermal traits @@ -190,7 +178,11 @@ public: }; //! non-isothermal vtkoutput -SET_TYPE_PROP(TwoPNCMinNI, VtkOutputFields, EnergyVtkOutputFields<MineralizationVtkOutputFields<TwoPNCVtkOutputFields>>); +SET_PROP(TwoPNCMinNI, IOFields) +{ + using MineralizationIOF = MineralizationIOFields<TwoPNCIOFields>; + using type = EnergyIOFields<MineralizationIOF>; +}; } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/3p/iofields.hh b/dumux/porousmediumflow/3p/iofields.hh new file mode 100644 index 0000000000000000000000000000000000000000..3b8138622a194e5078670d48ba4bdf56862c9ae2 --- /dev/null +++ b/dumux/porousmediumflow/3p/iofields.hh @@ -0,0 +1,82 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup ThreePModel + * \brief Adds I/O fields specific to the three-phase model + */ +#ifndef DUMUX_THREEP_IO_FIELDS_HH +#define DUMUX_THREEP_IO_FIELDS_HH + +#include <dumux/io/name.hh> + +namespace Dumux { + +/*! + * \ingroup ThreePModel + * \brief Adds I/O fields specific to the three-phase model + */ +class ThreePIOFields +{ +public: + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FluidSystem = typename VolumeVariables::FluidSystem; + + // register standardized output fields + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + { + out.addVolumeVariable([phaseIdx](const auto& v){ return v.saturation(phaseIdx); }, + IOName::saturation<FluidSystem>(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.pressure(phaseIdx); }, + IOName::pressure<FluidSystem>(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.density(phaseIdx); }, + IOName::density<FluidSystem>(phaseIdx)); + } + + out.addVolumeVariable( [](const auto& v){ return v.porosity(); }, + IOName::porosity()); + out.addVolumeVariable( [](const auto& v){ return v.permeability(); }, + IOName::permeability()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state = 0) + { + switch (pvIdx) + { + case 0: return IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx); + case 1: return IOName::saturation<FluidSystem>(FluidSystem::wPhaseIdx); + default: return IOName::saturation<FluidSystem>(FluidSystem::nPhaseIdx); + } + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/3p/model.hh b/dumux/porousmediumflow/3p/model.hh index 2156f7b7db6385f51d54835167ce31a1cefac36d..bd6b39126d2de1fe0de07f2818c3e44ce2fc88b6 100644 --- a/dumux/porousmediumflow/3p/model.hh +++ b/dumux/porousmediumflow/3p/model.hh @@ -66,11 +66,11 @@ #include <dumux/porousmediumflow/immiscible/localresidual.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -186,14 +186,7 @@ public: }; //! Set the vtk output fields specific to this model -SET_PROP(ThreeP, VtkOutputFields) -{ -private: - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - -public: - using type = ThreePVtkOutputFields; -}; +SET_TYPE_PROP(ThreeP, IOFields, ThreePIOFields); ///////////////////////////////////////////////// // Properties for the non-isothermal 3p model @@ -209,14 +202,7 @@ public: }; //! Set non-isothermal output fields -SET_PROP(ThreePNI, VtkOutputFields) -{ -private: - using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using IsothermalFields = ThreePVtkOutputFields; -public: - using type = EnergyVtkOutputFields<IsothermalFields>; -}; +SET_TYPE_PROP(ThreePNI, IOFields, EnergyIOFields<ThreePIOFields>); //! Set non-isothermal model traits SET_PROP(ThreePNI, ModelTraits) diff --git a/dumux/porousmediumflow/3p/vtkoutputfields.hh b/dumux/porousmediumflow/3p/vtkoutputfields.hh deleted file mode 100644 index 11c78810d6e3e3578422efae8672291379461b3e..0000000000000000000000000000000000000000 --- a/dumux/porousmediumflow/3p/vtkoutputfields.hh +++ /dev/null @@ -1,57 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program 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. * - * * - * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup ThreePModel - * \brief Adds vtk output fields specific to the three-phase model - */ -#ifndef DUMUX_THREEP_VTK_OUTPUT_FIELDS_HH -#define DUMUX_THREEP_VTK_OUTPUT_FIELDS_HH - -namespace Dumux { - -/*! - * \ingroup ThreePModel - * \brief Adds vtk output fields specific to the three-phase model - */ -class ThreePVtkOutputFields -{ -public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - // register standardized vtk output fields - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - { - vtk.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); - } - - vtk.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); - vtk.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/3p3c/iofields.hh b/dumux/porousmediumflow/3p3c/iofields.hh new file mode 100644 index 0000000000000000000000000000000000000000..9b24517a1ec7284f017dbf1e03070f7649bdaf9c --- /dev/null +++ b/dumux/porousmediumflow/3p3c/iofields.hh @@ -0,0 +1,131 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup ThreePThreeCModel + * \brief Adds I/O fields specific to the three-phase three-component model + */ +#ifndef DUMUX_THREEPTHREEC_IO_FIELDS_HH +#define DUMUX_THREEPTHREEC_IO_FIELDS_HH + +#include <dumux/io/name.hh> + +namespace Dumux { + +/*! + * \ingroup ThreePThreeCModel + * \brief Adds I/O fields specific to the three-phase three-component model + */ +class ThreePThreeCIOFields +{ +public: + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FluidSystem = typename VolumeVariables::FluidSystem; + + // register standardized output fields + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + { + out.addVolumeVariable( [phaseIdx](const auto& v){ return v.saturation(phaseIdx); }, + IOName::saturation<FluidSystem>(phaseIdx)); + out.addVolumeVariable( [phaseIdx](const auto& v){ return v.pressure(phaseIdx); }, + IOName::pressure<FluidSystem>(phaseIdx)); + out.addVolumeVariable( [phaseIdx](const auto& v){ return v.density(phaseIdx); }, + IOName::density<FluidSystem>(phaseIdx)); + + for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + out.addVolumeVariable([phaseIdx, compIdx](const auto& v){ return v.moleFraction(phaseIdx, compIdx); }, + IOName::moleFraction<FluidSystem>(phaseIdx, compIdx)); + } + + out.addVolumeVariable( [](const auto& v){ return v.porosity(); }, + IOName::porosity()); + out.addVolumeVariable( [](const auto& v){ return v.priVars().state(); }, + IOName::phasePresence()); + out.addVolumeVariable( [](const auto& v){ return v.permeability(); }, + IOName::permeability()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state) + { + using Indices = typename ModelTraits::Indices; + static constexpr auto numEq = ModelTraits::numEq(); + using StringVec = std::array<std::string, numEq>; + + switch (state) + { + case Indices::threePhases: + { + static const StringVec s1 = {IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx), + IOName::saturation<FluidSystem>(FluidSystem::wPhaseIdx), + IOName::saturation<FluidSystem>(FluidSystem::nPhaseIdx)}; + return s1[pvIdx]; + } + case Indices::wPhaseOnly: + { + static const StringVec s2 = {IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx), + IOName::moleFraction<FluidSystem>(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx), + IOName::moleFraction<FluidSystem>(FluidSystem::wPhaseIdx, FluidSystem::nCompIdx)}; + return s2[pvIdx]; + } + case Indices::gnPhaseOnly: + { + static const StringVec s3 = {IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx), + IOName::moleFraction<FluidSystem>(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx), + IOName::saturation<FluidSystem>(FluidSystem::nPhaseIdx)}; + return s3[pvIdx]; + } + case Indices::wnPhaseOnly: + { + static const StringVec s4 = {IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx), + IOName::moleFraction<FluidSystem>(FluidSystem::wPhaseIdx, FluidSystem::gCompIdx), + IOName::saturation<FluidSystem>(FluidSystem::nPhaseIdx)}; + return s4[pvIdx]; + } + case Indices::gPhaseOnly: + { + static const StringVec s5 = {IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx), + IOName::moleFraction<FluidSystem>(FluidSystem::gPhaseIdx, FluidSystem::wCompIdx), + IOName::moleFraction<FluidSystem>(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; + return s5[pvIdx]; + } + case Indices::wgPhaseOnly: + { + static const StringVec s6 = {IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx), + IOName::saturation<FluidSystem>(FluidSystem::wPhaseIdx), + IOName::moleFraction<FluidSystem>(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; + return s6[pvIdx]; + } + } + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/3p3c/model.hh b/dumux/porousmediumflow/3p3c/model.hh index 9d5cd0172af1ff26b8210ecc122d30351856ff09..be5d31c1751bf8a36f5be7a606788d0357ad13d2 100644 --- a/dumux/porousmediumflow/3p3c/model.hh +++ b/dumux/porousmediumflow/3p3c/model.hh @@ -84,7 +84,7 @@ #include <dumux/porousmediumflow/properties.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include <dumux/material/spatialparams/fv.hh> #include <dumux/material/fluidstates/compositional.hh> @@ -95,7 +95,7 @@ #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "primaryvariableswitch.hh" #include "localresidual.hh" @@ -206,7 +206,7 @@ NEW_TYPE_TAG(ThreePThreeCNI, INHERITS_FROM(ThreePThreeC)); ////////////////////////////////////////////////////////////////// //! Set the model traits -SET_PROP(ThreePThreeC, ModelTraits) +SET_PROP(ThreePThreeC, BaseModelTraits) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); @@ -215,6 +215,7 @@ private: public: using type = ThreePThreeCModelTraits<GET_PROP_VALUE(TypeTag, UseConstraintSolver), GET_PROP_VALUE(TypeTag, UseMoles)>; }; +SET_TYPE_PROP(ThreePThreeC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //! Determines whether a constraint solver should be used explicitly SET_BOOL_PROP(ThreePThreeC, UseConstraintSolver, false); @@ -272,7 +273,7 @@ public: SET_TYPE_PROP(ThreePThreeC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>); //! Set the vtk output fields specific to this model -SET_TYPE_PROP(ThreePThreeC, VtkOutputFields, ThreePThreeCVtkOutputFields); +SET_TYPE_PROP(ThreePThreeC, IOFields, ThreePThreeCIOFields); //! Use mole fractions in the balance equations by default SET_BOOL_PROP(ThreePThreeC, UseMoles, true); @@ -288,16 +289,13 @@ SET_TYPE_PROP(ThreePThreeCNI, ThermalConductivityModel, ThermalConductivitySomer SET_PROP(ThreePThreeCNI, ModelTraits) { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - static_assert(FluidSystem::numComponents == 3, "Only fluid systems with 3 components are supported by the 3p3c model!"); - static_assert(FluidSystem::numPhases == 3, "Only fluid systems with 3 phases are supported by the 3p3c model!"); - using IsothermalModelTraits = ThreePThreeCModelTraits<GET_PROP_VALUE(TypeTag, UseConstraintSolver), GET_PROP_VALUE(TypeTag, UseMoles)>; + using IsothermalModelTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = PorousMediumFlowNIModelTraits<IsothermalModelTraits>; }; //! Set the non-isothermal vktoutputfields -SET_TYPE_PROP(ThreePThreeCNI, VtkOutputFields, EnergyVtkOutputFields<ThreePThreeCVtkOutputFields>); +SET_TYPE_PROP(ThreePThreeCNI, IOFields, EnergyIOFields<ThreePThreeCIOFields>); } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/3p3c/vtkoutputfields.hh b/dumux/porousmediumflow/3p3c/vtkoutputfields.hh deleted file mode 100644 index 23905e4e7264281361b6f618233705f06618f44b..0000000000000000000000000000000000000000 --- a/dumux/porousmediumflow/3p3c/vtkoutputfields.hh +++ /dev/null @@ -1,61 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program 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. * - * * - * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup ThreePThreeCModel - * \brief Adds vtk output fields specific to the three-phase three-component model - */ -#ifndef DUMUX_THREEPTHREEC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_THREEPTHREEC_VTK_OUTPUT_FIELDS_HH - -namespace Dumux { - -/*! - * \ingroup ThreePThreeCModel - * \brief Adds vtk output fields specific to the three-phase three-component model - */ -class ThreePThreeCVtkOutputFields -{ -public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - // register standardized vtk output fields - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - { - vtk.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); - - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - } - - vtk.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); - vtk.addVolumeVariable( [](const auto& v){ return v.priVars().state(); },"phase presence"); - vtk.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/3pwateroil/iofields.hh b/dumux/porousmediumflow/3pwateroil/iofields.hh new file mode 100644 index 0000000000000000000000000000000000000000..1da1f5382e67874293b8be2f05d820e4bf9e3c02 --- /dev/null +++ b/dumux/porousmediumflow/3pwateroil/iofields.hh @@ -0,0 +1,137 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup ThreePWaterOilModel + * \brief Adds I/O fields specific to the twop model + */ +#ifndef DUMUX_3P2CNI_IO_FIELDS_HH +#define DUMUX_3P2CNI_IO_FIELDS_HH + +#include <dumux/io/name.hh> +#include <dumux/porousmediumflow/3p3c/iofields.hh> + +namespace Dumux { + +/*! + * \ingroup ThreePWaterOilModel + * \brief Adds I/O fields specific to the three-phase three-component model + */ +class ThreePWaterOilIOFields +{ + +public: + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FluidSystem = typename VolumeVariables::FluidSystem; + + // register standardized output fields + for (int phaseIdx = 0; phaseIdx < VolumeVariables::numPhases(); ++phaseIdx) + { + out.addVolumeVariable([phaseIdx](const auto& v){ return v.saturation(phaseIdx); }, + IOName::saturation<FluidSystem>(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.pressure(phaseIdx); }, + IOName::pressure<FluidSystem>(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.density(phaseIdx); }, + IOName::density<FluidSystem>(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.mobility(phaseIdx); }, + IOName::mobility<FluidSystem>(phaseIdx)); + out.addVolumeVariable([phaseIdx](const auto& v){ return v.viscosity(phaseIdx); }, + IOName::viscosity<FluidSystem>(phaseIdx)); + + for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + out.addVolumeVariable([phaseIdx, compIdx](const auto& v){ return v.moleFraction(phaseIdx, compIdx); }, + IOName::moleFraction<FluidSystem>(phaseIdx, compIdx)); + } + + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, + IOName::phasePresence()); + out.addVolumeVariable([](const auto& v){ return v.permeability(); }, + IOName::permeability()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state) + { + using Indices = typename ModelTraits::Indices; + static constexpr auto numEq = ModelTraits::numEq(); + using StringVec = std::array<std::string, numEq>; + + switch (state) + { + case Indices::threePhases: + { + static const StringVec s1 = {IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx), + IOName::saturation<FluidSystem>(FluidSystem::wPhaseIdx), + IOName::saturation<FluidSystem>(FluidSystem::nPhaseIdx)}; + return s1[pvIdx]; + } + case Indices::wPhaseOnly: + { + static const StringVec s2 = {IOName::pressure<FluidSystem>(FluidSystem::wPhaseIdx), + IOName::temperature(), + IOName::moleFraction<FluidSystem>(FluidSystem::wPhaseIdx, FluidSystem::nCompIdx)}; + return s2[pvIdx]; + } + case Indices::gnPhaseOnly: + { + static const StringVec s3 = {IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx), + IOName::saturation<FluidSystem>(FluidSystem::nPhaseIdx), + IOName::moleFraction<FluidSystem>(FluidSystem::nPhaseIdx, FluidSystem::wCompIdx)}; + return s3[pvIdx]; + } + case Indices::wnPhaseOnly: + { + static const StringVec s4 = {IOName::pressure<FluidSystem>(FluidSystem::wPhaseIdx), + IOName::temperature(), + IOName::saturation<FluidSystem>(FluidSystem::nPhaseIdx)}; + return s4[pvIdx]; + } + case Indices::gPhaseOnly: + { + static const StringVec s5 = {IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx), + IOName::temperature(), + IOName::moleFraction<FluidSystem>(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; + return s5[pvIdx]; + } + case Indices::wgPhaseOnly: + { + static const StringVec s6 = {IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx), + IOName::saturation<FluidSystem>(FluidSystem::wPhaseIdx), + IOName::moleFraction<FluidSystem>(FluidSystem::gPhaseIdx, FluidSystem::nCompIdx)}; + return s6[pvIdx]; + } + } + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/3pwateroil/model.hh b/dumux/porousmediumflow/3pwateroil/model.hh index f33abc1f824b85e421e2c81135836f0e4a99716c..ecb22d7d78acca55fd786ac7d6d5c651b28d6613 100644 --- a/dumux/porousmediumflow/3pwateroil/model.hh +++ b/dumux/porousmediumflow/3pwateroil/model.hh @@ -81,7 +81,7 @@ #include <dumux/porousmediumflow/properties.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include <dumux/porousmediumflow/compositional/switchableprimaryvariables.hh> #include "indices.hh" @@ -89,7 +89,7 @@ #include "volumevariables.hh" #include "localresidual.hh" #include "primaryvariableswitch.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -274,7 +274,7 @@ public: }; //! Set the non-isothermal vkt output fields -SET_TYPE_PROP(ThreePWaterOilNI, VtkOutputFields, EnergyVtkOutputFields<ThreePWaterOilVtkOutputFields>); +SET_TYPE_PROP(ThreePWaterOilNI, IOFields, EnergyIOFields<ThreePWaterOilIOFields>); } // end namespace Properties } // end namespace Dumux diff --git a/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh b/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh deleted file mode 100644 index 68129047279e0a77736df292bcb0ce7c742bb857..0000000000000000000000000000000000000000 --- a/dumux/porousmediumflow/3pwateroil/vtkoutputfields.hh +++ /dev/null @@ -1,63 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program 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. * - * * - * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup ThreePWaterOilModel - * \brief Adds vtk output fields specific to the twop model - */ -#ifndef DUMUX_3P2CNI_VTK_OUTPUT_FIELDS_HH -#define DUMUX_3P2CNI_VTK_OUTPUT_FIELDS_HH - -namespace Dumux { - -/*! - * \ingroup ThreePWaterOilModel - * \brief Adds vtk output fields specific to the three-phase three-component model - */ -class ThreePWaterOilVtkOutputFields -{ - -public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - // register standardized vtk output fields - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - { - vtk.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.mobility(i); },"mob_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){return v.viscosity(i); }, "mu_"+FluidSystem::phaseName(i)); - - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - } - vtk.addVolumeVariable( [](const auto& v){ return v.porosity(); },"porosity"); - vtk.addVolumeVariable( [](const auto& v){ return v.priVars().state(); },"phase presence"); - vtk.addVolumeVariable( [](const auto& v){ return v.permeability(); },"permeability"); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/mineralization/vtkoutputfields.hh b/dumux/porousmediumflow/mineralization/iofields.hh similarity index 55% rename from dumux/porousmediumflow/mineralization/vtkoutputfields.hh rename to dumux/porousmediumflow/mineralization/iofields.hh index fc482af544e471b723f8839e8a15f07059ab4806..62124d295b8d040224c81f4c551980331a6ca308 100644 --- a/dumux/porousmediumflow/mineralization/vtkoutputfields.hh +++ b/dumux/porousmediumflow/mineralization/iofields.hh @@ -19,36 +19,57 @@ /*! * \file * \ingroup MineralizationModel - * \brief Adds vtk output fields specific to the models considering + * \brief Adds I/O fields specific to the models considering * mineralization processes. */ -#ifndef DUMUX_MINERALIZATION_VTK_OUTPUT_FIELDS_HH -#define DUMUX_MINERALIZATION_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_MINERALIZATION_IO_FIELDS_HH +#define DUMUX_MINERALIZATION_IO_FIELDS_HH + +#include <dumux/io/name.hh> namespace Dumux { /*! * \ingroup MineralizationModel - * \brief Adds vtk output fields specific to a NCMin model + * \brief Adds I/O fields specific to a NCMin model */ -template<class NonMineralizationVtkOutputFields> -class MineralizationVtkOutputFields +template<class NonMineralizationIOFields> +class MineralizationIOFields { public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - using SolidSystem = typename VtkOutputModule::VolumeVariables::SolidSystem; + using SolidSystem = typename OutputModule::VolumeVariables::SolidSystem; // output of the model without mineralization - NonMineralizationVtkOutputFields::init(vtk); + NonMineralizationIOFields::initOutputModule(out); // additional output for (int i = 0; i < SolidSystem::numComponents - SolidSystem::numInertComponents; ++i) { - vtk.addVolumeVariable([i](const auto& v){ return v.solidVolumeFraction(i); },"precipitateVolumeFraction^"+ SolidSystem::componentName(i)); + out.addVolumeVariable([i](const auto& v){ return v.solidVolumeFraction(i); }, + IOName::solidVolumeFraction<SolidSystem>(i)); } } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem, class SolidSystem> + static std::string primaryVariableName(int pvIdx, int state = 0) + { + static constexpr int nonMinNumEq = ModelTraits::numEq() - ModelTraits::numSolidComps() + ModelTraits::numInertSolidComps(); + + if (pvIdx < nonMinNumEq) + return NonMineralizationIOFields::template primaryVariableName<ModelTraits, FluidSystem, SolidSystem>(pvIdx, state); + else + return IOName::solidVolumeFraction<SolidSystem>(pvIdx - nonMinNumEq); + } }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/mpnc/vtkoutputfields.hh b/dumux/porousmediumflow/mpnc/iofields.hh similarity index 54% rename from dumux/porousmediumflow/mpnc/vtkoutputfields.hh rename to dumux/porousmediumflow/mpnc/iofields.hh index dc81d040cb6b26dec79029f050936996a5776b5f..ee9d59c61a40a7a2cd2a03de779bb0739529cccc 100644 --- a/dumux/porousmediumflow/mpnc/vtkoutputfields.hh +++ b/dumux/porousmediumflow/mpnc/iofields.hh @@ -19,41 +19,58 @@ /*! * \file * \ingroup MPNCModel - * \brief Adds vtk output fields specific to the twop model + * \brief Adds I/O fields specific to the twop model */ -#ifndef DUMUX_MPNC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_MPNC_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_MPNC_IO_FIELDS_HH +#define DUMUX_MPNC_IO_FIELDS_HH + +#include <dumux/io/name.hh> namespace Dumux { /*! * \ingroup MPNCModel - * \brief Adds vtk output fields specific to the twop model + * \brief Adds I/O fields specific to the twop model */ -class MPNCVtkOutputFields +class MPNCIOFields { public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); for (int i = 0; i < VolumeVariables::numPhases(); ++i) { - vtk.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, "S_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, "p_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.density(i); }, "rho_"+ FluidSystem::phaseName(i)); - vtk.addVolumeVariable([i](const auto& v){ return v.mobility(i); },"mob_"+ FluidSystem::phaseName(i)); + out.addVolumeVariable([i](const auto& v){ return v.saturation(i); }, + IOName::saturation<FluidSystem>(i)); + out.addVolumeVariable([i](const auto& v){ return v.pressure(i); }, + IOName::pressure<FluidSystem>(i)); + out.addVolumeVariable([i](const auto& v){ return v.density(i); }, + IOName::density<FluidSystem>(i)); + out.addVolumeVariable([i](const auto& v){ return v.mobility(i); }, + IOName::mobility<FluidSystem>(i)); for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, - "x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); + out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, + IOName::moleFraction<FluidSystem>(i, j)); } + for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([j](const auto& v){ return v.fugacity(j); }, - "fugacity^"+ FluidSystem::componentName(j)); + out.addVolumeVariable([j](const auto& v){ return v.fugacity(j); }, + "fugacity^"+ FluidSystem::componentName(j)); + + + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); } }; diff --git a/dumux/porousmediumflow/mpnc/model.hh b/dumux/porousmediumflow/mpnc/model.hh index 4b49402cdab0ce8be6438c85c4a276b6574054cf..fa459904fb2c471062145b72ed3805c705232775 100644 --- a/dumux/porousmediumflow/mpnc/model.hh +++ b/dumux/porousmediumflow/mpnc/model.hh @@ -108,13 +108,13 @@ #include <dumux/porousmediumflow/compositional/localresidual.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include <dumux/porousmediumflow/nonequilibrium/model.hh> #include <dumux/porousmediumflow/nonequilibrium/volumevariables.hh> #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "localresidual.hh" #include "pressureformulation.hh" @@ -299,7 +299,7 @@ public: }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(MPNC, VtkOutputFields, MPNCVtkOutputFields); +SET_TYPE_PROP(MPNC, IOFields, MPNCIOFields); ///////////////////////////////////////////////// // Properties for the non-isothermal mpnc model @@ -326,7 +326,7 @@ public: SET_TYPE_PROP(MPNCNonequil, EquilibriumLocalResidual, MPNCLocalResidual<TypeTag>); //! Set the vtk output fields specific to this model -SET_TYPE_PROP(MPNCNonequil, EquilibriumVtkOutputFields, MPNCVtkOutputFields); +SET_TYPE_PROP(MPNCNonequil, EquilibriumIOFields, MPNCIOFields); //! For non-equilibrium with mpnc we have to overwrite the model traits again, //! because the mpnc indices depend on the status of the non-equilibrium model traits diff --git a/dumux/porousmediumflow/nonequilibrium/vtkoutputfields.hh b/dumux/porousmediumflow/nonequilibrium/iofields.hh similarity index 64% rename from dumux/porousmediumflow/nonequilibrium/vtkoutputfields.hh rename to dumux/porousmediumflow/nonequilibrium/iofields.hh index 22171798638c3acd1b1fa8716d666912690f9bac..bece5487af87212978d1c8b8951b96f903e2bcf2 100644 --- a/dumux/porousmediumflow/nonequilibrium/vtkoutputfields.hh +++ b/dumux/porousmediumflow/nonequilibrium/iofields.hh @@ -19,37 +19,47 @@ /*! * \file * \ingroup PorousmediumNonEquilibriumModel - * \brief Adds vtk output fields specific to non-isothermal models + * \brief Adds I/O fields specific to non-isothermal models */ #ifndef DUMUX_NONEQUILBRIUM_OUTPUT_FIELDS_HH #define DUMUX_NONEQUILBRIUM_OUTPUT_FIELDS_HH +#include <dumux/io/name.hh> + namespace Dumux { /*! * \ingroup PorousmediumNonEquilibriumModel - * \brief Adds vtk output fields specific to non-isothermal models + * \brief Adds I/O fields specific to non-isothermal models */ -template<class ModelTraits, class EquilibriumVtkOutputFields> -class NonEquilibriumVtkOutputFields +template<class ModelTraits, class EquilibriumIOFields> +class NonEquilibriumIOFields { public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - using FluidSystem = typename VtkOutputModule::VolumeVariables::FluidSystem; + using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem; - EquilibriumVtkOutputFields::init(vtk); + EquilibriumIOFields::initOutputModule(out); for (int i = 0; i < ModelTraits::numEnergyEqFluid(); ++i) - vtk.addVolumeVariable( [i](const auto& v){ return v.temperatureFluid(i); }, "T_" + FluidSystem::phaseName(i) ); - for (int i = 0; i < ModelTraits::numEnergyEqSolid(); ++i) - vtk.addVolumeVariable( [i](const auto& v){ return v.temperatureSolid(); }, "T_s" ); + out.addVolumeVariable([i](const auto& v){ return v.temperatureFluid(i); }, + IOName::fluidTemperature<FluidSystem>(i)); + out.addVolumeVariable([](const auto& v){ return v.temperatureSolid(); }, + IOName::solidTemperature()); for (int i = 0; i < ModelTraits::numPhases(); ++i){ - vtk.addVolumeVariable( [i](const auto& v){ return v.reynoldsNumber(i); }, "reynoldsNumber_" + FluidSystem::phaseName(i) ); - vtk.addVolumeVariable( [i](const auto& v){ return v.nusseltNumber(i); }, "nusseltNumber_" + FluidSystem::phaseName(i) ); - vtk.addVolumeVariable( [i](const auto& v){ return v.prandtlNumber(i); }, "prandtlNumber_" + FluidSystem::phaseName(i) ); + out.addVolumeVariable( [i](const auto& v){ return v.reynoldsNumber(i); }, "reynoldsNumber_" + FluidSystem::phaseName(i) ); + out.addVolumeVariable( [i](const auto& v){ return v.nusseltNumber(i); }, "nusseltNumber_" + FluidSystem::phaseName(i) ); + out.addVolumeVariable( [i](const auto& v){ return v.prandtlNumber(i); }, "prandtlNumber_" + FluidSystem::phaseName(i) ); } } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } }; } // end namespace Dumux diff --git a/dumux/porousmediumflow/nonequilibrium/model.hh b/dumux/porousmediumflow/nonequilibrium/model.hh index b4ba31ed5bf5f81c9dc95299236e9f88b8294da5..f4a5b56aa1a3a145976bc27e8bc636cc948a4c8f 100644 --- a/dumux/porousmediumflow/nonequilibrium/model.hh +++ b/dumux/porousmediumflow/nonequilibrium/model.hh @@ -38,7 +38,7 @@ #include "localresidual.hh" #include "indices.hh" #include "gridvariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" /*! * \ingroup \ingroup PorousmediumNonEquilibriumModel @@ -132,13 +132,13 @@ public: SET_TYPE_PROP(NonEquilibrium, GridVariables, NonEquilibriumGridVariables<TypeTag>); //! indices for non-isothermal models -SET_PROP(NonEquilibrium, VtkOutputFields) +SET_PROP(NonEquilibrium, IOFields) { private: - using EquilibriumVtkOutputFields = typename GET_PROP_TYPE(TypeTag, EquilibriumVtkOutputFields); + using EquilibriumIOFields = typename GET_PROP_TYPE(TypeTag, EquilibriumIOFields); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); public: - using type = NonEquilibriumVtkOutputFields<ModelTraits, EquilibriumVtkOutputFields>; + using type = NonEquilibriumIOFields<ModelTraits, EquilibriumIOFields>; }; SET_PROP(NonEquilibrium, NusseltFormulation) diff --git a/dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh b/dumux/porousmediumflow/nonisothermal/iofields.hh similarity index 58% rename from dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh rename to dumux/porousmediumflow/nonisothermal/iofields.hh index d5c0e6c0b490cb27bd4ae887e28dd8598cf9e397..ed979301a3b4a2a2c31780ff5abcca724d54c68e 100644 --- a/dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh +++ b/dumux/porousmediumflow/nonisothermal/iofields.hh @@ -19,27 +19,48 @@ /*! * \file * \ingroup NIModel - * \brief Adds vtk output fields specific to non-isothermal models + * \brief Adds I/O fields specific to non-isothermal models */ #ifndef DUMUX_ENERGY_OUTPUT_FIELDS_HH #define DUMUX_ENERGY_OUTPUT_FIELDS_HH +#include <dumux/io/name.hh> + namespace Dumux { /*! * \ingroup NIModel - * \brief Adds vtk output fields specific to non-isothermal models + * \brief Adds I/O fields specific to non-isothermal models */ -template<class IsothermalVtkOutputFields> -class EnergyVtkOutputFields +template<class IsothermalIOFields> +class EnergyIOFields { public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + IsothermalIOFields::initOutputModule(out); + out.addVolumeVariable( [](const auto& v){ return v.temperature(); }, + IOName::temperature()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - IsothermalVtkOutputFields::init(vtk); - vtk.addVolumeVariable( [](const auto& v){ return v.temperature(); }, "T"); + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem = void, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state = 0) + { + using IsothermalTraits = typename ModelTraits::IsothermalTraits; + + if (pvIdx < ModelTraits::numEq() - 1) + return IsothermalIOFields::template primaryVariableName<IsothermalTraits, FluidSystem, SolidSystem>(pvIdx, state); + else + return IOName::temperature(); } }; diff --git a/dumux/porousmediumflow/nonisothermal/model.hh b/dumux/porousmediumflow/nonisothermal/model.hh index edf37038bede13644d596d6fbab1149309817b83..12d5cfdf0e995111b803c170773acf684aea44cf 100644 --- a/dumux/porousmediumflow/nonisothermal/model.hh +++ b/dumux/porousmediumflow/nonisothermal/model.hh @@ -63,9 +63,12 @@ namespace Dumux { * flow models based on the specifics of a given isothermal model. * \tparam IsothermalTraits Model traits of the isothermal model */ -template<class IsothermalTraits> -struct PorousMediumFlowNIModelTraits : public IsothermalTraits +template<class IsothermalT> +struct PorousMediumFlowNIModelTraits : public IsothermalT { + //! Export the isothermal model traits + using IsothermalTraits = IsothermalT; + //! We solve for one more equation, i.e. the energy balance static constexpr int numEq() { return IsothermalTraits::numEq()+1; } //! only one energy equation is needed when assuming thermal equilibrium diff --git a/dumux/porousmediumflow/richards/iofields.hh b/dumux/porousmediumflow/richards/iofields.hh new file mode 100644 index 0000000000000000000000000000000000000000..c2df1959b14f81f36acd6793bddc8c517160e1b1 --- /dev/null +++ b/dumux/porousmediumflow/richards/iofields.hh @@ -0,0 +1,102 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup RichardsModel + * \brief Adds I/O fields specific to the Richards model. + */ +#ifndef DUMUX_RICHARDS_IO_FIELDS_HH +#define DUMUX_RICHARDS_IO_FIELDS_HH + +#include <dumux/common/parameters.hh> +#include <dumux/io/name.hh> + +namespace Dumux { + +/*! + * \ingroup RichardsModel + * \brief Adds I/O fields specific to the Richards model. + */ +template <bool enableWaterDiffusionInAir> +class RichardsIOFields +{ +public: + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FS = typename VolumeVariables::FluidSystem; + + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::liquidPhaseIdx); }, + IOName::saturation<FS>(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::gasPhaseIdx); }, + IOName::saturation<FS>(FS::gasPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::liquidPhaseIdx); }, + IOName::pressure<FS>(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::gasPhaseIdx); }, + IOName::pressure<FS>(FS::gasPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, + IOName::capillaryPressure()); + out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); }, + IOName::density<FS>(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); }, + IOName::mobility<FS>(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.relativePermeability(FS::liquidPhaseIdx); }, + IOName::relativePermeability<FS>(FS::liquidPhaseIdx)); + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); + + static const bool gravity = getParamFromGroup<bool>(out.paramGroup(), "Problem.EnableGravity"); + + if(gravity) + out.addVolumeVariable([](const auto& v){ return v.pressureHead(FS::liquidPhaseIdx); }, + IOName::pressureHead()); + if (enableWaterDiffusionInAir) + out.addVolumeVariable([](const auto& v){ return v.moleFraction(FS::gasPhaseIdx, FS::liquidCompIdx); }, + IOName::moleFraction<FS>(FS::gasPhaseIdx, FS::liquidCompIdx)); + out.addVolumeVariable([](const auto& v){ return v.waterContent(FS::liquidPhaseIdx); }, + IOName::waterContent()); + + out.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, + IOName::phasePresence()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template<class ModelTraits, class FluidSystem, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state) + { + using Indices = typename ModelTraits::Indices; + + if (state == Indices::gasPhaseOnly) + return IOName::moleFraction<FluidSystem>(FluidSystem::gasPhaseIdx, + FluidSystem::liquidCompIdx); + else + return IOName::pressure<FluidSystem>(FluidSystem::liquidPhaseIdx); + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/richards/model.hh b/dumux/porousmediumflow/richards/model.hh index 99321fbda570a2ea1770bc72d3a4801b6717d30b..992be84a6f76722e04589844cf94af17c3111498 100644 --- a/dumux/porousmediumflow/richards/model.hh +++ b/dumux/porousmediumflow/richards/model.hh @@ -107,11 +107,11 @@ #include <dumux/porousmediumflow/properties.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "localresidual.hh" #include "primaryvariableswitch.hh" @@ -143,7 +143,7 @@ struct RichardsModelTraits return "x^" + FluidSystem::componentName(FluidSystem::comp0Idx) + "_" + FluidSystem::phaseName(FluidSystem::phase1Idx); else - return "p_" + FluidSystem::phaseName(FluidSystem::phase0Idx); + return IOName::pressure<FluidSystem>(FluidSystem::phase0Idx); } }; @@ -191,14 +191,14 @@ NEW_TYPE_TAG(RichardsNI, INHERITS_FROM(Richards)); SET_TYPE_PROP(Richards, LocalResidual, RichardsLocalResidual<TypeTag>); //! Set the vtk output fields specific to this model -SET_PROP(Richards, VtkOutputFields) +SET_PROP(Richards, IOFields) { private: - static constexpr bool enableWaterDiffusionInAir + static constexpr bool enableWaterDiffusionInAir = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); public: - using type = RichardsVtkOutputFields<enableWaterDiffusionInAir>; + using type = RichardsIOFields<enableWaterDiffusionInAir>; }; //! The model traits @@ -296,13 +296,12 @@ public: }; //! Set the vtk output fields specific to th non-isothermal model -SET_PROP(RichardsNI, VtkOutputFields) +SET_PROP(RichardsNI, IOFields) { -private: - static constexpr bool enableWaterDiffusionInAir = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); - using IsothermalFields = RichardsVtkOutputFields<enableWaterDiffusionInAir>; -public: - using type = EnergyVtkOutputFields<IsothermalFields>; + static constexpr bool enableWaterDiffusionInAir + = GET_PROP_VALUE(TypeTag, EnableWaterDiffusionInAir); + using RichardsIOF = RichardsIOFields<enableWaterDiffusionInAir>; + using type = EnergyIOFields<RichardsIOF>; }; // \} diff --git a/dumux/porousmediumflow/richards/vtkoutputfields.hh b/dumux/porousmediumflow/richards/vtkoutputfields.hh deleted file mode 100644 index 3d6825d08545f97d61bf65611c4d6e2fdd1f3970..0000000000000000000000000000000000000000 --- a/dumux/porousmediumflow/richards/vtkoutputfields.hh +++ /dev/null @@ -1,69 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program 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. * - * * - * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup RichardsModel - * \brief Adds vtk output fields specific to the Richards model. - */ -#ifndef DUMUX_RICHARDS_VTK_OUTPUT_FIELDS_HH -#define DUMUX_RICHARDS_VTK_OUTPUT_FIELDS_HH - -#include <dumux/common/parameters.hh> - -namespace Dumux { - -/*! - * \ingroup RichardsModel - * \brief Adds vtk output fields specific to the Richards model. - */ -template<bool enableWaterDiffusionInAir> -class RichardsVtkOutputFields -{ -public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::liquidPhaseIdx); }, "S_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::gasPhaseIdx); }, "S_"+FluidSystem::phaseName(FluidSystem::gasPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::liquidPhaseIdx); }, "p_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::gasPhaseIdx); }, "p_"+FluidSystem::phaseName(FluidSystem::gasPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::liquidPhaseIdx); }, "rho_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::liquidPhaseIdx); }, "mob_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.relativePermeability(FluidSystem::liquidPhaseIdx); }, "kr"); - vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); - - static const bool gravity = getParamFromGroup<bool>(vtk.paramGroup(), "Problem.EnableGravity"); - - if(gravity) - vtk.addVolumeVariable([](const auto& v){ return v.pressureHead(FluidSystem::liquidPhaseIdx); }, "pressure head"); - if (enableWaterDiffusionInAir) - vtk.addVolumeVariable([](const auto& v){ return v.moleFraction(1, 0); }, "x^"+FluidSystem::componentName(FluidSystem::gasCompIdx)+"_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.waterContent(FluidSystem::liquidPhaseIdx); },"water content"); - - vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phase presence"); - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/richardsnc/iofields.hh b/dumux/porousmediumflow/richardsnc/iofields.hh new file mode 100644 index 0000000000000000000000000000000000000000..865623ad384a80fc879a915fedf087e68547c500 --- /dev/null +++ b/dumux/porousmediumflow/richardsnc/iofields.hh @@ -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: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup RichardsNCModel + * \brief Adds I/O fields specific to the Richards model. + */ +#ifndef DUMUX_RICHARDSNC_IO_FIELDS_HH +#define DUMUX_RICHARDSNC_IO_FIELDS_HH + +#include <dumux/common/parameters.hh> +#include <dumux/io/name.hh> + +namespace Dumux { + +/*! + * \ingroup RichardsNCModel + * \brief Adds I/O fields specific to the Richards model. + */ +class RichardsNCIOFields +{ +public: + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FS = typename VolumeVariables::FluidSystem; + + out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::liquidPhaseIdx); }, + IOName::saturation() + "_" + IOName::liquidPhase()); + out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::gasPhaseIdx); }, + IOName::saturation() + "_" + IOName::gaseousPhase()); + out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::liquidPhaseIdx); }, + IOName::pressure() + "_" + IOName::liquidPhase()); + out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::gasPhaseIdx); }, + IOName::pressure() + "_" + IOName::gaseousPhase()); + out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, + IOName::capillaryPressure()); + out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); }, + IOName::density() + "_" + IOName::liquidPhase()); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); }, + IOName::mobility() + "_" + IOName::liquidPhase()); + out.addVolumeVariable([](const auto& v){ return v.relativePermeability(VolumeVariables::liquidPhaseIdx); }, + IOName::relativePermeability() + "_" + IOName::liquidPhase()); + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); + out.addVolumeVariable([](const auto& v){ return v.temperature(); }, + IOName::temperature()); + + static const bool gravity = getParamFromGroup<bool>(out.paramGroup(), "Problem.EnableGravity"); + if (gravity) + out.addVolumeVariable([](const auto& v){ return v.pressureHead(VolumeVariables::liquidPhaseIdx); }, + IOName::pressureHead()); + out.addVolumeVariable([](const auto& v){ return v.waterContent(VolumeVariables::liquidPhaseIdx); }, + IOName::waterContent()); + + for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) + out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(VolumeVariables::liquidPhaseIdx, compIdx); }, + IOName::moleFraction<FS>(VolumeVariables::liquidPhaseIdx, compIdx)); + + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state = 0) + { + if (pvIdx == 0) + return IOName::pressure<FluidSystem>(0); + else + return ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(0, pvIdx) + : IOName::massFraction<FluidSystem>(0, pvIdx); + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/porousmediumflow/richardsnc/model.hh b/dumux/porousmediumflow/richardsnc/model.hh index 812e485435a93dfce3c90a38b072a58eee4113f1..3937e5a5686b25de4c49cc1f22c4ffc9b1e07ad5 100644 --- a/dumux/porousmediumflow/richardsnc/model.hh +++ b/dumux/porousmediumflow/richardsnc/model.hh @@ -82,13 +82,13 @@ #include <dumux/porousmediumflow/properties.hh> #include <dumux/porousmediumflow/nonisothermal/model.hh> #include <dumux/porousmediumflow/nonisothermal/indices.hh> -#include <dumux/porousmediumflow/nonisothermal/vtkoutputfields.hh> +#include <dumux/porousmediumflow/nonisothermal/iofields.hh> #include <dumux/porousmediumflow/richards/model.hh> #include "volumevariables.hh" #include "indices.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { @@ -120,7 +120,7 @@ struct RichardsNCModelTraits { const std::string xString = useMoles() ? "x" : "X"; if (pvIdx == 0) - return "p_" + FluidSystem::phaseName(0); + return IOName::pressure<FluidSystem>(0); else return xString + "^" + FluidSystem::componentName(pvIdx) + "_" + FluidSystem::phaseName(0); @@ -144,13 +144,14 @@ NEW_TYPE_TAG(RichardsNCNI, INHERITS_FROM(RichardsNC)); ////////////////////////////////////////////////////////////////// //! Set the model traits class -SET_PROP(RichardsNC, ModelTraits) +SET_PROP(RichardsNC, BaseModelTraits) { private: using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); public: using type = RichardsNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; }; +SET_TYPE_PROP(RichardsNC, ModelTraits, typename GET_PROP_TYPE(TypeTag, BaseModelTraits)); //! Define that per default mole fractions are used in the balance equations SET_BOOL_PROP(RichardsNC, UseMoles, true); @@ -213,7 +214,7 @@ SET_PROP(RichardsNC, FluidState) }; //! Set the vtk output fields specific to this model -SET_TYPE_PROP(RichardsNC, VtkOutputFields, RichardsNCVtkOutputFields); +SET_TYPE_PROP(RichardsNC, IOFields, RichardsNCIOFields); //! The model after Millington (1961) is used for the effective diffusivity SET_TYPE_PROP(RichardsNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<typename GET_PROP_TYPE(TypeTag, Scalar)>); @@ -229,8 +230,7 @@ SET_TYPE_PROP(RichardsNCNI, ThermalConductivityModel, ThermalConductivityAverage SET_PROP(RichardsNCNI, ModelTraits) { private: - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using IsothermalTraits = RichardsNCModelTraits<FluidSystem::numComponents, GET_PROP_VALUE(TypeTag, UseMoles), GET_PROP_VALUE(TypeTag, ReplaceCompEqIdx)>; + using IsothermalTraits = typename GET_PROP_TYPE(TypeTag, BaseModelTraits); public: using type = PorousMediumFlowNIModelTraits<IsothermalTraits>; }; diff --git a/dumux/porousmediumflow/richardsnc/vtkoutputfields.hh b/dumux/porousmediumflow/richardsnc/vtkoutputfields.hh deleted file mode 100644 index 414b6e3faa99d101e45711984be571d419d97687..0000000000000000000000000000000000000000 --- a/dumux/porousmediumflow/richardsnc/vtkoutputfields.hh +++ /dev/null @@ -1,69 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program 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. * - * * - * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup RichardsNCModel - * \brief Adds vtk output fields specific to the Richards model. - */ -#ifndef DUMUX_RICHARDSNC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_RICHARDSNC_VTK_OUTPUT_FIELDS_HH - -#include <dumux/common/parameters.hh> - -namespace Dumux { - -/*! - * \ingroup RichardsNCModel - * \brief Adds vtk output fields specific to the Richards model. - */ -class RichardsNCVtkOutputFields -{ -public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - vtk.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::liquidPhaseIdx); }, "S_"+FluidSystem::phaseName(VolumeVariables::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::gasPhaseIdx); }, "S_gas"); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::liquidPhaseIdx); }, "p_"+FluidSystem::phaseName(VolumeVariables::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::gasPhaseIdx); }, "p_gas"); - vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::liquidPhaseIdx); }, "rho_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::liquidPhaseIdx); }, "mob_"+FluidSystem::phaseName(FluidSystem::liquidPhaseIdx)); - vtk.addVolumeVariable([](const auto& v){ return v.relativePermeability(VolumeVariables::liquidPhaseIdx); }, "kr"); - vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); - vtk.addVolumeVariable([](const auto& v){ return v.temperature(); }, "T"); - - static const bool gravity = getParamFromGroup<bool>(vtk.paramGroup(), "Problem.EnableGravity"); - if(gravity) - vtk.addVolumeVariable([](const auto& v){ return v.pressureHead(VolumeVariables::liquidPhaseIdx); }, "pressure head"); - vtk.addVolumeVariable([](const auto& v){ return v.waterContent(VolumeVariables::liquidPhaseIdx); },"water content"); - - for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) - vtk.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(VolumeVariables::liquidPhaseIdx, compIdx); }, - "x^" + FluidSystem::componentName(compIdx) + "_" + FluidSystem::phaseName(VolumeVariables::liquidPhaseIdx)); - - } -}; - -} // end namespace Dumux - -#endif diff --git a/dumux/porousmediumflow/tracer/vtkoutputfields.hh b/dumux/porousmediumflow/tracer/iofields.hh similarity index 55% rename from dumux/porousmediumflow/tracer/vtkoutputfields.hh rename to dumux/porousmediumflow/tracer/iofields.hh index 417b3d015a0deea0709f5595426524d885b96ba0..94cae16f18c8ece22a12d0803376a94da7392cac 100644 --- a/dumux/porousmediumflow/tracer/vtkoutputfields.hh +++ b/dumux/porousmediumflow/tracer/iofields.hh @@ -19,37 +19,53 @@ /*! * \file * \ingroup TracerModel - * \brief Adds vtk output fields specific to the tracer model + * \brief Adds I/O fields specific to the tracer model */ -#ifndef DUMUX_TRACER_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TRACER_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_TRACER_IO_FIELDS_HH +#define DUMUX_TRACER_IO_FIELDS_HH #include <string> +#include <dumux/io/name.hh> + namespace Dumux { /*! * \ingroup TracerModel - * \brief Adds vtk output fields specific to the tracer model + * \brief Adds I/O fields specific to the tracer model */ -class TracerVtkOutputFields +class TracerIOFields { public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; + using VolumeVariables = typename OutputModule::VolumeVariables; using FluidSystem = typename VolumeVariables::FluidSystem; - // register standardized vtk output fields + // register standardized out output fields for (int compIdx = 0; compIdx < VolumeVariables::numComponents(); ++compIdx) { - vtk.addVolumeVariable( [compIdx](const auto& v){ return v.moleFraction(0, compIdx); }, - "x^" + std::string(FluidSystem::componentName(compIdx))); - vtk.addVolumeVariable( [compIdx](const auto& v){ return v.massFraction(0, compIdx); }, - "X^" + std::string(FluidSystem::componentName(compIdx))); + out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(0, compIdx); }, + "x^" + FluidSystem::componentName(compIdx)); + out.addVolumeVariable([compIdx](const auto& v){ return v.massFraction(0, compIdx); }, + "X^" + FluidSystem::componentName(compIdx)); } - vtk.addVolumeVariable( [](const auto& v){ return v.density(); }, "rho"); + out.addVolumeVariable( [](const auto& v){ return v.density(); }, IOName::density()); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } + + template <class ModelTraits, class FluidSystem, class SolidSystem = void> + static std::string primaryVariableName(int pvIdx, int state = 0) + { + const std::string xString = ModelTraits::useMoles() ? "x" : "X"; + return xString + "^" + FluidSystem::componentName(pvIdx); } }; diff --git a/dumux/porousmediumflow/tracer/model.hh b/dumux/porousmediumflow/tracer/model.hh index e6793e455a0fcf5798fe75c466235edb8bbd0508..cccbb3bc1037e8e18b5a1607f22a7c1c40ecc1e0 100644 --- a/dumux/porousmediumflow/tracer/model.hh +++ b/dumux/porousmediumflow/tracer/model.hh @@ -59,7 +59,7 @@ #include "indices.hh" #include "volumevariables.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" #include "localresidual.hh" namespace Dumux { @@ -142,7 +142,7 @@ public: SET_TYPE_PROP(Tracer, LocalResidual, TracerLocalResidual<TypeTag>); //! Set the vtk output fields specific to this model -SET_TYPE_PROP(Tracer, VtkOutputFields, TracerVtkOutputFields); +SET_TYPE_PROP(Tracer, IOFields, TracerIOFields); //! Set the volume variables property SET_PROP(Tracer, VolumeVariables) diff --git a/test/freeflow/navierstokes/CMakeLists.txt b/test/freeflow/navierstokes/CMakeLists.txt index ba3367981d67023ec117c8c8b3c8a8b094eeff0c..f9b9bea0781b8c9052866d5d8ff4e5f0e3d915ca 100644 --- a/test/freeflow/navierstokes/CMakeLists.txt +++ b/test/freeflow/navierstokes/CMakeLists.txt @@ -51,17 +51,6 @@ dune_add_test(NAME test_navierstokes_channel ${CMAKE_CURRENT_BINARY_DIR}/test_channel_navierstokes-00002.vtu --command "${CMAKE_CURRENT_BINARY_DIR}/test_channel test_channel_navierstokes.input -Vtk.WriteFaceData 1") -dune_add_test(NAME test_navierstokes_channel_restart - TARGET test_channel - CMAKE_GUARD HAVE_UMFPACK - COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - CMD_ARGS --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/channel-navierstokes-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_channel_navierstokes_restart-00001.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_channel test_channel_navierstokes.input -Vtk.WriteFaceData 1 -TimeLoop.DtInitial 1 -Restart.Time 1 -CellCenter.Restart.File test_channel_navierstokes-00001.vtu -Face.Restart.File test_channel_navierstokes-face-00001.vtp -Problem.Name test_channel_navierstokes_restart") - -# the restart test has to run after the test that produces the corresponding vtu file -set_tests_properties(test_navierstokes_channel_restart PROPERTIES DEPENDS test_navierstokes_channel) add_executable(test_channel_stokesni EXCLUDE_FROM_ALL test_channel.cc) target_compile_definitions(test_channel_stokesni PUBLIC "NONISOTHERMAL=1") diff --git a/test/freeflow/navierstokes/test_angeli.cc b/test/freeflow/navierstokes/test_angeli.cc index 021fbc210015bcde16b37da087d65f7ca8156f6c..f19351e6bb1f433cca6f6f8b5d468f290073f0c3 100644 --- a/test/freeflow/navierstokes/test_angeli.cc +++ b/test/freeflow/navierstokes/test_angeli.cc @@ -149,8 +149,8 @@ int main(int argc, char** argv) try // intialize the vtk output module StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_channel.cc b/test/freeflow/navierstokes/test_channel.cc index 4ad7012be710e0d8cdb5e66fcf5041aa69c4f2c3..78fc06c138e3b4852c5b6a5797f82b43d66bc956 100644 --- a/test/freeflow/navierstokes/test_channel.cc +++ b/test/freeflow/navierstokes/test_channel.cc @@ -139,21 +139,7 @@ int main(int argc, char** argv) try SolutionVector x; x[FVGridGeometry::cellCenterIdx()].resize(numDofsCellCenter); x[FVGridGeometry::faceIdx()].resize(numDofsFace); - if (restartTime > 0) - { - using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); - - auto fileNameCell = getParamFromGroup<std::string>("CellCenter", "Restart.File"); - loadSolution(x[FVGridGeometry::cellCenterIdx()], fileNameCell, - [](int pvIdx, int state){ return "p"; }, // test option with lambda - *fvGridGeometry); - - auto fileNameFace = getParamFromGroup<std::string>("Face", "Restart.File"); - loadSolution(x[FVGridGeometry::faceIdx()], fileNameFace, - ModelTraits::primaryVariableNameFace<>, *fvGridGeometry); - } - else - problem->applyInitialSolution(x); + problem->applyInitialSolution(x); auto xOld = x; // instantiate time loop @@ -167,9 +153,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // initialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // the assembler with time loop for instationary problem diff --git a/test/freeflow/navierstokes/test_closedsystem.cc b/test/freeflow/navierstokes/test_closedsystem.cc index 8401ace5e16d5b56b86cda16f8feea0264d79ed3..a006672081c120df0fbc69244535fd7078347cb7 100644 --- a/test/freeflow/navierstokes/test_closedsystem.cc +++ b/test/freeflow/navierstokes/test_closedsystem.cc @@ -142,9 +142,9 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/freeflow/navierstokes/test_donea.cc b/test/freeflow/navierstokes/test_donea.cc index 0cc05bb7c5ef6e2c080b45536d611163274da605..fc884e315fe5c3fa4e5b4828600293a651435f3a 100644 --- a/test/freeflow/navierstokes/test_donea.cc +++ b/test/freeflow/navierstokes/test_donea.cc @@ -137,9 +137,9 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_kovasznay.cc b/test/freeflow/navierstokes/test_kovasznay.cc index 173cfd5d75a50b041c198f4d6afa2a579ee6cd19..1bb20aeb3905b14fc2f8607868b07bd14b598138 100644 --- a/test/freeflow/navierstokes/test_kovasznay.cc +++ b/test/freeflow/navierstokes/test_kovasznay.cc @@ -134,9 +134,9 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_navierstokes_1d.cc b/test/freeflow/navierstokes/test_navierstokes_1d.cc index b728eea1716592fe21420058757bfbf4fde91f36..da8777f6de5446062a654adb0a48af35981f1ce2 100644 --- a/test/freeflow/navierstokes/test_navierstokes_1d.cc +++ b/test/freeflow/navierstokes/test_navierstokes_1d.cc @@ -123,9 +123,9 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getAnalyticalPressureSolution(), "pressureExact"); vtkWriter.addField(problem->getAnalyticalVelocitySolution(), "velocityExact"); vtkWriter.addFaceField(problem->getAnalyticalVelocitySolutionOnFace(), "faceVelocityExact"); diff --git a/test/freeflow/navierstokes/test_stokes_channel_3d.cc b/test/freeflow/navierstokes/test_stokes_channel_3d.cc index 8280439437e1d91f4a5607c041f3c16a52b9c9b8..5b9d3a0f96a8ae770302d7069fb26c2c3c82fc81 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_3d.cc +++ b/test/freeflow/navierstokes/test_stokes_channel_3d.cc @@ -131,9 +131,9 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/freeflow/navierstokesnc/test_channel.cc b/test/freeflow/navierstokesnc/test_channel.cc index 3a3fb6dae4184323d409f436f6349452113b0c13..7b3cd9548618341031b64e5d21a8cebcc9f3f1a8 100644 --- a/test/freeflow/navierstokesnc/test_channel.cc +++ b/test/freeflow/navierstokesnc/test_channel.cc @@ -147,9 +147,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaP(), "deltaP"); vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc index edd782c140c86f1fa11486085258893da5a529fc..bebae70faf1589dd3a5c6ff564d7f5560daabbd3 100644 --- a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc +++ b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc @@ -146,9 +146,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getDeltaRho(), "deltaRho"); vtkWriter.write(0.0); diff --git a/test/freeflow/navierstokesnc/test_msfreeflow.cc b/test/freeflow/navierstokesnc/test_msfreeflow.cc index 766d6620523959af45b8011baf0cad035a128380..bbe525a69fae2a58bd5d813008de3f52b758d711 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.cc +++ b/test/freeflow/navierstokesnc/test_msfreeflow.cc @@ -146,9 +146,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/freeflow/rans/test_pipe_laufer.cc b/test/freeflow/rans/test_pipe_laufer.cc index 0ddaffc8db09e70b1fa40542136d67f94569ecfd..2825c0a39e248a9104de17f3a0866ef0d0e07a3d 100644 --- a/test/freeflow/rans/test_pipe_laufer.cc +++ b/test/freeflow/rans/test_pipe_laufer.cc @@ -142,9 +142,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/freeflow/ransnc/test_flatplate.cc b/test/freeflow/ransnc/test_flatplate.cc index d4d0e0086a2a1ef6b9b104fb0af2f85dfae0e1d6..5f511d5201bf3a57bc23d80afa8dbf811924d963 100644 --- a/test/freeflow/ransnc/test_flatplate.cc +++ b/test/freeflow/ransnc/test_flatplate.cc @@ -138,9 +138,9 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/geomechanics/poroelastic/test_poroelastic.cc b/test/geomechanics/poroelastic/test_poroelastic.cc index 98368995c2c47173874f210994a535e542278541..97ac7f7e5fe33c8499bf0c4678f14d7049b2b8e3 100644 --- a/test/geomechanics/poroelastic/test_poroelastic.cc +++ b/test/geomechanics/poroelastic/test_poroelastic.cc @@ -144,10 +144,10 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module and output fields - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); using VtkOutputModule = Dumux::VtkOutputModule<GridVariables, SolutionVector>; VtkOutputModule vtkWriter(*gridVariables, x, problem->name()); - VtkOutputFields::init(vtkWriter); + IOFields::initOutputModule(vtkWriter); // also, add exact solution to the output SolutionVector xExact(fvGridGeometry->numDofs()); diff --git a/test/io/vtk/CMakeLists.txt b/test/io/vtk/CMakeLists.txt index f4e8f47e82381a6dd65423dd5c455205d98dbc86..9745bfa56faca9ab2ab3e307026a1d3952a2ec4c 100644 --- a/test/io/vtk/CMakeLists.txt +++ b/test/io/vtk/CMakeLists.txt @@ -1,3 +1,5 @@ +add_input_file_links() + dune_add_test(NAME test_vtkreader_3d SOURCES test_vtkreader.cc CMAKE_GUARD dune-alugrid_FOUND @@ -46,3 +48,6 @@ dune_add_test(NAME test_vtkreader_1d ${CMAKE_SOURCE_DIR}/test/references/test_embedded_1p_richards_tpfa_1d.vtp test-1d" --files ${CMAKE_SOURCE_DIR}/test/references/test_embedded_1p_richards_tpfa_1d.vtp ${CMAKE_CURRENT_BINARY_DIR}/test-1d.vtp) + +dune_add_test(NAME test_vtk_staggeredfreeflowpvnames + SOURCES test_vtk_staggeredfreeflowpvnames.cc) diff --git a/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc new file mode 100644 index 0000000000000000000000000000000000000000..453126339dfd4ed1563bf4437ad0c5525e7ee6ce --- /dev/null +++ b/test/io/vtk/test_vtk_staggeredfreeflowpvnames.cc @@ -0,0 +1,397 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * + * \brief Test for writing and reading vtk files for the staggered grid free flow models + */ +#include <config.h> + +#include <iostream> +#include <string> +#include <vector> +#include <numeric> + +#include <dune/common/exceptions.hh> +#include <dune/common/parallel/mpihelper.hh> +#include <dune/common/float_cmp.hh> +#include <dune/grid/yaspgrid.hh> + +#include <dumux/common/properties.hh> +#include <dumux/common/dumuxmessage.hh> + +#include <dumux/discretization/staggered/freeflow/properties.hh> +#include <dumux/freeflow/navierstokes/model.hh> +#include <dumux/freeflow/compositional/kepsilonncmodel.hh> +#include <dumux/freeflow/compositional/lowrekepsilonncmodel.hh> +#include <dumux/freeflow/compositional/komegancmodel.hh> +#include <dumux/freeflow/compositional/oneeqncmodel.hh> +#include <dumux/freeflow/compositional/zeroeqncmodel.hh> +#include <dumux/material/fluidsystems/1padapter.hh> +#include <dumux/material/fluidsystems/h2oair.hh> + +#include <dumux/freeflow/navierstokes/problem.hh> +#include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/loadsolution.hh> +#include <dumux/freeflow/rans/zeroeq/problem.hh> +#include <dumux/freeflow/rans/oneeq/problem.hh> +#include <dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh> +#include <dumux/freeflow/rans/twoeq/kepsilon/problem.hh> +#include <dumux/freeflow/rans/twoeq/komega/problem.hh> + +namespace Dumux { +namespace Properties { + +NEW_TYPE_TAG(StaggeredPVNamesTestTypeTag, INHERITS_FROM(StaggeredFreeFlowModel)); + +NEW_TYPE_TAG(NavierStokesPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokes)); +NEW_TYPE_TAG(NavierStokesNIPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokesNI)); +NEW_TYPE_TAG(NavierStokesNCPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokesNC)); +NEW_TYPE_TAG(NavierStokesNCNIPVNameTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, NavierStokesNCNI)); + +NEW_TYPE_TAG(KEpsilonNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilon)); +NEW_TYPE_TAG(KEpsilonNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilonNI)); +NEW_TYPE_TAG(KEpsilonNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilonNC)); +NEW_TYPE_TAG(KEpsilonNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KEpsilonNCNI)); + +NEW_TYPE_TAG(LowReKEpsilonNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilon)); +NEW_TYPE_TAG(LowReKEpsilonNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilonNI)); +NEW_TYPE_TAG(LowReKEpsilonNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilonNC)); +NEW_TYPE_TAG(LowReKEpsilonNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, LowReKEpsilonNCNI)); + +NEW_TYPE_TAG(KOmegaNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmega)); +NEW_TYPE_TAG(KOmegaNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmegaNI)); +NEW_TYPE_TAG(KOmegaNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmegaNC)); +NEW_TYPE_TAG(KOmegaNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, KOmegaNCNI)); + +NEW_TYPE_TAG(OneEqNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEq)); +NEW_TYPE_TAG(OneEqNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEqNI)); +NEW_TYPE_TAG(OneEqNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEqNC)); +NEW_TYPE_TAG(OneEqNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, OneEqNCNI)); + +NEW_TYPE_TAG(ZeroEqNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEq)); +NEW_TYPE_TAG(ZeroEqNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEqNI)); +NEW_TYPE_TAG(ZeroEqNCNameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEqNC)); +NEW_TYPE_TAG(ZeroEqNCNINameTestTypeTag, INHERITS_FROM(StaggeredPVNamesTestTypeTag, ZeroEqNCNI)); + +// The fluid system +SET_PROP(StaggeredPVNamesTestTypeTag, FluidSystem) +{ + using H2OAir = FluidSystems::H2OAir<typename GET_PROP_TYPE(TypeTag, Scalar)>; + static constexpr auto phaseIdx = H2OAir::gasPhaseIdx; // simulate the air phase + using type = FluidSystems::OnePAdapter<H2OAir, phaseIdx>; +}; + +SET_TYPE_PROP(StaggeredPVNamesTestTypeTag, Scalar, double); + +// Set the grid type +SET_TYPE_PROP(StaggeredPVNamesTestTypeTag, Grid, Dune::YaspGrid<2>); + +SET_PROP(StaggeredPVNamesTestTypeTag, Problem) +{ +private: + // use the ZeroEqProblem as base class for non-RANS models and for the ZeroEq model + // use the the KEpsilonProblem as base class for all RANS models except the ZeroEq model + // NOTE: this rather unpleasant hack will be removed once the RANS models have been unified + using MTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + + static constexpr auto dim = MTraits::dim(); + static constexpr auto nComp = MTraits::numComponents(); + static constexpr auto numEq = MTraits::numEq(); + + using BaseTurbulentProblem = std::conditional_t<(std::is_same<typename MTraits::Indices, KOmegaIndices<dim, nComp>>::value || + std::is_same<typename MTraits::Indices, FreeflowNonIsothermalIndices<KOmegaIndices<dim, nComp>, numEq>>::value), + KOmegaProblem<TypeTag>, + std::conditional_t<(std::is_same<typename MTraits::Indices, KEpsilonIndices<dim, nComp>>::value || + std::is_same<typename MTraits::Indices, FreeflowNonIsothermalIndices<KEpsilonIndices<dim, nComp>, numEq>>::value), + KEpsilonProblem<TypeTag>, + std::conditional_t<(std::is_same<typename MTraits::Indices, LowReKEpsilonIndices<dim, nComp>>::value || + std::is_same<typename MTraits::Indices, FreeflowNonIsothermalIndices<LowReKEpsilonIndices<dim, nComp>, numEq>>::value), + LowReKEpsilonProblem<TypeTag>, OneEqProblem<TypeTag>>>>; + + using BaseProblem = std::conditional_t<MTraits::usesTurbulenceModel() && + !std::is_same<MTraits, RANSModelTraits<dim>>::value && + !std::is_same<MTraits, FreeflowNIModelTraits<RANSModelTraits<dim>>>::value && + !std::is_same<MTraits, ZeroEqNCModelTraits<dim, nComp, false, 0>>::value && + !std::is_same<MTraits, FreeflowNIModelTraits<ZeroEqNCModelTraits<dim, nComp, false, 0>>>::value, + BaseTurbulentProblem, ZeroEqProblem<TypeTag>>; + + template<class TTag> + class MockProblem : public BaseProblem + { + using ParentType = BaseProblem; + using BoundaryTypes = typename GET_PROP_TYPE(TTag, BoundaryTypes); + using Scalar = typename GET_PROP_TYPE(TTag, Scalar); + using Traits = typename GET_PROP_TYPE(TTag, ModelTraits); + public: + using ParentType::ParentType; + + template<class GlobalPosition> + BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const + { + BoundaryTypes values; + return values; + } + + Scalar temperature() const + { return 300; } + + template<class T = TTag, bool enable = GET_PROP_TYPE(T, ModelTraits)::usesTurbulenceModel(), std::enable_if_t<!enable, int> = 0> + void updateStaticWallProperties() {} + + template<class U, bool enable = Traits::usesTurbulenceModel(), std::enable_if_t<!enable, int> = 0> + void updateDynamicWallProperties(const U&) {} + + // for ZeroEq model + template<class T = TTag, bool enable = GET_PROP_TYPE(T, ModelTraits)::usesTurbulenceModel(), std::enable_if_t<enable, int> = 0> + void updateStaticWallProperties() + { ParentType::updateStaticWallProperties(); } + + // for ZeroEq model + template<class U, bool enable = Traits::usesTurbulenceModel(), std::enable_if_t<enable, int> = 0> + void updateDynamicWallProperties(const U& u) + { return ParentType::updateDynamicWallProperties(u); } + + template<class Scvf> + bool isOnWall(const Scvf&) const + { return true; } + }; + +public: + using type = MockProblem<TypeTag>; +}; + +} +} + +template<class SolutionVector, class Values> +void assignValues(SolutionVector& sol, Values values) +{ + for (auto& entry : sol) + { + for (int pvIdx = 0; pvIdx < values.size(); ++pvIdx) + { + // make sure to get values that can be exactly represented in the vtk file (Float32) + std::stringstream stream; + stream << std::fixed << std::setprecision(5) << std::scientific << values[pvIdx]; + entry[pvIdx] = std::stod(stream.str()); + } + + // increment all values by 1% for each dof + for (auto& i : values) + i += 0.01*i; + } +} + +template<class TypeTag, class FVGridGeometry, std::size_t numValues> +void testWriteAndReadVtk(std::shared_ptr<FVGridGeometry> fvGridGeometry, + const std::array<typename GET_PROP_TYPE(TypeTag, Scalar), numValues>& values, + const std::string& fileName, + bool verbose = false, + bool deleteFiles = true) +{ + using namespace Dumux; + + // the solution vector + using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + SolutionVector writeFrom; + + writeFrom[FVGridGeometry::cellCenterIdx()].resize(fvGridGeometry->numCellCenterDofs()); + writeFrom[FVGridGeometry::faceIdx()].resize(fvGridGeometry->numFaceDofs()); + + SolutionVector readTo = writeFrom; + + // the problem (initial and boundary conditions) + using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + auto problem = std::make_shared<Problem>(fvGridGeometry); + + assignValues(writeFrom[FVGridGeometry::cellCenterIdx()], values); + assignValues(writeFrom[FVGridGeometry::faceIdx()], std::array<typename GET_PROP_TYPE(TypeTag, Scalar), 1>{1.0}); + + problem->updateStaticWallProperties(); + problem->updateDynamicWallProperties(writeFrom); + + // the grid variables + using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); + gridVariables->init(writeFrom); + + // initialize the vtk output module + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + StaggeredVtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, writeFrom, fileName); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields + vtkWriter.write(0); + + using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + + using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); + using FacePrimaryVariables = typename GET_PROP_TYPE(TypeTag, FacePrimaryVariables); + + // cc dofs + loadSolution(readTo[FVGridGeometry::cellCenterIdx()], fileName + "-00000.vtu", + createCellCenterPVNameFunction<IOFields, CellCenterPrimaryVariables, ModelTraits, FluidSystem>(), + *fvGridGeometry); + + if (verbose) + { + std::cout << "reference cc " << std::endl; + for (const auto& block : writeFrom[FVGridGeometry::cellCenterIdx()]) + std::cout << block << std::endl; + + std::cout << "result cc " << std::endl; + for (const auto& block : readTo[FVGridGeometry::cellCenterIdx()]) + std::cout << block << std::endl; + } + + for (int i = 0; i < readTo[FVGridGeometry::cellCenterIdx()].size(); ++i) + { + if (Dune::FloatCmp::ne(readTo[FVGridGeometry::cellCenterIdx()][i], writeFrom[FVGridGeometry::cellCenterIdx()][i])) + DUNE_THROW(Dune::IOError, "Values don't match: new " << readTo[FVGridGeometry::cellCenterIdx()][i] << ", old " << writeFrom[FVGridGeometry::cellCenterIdx()][i]); + } + + // face dofs + loadSolution(readTo[FVGridGeometry::faceIdx()], fileName + "-face-00000.vtp", + createFacePVNameFunction<IOFields, FacePrimaryVariables, ModelTraits, FluidSystem>(), + *fvGridGeometry); + + if (verbose) + { + std::cout << "reference face " << std::endl; + for (const auto& block : writeFrom[FVGridGeometry::faceIdx()]) + std::cout << block << std::endl; + + std::cout << "result face " << std::endl; + for (const auto& block : readTo[FVGridGeometry::faceIdx()]) + std::cout << block << std::endl; + } + + for (int i = 0; i < readTo[FVGridGeometry::faceIdx()].size(); ++i) + { + if (Dune::FloatCmp::ne(readTo[FVGridGeometry::faceIdx()][i], writeFrom[FVGridGeometry::faceIdx()][i])) + DUNE_THROW(Dune::IOError, "Values don't match: new " << readTo[FVGridGeometry::faceIdx()][i] << ", old " << writeFrom[FVGridGeometry::faceIdx()][i]); + } + + // clean up the folder + if(deleteFiles) + { + if(system("exec rm -r *pvd *vtu *vtp")) + DUNE_THROW(Dune::IOError, "Deleting files failed"); + } +} + + +int main(int argc, char** argv) try +{ + using namespace Dumux; + + // initialize MPI, finalize is done automatically on exit + const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); + + // print dumux start message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/true); + + // initialize ther parameters + auto parameters = [](auto& params) + { + params["Problem.Name"] = "test"; + params["Vtk.WriteFaceData"] = "true"; + }; + + Parameters::init(parameters); + + using CommonTypeTag = TTAG(StaggeredPVNamesTestTypeTag); + using Grid = typename GET_PROP_TYPE(CommonTypeTag, Grid); + using FVGridGeometry = typename GET_PROP_TYPE(CommonTypeTag, FVGridGeometry); + using Scalar = typename GET_PROP_TYPE(CommonTypeTag, Scalar); + using GlobalPosition = Dune::FieldVector<Scalar, Grid::dimension>; + + const GlobalPosition lowerLeft(0.0); + const GlobalPosition upperRight(5.0); + std::array<unsigned int, Grid::dimension> cells; + std::fill(cells.begin(), cells.end(), 5); + + const auto grid = Dune::StructuredGridFactory<Grid>::createCubeGrid(lowerLeft, upperRight, cells); + const auto gridView = grid->leafGridView(); + auto fvGridGeometry = std::make_shared<FVGridGeometry>(gridView); + fvGridGeometry->update(); + + using FluidSystem = typename GET_PROP_TYPE(CommonTypeTag, FluidSystem); + FluidSystem::init(); + + testWriteAndReadVtk<TTAG(NavierStokesPVNameTypeTag)>(fvGridGeometry, std::array<Scalar, 1>{1e5}, "navierstokes"); + testWriteAndReadVtk<TTAG(NavierStokesNIPVNameTypeTag)>(fvGridGeometry, std::array<Scalar, 2>{1e5, 300.0}, "navierstokesni"); + testWriteAndReadVtk<TTAG(NavierStokesNCPVNameTypeTag)>(fvGridGeometry, std::array<Scalar, 2>{1e5, 1e-3}, "navierstokesnc"); + testWriteAndReadVtk<TTAG(NavierStokesNCNIPVNameTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1e-3, 300.0}, "navierstokesncni"); + + testWriteAndReadVtk<TTAG(ZeroEqNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 1>{1e5}, "zeroeq"); + testWriteAndReadVtk<TTAG(ZeroEqNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 2>{1e5, 300.0}, "zeroeqni"); + testWriteAndReadVtk<TTAG(ZeroEqNCNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 2>{1e5, 1e-3}, "zeroeqnc"); + testWriteAndReadVtk<TTAG(ZeroEqNCNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1e-3, 300.0}, "zeroeqncni"); + + testWriteAndReadVtk<TTAG(OneEqNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 2>{1e5, 1.0}, "oneeq"); + testWriteAndReadVtk<TTAG(OneEqNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.0, 300.0}, "oneeqni"); + testWriteAndReadVtk<TTAG(OneEqNCNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1e-3, 1.0}, "oneeqnc"); + testWriteAndReadVtk<TTAG(OneEqNCNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.0, 300.0}, "oneeqncni"); + + testWriteAndReadVtk<TTAG(KEpsilonNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.1, 1.2}, "kepsilon"); + testWriteAndReadVtk<TTAG(KEpsilonNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1.1, 1.2, 300.0}, "kepsilonni"); + testWriteAndReadVtk<TTAG(KEpsilonNCNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.1, 1.2}, "kepsilonnc"); + testWriteAndReadVtk<TTAG(KEpsilonNCNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 5>{1e5, 1e-3, 1.1, 1.2, 300.0}, "kepsilonncni"); + + testWriteAndReadVtk<TTAG(LowReKEpsilonNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.1, 1.2}, "lowrekepsilon"); + testWriteAndReadVtk<TTAG(LowReKEpsilonNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1.1, 1.2, 300.0}, "lowrekepsilonni"); + testWriteAndReadVtk<TTAG(LowReKEpsilonNCNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.1, 1.2}, "lowrekepsilonnc"); + testWriteAndReadVtk<TTAG(LowReKEpsilonNCNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 5>{1e5, 1e-3, 1.1, 1.2, 300.0}, "lowrekepsilonncni"); + + testWriteAndReadVtk<TTAG(KOmegaNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 3>{1e5, 1.1, 1.2}, "komega"); + testWriteAndReadVtk<TTAG(KOmegaNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1.1, 1.2, 300.0}, "komegani"); + testWriteAndReadVtk<TTAG(KOmegaNCNameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 4>{1e5, 1e-3, 1.1, 1.2}, "komeganc"); + testWriteAndReadVtk<TTAG(KOmegaNCNINameTestTypeTag)>(fvGridGeometry, std::array<Scalar, 5>{1e5, 1e-3, 1.1, 1.2, 300.0}, "komegancni"); + + //////////////////////////////////////////////////////////// + // finalize, print dumux message to say goodbye + //////////////////////////////////////////////////////////// + + // print dumux end message + if (mpiHelper.rank() == 0) + { + Parameters::print(); + DumuxMessage::print(/*firstCall=*/false); + } + + return 0; +} // end main +catch (Dumux::ParameterException &e) +{ + std::cerr << std::endl << e << " ---> Abort!" << std::endl; + return 1; +} +catch (Dune::Exception &e) +{ + std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; + return 2; +} +catch (...) +{ + std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; + return 3; +} diff --git a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc index daabfac105708fd35c9184d7f83aca9a48882e3d..2a9686fbe016c25b6a6a6ce379e773111a7666fd 100644 --- a/test/multidomain/boundary/darcydarcy/1p_1p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_1p/main.cc @@ -225,12 +225,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using SolutionVector0 = std::decay_t<decltype(sol[domain0Idx])>; VtkOutputModule<GridVariables0, SolutionVector0> vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); - GET_PROP_TYPE(SubTypeTag0, VtkOutputFields)::init(vtkWriter0); + GET_PROP_TYPE(SubTypeTag0, IOFields)::initOutputModule(vtkWriter0); vtkWriter0.write(0.0); using SolutionVector1 = std::decay_t<decltype(sol[domain1Idx])>; VtkOutputModule<GridVariables1, SolutionVector1> vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); - GET_PROP_TYPE(SubTypeTag1, VtkOutputFields)::init(vtkWriter1); + GET_PROP_TYPE(SubTypeTag1, IOFields)::initOutputModule(vtkWriter1); vtkWriter1.write(0.0); // instantiate time loop diff --git a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc index 5d39ab1b25eb30013cd018c3ae5bf15e0a31e649..f749e1412223a35cd55aced5e3b5dd6489c724ad 100644 --- a/test/multidomain/boundary/darcydarcy/1p_2p/main.cc +++ b/test/multidomain/boundary/darcydarcy/1p_2p/main.cc @@ -210,12 +210,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using SolutionVector0 = std::decay_t<decltype(sol[domain0Idx])>; VtkOutputModule<GridVariables0, SolutionVector0> vtkWriter0(*gridVariables0, sol[domain0Idx], problem0->name()); - GET_PROP_TYPE(SubTypeTag0, VtkOutputFields)::init(vtkWriter0); + GET_PROP_TYPE(SubTypeTag0, IOFields)::initOutputModule(vtkWriter0); vtkWriter0.write(0.0); using SolutionVector1 = std::decay_t<decltype(sol[domain1Idx])>; VtkOutputModule<GridVariables1, SolutionVector1> vtkWriter1(*gridVariables1, sol[domain1Idx], problem1->name()); - GET_PROP_TYPE(SubTypeTag1, VtkOutputFields)::init(vtkWriter1); + GET_PROP_TYPE(SubTypeTag1, IOFields)::initOutputModule(vtkWriter1); vtkWriter1.write(0.0); // instantiate time loop diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc index 3c0a40bfcfc677d7b844d8a47a6a3b7f89ad9ed1..0e51f16ffbe09de84f0da54109007b1fb096e8a7 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/horizontalflow/test_stokes1p2cdarcy1p2chorizontal.cc @@ -187,13 +187,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam<std::string>("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc index 33c4e66f115e01ae4aa36975ec72790b4bdef54a..946bb677b470860c7cc751b39e976860c00a4c92 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_1p2c/verticalflow/test_stokes1p2cdarcy1p2cvertical.cc @@ -188,13 +188,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam<std::string>("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc index f75717383c38bd4a269ab2fe39e717735de1ce4c..9a506d0e0f18d194cb9e94ae34f90144735d342c 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/test_stokes1p2cdarcy2p2chorizontal.cc @@ -180,13 +180,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam<std::string>("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc index 0bcdd17719a4cecedbc0f6a41a95ddfdb01ab2cd..70ad0085b4739c573bab372ec1a3c8279c07807f 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/horizontalflow/test_stokes1pdarcy1phorizontal.cc @@ -159,13 +159,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam<std::string>("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler for a stationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc index bcd5fe3199ae8737c6d2938adbfcf0b8586dead2..a51aeacd045d93dcb5ef404f622a361fe4bd6592 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_1p/verticalflow/test_stokes1pdarcy1pvertical.cc @@ -162,13 +162,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam<std::string>("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // the assembler for a stationary problem diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc index 4461ef4de1cf9d2fe6cc7cc78b11bc6ff693901e..9d6712d2b6de2f90a1284888ca9d131ea3f2ef49 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/test_stokes1pdarcy2pvertical.cc @@ -211,13 +211,13 @@ int main(int argc, char** argv) try const auto darcyName = getParam<std::string>("Problem.Name") + "_" + darcyProblem->name(); StaggeredVtkOutputModule<StokesGridVariables, typename GET_PROP_TYPE(StokesTypeTag, SolutionVector)> stokesVtkWriter(*stokesGridVariables, stokesSol, stokesName); - GET_PROP_TYPE(StokesTypeTag, VtkOutputFields)::init(stokesVtkWriter); + GET_PROP_TYPE(StokesTypeTag, IOFields)::initOutputModule(stokesVtkWriter); stokesVtkWriter.write(0.0); VtkOutputModule<DarcyGridVariables, typename GET_PROP_TYPE(DarcyTypeTag, SolutionVector)> darcyVtkWriter(*darcyGridVariables, sol[darcyIdx], darcyName); using DarcyVelocityOutput = typename GET_PROP_TYPE(DarcyTypeTag, VelocityOutput); darcyVtkWriter.addVelocityOutput(std::make_shared<DarcyVelocityOutput>(*darcyGridVariables)); - GET_PROP_TYPE(DarcyTypeTag, VtkOutputFields)::init(darcyVtkWriter); + GET_PROP_TYPE(DarcyTypeTag, IOFields)::initOutputModule(darcyVtkWriter); darcyVtkWriter.write(0.0); // instantiate time loop diff --git a/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc b/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc index d09a5bd60c733ff2b50682ee2f0df2aa1778ee72..4ad28950767e38ce49af59fdb16e54a08b2adda0 100644 --- a/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc +++ b/test/multidomain/embedded/1d3d/1p2c_richards2c/test_1p2c_richards2c.cc @@ -350,12 +350,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t<decltype(sol[bulkIdx])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t<decltype(sol[lowDimIdx])>; VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); diff --git a/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc b/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc index 02476ecaf3cbdc44b69a3750b1772eabcd29beea..93e29f7992ee1b2292ad1963b4e07d1238c19b7c 100644 --- a/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc +++ b/test/multidomain/embedded/1d3d/1p_1p/test_1p_1p.cc @@ -161,13 +161,13 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t<decltype(sol[bulkIdx])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); bulkProblem->addVtkOutputFields(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t<decltype(sol[lowDimIdx])>; VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); diff --git a/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc b/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc index 35cbf5b279eef76d1193033f6d33cf5dfbc186e7..f2244432248a62ba1f97e4b0d65c04b001b6cc69 100644 --- a/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc +++ b/test/multidomain/embedded/1d3d/1p_richards/test_1p_richards.cc @@ -167,12 +167,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t<decltype(sol[bulkIdx])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t<decltype(sol[lowDimIdx])>; VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); lowDimProblem->addVtkOutputFields(lowDimVtkWriter); lowDimVtkWriter.write(0.0); diff --git a/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc b/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc index 454917e870ab0b81e52f1c161aaba7cdc1fdacba..89cd00a3904e7e8697b61e4933a08785253a7a16 100644 --- a/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc +++ b/test/multidomain/embedded/2d3d/1p_1p/test_1p_1p.cc @@ -211,12 +211,12 @@ int main(int argc, char** argv) try // intialize the vtk output module using BulkSolutionVector = std::decay_t<decltype(sol[bulkIdx])>; VtkOutputModule<BulkGridVariables, BulkSolutionVector> bulkVtkWriter(*bulkGridVariables, sol[bulkIdx], bulkProblem->name()); - GET_PROP_TYPE(BulkTypeTag, VtkOutputFields)::init(bulkVtkWriter); + GET_PROP_TYPE(BulkTypeTag, IOFields)::initOutputModule(bulkVtkWriter); bulkVtkWriter.write(0.0); using LowDimSolutionVector = std::decay_t<decltype(sol[lowDimIdx])>; VtkOutputModule<LowDimGridVariables, LowDimSolutionVector> lowDimVtkWriter(*lowDimGridVariables, sol[lowDimIdx], lowDimProblem->name()); - GET_PROP_TYPE(LowDimTypeTag, VtkOutputFields)::init(lowDimVtkWriter); + GET_PROP_TYPE(LowDimTypeTag, IOFields)::initOutputModule(lowDimVtkWriter); lowDimVtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc b/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc index 3298918f0504340189e2af38fb4d86a3d6f97fb3..39490ae7dc12cbe9bbc0f9499624000b2cc0a94f 100644 --- a/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc +++ b/test/multidomain/facet/1p_1p/analytical/test_facetcoupling_fv_1p1p.cc @@ -281,10 +281,10 @@ int main(int argc, char** argv) try const bool writeVTK = getParam<bool>("Output.EnableVTK"); if (writeVTK) { - using BulkVtkOutputFields = typename GET_PROP_TYPE(BulkProblemTypeTag, VtkOutputFields); - using LowDimVtkOutputFields = typename GET_PROP_TYPE(LowDimProblemTypeTag, VtkOutputFields); - BulkVtkOutputFields::init(bulkVtkWriter); - LowDimVtkOutputFields::init(lowDimVtkWriter); + using BulkIOFields = typename GET_PROP_TYPE(BulkProblemTypeTag, IOFields); + using LowDimIOFields = typename GET_PROP_TYPE(LowDimProblemTypeTag, IOFields); + BulkIOFields::initOutputModule(bulkVtkWriter); + LowDimIOFields::initOutputModule(lowDimVtkWriter); bulkExact.resize(bulkFvGridGeometry->numDofs()); lowDimExact.resize(lowDimFvGridGeometry->numDofs()); diff --git a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc b/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc index fdd1dcfba20921f59b2a7ae95eb527a9adaa4e3e..fe8edaccf1a8780ca2fb1bed2e95f368a8f1b35c 100644 --- a/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc +++ b/test/multidomain/facet/1p_1p/threedomain/test_facetcoupling_tpfa_1p1p_threedomain.cc @@ -183,12 +183,12 @@ int main(int argc, char** argv) try VtkOutputModule<EdgeGridVariables, EdgeSolutionVector> edgeVtkWriter(*edgeGridVariables, x[edgeId], edgeProblem->name()); // Add model specific output fields - using BulkVtkOutputFields = typename GET_PROP_TYPE(BulkProblemTypeTag, VtkOutputFields); - using FacetVtkOutputFields = typename GET_PROP_TYPE(FacetProblemTypeTag, VtkOutputFields); - using EdgeVtkOutputFields = typename GET_PROP_TYPE(EdgeProblemTypeTag, VtkOutputFields); - BulkVtkOutputFields::init(bulkVtkWriter); - FacetVtkOutputFields::init(facetVtkWriter); - EdgeVtkOutputFields::init(edgeVtkWriter); + using BulkIOFields = typename GET_PROP_TYPE(BulkProblemTypeTag, IOFields); + using FacetIOFields = typename GET_PROP_TYPE(FacetProblemTypeTag, IOFields); + using EdgeIOFields = typename GET_PROP_TYPE(EdgeProblemTypeTag, IOFields); + BulkIOFields::initOutputModule(bulkVtkWriter); + FacetIOFields::initOutputModule(facetVtkWriter); + EdgeIOFields::initOutputModule(edgeVtkWriter); bulkVtkWriter.write(0.0); facetVtkWriter.write(0.0); edgeVtkWriter.write(0.0); diff --git a/test/multidomain/poromechanics/el1p/test_el1p.cc b/test/multidomain/poromechanics/el1p/test_el1p.cc index a70a605bac0986a17637a1f70d4d529ac2b911c1..2626ca23e286e5b1c54e7be5a56f6077b010d3be 100644 --- a/test/multidomain/poromechanics/el1p/test_el1p.cc +++ b/test/multidomain/poromechanics/el1p/test_el1p.cc @@ -156,8 +156,8 @@ int main(int argc, char** argv) try PoroMechVtkOutputModule poroMechVtkWriter(*poroMechGridVariables, x[poroMechId], poroMechProblem->name()); // add output fields to writers - using OnePOutputFields = typename GET_PROP_TYPE(OnePTypeTag, VtkOutputFields); - using PoroMechOutputFields = typename GET_PROP_TYPE(PoroMechTypeTag, VtkOutputFields); + using OnePOutputFields = typename GET_PROP_TYPE(OnePTypeTag, IOFields); + using PoroMechOutputFields = typename GET_PROP_TYPE(PoroMechTypeTag, IOFields); OnePOutputFields::init(onePVtkWriter); PoroMechOutputFields::init(poroMechVtkWriter); diff --git a/test/multidomain/poromechanics/el2p/test_el2p.cc b/test/multidomain/poromechanics/el2p/test_el2p.cc index f30dcb2d6f9d12209102f18902d4d1ae0da8d9c1..06e38222f2b252923cebef9ac856f839d33b63c9 100644 --- a/test/multidomain/poromechanics/el2p/test_el2p.cc +++ b/test/multidomain/poromechanics/el2p/test_el2p.cc @@ -164,8 +164,8 @@ int main(int argc, char** argv) try PoroMechVtkOutputModule poroMechVtkWriter(*poroMechGridVariables, x[poroMechId], poroMechProblem->name()); // add output fields to writers - using TwoPOutputFields = typename GET_PROP_TYPE(TwoPTypeTag, VtkOutputFields); - using PoroMechOutputFields = typename GET_PROP_TYPE(PoroMechTypeTag, VtkOutputFields); + using TwoPOutputFields = typename GET_PROP_TYPE(TwoPTypeTag, IOFields); + using PoroMechOutputFields = typename GET_PROP_TYPE(PoroMechTypeTag, IOFields); TwoPOutputFields::init(twoPVtkWriter); PoroMechOutputFields::init(poroMechVtkWriter); diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc index e86724c8b49e8c5f12b0f4a4aef9cc5dfd89c9a6..1ddcc3694ea4fbad4357206234124cba04404476 100644 --- a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc +++ b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc @@ -113,8 +113,8 @@ int main(int argc, char** argv) try VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc index 3d62ebbb3fee50a753499549f1f22fc40d1675bb..832cadca5e27ea048a4f9bbf76b3fb45f8e47c01 100644 --- a/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc +++ b/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc @@ -100,11 +100,11 @@ int main(int argc, char** argv) try gridVariables->init(x); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // the assembler with time loop for instationary problem diff --git a/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc b/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc index 0f46073e770cd0a7d44e232af78009a6d8ae47b7..2d9c5029791ea297b8a3fa0a7a4b7d7c61cc8f2f 100644 --- a/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc @@ -101,8 +101,8 @@ int main(int argc, char** argv) try VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // make assemble and attach linear system diff --git a/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc b/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc index 2cbb88a83404d7580e7a44b9078f16df590ed6b4..160f8afe736bdf15dc96c04b7287e1a21bcdde8c 100644 --- a/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/periodicbc/test_1pfv.cc @@ -102,8 +102,8 @@ int main(int argc, char** argv) try // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // make assemble and attach linear system diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc index e509f4dc7e9fe27df2abd6659a4a508af261c8f0..b1be638a61628c90ea5b64b19a533bc46b5a2dce 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc @@ -107,11 +107,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc index 319ada366aa893920c154044880292a5bc66a507..40d34f985601d9c0be67a6696ace5d363bd7794d 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc @@ -107,11 +107,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/test_1pfv.cc b/test/porousmediumflow/1p/implicit/test_1pfv.cc index 1a388afcb832dc0089ebead78affa4230b44b5ce..2eba6454646c2256316ccb1f3f97501e0cb84635 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv.cc @@ -137,11 +137,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields // if we are using a random permeability field with gstat bool isRandomField = getParam<bool>("SpatialParams.RandomField", false); diff --git a/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc b/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc index da93fd8fcc23867ce8a17752e329f0ffa2a0c0f0..b223bae5615fd553be5ead07d109bf710edbc5ac 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc b/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc index 3b3f754d6ffc3290ee806e2a74fa7eeffa747c7b..9a2000ab08ad1fb4b9926226bff4c76620fb0f79 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1p/implicit/test_1pnifv.cc b/test/porousmediumflow/1p/implicit/test_1pnifv.cc index 2009502d47141da80085ef2e08d9f7e71b58c83b..87acaaf41cfab2645458fa6b468ef79d087acc86 100644 --- a/test/porousmediumflow/1p/implicit/test_1pnifv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pnifv.cc @@ -131,9 +131,11 @@ int main(int argc, char** argv) try SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); const auto fileName = getParam<std::string>("Restart.File"); - loadSolution(x, fileName, createPVNameFunction<ModelTraits>(), *fvGridGeometry); + loadSolution(x, fileName, createPVNameFunction<IOFields, PrimaryVariables, ModelTraits>(), *fvGridGeometry); } else problem->applyInitialSolution(x); @@ -145,11 +147,11 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(restartTime); diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc index d6eccc18a854135c949b788610f0cc6759c44d29..14388ed79435821500304e465aafa48757effece 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc @@ -114,8 +114,8 @@ int main(int argc, char** argv) try VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc index 0f5f7d2acc34797f3d4a47f483185f402b1ee655..ddcf6be674802dea6ccef6b9d18e87660f4ab30f 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc @@ -113,8 +113,8 @@ int main(int argc, char** argv) try VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc index 5cb98b4f1277055fc3e6daa28d690c09c1f2d0fe..09086813296dc88266aa36ff7fac6324c35dd680 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc @@ -113,8 +113,8 @@ int main(int argc, char** argv) try VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc index 9b810e7049b314e736cc5592144c37160e5e683a..d6218e01444974492bfd4848360d92b978038723 100644 --- a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc +++ b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc @@ -137,8 +137,8 @@ int main(int argc, char** argv) try // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); // Add model specific output fields vtkWriter.addField(problem->getPerm(), "permeability"); diff --git a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc index a0c294a360deb3dfb0f3a0cf171d5b7567d20e87..27704f727974d2f2cacaae35174da8545726d18c 100644 --- a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc +++ b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc @@ -183,11 +183,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc index 214e85a5518c244d685ceaf8641dad82beb6fcc4..789539bb1a0d865d5daf988eb79fc70ba0b2a628 100644 --- a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc +++ b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc @@ -148,9 +148,9 @@ int main(int argc, char** argv) try // intialize the vtk output module using VtkOutputModule = BoxDfmVtkOutputModule<GridVariables, SolutionVector, FractureGrid>; - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule vtkWriter(*gridVariables, x, problem->name(), fractureGridAdapter, "", Dune::VTK::nonconforming); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc index ba0d1bf755c5d5b30a7e5a46488791bd7609771a..7ab9edee59be9ab0cfebf508ab532aa6b288a35b 100644 --- a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc +++ b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc @@ -146,12 +146,12 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name(), "", Dune::VTK::conforming); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields problem->addFieldsToWriter(vtkWriter); //!< Add some more problem dependent fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc b/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc index 4d9d848b031a4bb63880c9ae9dc1c6bedd7b15ba..e4e8d2ba27f7daaec67fefe62f0fd5bab98c2ab0 100644 --- a/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc +++ b/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc @@ -120,11 +120,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc index b7c94c4de9d9966abd1de0ae8d3f33de76cecfc7..dbd1d3f5709deb02bf10294fccc405810109ac0f 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc +++ b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc @@ -136,10 +136,12 @@ int main(int argc, char** argv) try SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); const auto fileName = getParam<std::string>("Restart.File"); - loadSolution(x, fileName, createPVNameFunction<ModelTraits, FluidSystem>(), *fvGridGeometry); + loadSolution(x, fileName, createPVNameFunction<IOFields, PrimaryVariables, ModelTraits, FluidSystem>(), *fvGridGeometry); } else problem->applyInitialSolution(x); @@ -155,7 +157,7 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); // use non-conforming output for the test with interface solver const auto ncOutput = getParam<bool>("Problem.UseNonConformingOutput", false); @@ -163,7 +165,7 @@ int main(int argc, char** argv) try ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // instantiate time loop diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc index 2727e473c21d3d93d0373eef297afcbe231a17ce..dc2a091754b597c31845e2a039be13bf1f96efa8 100644 --- a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc +++ b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc index 3dd8850bd67d78be0ef291d7d0116840d058521e..e597d12c3a4be32d256fa4dd6c5f93fe6e97d8c8 100644 --- a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc +++ b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc @@ -111,8 +111,8 @@ int main(int argc, char** argv) try // intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh index 6375775b7da535ebf9751a09bed0fc20b9f80aba..a5e708c2e8f4344c957c540e636a9a846fb3ef4a 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/2p2c_comparison_problem.hh @@ -36,7 +36,7 @@ #include <dumux/material/fluidstates/compositional.hh> #include "2p2c_comparison_spatialparams.hh" -#include "vtkoutputfields.hh" +#include "iofields.hh" namespace Dumux { /*! @@ -82,7 +82,7 @@ public: SET_BOOL_PROP(TwoPTwoCComparison, UseMoles, true); -SET_TYPE_PROP(TwoPTwoCComparison, VtkOutputFields, TwoPTwoCMPNCVtkOutputFields); +SET_TYPE_PROP(TwoPTwoCComparison, IOFields, TwoPTwoCMPNCIOFields); } // end namespace Properties diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh new file mode 100644 index 0000000000000000000000000000000000000000..8f42a26678436aa4ddeea0ee46b1aac372324419 --- /dev/null +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh @@ -0,0 +1,89 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program 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. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * \ingroup TwoPTwoCModel + * \brief Adds I/O fields specific to the twop model + */ +#ifndef DUMUX_TWOPTWOC_MPNC_IO_FIELDS_HH +#define DUMUX_TWOPTWOC_MPNC_IO_FIELDS_HH + +#include <dumux/io/name.hh> + +namespace Dumux { + +/*! + * \ingroup TwoPTwoCModel + * \brief Adds I/O fields specific to the two-phase two-component model + */ +class TwoPTwoCMPNCIOFields +{ +public: + template <class OutputModule> + static void initOutputModule(OutputModule& out) + { + using VolumeVariables = typename OutputModule::VolumeVariables; + using FS = typename VolumeVariables::FluidSystem; + + // register standardized output fields + out.addVolumeVariable([](const auto& v){ return v.porosity(); }, + IOName::porosity()); + + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase0Idx); }, + IOName::saturation<FS>(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase1Idx); }, + IOName::saturation<FS>(FS::phase1Idx)); + + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase0Idx); }, + IOName::pressure<FS>(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase1Idx); }, + IOName::pressure<FS>(FS::phase1Idx)); + + out.addVolumeVariable([](const auto& v){ return v.density(FS::phase0Idx); }, + IOName::density<FS>(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.density(FS::phase1Idx); }, + IOName::density<FS>(FS::phase1Idx)); + + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase0Idx); }, + IOName::mobility<FS>(FS::phase0Idx)); + out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase1Idx); }, + IOName::mobility<FS>(FS::phase1Idx)); + + for (int i = 0; i < VolumeVariables::numPhases(); ++i) + for (int j = 0; j < VolumeVariables::numComponents(); ++j) + out.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); }, + IOName::massFraction<FS>(i, j)); + + for (int i = 0; i < VolumeVariables::numPhases(); ++i) + for (int j = 0; j < VolumeVariables::numComponents(); ++j) + out.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, + IOName::moleFraction<FS>(i, j)); + } + + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) + { + initOutputModule(out); + } +}; + +} // end namespace Dumux + +#endif diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc index 15b3e79759bd73743a51129766ae4a97dc8e599a..3225fd7be8c4aa6943515231084a0e5d7b2537cb 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc @@ -132,11 +132,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh b/test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh deleted file mode 100644 index c9b21f177ada7067a5034a9fd4e8f45ca09eceba..0000000000000000000000000000000000000000 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh +++ /dev/null @@ -1,66 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program 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. * - * * - * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup TwoPTwoCModel - * \brief Adds vtk output fields specific to the twop model - */ -#ifndef DUMUX_TWOPTWOC_MPNC_VTK_OUTPUT_FIELDS_HH -#define DUMUX_TWOPTWOC_MPNC_VTK_OUTPUT_FIELDS_HH - -namespace Dumux { - -/*! - * \ingroup TwoPTwoCModel - * \brief Adds vtk output fields specific to the two-phase two-component model - */ -class TwoPTwoCMPNCVtkOutputFields -{ -public: - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) - { - using VolumeVariables = typename VtkOutputModule::VolumeVariables; - using FluidSystem = typename VolumeVariables::FluidSystem; - - // register standardized vtk output fields - vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); - vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::phase0Idx); }, "S_"+ FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.saturation(FluidSystem::phase1Idx); }, "S_"+ FluidSystem::phaseName(FluidSystem::phase1Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::phase0Idx); }, "p_"+ FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.pressure(FluidSystem::phase1Idx); }, "p_"+ FluidSystem::phaseName(FluidSystem::phase1Idx)); - - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase0Idx); }, "rho_"+ FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.density(FluidSystem::phase1Idx); }, "rho_"+ FluidSystem::phaseName(FluidSystem::phase1Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase0Idx); }, "mob_"+ FluidSystem::phaseName(FluidSystem::phase0Idx)); - vtk.addVolumeVariable([](const auto& v){ return v.mobility(FluidSystem::phase1Idx); }, "mob_"+ FluidSystem::phaseName(FluidSystem::phase1Idx)); - - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.massFraction(i,j); },"X^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - - for (int i = 0; i < VolumeVariables::numPhases(); ++i) - for (int j = 0; j < VolumeVariables::numComponents(); ++j) - vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); },"x^"+ FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - } -}; - -} // end namespace Dumux - -#endif diff --git a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc index d40a89200e94a7ae33aa34a1dffc7a65ccbe7ed3..32af683f5b6ec1b871ab2ed5d04ca3acaecd1888 100644 --- a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc @@ -104,10 +104,12 @@ int main(int argc, char** argv) try SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); const auto fileName = getParam<std::string>("Restart.File"); - const auto pvName = createPVNameFunctionWithState<ModelTraits, FluidSystem>(); + const auto pvName = createPVNameFunction<IOFields, PrimaryVariables, ModelTraits, FluidSystem>(); loadSolution(x, fileName, pvName, *fvGridGeometry); } else @@ -120,11 +122,11 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // instantiate time loop diff --git a/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc b/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc index a0c86b5fbc57daf52596d001f179a692131f22a4..f091bf5daea67613bead410675287b450461ce62 100644 --- a/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc +++ b/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // initialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields problem->addVtkFields(vtkWriter); //!< Add problem specific output fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc b/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc index 71cf087a2c2ad32359c873a9aa9016fa6b3ee099..4c28d5a862230c9df490f422a673d4ccace6c33d 100644 --- a/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc +++ b/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc @@ -129,11 +129,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc index 83fad384a01ecca6b771903504d64fb24a5748d8..7dfe35fa76cfdcd4132066d337b619c07e427042 100644 --- a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc +++ b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc @@ -126,11 +126,13 @@ int main(int argc, char** argv) try SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem); const auto fileName = getParam<std::string>("Restart.File"); - const auto pvName = createPVNameFunctionWithState<ModelTraits, FluidSystem, SolidSystem>(); + const auto pvName = createPVNameFunction<IOFields, PrimaryVariables, ModelTraits, FluidSystem, SolidSystem>(); loadSolution(x, fileName, pvName, *fvGridGeometry); } else @@ -143,11 +145,11 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // initialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields //add specific output vtkWriter.addField(problem->getPermeability(), "Permeability"); // update the output fields before write diff --git a/test/porousmediumflow/3p/implicit/test_3p_fv.cc b/test/porousmediumflow/3p/implicit/test_3p_fv.cc index d6ebdec51bd50636bc0e0eb5b37cc881e744a935..6e8373ebfb9df75c190d05cac192ea578e91934f 100644 --- a/test/porousmediumflow/3p/implicit/test_3p_fv.cc +++ b/test/porousmediumflow/3p/implicit/test_3p_fv.cc @@ -136,11 +136,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc b/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc index 9eff45fdfda89857eaf8393293c4fa6897bc5183..0944b34c0db8adea28580a84f5306951324f16b1 100644 --- a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc +++ b/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc @@ -136,11 +136,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc b/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc index e1e436da3dd431d429a1bcca2a552831f8167b18..f1eb062fd28bd28523c7ee91e6e29f0e3c82f3b8 100644 --- a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc +++ b/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc @@ -136,11 +136,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); // output every vtkOutputInterval time step diff --git a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc index c0f0b39452184e37b692472928003036548b9574..727f1a7bace18e8ca80f22e26a087f5584d53570 100644 --- a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc +++ b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc @@ -136,11 +136,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc b/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc index 20f467c2e90ab71d9e0760e3b3d93135bb219499..6e5745a75d8a677261ba0e53e48ffa082ee99a69 100644 --- a/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc +++ b/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc @@ -133,11 +133,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/co2/implicit/test_co2_fv.cc b/test/porousmediumflow/co2/implicit/test_co2_fv.cc index 3caebab423f92dcb06d078cf24d3cfcce6236f4c..54cdbf7e695a9afc9ac256e791932e91ace22a9c 100644 --- a/test/porousmediumflow/co2/implicit/test_co2_fv.cc +++ b/test/porousmediumflow/co2/implicit/test_co2_fv.cc @@ -110,11 +110,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields problem->addFieldsToWriter(vtkWriter); //!< Add some more problem dependent fields vtkWriter.write(0.0); diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh index 68840b937d6d5ebb6d3d3853c94b3baa59ce81ce..6e7c521ac6ad33f5b1e84b6fadcc1bcbefba57ef 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh @@ -32,7 +32,7 @@ #include <dumux/porousmediumflow/mpnc/model.hh> #include <dumux/porousmediumflow/problem.hh> -#include <test/porousmediumflow/2p2c/implicit/mpnccomparison/vtkoutputfields.hh> +#include <test/porousmediumflow/2p2c/implicit/mpnccomparison/iofields.hh> #include <dumux/material/fluidsystems/h2on2.hh> #include <dumux/material/fluidstates/compositional.hh> @@ -77,7 +77,7 @@ SET_TYPE_PROP(MPNCComparison, // decide which type to use for floating values (double / quad) SET_TYPE_PROP(MPNCComparison, Scalar, double); SET_BOOL_PROP(MPNCComparison, UseMoles, true); -SET_TYPE_PROP(MPNCComparison, VtkOutputFields, TwoPTwoCMPNCVtkOutputFields); +SET_TYPE_PROP(MPNCComparison, IOFields, TwoPTwoCMPNCIOFields); } // end namespace Dumux /*! diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc index fc7387f487f2c50841bbfbe16bfd9c7bc449a054..bb6ef40cc29752a5dd7f0e88873d7852efddb46b 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc @@ -138,11 +138,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc b/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc index b404a85961511aec3afa2a43abbb8fb378fbedf9..ad32dc8140ccce547a9e32edac8dfdab13dcfd61 100644 --- a/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc +++ b/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc @@ -137,11 +137,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc b/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc index c133779e787611e623529b420a677d5f5fd1f29d..1c81c08a73922720732003bfabbde30a89490a61 100644 --- a/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc +++ b/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc @@ -136,11 +136,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc b/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc index b545d6e4b1c34b0c82b739066c177a20e51943c0..41f6bfb518800441794c600b2f92a8a968b5f0a5 100644 --- a/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc +++ b/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc @@ -138,11 +138,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc b/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc index 68b566589c591385f42b0d13dc1dd7d0edd17257..c9b942d261256c02b47b82e70910e310a3de7c11 100644 --- a/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc +++ b/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc index c145f63b0d99b469b9f81053ba343dbeffa5450c..dc48aebad51945bb33f2d451cd9f378e47a8cb9f 100644 --- a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc @@ -98,10 +98,12 @@ int main(int argc, char** argv) try SolutionVector x(fvGridGeometry->numDofs()); if (restartTime > 0) { + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); const auto fileName = getParam<std::string>("Restart.File"); - loadSolution(x, fileName, createPVNameFunction<ModelTraits, FluidSystem>(), *fvGridGeometry); + loadSolution(x, fileName, createPVNameFunction<IOFields, PrimaryVariables, ModelTraits, FluidSystem>(), *fvGridGeometry); } else { @@ -116,11 +118,11 @@ int main(int argc, char** argv) try gridVariables->init(x, xOld); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(restartTime); // get some time loop parameters diff --git a/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc index 3b41a9ac590634e17b23fc12f8d3ccd502a830ef..056beb23ebcd35e7174d14f1f4e62f1b656a722b 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc index 59879c9d363c5a00537db1177db69b61324e1a88..04cc3790ee8ae9ec405b79140cf3c206884e3ff8 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc @@ -131,11 +131,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc index cf93612ae3521da6978766bbd9463f342fe80ecd..e44007b65e56582a1327136f0727ae775aef28e6 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc @@ -104,11 +104,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc b/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc index ff649d03be1430b4a697af479edc88c96a2f464c..7197c7c0a60c1e6675c9574c6e2fe5b822d954a7 100644 --- a/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc +++ b/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc @@ -132,11 +132,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc index 757a2c39ab063b481d5f9dd514c15ab21e39f590..1af9c7ad18a5d83ab666a80403a7f38ce1a7892b 100644 --- a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc +++ b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc @@ -226,8 +226,8 @@ int main(int argc, char** argv) try //! intialize the vtk output module VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, tracerProblem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TracerTypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TracerTypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields using VelocityOutput = typename GET_PROP_TYPE(TracerTypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); vtkWriter.write(0.0); diff --git a/test/porousmediumflow/tracer/constvel/test_tracer.cc b/test/porousmediumflow/tracer/constvel/test_tracer.cc index 088255115a0dcd3810388b87f4883a4ffa9b2be3..ab2b378871cc15ee1603efd3cb8edf18d7be5bf3 100644 --- a/test/porousmediumflow/tracer/constvel/test_tracer.cc +++ b/test/porousmediumflow/tracer/constvel/test_tracer.cc @@ -122,8 +122,8 @@ int main(int argc, char** argv) try VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); + IOFields::initOutputModule(vtkWriter); //!< Add model specific output fields vtkWriter.write(0.0); ///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc b/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc index 7cbbff30cb7eea95ff4e70b32c2217b7d22a6d6e..5e1374769c741906e21e2e4e7a7a1e8596fd1811 100644 --- a/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc +++ b/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc @@ -138,11 +138,11 @@ int main(int argc, char** argv) try auto dt = getParam<Scalar>("TimeLoop.DtInitial"); // intialize the vtk output module - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + using IOFields = typename GET_PROP_TYPE(TypeTag, IOFields); VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name()); using VelocityOutput = typename GET_PROP_TYPE(TypeTag, VelocityOutput); vtkWriter.addVelocityOutput(std::make_shared<VelocityOutput>(*gridVariables)); - VtkOutputFields::init(vtkWriter); //! Add model specific output fields + IOFields::initOutputModule(vtkWriter); //! Add model specific output fields vtkWriter.write(0.0); // instantiate time loop diff --git a/test/references/3pwateroilbox-reference.vtu b/test/references/3pwateroilbox-reference.vtu index 8bb9a595ab92864d331f866eaa71aebfc9f89c82..2416e05561511454ac4ee7541c17a92629fe990d 100644 --- a/test/references/3pwateroilbox-reference.vtu +++ b/test/references/3pwateroilbox-reference.vtu @@ -2535,7 +2535,7 @@ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 </DataArray> - <DataArray type="Float32" Name="viscos_aq" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="mu_aq" NumberOfComponents="1" format="ascii"> 0.000954057 0.000954014 0.000954032 0.000953987 0.000953936 0.000953917 0.000953862 0.000953846 0.000953803 0.000953789 0.00095376 0.000953749 0.000953733 0.000953725 0.00095372 0.000953715 0.000953718 0.000953715 0.000953725 0.000953724 0.000953739 0.000953738 0.000953757 0.000953757 0.000953778 0.000953779 0.000953802 0.000953803 0.000953827 0.000953829 0.000953854 0.000953856 0.000953881 0.000953883 0.000953909 0.00095391 @@ -2746,7 +2746,7 @@ 0.000954929 0.000954929 0.00095493 0.00095493 0.000954931 0.000954932 0.000954932 0.000954933 0.000954933 0.000954934 0.000954934 0.000954935 0.000954935 0.000954936 0.000954936 0.000954936 0.000954937 </DataArray> - <DataArray type="Float32" Name="viscos_napl" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="mu_napl" NumberOfComponents="1" format="ascii"> 1739.16 1738.7 1738.82 1738.36 1737.91 1737.68 1737.17 1736.98 1736.57 1736.4 1736.14 1736 1735.87 1735.77 1735.74 1735.66 1735.72 1735.66 1735.79 1735.75 1735.92 1735.89 1736.11 1736.09 1736.33 1736.31 1736.57 1736.56 1736.83 1736.82 1737.1 1737.09 1737.38 1737.37 1737.66 1737.65 @@ -2957,7 +2957,7 @@ 1747.21 1747.22 1747.22 1747.23 1747.24 1747.24 1747.25 1747.25 1747.26 1747.26 1747.27 1747.27 1747.28 1747.28 1747.29 1747.29 1747.29 </DataArray> - <DataArray type="Float32" Name="viscos_gas" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="mu_gas" NumberOfComponents="1" format="ascii"> 5.91112e-09 5.89577e-09 5.94453e-09 5.92224e-09 5.85837e-09 5.87276e-09 5.81658e-09 5.82477e-09 5.78228e-09 5.78942e-09 5.75858e-09 5.7663e-09 5.74447e-09 5.75313e-09 5.73802e-09 5.74757e-09 5.73737e-09 5.74768e-09 5.74101e-09 5.75193e-09 5.74777e-09 5.75918e-09 5.75676e-09 5.76855e-09 5.76732e-09 5.77942e-09 5.77898e-09 5.79133e-09 5.79138e-09 5.80392e-09 5.80426e-09 5.81697e-09 5.81743e-09 5.83028e-09 5.83077e-09 5.84373e-09 diff --git a/test/references/richardsanalyticalcc-reference.vtu b/test/references/richardsanalyticalcc-reference.vtu index ed9cce9d696ea3546686deabc1d91065c24178fc..9bcbeef80d7814f386a1d1c929706bae80bf8a3b 100644 --- a/test/references/richardsanalyticalcc-reference.vtu +++ b/test/references/richardsanalyticalcc-reference.vtu @@ -318,7 +318,7 @@ 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardslensbox-reference-parallel.vtu b/test/references/richardslensbox-reference-parallel.vtu index 3c824a4e3a9a2309e8787b7c20c0d1323fdc6a34..901ca580caaa6296f63d6de186495e7f0dbf74d6 100644 --- a/test/references/richardslensbox-reference-parallel.vtu +++ b/test/references/richardslensbox-reference-parallel.vtu @@ -150,7 +150,7 @@ 146.749 164.984 146.749 3.92159 0 0 0 0 0 0 0 0.0196823 249.082 733.751 753.199 733.751 249.082 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/test/references/richardslensbox-reference.vtu b/test/references/richardslensbox-reference.vtu index 076c15811e15530376dc76496a5cbe583f9c6b14..32ce87a8dc41fa210ba3a9e504da695ee4999199 100644 --- a/test/references/richardslensbox-reference.vtu +++ b/test/references/richardslensbox-reference.vtu @@ -269,7 +269,7 @@ 249.082 733.751 753.199 733.751 249.082 0.0196823 0 0 0 0 0 0 0 0 0 0 0 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/test/references/richardslenscc-reference-parallel.vtu b/test/references/richardslenscc-reference-parallel.vtu index 64b199f8c9331191c357989572fabbf3e568eb0b..7a8a5e3c2a909beb910f9e35789c96e1760b676c 100644 --- a/test/references/richardslenscc-reference-parallel.vtu +++ b/test/references/richardslenscc-reference-parallel.vtu @@ -129,7 +129,7 @@ 0 0 0 0 0 0 0 0 10.7357 17.6661 17.6661 10.7357 0 0 0 0 0 0 0 0.0154609 407.511 473.279 473.279 407.511 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/test/references/richardslenscc-reference.vtu b/test/references/richardslenscc-reference.vtu index 6a548781500b09664cc0bb9d015c85d214796336..fa6c1e1b7ff7fb38be07c087ff9d65cc4fa2e1ba 100644 --- a/test/references/richardslenscc-reference.vtu +++ b/test/references/richardslenscc-reference.vtu @@ -241,7 +241,7 @@ 0 0 0 0 0 0 0 0.0154609 407.511 473.279 473.279 407.511 0.0154609 0 0 0 0 0 0 0 0 0 0 0 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/test/references/richardsniconductionbox-reference.vtu b/test/references/richardsniconductionbox-reference.vtu index 1986fbf328dba077c6142e1eb4529a3c4c80c603..8ee8e4fcd8bcbaf476223a64faf8041f5c6be74f 100644 --- a/test/references/richardsniconductionbox-reference.vtu +++ b/test/references/richardsniconductionbox-reference.vtu @@ -255,7 +255,7 @@ 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardsniconductioncc-reference.vtu b/test/references/richardsniconductioncc-reference.vtu index 36a22a712d441b123f7e502a11164b818e3eec20..5187408907e2504100bd71f1f235121ecc3f33e8 100644 --- a/test/references/richardsniconductioncc-reference.vtu +++ b/test/references/richardsniconductioncc-reference.vtu @@ -136,7 +136,7 @@ 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 921.392 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardsniconvectionbox-reference.vtu b/test/references/richardsniconvectionbox-reference.vtu index 72cfb75c55fadbe578e77d718ae97caa04c1e327..b751ca7007ff5e256f56a9812f1ce83927096996 100644 --- a/test/references/richardsniconvectionbox-reference.vtu +++ b/test/references/richardsniconvectionbox-reference.vtu @@ -115,7 +115,7 @@ 921.42 921.42 921.42 921.42 921.42 921.42 921.419 921.419 921.419 921.419 921.419 921.419 921.419 921.419 921.419 921.419 921.392 921.392 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardsniconvectioncc-reference.vtu b/test/references/richardsniconvectioncc-reference.vtu index e644b0e21a3495daee0bc521f40c2ae500c048e5..fdf46b11a0a8a1a6c54620b436fdf18b8d34a980 100644 --- a/test/references/richardsniconvectioncc-reference.vtu +++ b/test/references/richardsniconvectioncc-reference.vtu @@ -66,7 +66,7 @@ 921.422 921.422 921.421 921.421 921.421 921.421 921.421 921.421 921.42 921.42 921.42 921.42 921.42 921.42 921.42 921.419 921.419 921.419 921.419 921.418 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardswelltracerbox-reference.vtu b/test/references/richardswelltracerbox-reference.vtu index 5a0d6b21619195fab311b366a27a5697b3c0555e..2f22e0c79637ab7d0a51b9f114da3aaae86fc08b 100644 --- a/test/references/richardswelltracerbox-reference.vtu +++ b/test/references/richardswelltracerbox-reference.vtu @@ -647,7 +647,7 @@ 0.00249281 0.0025516 0.00264837 0.00282718 0.00320399 0.00394512 0.00523999 0.0074141 0.0116811 0.0259377 0.0944501 0.432193 2.08172 9.29282 31.8186 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/richardswelltracercc-reference.vtu b/test/references/richardswelltracercc-reference.vtu index df51063e775539284ba2e6e183fc2e88af6de54d..9537ef0e727cdfba1e531ef35e1b6dbd293195c2 100644 --- a/test/references/richardswelltracercc-reference.vtu +++ b/test/references/richardswelltracercc-reference.vtu @@ -605,7 +605,7 @@ 0.00614061 0.0062582 0.00646096 0.00684863 0.00773605 0.00951366 0.0130612 0.0244501 0.0786285 0.344282 1.70825 8.96678 45.2552 188.888 535.009 890.348 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/test/references/rosi2c-soil-reference.vtu b/test/references/rosi2c-soil-reference.vtu index 99012737accaae4a161fc62a2f6b032bb32fcdb8..176d3bdb6ad403f4dc33bbfb509eb9d77862429f 100644 --- a/test/references/rosi2c-soil-reference.vtu +++ b/test/references/rosi2c-soil-reference.vtu @@ -4686,7 +4686,7 @@ 0.000634247 0.000632533 0.000629226 0.000624564 0.0006189 0.000612694 0.000606494 0.000600903 0.000596525 0.000593887 0.00059335 0.000595015 0.000598672 0.000603847 0.000609902 0.000616155 0.00062197 0.000626811 0.000630269 0.000632067 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 6.59414e-07 6.5816e-07 6.55784e-07 6.52554e-07 6.4887e-07 6.45244e-07 6.42229e-07 6.40294e-07 6.3969e-07 6.4044e-07 6.42415e-07 6.45407e-07 6.49154e-07 6.53349e-07 6.57664e-07 6.6178e-07 6.65414e-07 6.68339e-07 6.70382e-07 6.71431e-07 6.58388e-07 6.57017e-07 6.54406e-07 6.5083e-07 6.46713e-07 6.42635e-07 6.39255e-07 6.37145e-07 6.3656e-07 6.37457e-07 6.39653e-07 6.42918e-07 6.4698e-07 6.51511e-07 6.56152e-07 6.60561e-07 diff --git a/test/references/test_boxrichardsevaporation-reference.vtu b/test/references/test_boxrichardsevaporation-reference.vtu index 45135a776820db34e89f4b49aaefd264b5ae7121..ad98f26f49c1170a10409fd4ed9ca24d98ac25d3 100644 --- a/test/references/test_boxrichardsevaporation-reference.vtu +++ b/test/references/test_boxrichardsevaporation-reference.vtu @@ -94,7 +94,7 @@ 0.000207045 0.000207045 0.000207045 0.000207045 0.000207045 0.000207045 0.000206541 0.000206541 0.000206541 0.000206541 0.000206541 0.000206541 0 0 0 0 0 0 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 diff --git a/test/references/test_ccrichardsevaporation-reference.vtu b/test/references/test_ccrichardsevaporation-reference.vtu index 14e279ed93ec2aee760d67e673dca46cbbc1eb0c..85fe61c8e8f93ac04d58a4b653b6d51d2cd40047 100644 --- a/test/references/test_ccrichardsevaporation-reference.vtu +++ b/test/references/test_ccrichardsevaporation-reference.vtu @@ -80,7 +80,7 @@ 0.000207047 0.000207046 0.000207046 0.000207046 0.000207046 0.000207046 0.000206733 0.000206733 0.000206733 0.000206733 0.000206733 0 0 0 0 0 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 2.18844e-07 diff --git a/test/references/test_embedded_1d3d_1p2c_richards2c_3d-reference.vtu b/test/references/test_embedded_1d3d_1p2c_richards2c_3d-reference.vtu index 606678d167cfcb93761a053917008eac95a16814..ac4cc1591fccbc63635d80f2f4585ee9164e5de3 100644 --- a/test/references/test_embedded_1d3d_1p2c_richards2c_3d-reference.vtu +++ b/test/references/test_embedded_1d3d_1p2c_richards2c_3d-reference.vtu @@ -1886,7 +1886,7 @@ 0.0127774 0.0126583 0.0122684 0.0123525 0.0125632 0.0125142 0.0122497 0.0123338 0.0125387 0.0124892 0.0124988 0.0126437 0.0127594 0.0126619 0.0124716 0.0126137 0.0127273 0.0126335 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 1.44809e-05 1.44681e-05 1.44481e-05 1.44309e-05 1.44253e-05 1.44355e-05 1.44585e-05 1.44872e-05 1.45122e-05 1.45267e-05 1.44751e-05 1.44594e-05 1.44341e-05 1.44133e-05 1.44055e-05 1.44179e-05 1.44452e-05 1.44789e-05 1.45076e-05 1.45239e-05 1.4468e-05 1.44479e-05 1.44141e-05 1.43748e-05 1.43911e-05 1.44245e-05 1.4467e-05 1.4502e-05 1.45212e-05 1.44672e-05 1.44446e-05 1.44066e-05 1.43525e-05 1.44114e-05 1.44612e-05 1.45016e-05 diff --git a/test/references/test_embedded_1p_richards_box_3d.vtu b/test/references/test_embedded_1p_richards_box_3d.vtu index 335590ba65e26809d475d6df6bb713d8a6f39a22..ac4accc8b0d5ae3d8b8f82da6296a5637a6da72c 100644 --- a/test/references/test_embedded_1p_richards_box_3d.vtu +++ b/test/references/test_embedded_1p_richards_box_3d.vtu @@ -1305,7 +1305,7 @@ 0.000853228 0.000849936 0.000840787 0.000827768 0.000813799 0.000802194 0.00079593 0.000796775 0.000804455 0.000816508 0.000829133 0.000838513 0.000841964 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 1.00391e-06 1.00242e-06 1.00366e-06 1.00206e-06 9.95402e-07 9.93208e-07 9.94817e-07 9.92198e-07 9.98992e-07 9.98387e-07 9.8792e-07 9.85599e-07 9.96116e-07 9.95527e-07 9.83273e-07 9.78899e-07 9.96344e-07 9.9544e-07 9.83048e-07 9.78762e-07 1.00053e-06 9.99215e-07 9.88161e-07 9.85146e-07 1.00794e-06 1.00648e-06 9.96855e-07 9.944e-07 1.01744e-06 1.01597e-06 1.00736e-06 1.00513e-06 1.02789e-06 1.0266e-06 1.01866e-06 1.01678e-06 diff --git a/test/references/test_embedded_1p_richards_tpfa_3d.vtu b/test/references/test_embedded_1p_richards_tpfa_3d.vtu index 35ff8633f6ea9eb2545b505e1aa0527291b0e9a4..7e0602b4c9f72ec3dd45736fddaec9a868126c3e 100644 --- a/test/references/test_embedded_1p_richards_tpfa_3d.vtu +++ b/test/references/test_embedded_1p_richards_tpfa_3d.vtu @@ -1025,7 +1025,7 @@ 0.00084527 0.000837485 0.000823297 0.000805259 0.000786915 0.000772548 0.000766755 0.000773315 0.000789494 0.000807961 0.000823252 0.000831811 0.000854015 0.000847195 0.000834856 0.0008194 0.000804085 0.000792642 0.000788559 0.000793778 0.000806374 0.000821398 0.000834209 0.000841488 </DataArray> - <DataArray type="Float32" Name="kr" NumberOfComponents="1" format="ascii"> + <DataArray type="Float32" Name="kr_liq" NumberOfComponents="1" format="ascii"> 1.00167e-06 9.98753e-07 9.94934e-07 9.93791e-07 9.97518e-07 1.00505e-06 1.01504e-06 1.02648e-06 1.03813e-06 1.04854e-06 1.05634e-06 1.06051e-06 1.00014e-06 9.96259e-07 9.9067e-07 9.88601e-07 9.92941e-07 1.00095e-06 1.01116e-06 1.02312e-06 1.03552e-06 1.04666e-06 1.05501e-06 1.05947e-06 9.98887e-07 9.93723e-07 9.85174e-07 9.81583e-07 9.86886e-07 9.94784e-07 1.00444e-06 1.01717e-06 1.03097e-06 1.04349e-06 1.05286e-06 1.05785e-06