3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/richardsnc/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_RICHARDSNC_IO_FIELDS_HH
26#define DUMUX_RICHARDSNC_IO_FIELDS_HH
27
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 FS = typename VolumeVariables::FluidSystem;
45
46 out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::liquidPhaseIdx); },
48 out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::gasPhaseIdx); },
50 out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::liquidPhaseIdx); },
52 out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::gasPhaseIdx); },
54 out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); },
56 out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); },
58 out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); },
60 out.addVolumeVariable([](const auto& v){ return v.relativePermeability(VolumeVariables::liquidPhaseIdx); },
62 out.addVolumeVariable([](const auto& v){ return v.porosity(); },
64 out.addVolumeVariable([](const auto& v){ return v.temperature(); },
66
67 static const bool gravity = getParamFromGroup<bool>(out.paramGroup(), "Problem.EnableGravity");
68 if (gravity)
69 out.addVolumeVariable([](const auto& v){ return v.pressureHead(VolumeVariables::liquidPhaseIdx); },
71 out.addVolumeVariable([](const auto& v){ return v.waterContent(VolumeVariables::liquidPhaseIdx); },
73
74 for (int compIdx = 0; compIdx < VolumeVariables::numFluidComponents(); ++compIdx)
75 out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(VolumeVariables::liquidPhaseIdx, compIdx); },
76 IOName::moleFraction<FS>(VolumeVariables::liquidPhaseIdx, compIdx));
77
78 }
79
80 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
81 static std::string primaryVariableName(int pvIdx, int state = 0)
82 {
83 if (pvIdx == 0)
84 return IOName::pressure<FluidSystem>(0);
85 else
86 return ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(0, pvIdx)
87 : IOName::massFraction<FluidSystem>(0, pvIdx);
88 }
89};
90
91} // end namespace Dumux
92
93#endif
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
A collection of input/output field names for common physical quantities.
Definition: adapt.hh:29
std::string waterContent() noexcept
I/O name of water content.
Definition: name.hh:155
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
std::string capillaryPressure() noexcept
I/O name of capillary pressure.
Definition: name.hh:135
std::string gaseousPhase() noexcept
I/O name of gaseous phase.
Definition: name.hh:123
std::string saturation(int phaseIdx) noexcept
I/O name of saturation for multiphase systems.
Definition: name.hh:43
std::string relativePermeability(int phaseIdx) noexcept
I/O name of relative permeability for multiphase systems.
Definition: name.hh:92
std::string mobility(int phaseIdx) noexcept
I/O name of mobility for multiphase systems.
Definition: name.hh:101
std::string pressureHead() noexcept
I/O name of pressure head.
Definition: name.hh:151
std::string liquidPhase() noexcept
I/O name of liquid phase.
Definition: name.hh:119
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
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:139
Adds I/O fields specific to the Richards model.
Definition: porousmediumflow/richardsnc/iofields.hh:38
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porousmediumflow/richardsnc/iofields.hh:81
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/richardsnc/iofields.hh:41