version 3.8
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// 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_RICHARDSNC_IO_FIELDS_HH
14#define DUMUX_RICHARDSNC_IO_FIELDS_HH
15
17#include <dumux/io/name.hh>
18
19namespace Dumux {
20
26{
27public:
28 template <class OutputModule>
29 static void initOutputModule(OutputModule& out)
30 {
31 using VolumeVariables = typename OutputModule::VolumeVariables;
32 using FS = typename VolumeVariables::FluidSystem;
33
34 out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::liquidPhaseIdx); },
36 out.addVolumeVariable([](const auto& v){ return v.saturation(VolumeVariables::gasPhaseIdx); },
38 out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::liquidPhaseIdx); },
40 out.addVolumeVariable([](const auto& v){ return v.pressure(VolumeVariables::gasPhaseIdx); },
42 out.addVolumeVariable([](const auto& v){ return v.capillaryPressure(); },
44 out.addVolumeVariable([](const auto& v){ return v.density(FS::liquidPhaseIdx); },
46 out.addVolumeVariable([](const auto& v){ return v.mobility(FS::liquidPhaseIdx); },
48 out.addVolumeVariable([](const auto& v){ return v.relativePermeability(VolumeVariables::liquidPhaseIdx); },
50 out.addVolumeVariable([](const auto& v){ return v.porosity(); },
52 out.addVolumeVariable([](const auto& v){ return v.temperature(); },
54
55 static const bool gravity = getParamFromGroup<bool>(out.paramGroup(), "Problem.EnableGravity");
56 if (gravity)
57 out.addVolumeVariable([](const auto& v){ return v.pressureHead(VolumeVariables::liquidPhaseIdx); },
59 out.addVolumeVariable([](const auto& v){ return v.waterContent(VolumeVariables::liquidPhaseIdx); },
61
62 for (int compIdx = 0; compIdx < VolumeVariables::numFluidComponents(); ++compIdx)
63 out.addVolumeVariable([compIdx](const auto& v){ return v.moleFraction(VolumeVariables::liquidPhaseIdx, compIdx); },
64 IOName::moleFraction<FS>(VolumeVariables::liquidPhaseIdx, compIdx));
65
66 }
67
68 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
69 static std::string primaryVariableName(int pvIdx, int state = 0)
70 {
71 if (pvIdx == 0)
72 return IOName::pressure<FluidSystem>(0);
73 else
74 return ModelTraits::useMoles() ? IOName::moleFraction<FluidSystem>(0, pvIdx)
75 : IOName::massFraction<FluidSystem>(0, pvIdx);
76 }
77};
78
79} // end namespace Dumux
80
81#endif
Adds I/O fields specific to the Richards model.
Definition: porousmediumflow/richardsnc/iofields.hh:26
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porousmediumflow/richardsnc/iofields.hh:69
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/richardsnc/iofields.hh:29
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 temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
std::string capillaryPressure() noexcept
I/O name of capillary pressure.
Definition: name.hh:123
std::string gaseousPhase() noexcept
I/O name of gaseous phase.
Definition: name.hh:111
std::string saturation(int phaseIdx) noexcept
I/O name of saturation for multiphase systems.
Definition: name.hh:31
std::string relativePermeability(int phaseIdx) noexcept
I/O name of relative permeability for multiphase systems.
Definition: name.hh:80
std::string mobility(int phaseIdx) noexcept
I/O name of mobility for multiphase systems.
Definition: name.hh:89
std::string pressureHead() noexcept
I/O name of pressure head.
Definition: name.hh:139
std::string liquidPhase() noexcept
I/O name of liquid phase.
Definition: name.hh:107
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:22
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:53
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.