diff --git a/dumux/porousmediumflow/3p3c/model.hh b/dumux/porousmediumflow/3p3c/model.hh index 5897c0957b9acdfd8865707ac41a8aa750bc2a05..438d45a073f1b250f55135b805ea16adf99674f6 100644 --- a/dumux/porousmediumflow/3p3c/model.hh +++ b/dumux/porousmediumflow/3p3c/model.hh @@ -203,8 +203,15 @@ SET_PROP(ThreePThreeC, EffectiveDiffusivityModel) using type = DiffusivityMillingtonQuirk<Scalar>; }; -//! Set the vtk output fields specific to the ThreeP model -SET_TYPE_PROP(ThreePThreeC, VtkOutputFields, ThreePThreeCVtkOutputFields<TypeTag>); +//! Set the vtk output fields specific to this model +SET_PROP(ThreePThreeC, VtkOutputFields) +{ +private: + using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Indices = typename GET_PROP_TYPE(TypeTag, Indices); +public: + using type = ThreePThreeCVtkOutputFields<FluidSystem, Indices>; +}; //! Use mole fractions in the balance equations by default SET_BOOL_PROP(ThreePThreeC, UseMoles, true); @@ -241,8 +248,16 @@ public: //! Set isothermal NumEq SET_INT_PROP(ThreePThreeCNI, IsothermalNumEq, 3); -//! Set the vtk output fields specific to the ThreeP model -SET_TYPE_PROP(ThreePThreeCNI, IsothermalVtkOutputFields, ThreePThreeCVtkOutputFields<TypeTag>); +//! Set the isothermal vktoutputfields +SET_PROP(ThreePThreeCNI, IsothermalVtkOutputFields) +{ +private: + using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + using Indices = typename GET_PROP_TYPE(TypeTag, Indices); + +public: + using type = ThreePThreeCVtkOutputFields<FluidSystem, Indices>; +}; } // end namespace Properties diff --git a/dumux/porousmediumflow/3p3c/vtkoutputfields.hh b/dumux/porousmediumflow/3p3c/vtkoutputfields.hh index abccdece2452ad54f9da94fa2d58c3cb71759caa..58453fb2c5dfe990179f900fbb16aba8c9df27fb 100644 --- a/dumux/porousmediumflow/3p3c/vtkoutputfields.hh +++ b/dumux/porousmediumflow/3p3c/vtkoutputfields.hh @@ -33,39 +33,33 @@ namespace Dumux * \ingroup ThreePThreeCModel * \brief Adds vtk output fields specific to the three-phase three-component model */ -template<class TypeTag> +template<class FluidSystem, class Indices> class ThreePThreeCVtkOutputFields { - using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases), - numComponents = GET_PROP_VALUE(TypeTag, NumComponents) - }; public: template <class VtkOutputModule> static void init(VtkOutputModule& vtk) { // register standardized vtk output fields - 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.saturation(Indices::gPhaseIdx); },"Sg"); - 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.pressure(Indices::gPhaseIdx); },"pg"); - 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.density(Indices::gPhaseIdx); },"rhog"); + 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.saturation(Indices::gPhaseIdx); },"Sg"); + 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.pressure(Indices::gPhaseIdx); },"pg"); + 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.density(Indices::gPhaseIdx); },"rhog"); - for (int i = 0; i < numPhases; ++i) - for (int j = 0; j < numComponents; ++j) - vtk.addVolumeVariable([i,j](const VolumeVariables& v){ return v.moleFraction(i,j); }, + for (int i = 0; i < FluidSystem::numPhases; ++i) + for (int j = 0; j < FluidSystem::numComponents; ++j) + vtk.addVolumeVariable([i,j](const auto& v){ return v.moleFraction(i,j); }, "x^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(i)); - vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.porosity(); },"porosity"); - vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.priVars().state(); },"phase presence"); - vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.permeability(); },"permeability"); + 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"); } };