diff --git a/dumux/freeflow/staggered/properties.hh b/dumux/freeflow/staggered/properties.hh index 26b696637dc1c303cafb9c985ff6bf8e05dc5a74..357cc34b57c18a59880ee9d00c2e6467bfe58b1d 100644 --- a/dumux/freeflow/staggered/properties.hh +++ b/dumux/freeflow/staggered/properties.hh @@ -141,9 +141,6 @@ SET_BOOL_PROP(NavierStokes, EnableEnergyBalance, false); SET_TYPE_PROP(NavierStokes, VelocityOutput, StaggeredFreeFlowVelocityOutput<TypeTag>); -// disable velocity output by default -SET_BOOL_PROP(NavierStokes, VtkAddVelocity, true); - SET_TYPE_PROP(NavierStokes, VtkOutputFields, NavierStokesVtkOutputFields<TypeTag>); SET_BOOL_PROP(NavierStokes, EnableInertiaTerms, true); diff --git a/dumux/freeflow/staggerednc/fluxvariables.hh b/dumux/freeflow/staggerednc/fluxvariables.hh index 83542c6eb03eda7bd065b43733ea38d6a7cac072..8639c26ebfbac28cd785f22749cd9c9f1658bdd1 100644 --- a/dumux/freeflow/staggerednc/fluxvariables.hh +++ b/dumux/freeflow/staggerednc/fluxvariables.hh @@ -23,7 +23,7 @@ #ifndef DUMUX_FREELOW_IMPLICIT_NC_FLUXVARIABLES_HH #define DUMUX_FREELOW_IMPLICIT_NC_FLUXVARIABLES_HH -#include <dumux/implicit/properties.hh> +#include <dumux/common/properties.hh> #include <dumux/discretization/fluxvariablesbase.hh> #include "../staggered/fluxvariables.hh" @@ -96,6 +96,7 @@ class FreeFlowFluxVariablesImpl<TypeTag, true> : public FreeFlowFluxVariablesImp }; public: + CellCenterPrimaryVariables computeFluxForCellCenter(const Problem& problem, const Element &element, const FVElementGeometry& fvGeometry, @@ -127,7 +128,7 @@ private: const Scalar velocity = elemFaceVars[scvf].velocitySelf(); const bool insideIsUpstream = sign(scvf.outerNormalScalar()) == sign(velocity); - const Scalar upWindWeight = GET_PROP_VALUE(TypeTag, ImplicitUpwindWeight); + const Scalar upWindWeight = getParamFromGroup<Scalar>(GET_PROP_VALUE(TypeTag, ModelParameterGroup), "Implicit.UpwindWeight"); for (int compIdx = 0; compIdx < numComponents; ++compIdx) { diff --git a/dumux/freeflow/staggerednc/indices.hh b/dumux/freeflow/staggerednc/indices.hh index b68c4d4ea0c6b0c992d1f8acb13854b6c178ee0d..d6a83c1eff5913d812d4a944b84a62309cac3bf3 100644 --- a/dumux/freeflow/staggerednc/indices.hh +++ b/dumux/freeflow/staggerednc/indices.hh @@ -24,6 +24,7 @@ #define DUMUX_STAGGERED_NAVIERSTOKES_NC_INDICES_HH #include <dumux/freeflow/staggered/indices.hh> +#include <dumux/common/properties.hh> namespace Dumux { diff --git a/dumux/freeflow/staggerednc/localresidual.hh b/dumux/freeflow/staggerednc/localresidual.hh index db16c348a81be626c2daa7da8f7d996d625f571a..6edb9805f33ba6d24492498964491645db94cf30 100644 --- a/dumux/freeflow/staggerednc/localresidual.hh +++ b/dumux/freeflow/staggerednc/localresidual.hh @@ -23,7 +23,6 @@ #ifndef DUMUX_STAGGERED_NAVIERSTOKES_NC_LOCAL_RESIDUAL_HH #define DUMUX_STAGGERED_NAVIERSTOKES_NC_LOCAL_RESIDUAL_HH -#include <dune/istl/matrix.hh> #include <dumux/common/valgrind.hh> #include <dumux/implicit/staggered/localresidual.hh> @@ -65,17 +64,17 @@ class StaggeredNavierStokesResidualImpl<TypeTag, true> : public StaggeredNavierS friend ParentType; using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); using Indices = typename GET_PROP_TYPE(TypeTag, Indices); - using FluxVariables = typename GET_PROP_TYPE(TypeTag, FluxVariables); using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); + using CellCenterResidual = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; enum { conti0EqIdx = Indices::conti0EqIdx, @@ -92,6 +91,8 @@ class StaggeredNavierStokesResidualImpl<TypeTag, true> : public StaggeredNavierS static constexpr int numComponents = GET_PROP_VALUE(TypeTag, NumComponents); static constexpr bool useMoles = GET_PROP_VALUE(TypeTag, UseMoles); +public: + using ParentType::ParentType; /*! * \brief Evaluate the rate of change of all conservation @@ -103,7 +104,8 @@ class StaggeredNavierStokesResidualImpl<TypeTag, true> : public StaggeredNavierS * \note The volVars can be different to allow computing * the implicit euler time derivative here */ - CellCenterPrimaryVariables computeStorageForCellCenter(const SubControlVolume& scv, + CellCenterPrimaryVariables computeStorageForCellCenter(const Problem& problem, + const SubControlVolume& scv, const VolumeVariables& volVars) const { CellCenterPrimaryVariables storage(0.0); @@ -140,11 +142,13 @@ protected: * \param elemVolVars The current or previous element volVars * \param bcTypes The boundary types */ - void setFixedCell_(const SubControlVolume& insideScv, + void setFixedCell_(CellCenterResidual& residual, + const Problem& problem, + const SubControlVolume& insideScv, const ElementVolumeVariables& elemVolVars, - const BoundaryTypes& bcTypes) + const BoundaryTypes& bcTypes) const { - ParentType::setFixedCell_(insideScv, elemVolVars, bcTypes); + ParentType::setFixedCell_(residual, problem, insideScv, elemVolVars, bcTypes); for (int compIdx = 0; compIdx < numComponents; ++compIdx) { @@ -156,7 +160,7 @@ protected: { const auto& insideVolVars = elemVolVars[insideScv]; const Scalar massOrMoleFraction = useMoles ? insideVolVars.moleFraction(phaseIdx, compIdx) : insideVolVars.massFraction(phaseIdx, compIdx); - this->ccResidual_[eqIdx] = massOrMoleFraction - this->problem().dirichletAtPos(insideScv.center())[cellCenterIdx][eqIdx]; + residual[eqIdx] = massOrMoleFraction - problem.dirichletAtPos(insideScv.center())[cellCenterIdx][eqIdx]; } } diff --git a/dumux/freeflow/staggerednc/model.hh b/dumux/freeflow/staggerednc/model.hh index f65194ab28971e01cc8140bc36b3dd00e16a5a5f..1c6c25cb78db68c0b86e3549500b168626eed0c9 100644 --- a/dumux/freeflow/staggerednc/model.hh +++ b/dumux/freeflow/staggerednc/model.hh @@ -27,15 +27,9 @@ #ifndef DUMUX_NAVIERSTOKES_NC_MODEL_HH #define DUMUX_NAVIERSTOKES_NC_MODEL_HH -// #include <dumux/porousmediumflow/implicit/velocityoutput.hh> -#include "properties.hh" -#include "../staggered/model.hh" -#include "../staggeredni/model.hh" -namespace Dumux -{ /*! - * \ingroup NavierStokesModel + * \ingroup NavierStokesModel TODO: doc me properly! * \brief A single-phase, isothermal flow model using the fully implicit scheme. * * Single-phase, isothermal flow model, which uses a standard Darcy approach as the @@ -55,63 +49,6 @@ namespace Dumux * and the implicit Euler method as time discretization. * The model supports compressible as well as incompressible fluids. */ -template<class TypeTag > -class NavierStokesNCModel : public NavierStokesModel<TypeTag> -{ - using ParentType = NavierStokesModel<TypeTag>; - typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry; - typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem; - typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; - typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - typedef typename GET_PROP_TYPE(TypeTag, FVGridGeometry) FVGridGeometry; - typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector; - typedef typename GET_PROP_TYPE(TypeTag, JacobianAssembler) JacobianAssembler; - using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); - using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); - - typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; - enum { dim = GridView::dimension }; - enum { dimWorld = GridView::dimensionworld }; - - enum { isBox = GET_PROP_VALUE(TypeTag, ImplicitIsBox) }; - enum { dofCodim = isBox ? dim : 0 }; - using Element = typename GridView::template Codim<0>::Entity; - - using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; - - static constexpr int numComponents = GET_PROP_VALUE(TypeTag, NumComponents); - - using DofTypeIndices = typename GET_PROP(TypeTag, DofTypeIndices); - typename DofTypeIndices::CellCenterIdx cellCenterIdx; - typename DofTypeIndices::FaceIdx faceIdx; - - enum { phaseIdx = Indices::phaseIdx }; - -public: - - void init(Problem& problem) - { - ParentType::init(problem); - - // register standardized vtk output fields - auto& vtkOutputModule = problem.vtkOutputModule(); - vtkOutputModule.addSecondaryVariable("rhoMolar",[](const VolumeVariables& v){ return v.molarDensity(); }); - vtkOutputModule.addSecondaryVariable("rho",[](const VolumeVariables& v){ return v.density(); }); - for (int j = 0; j < numComponents; ++j) - { - vtkOutputModule.addSecondaryVariable("X^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(phaseIdx), - [j](const VolumeVariables& v){ return v.massFraction(phaseIdx,j); }); - - vtkOutputModule.addSecondaryVariable("x^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(phaseIdx), - [j](const VolumeVariables& v){ return v.moleFraction(phaseIdx,j); }); - } - -// NonIsothermalModel::maybeAddTemperature(vtkOutputModule); - } -}; -} - -#include "propertydefaults.hh" #endif diff --git a/dumux/freeflow/staggerednc/properties.hh b/dumux/freeflow/staggerednc/properties.hh index 4fdcc281361f1e882df54be7320fbfc3c67ead3b..982cd53f0264462c322fcab12604d93f3a496102 100644 --- a/dumux/freeflow/staggerednc/properties.hh +++ b/dumux/freeflow/staggerednc/properties.hh @@ -29,6 +29,19 @@ #include <dumux/freeflow/staggered/properties.hh> #include <dumux/freeflow/staggeredni/properties.hh> +#include <dumux/discretization/fickslaw.hh> + +#include "volumevariables.hh" +#include "indices.hh" +#include "localresidual.hh" +#include "fluxvariables.hh" +#include "vtkoutputfields.hh" + +#include <dumux/implicit/staggered/localresidual.hh> +#include <dumux/material/fluidsystems/gasphase.hh> +#include <dumux/material/fluidsystems/liquidphase.hh> + +#include <dumux/material/fluidstates/compositional.hh> namespace Dumux { @@ -46,27 +59,75 @@ namespace Properties { NEW_TYPE_TAG(NavierStokesNC, INHERITS_FROM(NavierStokes)); NEW_TYPE_TAG(NavierStokesNCNI, INHERITS_FROM(NavierStokesNC, NavierStokesNonIsothermal)); -////////////////////////////////////////////////////////////////// -// Property tags -////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// +// default property values for the isothermal single phase model +/////////////////////////////////////////////////////////////////////////// +SET_PROP(NavierStokesNC, NumEqCellCenter) +{ +private: + static constexpr int numComponents = GET_PROP_VALUE(TypeTag, NumComponents); +public: + static constexpr int value = numComponents; +}; + +SET_INT_PROP(NavierStokesNC, ReplaceCompEqIdx, 0); + +/*! +* \brief Set the property for the number of components. +* +* We just forward the number from the fluid system +* +*/ +SET_PROP(NavierStokesNC, NumComponents) +{ +private: + typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; + +public: + static constexpr int value = FluidSystem::numComponents; + +}; + +//! the VolumeVariables property +SET_TYPE_PROP(NavierStokesNC, VolumeVariables, NavierStokesNCVolumeVariables<TypeTag>); +SET_TYPE_PROP(NavierStokesNC, Indices, NavierStokesNCIndices<TypeTag>); + +/*! + * \brief The fluid state which is used by the volume variables to + * store the thermodynamic state. This should be chosen + * appropriately for the model ((non-)isothermal, equilibrium, ...). + * This can be done in the problem. + */ +SET_PROP(NavierStokesNC, FluidState) +{ + private: + using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + public: + using type = CompositionalFluidState<Scalar, FluidSystem>; +}; + +SET_BOOL_PROP(NavierStokesNC, EnableComponentTransport, true); + +//! The one-phase model has no molecular diffusion +SET_BOOL_PROP(NavierStokesNC, EnableMolecularDiffusion, true); + +SET_TYPE_PROP(NavierStokesNC, MolecularDiffusionType, FicksLaw<TypeTag>); + +SET_BOOL_PROP(NavierStokesNC, UseMoles, false); //!< Defines whether molar (true) or mass (false) density is used + +SET_INT_PROP(NavierStokesNC, PhaseIdx, 0); //!< Defines the phaseIdx + +SET_TYPE_PROP(NavierStokesNC, VtkOutputFields, NavierStokesNCVtkOutputFields<TypeTag>); + +//set isothermal Indices +SET_TYPE_PROP(NavierStokesNCNI, IsothermalIndices, NavierStokesNCIndices<TypeTag>); + +//set isothermal NumEq +SET_INT_PROP(NavierStokesNCNI, IsothermalNumEqCellCenter, GET_PROP_VALUE(TypeTag, NumComponents)); //!< set the number of equations to 1 +SET_INT_PROP(NavierStokesNCNI, IsothermalNumEqFace, 1); //!< set the number of equations + -NEW_PROP_TAG(NumPhases); //!< Number of fluid phases in the system -NEW_PROP_TAG(Indices); //!< Enumerations for the model -NEW_PROP_TAG(FluidSystem); //!< The type of the fluid system to use -NEW_PROP_TAG(Fluid); //!< The fluid used for the default fluid system -NEW_PROP_TAG(FluidState); //!< The type of the fluid state to use -NEW_PROP_TAG(ProblemEnableGravity); //!< Returns whether gravity is considered in the problem -NEW_PROP_TAG(ImplicitMassUpwindWeight); //!< Returns weight of the upwind cell when calculating fluxes -NEW_PROP_TAG(ImplicitMobilityUpwindWeight); //!< Weight for the upwind mobility in the velocity calculation -NEW_PROP_TAG(VtkAddVelocity); //!< Returns whether velocity vectors are written into the vtk output -NEW_PROP_TAG(EnableInertiaTerms); //!< Returns whether to include inertia terms in the momentum balance eq or not (Stokes / Navier-Stokes) -NEW_PROP_TAG(BoundaryValues); //!< Type to set values on the boundary -NEW_PROP_TAG(EnableComponentTransport); //!< Returns whether to consider component transport or not -NEW_PROP_TAG(EnableEnergyTransport); //!< Returns whether to consider energy transport or not -NEW_PROP_TAG(FaceVariables); //!< Returns whether to consider energy transport or not -NEW_PROP_TAG(ReplaceCompEqIdx); //!< Returns whether to consider energy transport or not -NEW_PROP_TAG(UseMoles); //!< Defines whether molar (true) or mass (false) density is used -NEW_PROP_TAG(PhaseIdx); //!< Defines the phaseIdx // \} } diff --git a/dumux/freeflow/staggerednc/propertydefaults.hh b/dumux/freeflow/staggerednc/propertydefaults.hh deleted file mode 100644 index 56a901194a666338d0c58312c4173fbcb589470c..0000000000000000000000000000000000000000 --- a/dumux/freeflow/staggerednc/propertydefaults.hh +++ /dev/null @@ -1,143 +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/>. * - *****************************************************************************/ -/*! - * \ingroup Properties - * \ingroup ImplicitProperties - * \ingroup OnePModel - * \file - * - * \brief Defines the properties required for the one-phase fully implicit model. - */ -#ifndef DUMUX_NAVIER_STOKES_NC_PROPERTY_DEFAULTS_HH -#define DUMUX_NAVIER_STOKES_NC_PROPERTY_DEFAULTS_HH - -#include "properties.hh" - -#include "model.hh" -#include "volumevariables.hh" -#include "indices.hh" -#include "localresidual.hh" -#include "fluxvariables.hh" -#include "../staggered/problem.hh" -#include "../staggered/propertydefaults.hh" - - -#include <dumux/implicit/staggered/localresidual.hh> -#include <dumux/material/fluidsystems/gasphase.hh> -#include <dumux/material/fluidsystems/liquidphase.hh> -#include <dumux/material/components/nullcomponent.hh> -#include <dumux/material/fluidsystems/1p.hh> - -#include <dumux/material/fluidstates/compositional.hh> - - -namespace Dumux -{ - -namespace Properties -{ -// forward declaration -NEW_PROP_TAG(FluxVariables); -NEW_PROP_TAG(FluxVariablesCache); -} -// \{ - -/////////////////////////////////////////////////////////////////////////// -// default property values for the isothermal single phase model -/////////////////////////////////////////////////////////////////////////// -namespace Properties { - -SET_PROP(NavierStokesNC, NumEqCellCenter) -{ -private: - static constexpr int numComponents = GET_PROP_VALUE(TypeTag, NumComponents); -public: - static constexpr int value = numComponents; -}; - - -SET_INT_PROP(NavierStokesNC, ReplaceCompEqIdx, 0); - - - /*! - * \brief Set the property for the number of components. - * - * We just forward the number from the fluid system - * - */ -SET_PROP(NavierStokesNC, NumComponents) -{ -private: - typedef typename GET_PROP_TYPE(TypeTag, PTAG(FluidSystem)) FluidSystem; - -public: - static constexpr int value = FluidSystem::numComponents; - -}; - - -//! the VolumeVariables property -SET_TYPE_PROP(NavierStokesNC, VolumeVariables, NavierStokesNCVolumeVariables<TypeTag>); -SET_TYPE_PROP(NavierStokesNC, Model, NavierStokesNCModel<TypeTag>); -SET_TYPE_PROP(NavierStokesNC, Indices, NavierStokesNCIndices<TypeTag>); - - -/*! - * \brief The fluid state which is used by the volume variables to - * store the thermodynamic state. This should be chosen - * appropriately for the model ((non-)isothermal, equilibrium, ...). - * This can be done in the problem. - */ -SET_PROP(NavierStokesNC, FluidState) -{ - private: - typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - public: - typedef CompositionalFluidState<Scalar, FluidSystem> type; -}; - -// -SET_BOOL_PROP(NavierStokesNC, EnableComponentTransport, true); - -SET_BOOL_PROP(NavierStokesNC, UseMoles, false); //!< Defines whether molar (true) or mass (false) density is used - -SET_INT_PROP(NavierStokesNC, PhaseIdx, 0); //!< Defines the phaseIdx - - -////////////////////////////////////////////////////////////////// -// Property values for isothermal model required for the general non-isothermal model -////////////////////////////////////////////////////////////////// - -// set isothermal Model -SET_TYPE_PROP(NavierStokesNCNI, IsothermalModel, NavierStokesNCModel<TypeTag>); - -//set isothermal Indices -SET_TYPE_PROP(NavierStokesNCNI, IsothermalIndices, NavierStokesNCIndices<TypeTag>); - -//set isothermal NumEq -SET_INT_PROP(NavierStokesNCNI, IsothermalNumEqCellCenter, 2); //!< set the number of equations to 1 -SET_INT_PROP(NavierStokesNCNI, IsothermalNumEqFace, 1); //!< set the number of equations - -// \} -} // end namespace Properties - -} // end namespace Dumux - -#endif diff --git a/dumux/freeflow/staggerednc/vtkoutputfields.hh b/dumux/freeflow/staggerednc/vtkoutputfields.hh new file mode 100644 index 0000000000000000000000000000000000000000..29929bb6423c450b365e4259965e1a6f1bcbad52 --- /dev/null +++ b/dumux/freeflow/staggerednc/vtkoutputfields.hh @@ -0,0 +1,66 @@ +// -*- 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 Adds vtk output fields specific to the NavierStokesNC model + */ +#ifndef DUMUX_NAVIER_STOKES_NC_VTK_OUTPUT_FIELDS_HH +#define DUMUX_NAVIER_STOKES_NC_VTK_OUTPUT_FIELDS_HH + +#include <dumux/common/basicproperties.hh> + +namespace Dumux +{ + +/*! + * \ingroup TwoP, InputOutput + * \brief Adds vtk output fields specific to the NavierStokesNC model + */ +template<class TypeTag> +class NavierStokesNCVtkOutputFields +{ + using Indices = typename GET_PROP_TYPE(TypeTag, Indices); + using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables); + using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem); + + static constexpr int numComponents = GET_PROP_VALUE(TypeTag, NumComponents); + static constexpr int phaseIdx = GET_PROP_VALUE(TypeTag, PhaseIdx); + +public: + template <class VtkOutputModule> + static void init(VtkOutputModule& vtk) + { + vtk.addVolumeVariable([](const VolumeVariables& v){ return v.pressure(); }, "p"); + vtk.addVolumeVariable([](const VolumeVariables& v){ return v.molarDensity(); }, "rhoMolar"); + vtk.addVolumeVariable([](const VolumeVariables& v){ return v.density(); }, "rho"); + + for (int j = 0; j < numComponents; ++j) + { + vtk.addVolumeVariable([j](const VolumeVariables& v){ return v.massFraction(phaseIdx,j); }, "X^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(phaseIdx)); + vtk.addVolumeVariable([j](const VolumeVariables& v){ return v.moleFraction(phaseIdx,j); }, "x^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(phaseIdx)); + } + + if(GET_PROP_VALUE(TypeTag, EnableEnergyBalance)) + vtk.addVolumeVariable( [](const VolumeVariables& v){ return v.temperature(); },"temperature"); + } +}; + +} // end namespace Dumux + +#endif