version 3.8
porousmediumflow/tracer/iofields.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_TRACER_IO_FIELDS_HH
14#define DUMUX_TRACER_IO_FIELDS_HH
15
16#include <string>
17
18#include <dumux/io/name.hh>
19
20namespace Dumux {
21
27{
28public:
29 template <class OutputModule>
30 static void initOutputModule(OutputModule& out)
31 {
32 using VolumeVariables = typename OutputModule::VolumeVariables;
33 using FluidSystem = typename VolumeVariables::FluidSystem;
34
35 // register standardized out output fields
36 for (int compIdx = 0; compIdx < VolumeVariables::numFluidComponents(); ++compIdx)
37 {
38 out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(0, compIdx); },
39 "x^" + FluidSystem::componentName(compIdx));
40 out.addVolumeVariable([compIdx](const auto& v){ return v.massFraction(0, compIdx); },
41 "X^" + FluidSystem::componentName(compIdx));
42 }
43 out.addVolumeVariable( [](const auto& v){ return v.density(); }, IOName::density());
44 }
45
46 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
47 static std::string primaryVariableName(int pvIdx, int state = 0)
48 {
49 const std::string xString = ModelTraits::useMoles() ? "x" : "X";
50 return xString + "^" + FluidSystem::componentName(pvIdx);
51 }
52};
53
54} // end namespace Dumux
55
56#endif
Adds I/O fields specific to the tracer model.
Definition: porousmediumflow/tracer/iofields.hh:27
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porousmediumflow/tracer/iofields.hh:47
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/tracer/iofields.hh:30
A collection of input/output field names for common physical quantities.
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:53
Definition: adapt.hh:17