12#ifndef DUMUX_NAVIER_STOKES_IO_FIELDS_HH
13#define DUMUX_NAVIER_STOKES_IO_FIELDS_HH
25template<
class IOFields,
class PrimaryVariables,
class ModelTraits,
class Flu
idSystem>
28 static constexpr auto offset = ModelTraits::numEq() - PrimaryVariables::dimension;
32 const auto pvName = getParamFromGroup<std::vector<std::string>>(paramGroup,
"LoadSolution.CellCenterPriVarNames");
33 return [n = std::move(pvName)](
int pvIdx,
int state = 0){
return n[pvIdx]; };
37 return [](
int pvIdx,
int state = 0){
return IOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx + offset, state); };
45template<
class IOFields,
class PrimaryVariables,
class ModelTraits,
class Flu
idSystem>
50 const auto pvName = getParamFromGroup<std::vector<std::string>>(paramGroup,
"LoadSolution.FacePriVarNames");
51 return [n = std::move(pvName)](
int pvIdx,
int state = 0){
return n[pvIdx]; };
55 return [](
int pvIdx,
int state = 0){
return IOFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx , state); };
59template<
class T,
class U>
60class StaggeredVtkOutputModule;
70 struct isStaggered :
public std::false_type {};
72 template<
class... Args>
74 :
public std::true_type {};
78 template <
class OutputModule>
81 out.addVolumeVariable([](
const auto& v){
return v.pressure(); },
IOName::pressure());
82 out.addVolumeVariable([](
const auto& v){
return v.density(); },
IOName::density());
85 additionalOutput_(out, isStaggered<OutputModule>());
89 template <
class ModelTraits,
class Flu
idSystem =
void>
92 if (pvIdx < ModelTraits::dim())
101 template <
class OutputModule>
102 static void additionalOutput_(OutputModule& out, std::false_type)
106 template <
class OutputModule>
107 static void additionalOutput_(OutputModule& out, std::true_type)
109 const bool writeFaceVars = getParamFromGroup<bool>(out.paramGroup(),
"Vtk.WriteFaceData",
false);
112 auto faceVelocityVector = [](
const auto& scvf,
const auto& faceVars)
114 using VelocityVector = std::decay_t<
decltype(scvf.unitOuterNormal())>;
116 VelocityVector velocity(0.0);
117 velocity[scvf.directionIndex()] = faceVars.velocitySelf();
121 out.addFaceVariable(faceVelocityVector,
"faceVelocity");
123 auto faceNormalVelocity = [](
const auto& faceVars)
125 return faceVars.velocitySelf();
128 out.addFaceVariable(faceNormalVelocity,
"v");
Adds I/O fields for the Navier-Stokes model.
Definition: freeflow/navierstokes/iofields.hh:67
static void initOutputModule(OutputModule &out)
Initialize the Navier-Stokes specific output fields.
Definition: freeflow/navierstokes/iofields.hh:79
static std::string primaryVariableName(int pvIdx=0, int state=0)
return the names of the primary variables
Definition: freeflow/navierstokes/iofields.hh:90
A VTK output module to simplify writing dumux simulation data to VTK format Specialization for stagge...
Definition: staggeredvtkoutputmodule.hh:38
std::function< std::string(int, int)> createFacePVNameFunction(const std::string ¶mGroup="")
helper function to determine the names of primary variables on the cell faces of a model with stagger...
Definition: freeflow/navierstokes/iofields.hh:46
std::function< std::string(int, int)> createCellCenterPVNameFunction(const std::string ¶mGroup="")
helper function to determine the names of cell-centered primary variables of a model with staggered g...
Definition: freeflow/navierstokes/iofields.hh:26
bool hasParamInGroup(const std::string ¶mGroup, const std::string ¶m)
Check whether a key exists in the parameter tree with a model group prefix.
Definition: parameters.hh:165
A collection of input/output field names for common physical quantities.
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:22
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:53
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.