version 3.8
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// 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_RICHARDS_IO_FIELDS_HH
14#define DUMUX_RICHARDS_IO_FIELDS_HH
15
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 VV = typename OutputModule::VolumeVariables;
33 using FS = typename VV::FluidSystem;
34
35 out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase0Idx); },
36 IOName::saturation<FS>(FS::phase0Idx));
37 out.addVolumeVariable([](const auto& v){ return v.saturation(FS::phase1Idx); },
38 IOName::saturation<FS>(FS::phase1Idx));
39 out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase0Idx); },
40 IOName::pressure<FS>(FS::phase0Idx));
41 out.addVolumeVariable([](const auto& v){ return v.pressure(FS::phase1Idx); },
42 IOName::pressure<FS>(FS::phase1Idx));
43 out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); },
45 out.addVolumeVariable([](const auto& v){ return v.density(FS::phase0Idx); },
46 IOName::density<FS>(FS::phase0Idx));
47 out.addVolumeVariable([](const auto& v){ return v.mobility(FS::phase0Idx); },
48 IOName::mobility<FS>(FS::phase0Idx));
49 out.addVolumeVariable([](const auto& v){ return v.relativePermeability(FS::phase0Idx); },
50 IOName::relativePermeability<FS>(FS::phase0Idx));
51 out.addVolumeVariable([](const auto& v){ return v.porosity(); },
53
54 static const bool gravity = getParamFromGroup<bool>(out.paramGroup(), "Problem.EnableGravity");
55
56 if(gravity)
57 out.addVolumeVariable([](const auto& v){ return v.pressureHead(FS::phase0Idx); },
59 out.addVolumeVariable([](const auto& v){ return v.waterContent(FS::phase0Idx); },
61 }
62
63 template<class ModelTraits, class FluidSystem, class SolidSystem = void>
64 static std::string primaryVariableName(int pvIdx, int state)
65 {
66 return IOName::pressure<FluidSystem>(FluidSystem::phase0Idx);
67 }
68};
69
70} // end namespace Dumux
71
72#endif
Adds I/O fields specific to the Richards model.
Definition: porousmediumflow/richards/iofields.hh:27
static std::string primaryVariableName(int pvIdx, int state)
Definition: porousmediumflow/richards/iofields.hh:64
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/richards/iofields.hh:30
A collection of input/output field names for common physical quantities.
std::string waterContent() noexcept
I/O name of water content.
Definition: name.hh:143
std::string capillaryPressure() noexcept
I/O name of capillary pressure.
Definition: name.hh:123
std::string pressureHead() noexcept
I/O name of pressure head.
Definition: name.hh:139
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:127
Definition: adapt.hh:17
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Type traits to be used with matrix types.