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 54% rename from dumux/freeflow/compositional/vtkoutputfields.hh rename to dumux/freeflow/compositional/iofields.hh index 8c311dc65581f92fa46724fa9329ac23673aedcd..bfdc6dd4365e789ea35d049f8a93f810b95cc857 100644 --- a/dumux/freeflow/compositional/vtkoutputfields.hh +++ b/dumux/freeflow/compositional/iofields.hh @@ -19,52 +19,70 @@ /*! * \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 <dumux/freeflow/navierstokes/iofields.hh> +#include <dune/common/deprecated.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, class ModelTraits> +class 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 namespace IOFieldNames; + 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); }, massFraction<FluidSystem>(0, j)); + out.addVolumeVariable([j](const auto& v){ return v.moleFraction(j); }, 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"); + 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 FluidSystem> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + using namespace IOFieldNames; + if (pvIdx <= ModelTraits::dim()) + return BaseOutputFields::template primaryVariableName<FluidSystem>(pvIdx, state); + else + return ModelTraits::useMoles() ? moleFraction<FluidSystem>(pvIdx - ModelTraits::dim()) + : massFraction<FluidSystem>(pvIdx - ModelTraits::dim()); + } }; } // end namespace Dumux diff --git a/dumux/freeflow/compositional/kepsilonncmodel.hh b/dumux/freeflow/compositional/kepsilonncmodel.hh index 48a5d5c4ec02e40d5459bd5494572d18efe72956..3d272dd21ccf2adeca621c2f53f3d1857e5e84f1 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 { @@ -136,16 +136,15 @@ public: using type = KEpsilonFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(KEpsilonNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KEpsilonNC, 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 SinglePhaseVtkOutputFields = KEpsilonVtkOutputFields<FVGridGeometry>; + using SinglePhaseIOFields = KEpsilonIOFields<FVGridGeometry>; public: - using type = FreeflowNCVtkOutputFields<SinglePhaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<SinglePhaseIOFields, ModelTraits>; }; ////////////////////////////////////////////////////////////////////////// @@ -208,17 +207,16 @@ 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 BaseIOFields = KEpsilonIOFields<FVGridGeometry>; + using NonIsothermalFields = FreeflowNonIsothermalIOFields<BaseIOFields, ModelTraits>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<NonIsothermalFields, ModelTraits>; }; // \} diff --git a/dumux/freeflow/compositional/komegancmodel.hh b/dumux/freeflow/compositional/komegancmodel.hh index 216f8018aa0815bcb6c58a8ec78bfa83d4424983..16c6b97e686b5d5d679bcc5bcd2bdeb5cef6a845 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,16 +141,15 @@ public: using type = KOmegaFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(KOmegaNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KOmegaNC, 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 SinglePhaseVtkOutputFields = KOmegaVtkOutputFields<FVGridGeometry>; + using SinglePhaseIOFields = KOmegaIOFields<FVGridGeometry>; public: - using type = FreeflowNCVtkOutputFields<SinglePhaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<SinglePhaseIOFields, ModelTraits>; }; ////////////////////////////////////////////////////////////////////////// @@ -213,17 +212,16 @@ 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 BaseIOFields = KOmegaIOFields<FVGridGeometry>; + using NonIsothermalFields = FreeflowNonIsothermalIOFields<BaseIOFields, ModelTraits>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<NonIsothermalFields, ModelTraits>; }; // \} diff --git a/dumux/freeflow/compositional/lowrekepsilonncmodel.hh b/dumux/freeflow/compositional/lowrekepsilonncmodel.hh index 8a69f8cb5d0947e5a22a434ab0831374d19982ff..7242e1810097ed27f542092f2e5ac0a873714e89 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 { @@ -141,16 +141,15 @@ public: using type = LowReKEpsilonFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(LowReKEpsilonNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(LowReKEpsilonNC, 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 SinglePhaseVtkOutputFields = LowReKEpsilonVtkOutputFields<FVGridGeometry>; + using SinglePhaseIOFields = LowReKEpsilonIOFields<FVGridGeometry>; public: - using type = FreeflowNCVtkOutputFields<SinglePhaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<SinglePhaseIOFields, ModelTraits>; }; ////////////////////////////////////////////////////////////////////////// @@ -213,17 +212,16 @@ 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 BaseIOFields = LowReKEpsilonIOFields<FVGridGeometry>; + using NonIsothermalFields = FreeflowNonIsothermalIOFields<BaseIOFields, ModelTraits>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<NonIsothermalFields, ModelTraits>; }; // \} diff --git a/dumux/freeflow/compositional/navierstokesncmodel.hh b/dumux/freeflow/compositional/navierstokesncmodel.hh index 8b1e608675c5a6fedc4a37f1eba55b7473bd4345..fa1ec5d18b32cefaef107689dbf680590848e2bc 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> @@ -182,16 +182,15 @@ 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) +//! The specific I/O fields +SET_PROP(NavierStokesNC, 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 BaseIOFields = NavierStokesIOFields<FVGridGeometry>; public: - using type = FreeflowNCVtkOutputFields<BaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<BaseIOFields, ModelTraits>; }; /*! @@ -231,17 +230,16 @@ 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 BaseIOFields = NavierStokesIOFields<FVGridGeometry>; + using NonIsothermalFields = FreeflowNonIsothermalIOFields<BaseIOFields, ModelTraits>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<NonIsothermalFields, ModelTraits>; }; //! 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..4d75e899d0b657c6d8c48d456baccfa16a13094d 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,16 +139,15 @@ public: using type = OneEqFluxVariables<TypeTag, BaseFluxVariables>; }; -//! The specific vtk output fields -SET_PROP(OneEqNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(OneEqNC, 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 SinglePhaseVtkOutputFields = OneEqVtkOutputFields<FVGridGeometry>; + using SinglePhaseIOFields = OneEqIOFields<FVGridGeometry>; public: - using type = FreeflowNCVtkOutputFields<SinglePhaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<SinglePhaseIOFields, ModelTraits>; }; ////////////////////////////////////////////////////////////////////////// @@ -211,17 +210,16 @@ 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 BaseIOFields = OneEqIOFields<FVGridGeometry>; + using NonIsothermalFields = FreeflowNonIsothermalIOFields<BaseIOFields, ModelTraits>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<NonIsothermalFields, ModelTraits>; }; // \} diff --git a/dumux/freeflow/compositional/zeroeqncmodel.hh b/dumux/freeflow/compositional/zeroeqncmodel.hh index c55ed9b71cc3f9f2e65c60b35cf57dc644284d41..45168b0716958c8f5e1f831c823ea6a3826b007a 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,16 +98,15 @@ public: using type = ZeroEqVolumeVariables<Traits, CompositionalVolVars>; }; -//! The specific vtk output fields -SET_PROP(ZeroEqNC, VtkOutputFields) +//! The specific I/O fields +SET_PROP(ZeroEqNC, 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 BaseIOFields = RANSIOFields<FVGridGeometry>; public: - using type = FreeflowNCVtkOutputFields<BaseVtkOutputFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<BaseIOFields, ModelTraits>; }; ////////////////////////////////////////////////////////////////////////// @@ -152,17 +151,16 @@ 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 BaseIOFields = RANSIOFields<FVGridGeometry>; + using NonIsothermalFields = FreeflowNonIsothermalIOFields<BaseIOFields, ModelTraits>; public: - using type = FreeflowNCVtkOutputFields<NonIsothermalFields, ModelTraits, FVGridGeometry, FluidSystem>; + using type = FreeflowNCIOFields<NonIsothermalFields, ModelTraits>; }; // \} 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/vtkoutputfields.hh b/dumux/freeflow/navierstokes/iofields.hh similarity index 61% rename from dumux/freeflow/navierstokes/vtkoutputfields.hh rename to dumux/freeflow/navierstokes/iofields.hh index 6a6a156f2910ad02a84ac042cd34d3e6fe585b55..d8b607f5ee8407436c02119f4ab0b8cce3501b42 100644 --- a/dumux/freeflow/navierstokes/vtkoutputfields.hh +++ b/dumux/freeflow/navierstokes/iofields.hh @@ -19,59 +19,84 @@ /*! * \file * \ingroup NavierStokesModel - * \copydoc Dumux::NavierStokesVtkOutputFields + * \copydoc Dumux::NavierStokesIOFields */ -#ifndef DUMUX_NAVIER_STOKES_VTK_OUTPUT_FIELDS_HH -#define DUMUX_NAVIER_STOKES_VTK_OUTPUT_FIELDS_HH +#ifndef DUMUX_NAVIER_STOKES_IO_FIELDS_HH +#define DUMUX_NAVIER_STOKES_IO_FIELDS_HH #include <dune/common/fvector.hh> #include <dumux/common/parameters.hh> #include <dumux/discretization/methods.hh> +#include <dumux/io/fieldnames.hh> +#include <dune/common/deprecated.hh> + namespace Dumux { /*! * \ingroup NavierStokesModel - * \brief Adds vtk output fields for the Navier-Stokes model + * \brief Adds I/O fields for the Navier-Stokes model */ template<class FVGridGeometry> -class NavierStokesVtkOutputFields +class NavierStokesIOFields { // 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) + //! Initialize the Navier-Stokes specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - 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"); + using namespace IOFieldNames; + using FluidSystem = typename OutputModule::VolumeVariables::FluidSystem; + out.addVolumeVariable([](const auto& v){ return v.pressure(); }, pressure()); + out.addVolumeVariable([](const auto& v){ return v.molarDensity(); }, molarDensity<FluidSystem>()); + out.addVolumeVariable([](const auto& v){ return v.density(); }, density()); // add discretization-specific fields - additionalOutput_(vtk, discMethodTag<FVGridGeometry::discMethod>{}); + additionalOutput_(out, discMethodTag<FVGridGeometry::discMethod>{}); + } + + 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 FluidSystem = void> + static std::string primaryVariableName(int pvIdx = 0, int state = 0) + { + using namespace IOFieldNames; + const std::array<std::string, 3> velocities = {"v_x", "v_y", "v_z"}; + + if (pvIdx < FVGridGeometry::Grid::dimension) + return velocities[pvIdx]; + else + return pressure(); } private: //! Adds discretization-specific fields (nothing by default). - template <class VtkOutputModule, class AnyMethod> - static void additionalOutput_(VtkOutputModule& vtk, AnyMethod) + template <class OutputModule, class AnyMethod> + static void additionalOutput_(OutputModule& out, 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>) + template <class OutputModule> + static void additionalOutput_(OutputModule& out, discMethodTag<DiscretizationMethod::staggered>) { - const bool writeFaceVars = getParamFromGroup<bool>(vtk.paramGroup(), "Vtk.WriteFaceData", false); + const bool writeFaceVars = getParamFromGroup<bool>(out.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 Scalar = typename OutputModule::VolumeVariables::PrimaryVariables::value_type; using VelocityVector = Dune::FieldVector<Scalar, FVGridGeometry::GridView::dimensionworld>; VelocityVector velocity(0.0); @@ -79,14 +104,14 @@ private: return velocity; }; - vtk.addFaceVariable(faceVelocityVector, "faceVelocity"); + out.addFaceVariable(faceVelocityVector, "faceVelocity"); auto faceNormalVelocity = [](const auto& faceVars) { return faceVars.velocitySelf(); }; - vtk.addFaceVariable(faceNormalVelocity, "v"); + out.addFaceVariable(faceNormalVelocity, "v"); } } }; diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh index 0cac3cf664da088ddc581604ef9430fdaeaea0be..0f3aaad66fbb6d6aaffa8eb049c9145ebd170f54 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> @@ -212,13 +212,13 @@ 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) +//! The specific I/O fields +SET_PROP(NavierStokes, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = NavierStokesVtkOutputFields<FVGridGeometry>; + using type = NavierStokesIOFields<FVGridGeometry>; }; ////////////////////////////////////////////////////////////////// // Property values for non-isothermal Navier-Stokes model @@ -235,15 +235,15 @@ public: using type = FreeflowNIModelTraits<IsothermalTraits>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(NavierStokesNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(NavierStokesNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = NavierStokesVtkOutputFields<FVGridGeometry>; + using IsothermalFields = NavierStokesIOFields<FVGridGeometry>; public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; + using type = FreeflowNonIsothermalIOFields<IsothermalFields, ModelTraits>; }; // \} 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 54% rename from dumux/freeflow/nonisothermal/vtkoutputfields.hh rename to dumux/freeflow/nonisothermal/iofields.hh index 8e6bb42dac94af1d9a302a3904e1a2eb4f7d4d23..cfe560702a53828deddb74d5742ee353a198ba07 100644 --- a/dumux/freeflow/nonisothermal/vtkoutputfields.hh +++ b/dumux/freeflow/nonisothermal/iofields.hh @@ -19,39 +19,57 @@ /*! * \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 <dumux/io/fieldnames.hh> +#include <dune/common/deprecated.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, class ModelTraits> +class FreeflowNonIsothermalIOFields { public: - //! Initialize the non-isothermal specific vtk output fields. - template <class VtkOutputModule> - static void init(VtkOutputModule& vtk) + + //! Initialize the non-isothermal specific output fields. + template <class OutputModule> + DUNE_DEPRECATED_MSG("use initOutputModule instead") + static void init(OutputModule& out) { - IsothermalVtkOutputFields::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the non-isothermal specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! Add the non-isothermal specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.temperature(); }, "T"); - vtk.addVolumeVariable([](const auto& v){ return v.thermalConductivity(); }, "lambda"); + IsothermalIOFields::initOutputModule(out); + + using namespace IOFieldNames; + out.addVolumeVariable([](const auto& v){ return v.temperature(); }, temperature()); + out.addVolumeVariable([](const auto& v){ return v.thermalConductivity(); }, "lambda"); if (ModelTraits::usesTurbulenceModel()) - vtk.addVolumeVariable([](const auto& v){ return v.effectiveThermalConductivity() - v.thermalConductivity(); }, "lambda_t"); + out.addVolumeVariable([](const auto& v){ return v.effectiveThermalConductivity() - v.thermalConductivity(); }, "lambda_t"); + } + + //! return the names of the primary variables + template <class FluidSystem = void> + static std::string primaryVariableName(int pvIdx, int state = 0) + { + using namespace IOFieldNames; + if (pvIdx < ModelTraits::numEq() - 1) + return IsothermalIOFields::template primaryVariableName<FluidSystem>(pvIdx, state); + else + return 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 59% rename from dumux/freeflow/rans/vtkoutputfields.hh rename to dumux/freeflow/rans/iofields.hh index 4f8541bac29bd58b1bf8ba3e21b3602569e84206..3cf03af53a978816bafff9d19437e45f9e84f521 100644 --- a/dumux/freeflow/rans/vtkoutputfields.hh +++ b/dumux/freeflow/rans/iofields.hh @@ -19,50 +19,53 @@ /*! * \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> +class 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<FVGridGeometry>::initOutputModule(out); + + 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^+"); } }; diff --git a/dumux/freeflow/rans/model.hh b/dumux/freeflow/rans/model.hh index 62232a86d3bf0ac8f827b626f4b7110a426638c2..4a1f4e4635ec6df8d77b7dff0cec813007d5fc39 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,13 +83,13 @@ public: using type = RANSModelTraits<dim>; }; -//! The specific vtk output fields -SET_PROP(RANS, VtkOutputFields) +//! The specific I/O fields +SET_PROP(RANS, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = RANSVtkOutputFields<FVGridGeometry>; + using type = RANSIOFields<FVGridGeometry>; }; ////////////////////////////////////////////////////////////////// @@ -111,15 +111,15 @@ public: using type = FreeflowNIModelTraits<IsothermalTraits>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(RANSNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(RANSNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = RANSVtkOutputFields<FVGridGeometry>; + using IsothermalFields = RANSIOFields<FVGridGeometry>; public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; + using type = FreeflowNonIsothermalIOFields<IsothermalFields, ModelTraits>; }; //! Use Fourier's Law as default heat conduction type 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 68% rename from dumux/freeflow/rans/oneeq/vtkoutputfields.hh rename to dumux/freeflow/rans/oneeq/iofields.hh index be9d913e2fd0ff150df1d19625187a2bc50ca678..24adbfd3d91e17b272f0606de16d4758c2b69858 100644 --- a/dumux/freeflow/rans/oneeq/vtkoutputfields.hh +++ b/dumux/freeflow/rans/oneeq/iofields.hh @@ -19,39 +19,39 @@ /*! * \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> +class OneEqIOFields { enum { dim = FVGridGeometry::GridView::dimension }; public: - //! Initialize the Reynolds-averaged 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) { - RANSVtkOutputFields<FVGridGeometry>::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the OneEq specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! Initialize the OneEq specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.viscosityTilde(); }, "nu_tilde"); + RANSIOFields<FVGridGeometry>::initOutputModule(out); + out.addVolumeVariable([](const auto& v){ return v.viscosityTilde(); }, "nu_tilde"); } }; diff --git a/dumux/freeflow/rans/oneeq/model.hh b/dumux/freeflow/rans/oneeq/model.hh index 02c14b9a0a6e5213b046193856eec8d120f30324..e434db80ae11f5f5b2e75f579dbea4c2d3c68ccc 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 { @@ -179,13 +180,13 @@ public: using type = OneEqVolumeVariables<Traits, NSVolVars>; }; -//! The specific vtk output fields -SET_PROP(OneEq, VtkOutputFields) +//! The specific I/O fields +SET_PROP(OneEq, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = OneEqVtkOutputFields<FVGridGeometry>; + using type = OneEqIOFields<FVGridGeometry>; }; ////////////////////////////////////////////////////////////////// @@ -225,15 +226,15 @@ public: using type = OneEqVolumeVariables<Traits, NSVolVars>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(OneEqNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(OneEqNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = OneEqVtkOutputFields<FVGridGeometry>; + using IsothermalFields = OneEqIOFields<FVGridGeometry>; public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; + using type = FreeflowNonIsothermalIOFields<IsothermalFields, ModelTraits>; }; // \} 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 62% rename from dumux/freeflow/rans/twoeq/kepsilon/vtkoutputfields.hh rename to dumux/freeflow/rans/twoeq/kepsilon/iofields.hh index 7808fa069c76272116f2bb28c744c0959aa0a9dc..c05d2de1b52d07d3cb0d23511979e3904b06caeb 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/vtkoutputfields.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/iofields.hh @@ -19,44 +19,47 @@ /*! * \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> +class KEpsilonIOFields { enum { dim = FVGridGeometry::GridView::dimension }; public: - //! Initialize the Reynolds-averaged 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) { - RANSVtkOutputFields<FVGridGeometry>::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the KEpsilon specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! Initialize the KEpsilon specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - 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"); + RANSIOFields<FVGridGeometry>::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"); } }; diff --git a/dumux/freeflow/rans/twoeq/kepsilon/model.hh b/dumux/freeflow/rans/twoeq/kepsilon/model.hh index d3bcfd46aae0e9f2f8610c5bdfcdca448d31019b..6c99ba07ce2e89e831b13835f717640ecff310d1 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 { @@ -170,13 +170,13 @@ public: using type = KEpsilonVolumeVariables<Traits, NSVolVars>; }; -//! The specific vtk output fields -SET_PROP(KEpsilon, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KEpsilon, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = KEpsilonVtkOutputFields<FVGridGeometry>; + using type = KEpsilonIOFields<FVGridGeometry>; }; ////////////////////////////////////////////////////////////////// @@ -216,15 +216,15 @@ public: using type = KEpsilonVolumeVariables<Traits, NSVolVars>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(KEpsilonNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(KEpsilonNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = KEpsilonVtkOutputFields<FVGridGeometry>; + using IsothermalFields = KEpsilonIOFields<FVGridGeometry>; public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; + using type = FreeflowNonIsothermalIOFields<IsothermalFields, ModelTraits>; }; // \} 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 67% rename from dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh rename to dumux/freeflow/rans/twoeq/komega/iofields.hh index 95987da43f5787e17d2ad00d5dca26c3a8c579aa..7cc50459c7056e1e678c9231cb044dd9af3aeb56 100644 --- a/dumux/freeflow/rans/twoeq/komega/vtkoutputfields.hh +++ b/dumux/freeflow/rans/twoeq/komega/iofields.hh @@ -19,40 +19,41 @@ /*! * \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> +class KOmegaIOFields { 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) { - RANSVtkOutputFields<FVGridGeometry>::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the KOmegaModel specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! Initialize the KOmegaModel specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); - vtk.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega"); + out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); + out.addVolumeVariable([](const auto& v){ return v.dissipation(); }, "omega"); } }; diff --git a/dumux/freeflow/rans/twoeq/komega/model.hh b/dumux/freeflow/rans/twoeq/komega/model.hh index 718d2c1c5acf5288efabc6009de174adb7ae1897..806c24338711fe53ec9d08d863d1a9cbc6f04458 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 { @@ -177,13 +177,13 @@ public: using type = KOmegaVolumeVariables<Traits, NSVolVars>; }; -//! The specific vtk output fields -SET_PROP(KOmega, VtkOutputFields) +//! The specific I/O fields +SET_PROP(KOmega, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = KOmegaVtkOutputFields<FVGridGeometry>; + using type = KOmegaIOFields<FVGridGeometry>; }; /////////////////////////////////////////////////////////////////////////// @@ -224,15 +224,15 @@ public: using type = KOmegaVolumeVariables<Traits, NSVolVars>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(KOmegaNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(KOmegaNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = KOmegaVtkOutputFields<FVGridGeometry>; + using IsothermalFields = KOmegaIOFields<FVGridGeometry>; public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; + using type = FreeflowNonIsothermalIOFields<IsothermalFields, ModelTraits>; }; // \} 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 66% rename from dumux/freeflow/rans/twoeq/lowrekepsilon/vtkoutputfields.hh rename to dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh index 6ba9d9f2feafae1addf812901f3b38e79336e7e3..289777bf00c66eaf671749e83a0d65f02f25c485 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/vtkoutputfields.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/iofields.hh @@ -19,40 +19,42 @@ /*! * \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> +class LowReKEpsilonIOFields { enum { dim = FVGridGeometry::GridView::dimension }; public: - //! Initialize the Reynolds-averagedNavier-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) { - RANSVtkOutputFields<FVGridGeometry>::init(vtk); - add(vtk); + initOutputModule(out); } - //! Add the LowReKEpsilon specific vtk output fields. - template <class VtkOutputModule> - static void add(VtkOutputModule& vtk) + //! Initialize the LowReKEpsilon specific output fields. + template <class OutputModule> + static void initOutputModule(OutputModule& out) { - vtk.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); - vtk.addVolumeVariable([](const auto& v){ return v.dissipationTilde(); }, "epsilon"); + RANSIOFields<FVGridGeometry>::initOutputModule(out); + out.addVolumeVariable([](const auto& v){ return v.turbulentKineticEnergy(); }, "k"); + out.addVolumeVariable([](const auto& v){ return v.dissipationTilde(); }, "epsilon"); } }; diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/model.hh index 1fa9cd6cf7a3e8296601570e8ea75cbe067a4ddf..43c36f2896cbadd3b65038f39bcf89e298e67172 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 { @@ -186,13 +186,13 @@ public: using type = LowReKEpsilonVolumeVariables<Traits, NSVolVars>; }; -//! The specific vtk output fields -SET_PROP(LowReKEpsilon, VtkOutputFields) +//! The specific I/O fields +SET_PROP(LowReKEpsilon, IOFields) { private: using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); public: - using type = LowReKEpsilonVtkOutputFields<FVGridGeometry>; + using type = LowReKEpsilonIOFields<FVGridGeometry>; }; ////////////////////////////////////////////////////////////////// @@ -232,15 +232,15 @@ public: using type = LowReKEpsilonVolumeVariables<Traits, NSVolVars>; }; -//! The specific non-isothermal vtk output fields -SET_PROP(LowReKEpsilonNI, VtkOutputFields) +//! The specific non-isothermal I/O fields +SET_PROP(LowReKEpsilonNI, IOFields) { private: using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - using IsothermalFields = LowReKEpsilonVtkOutputFields<FVGridGeometry>; + using IsothermalFields = LowReKEpsilonIOFields<FVGridGeometry>; public: - using type = FreeflowNonIsothermalVtkOutputFields<IsothermalFields, ModelTraits>; + using type = FreeflowNonIsothermalIOFields<IsothermalFields, ModelTraits>; }; // \} diff --git a/test/freeflow/navierstokes/test_channel.cc b/test/freeflow/navierstokes/test_channel.cc index 4ad7012be710e0d8cdb5e66fcf5041aa69c4f2c3..e5be192cb6ba9755c9f46fe7371414ce84573343 100644 --- a/test/freeflow/navierstokes/test_channel.cc +++ b/test/freeflow/navierstokes/test_channel.cc @@ -167,9 +167,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_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/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/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