Commit 5c0d4151 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[io][freeflow] Rename vtkoutputfieds to iofields

parent 7f6afd8a
......@@ -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)
......@@ -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
......
......@@ -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>;
};
// \}
......
......@@ -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>;
};
// \}
......
......@@ -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>;
};
// \}
......
......@@ -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
......
......@@ -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>;
};
// \}
......
......@@ -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>;
};
// \}
......
......@@ -8,5 +8,5 @@ localresidual.hh
model.hh
problem.hh
volumevariables.hh
vtkoutputfields.hh
iofields.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/freeflow/navierstokes)
......@@ -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");
}
}
};
......
......@@ -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>