3.4
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/richards/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_RICHARDS_IO_FIELDS_HH
26#define DUMUX_RICHARDS_IO_FIELDS_HH
27
29#include <dumux/io/name.hh>
30
31namespace Dumux {
32
37template <bool enableWaterDiffusionInAir>
39{
40public:
41 template <class OutputModule>
42 static void initOutputModule(OutputModule& out)
43 {
44 using VolumeVariables = typename OutputModule::VolumeVariables;
45 using FS = typename VolumeVariables::FluidSystem;
46
47 out.addVolumeVariable([](const auto& v){ return v.saturation(FS::liquidPhaseIdx); },
48 IOName::saturation<FS>(FS::liquidPhaseIdx));
49 out.addVolumeVariable([](const auto& v){ return v.saturation(FS::gasPhaseIdx); },
50 IOName::saturation<FS>(FS::gasPhaseIdx));
51 out.addVolumeVariable([](const auto& v){ return v.pressure(FS::liquidPhaseIdx); },
52 IOName::pressure<FS>(FS::liquidPhaseIdx));
53 out.addVolumeVariable([](const auto& v){ return v.pressure(FS::gasPhaseIdx); },
54 IOName::pressure<FS>(FS::gasPhaseIdx));
55 out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); },
57 out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); },
58 IOName::density<FS>(FS::liquidPhaseIdx));
59 out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); },
60 IOName::mobility<FS>(FS::liquidPhaseIdx));
61 out.addVolumeVariable([](const auto& v){ return v.relativePermeability(FS::liquidPhaseIdx); },
62 IOName::relativePermeability<FS>(FS::liquidPhaseIdx));
63 out.addVolumeVariable([](const auto& v){ return v.porosity(); },
65
66 static const bool gravity = getParamFromGroup<bool>(out.paramGroup(), "Problem.EnableGravity");
67
68 if(gravity)
69 out.addVolumeVariable([](const auto& v){ return v.pressureHead(FS::liquidPhaseIdx); },
71 if constexpr (enableWaterDiffusionInAir)
72 out.addVolumeVariable([](const auto& v){ return v.moleFraction(FS::gasPhaseIdx, FS::liquidCompIdx); },
73 IOName::moleFraction<FS>(FS::gasPhaseIdx, FS::liquidCompIdx));
74 out.addVolumeVariable([](const auto& v){ return v.waterContent(FS::liquidPhaseIdx); },
76
77 out.addVolumeVariable([](const auto& v){ return v.priVars().state(); },
79 }
80
81 template<class ModelTraits, class FluidSystem, class SolidSystem = void>
82 static std::string primaryVariableName(int pvIdx, int state)
83 {
84 using Indices = typename ModelTraits::Indices;
85
86 if (state == Indices::gasPhaseOnly)
87 return IOName::moleFraction<FluidSystem>(FluidSystem::gasPhaseIdx,
88 FluidSystem::liquidCompIdx);
89 else
90 return IOName::pressure<FluidSystem>(FluidSystem::liquidPhaseIdx);
91 }
92};
93
94} // end namespace Dumux
95
96#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 capillaryPressure() noexcept
I/O name of capillary pressure.
Definition: name.hh:135
std::string phasePresence() noexcept
I/O name of phase presence.
Definition: name.hh:147
std::string pressureHead() noexcept
I/O name of pressure head.
Definition: name.hh:151
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:139
Adds I/O fields specific to the Richards model.
Definition: porousmediumflow/richards/iofields.hh:39
static std::string primaryVariableName(int pvIdx, int state)
Definition: porousmediumflow/richards/iofields.hh:82
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/richards/iofields.hh:42