3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/1pnc/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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
25#ifndef DUMUX_ONEPNC_IO_FIELDS_HH
26#define DUMUX_ONEPNC_IO_FIELDS_HH
27
28#include <string>
29#include <dumux/io/name.hh>
30
31namespace Dumux {
32
38{
39public:
40 template <class OutputModule>
41 static void initOutputModule(OutputModule& out)
42 {
43 using VolumeVariables = typename OutputModule::VolumeVariables;
44 using FluidSystem = typename VolumeVariables::FluidSystem;
45
46 out.addVolumeVariable([](const auto& volVars){ return volVars.pressure(0); },
48 out.addVolumeVariable([](const auto& volVars){ return volVars.density(0); },
50 out.addVolumeVariable([](const auto& volVars){ return volVars.viscosity(0); },
52
53 for (int i = 0; i < VolumeVariables::numFluidComponents(); ++i)
54 out.addVolumeVariable([i](const auto& volVars){ return volVars.moleFraction(0, i); },
55 IOName::moleFraction<FluidSystem>(0, i));
56
57 for (int i = 0; i < VolumeVariables::numFluidComponents(); ++i)
58 out.addVolumeVariable([i](const auto& volVars){ return volVars.massFraction(0, i); },
59 IOName::massFraction<FluidSystem>(0, i));
60 }
61
62 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
63 static std::string primaryVariableName(int pvIdx, int state = 0)
64 {
65 if (pvIdx == 0)
66 return IOName::pressure();
67 else if (ModelTraits::useMoles())
68 return IOName::moleFraction<FluidSystem>(0, pvIdx);
69 else
70 return IOName::massFraction<FluidSystem>(0, pvIdx);
71 }
72};
73
74} // end namespace Dumux
75
76#endif
A collection of input/output field names for common physical quantities.
Definition: adapt.hh:29
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:74
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Adds I/O fields specific to the OnePNC model.
Definition: porousmediumflow/1pnc/iofields.hh:38
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porousmediumflow/1pnc/iofields.hh:63
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/1pnc/iofields.hh:41