version 3.10-dev
porousmediumflow/richardsextended/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_RICHARDSEXTENDED_IO_FIELDS_HH
14#define DUMUX_RICHARDSEXTENDED_IO_FIELDS_HH
15
16#include <dumux/io/name.hh>
18
19namespace Dumux {
20
26{
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
36
37 out.addVolumeVariable([](const auto& v){ return v.moleFraction(FS::phase1Idx, FS::comp0Idx); },
38 IOName::moleFraction<FS>(FS::phase1Idx, FS::comp0Idx));
39 out.addVolumeVariable([](const auto& v){ return v.priVars().state(); },
41 }
42};
43
44 template<class ModelTraits, class FluidSystem, class SolidSystem = void>
45 static std::string primaryVariableName(int pvIdx, int state)
46 {
47 using Indices = typename ModelTraits::Indices;
48
49 if (state == Indices::gasPhaseOnly)
50 return IOName::moleFraction<FluidSystem>(FluidSystem::phase1Idx, FluidSystem::phase0Idx);
51 else
52 return IOName::pressure<FluidSystem>(FluidSystem::phase0Idx);
53 }
54} // end namespace Dumux
55
56#endif
Adds I/O fields specific to the extended Richards model.
Definition: porousmediumflow/richardsextended/iofields.hh:26
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/richardsextended/iofields.hh:30
Adds I/O fields specific to the Richards model.
Definition: porousmediumflow/richards/iofields.hh:27
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/richards/iofields.hh:30
A collection of input/output field names for common physical quantities.
std::string phasePresence() noexcept
I/O name of phase presence.
Definition: name.hh:135
Definition: adapt.hh:17
static std::string primaryVariableName(int pvIdx, int state)
Definition: porousmediumflow/richardsextended/iofields.hh:45
Adds I/O fields specific to the Richards model.