diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index b11c9247de16dd0b5d4672331b82cfe0c43d1759..cdba9ba5c0445bae4a82f267b6f51c791cc18dc8 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -103,7 +103,9 @@ SET_BOOL_PROP(TwoP, EnableEnergyBalance, false); // SET_TYPE_PROP(TwoP, LocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< Use the immiscible local residual operator for the 2p model SET_TYPE_PROP(TwoP, VolumeVariables, TwoPVolumeVariables<TypeTag>); //!< the VolumeVariables property SET_TYPE_PROP(TwoP, SpatialParams, FVSpatialParams<TypeTag>); //!< The spatial parameters. Use FVSpatialParams by default. -SET_TYPE_PROP(TwoP, VtkOutputFields, TwoPVtkOutputFields<TypeTag>); //!< Set the vtk output fields specific to the twop model + +//! Set the vtk output fields specific to the twop model +SET_TYPE_PROP(TwoP, VtkOutputFields, TwoPVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>); SET_TYPE_PROP(TwoP, Indices, @@ -125,7 +127,9 @@ public: SET_INT_PROP(TwoPNI, IsothermalNumEq, 2); //!< set isothermal NumEq SET_TYPE_PROP(TwoPNI, IsothermalVolumeVariables, TwoPVolumeVariables<TypeTag>); //!< set isothermal VolumeVariables SET_TYPE_PROP(TwoPNI, IsothermalLocalResidual, ImmiscibleLocalResidual<TypeTag>); //!< set isothermal LocalResidual -SET_TYPE_PROP(TwoPNI, IsothermalVtkOutputFields, TwoPVtkOutputFields<TypeTag>); //!< set isothermal output fields + +//! Set the vtk output fields specific to the isothermal twop model +SET_TYPE_PROP(TwoPNI, IsothermalVtkOutputFields, TwoPVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>); //! Set isothermal Indices SET_PROP(TwoPNI, IsothermalIndices) diff --git a/dumux/porousmediumflow/2p/vtkoutputfields.hh b/dumux/porousmediumflow/2p/vtkoutputfields.hh index 45f7534415fc9656030de9e95b815cc231cb8a63..402c92cc6c5699594db861c7f536f1506107cc4f 100644 --- a/dumux/porousmediumflow/2p/vtkoutputfields.hh +++ b/dumux/porousmediumflow/2p/vtkoutputfields.hh @@ -24,33 +24,29 @@ #ifndef DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH #define DUMUX_TWOP_VTK_OUTPUT_FIELDS_HH -#include <dumux/common/properties.hh> - namespace Dumux { /*! * \ingroup TwoPModel * \brief Adds vtk output fields specific to the two-phase model */ -template<class TypeTag> +template<class Indices> class TwoPVtkOutputFields { - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); public: template <class VtkOutputModule> static void init(VtkOutputModule& vtk) { - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw"); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn"); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(Indices::wPhaseIdx); }, "pw"); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(Indices::nPhaseIdx); }, "pn"); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.capillaryPressure(); }, "pc"); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.density(Indices::wPhaseIdx); }, "rhoW"); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.density(Indices::nPhaseIdx); }, "rhoN"); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.mobility(Indices::wPhaseIdx); }, "mobW"); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.mobility(Indices::nPhaseIdx); }, "mobN"); - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.porosity(); }, "porosity"); + vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::wPhaseIdx); }, "Sw"); + vtk.addVolumeVariable([](const auto& v){ return v.saturation(Indices::nPhaseIdx); }, "Sn"); + vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::wPhaseIdx); }, "pw"); + vtk.addVolumeVariable([](const auto& v){ return v.pressure(Indices::nPhaseIdx); }, "pn"); + vtk.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); }, "pc"); + vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::wPhaseIdx); }, "rhoW"); + vtk.addVolumeVariable([](const auto& v){ return v.density(Indices::nPhaseIdx); }, "rhoN"); + vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::wPhaseIdx); }, "mobW"); + vtk.addVolumeVariable([](const auto& v){ return v.mobility(Indices::nPhaseIdx); }, "mobN"); + vtk.addVolumeVariable([](const auto& v){ return v.porosity(); }, "porosity"); } }; diff --git a/dumux/porousmediumflow/2p1c/model.hh b/dumux/porousmediumflow/2p1c/model.hh index 90aa3d692c4c987e638b23237130be3440d9f4b2..e50a9352390c1f54168a8f120fef1afd5c96cd23 100644 --- a/dumux/porousmediumflow/2p1c/model.hh +++ b/dumux/porousmediumflow/2p1c/model.hh @@ -183,7 +183,7 @@ SET_TYPE_PROP(TwoPOneCNI, IsothermalLocalResidual, ImmiscibleLocalResidual<TypeT SET_TYPE_PROP(TwoPOneCNI, IsothermalIndices, TwoPOneCIndices<TypeTag, 0>); //! The isothermal vtk output fields. -SET_TYPE_PROP(TwoPOneCNI, IsothermalVtkOutputFields, TwoPOneCVtkOutputFields<TypeTag>); +SET_TYPE_PROP(TwoPOneCNI, IsothermalVtkOutputFields, TwoPOneCVtkOutputFields<typename GET_PROP_TYPE(TypeTag, Indices)>); //! Set isothermal NumEq. SET_INT_PROP(TwoPOneCNI, IsothermalNumEq, 1); diff --git a/dumux/porousmediumflow/2p1c/vtkoutputfields.hh b/dumux/porousmediumflow/2p1c/vtkoutputfields.hh index 69d1bdf4d26fbd357d2aaa64be7018da9ddb1a48..054f68bf4ae0aaf1103bcccc75573a9293dda026 100644 --- a/dumux/porousmediumflow/2p1c/vtkoutputfields.hh +++ b/dumux/porousmediumflow/2p1c/vtkoutputfields.hh @@ -26,26 +26,24 @@ #include <dumux/porousmediumflow/2p/vtkoutputfields.hh> -namespace Dumux -{ +namespace Dumux { /*! * \ingroup TwoPOneCModel * \brief Adds vtk output fields specific to two-phase one-component model. */ -template<class TypeTag> +template<class Indices> class TwoPOneCVtkOutputFields { - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); public: template <class VtkOutputModule> static void init(VtkOutputModule& vtk) { // use default fields from the 2p model - TwoPVtkOutputFields<TypeTag>::init(vtk); + TwoPVtkOutputFields<Indices>::init(vtk); - //output additional to TwoP output: - vtk.addVolumeVariable([](const VolumeVariables& v){ return v.priVars().state(); }, "phasePresence"); + // output additional to TwoP output: + vtk.addVolumeVariable([](const auto& v){ return v.priVars().state(); }, "phasePresence"); } }; diff --git a/dumux/porousmediumflow/2pnc/vtkoutputfields.hh b/dumux/porousmediumflow/2pnc/vtkoutputfields.hh index 15da2ad3fc2d06cfe14910170095af56c0a03519..25cc9571b63ad014e9787c18293f7637e5c3aa61 100644 --- a/dumux/porousmediumflow/2pnc/vtkoutputfields.hh +++ b/dumux/porousmediumflow/2pnc/vtkoutputfields.hh @@ -49,7 +49,7 @@ public: static void init(VtkOutputModule& vtk) { // use default fields from the 2p model - TwoPVtkOutputFields<TypeTag>::init(vtk); + TwoPVtkOutputFields<Indices>::init(vtk); //output additional to TwoP output: for (int i = 0; i < numPhases; ++i)