3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
dumux/porousmediumflow/2p1c/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_TWOP_ONEC_IO_FIELDS_HH
26#define DUMUX_TWOP_ONEC_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 // use default fields from the 2p model
45
46 // output additional to TwoP output:
47 out.addVolumeVariable([](const auto& v){ return v.priVars().state(); },
49 }
50
51 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
52 static std::string primaryVariableName(int pvIdx, int state)
53 {
54 using Indices = typename ModelTraits::Indices;
55
56 if (ModelTraits::priVarFormulation() == TwoPFormulation::p0s1)
57 return (pvIdx == 0) ? IOName::pressure<FluidSystem>(FluidSystem::phase0Idx) :
58 (state == Indices::twoPhases)
59 ? IOName::saturation<FluidSystem>(FluidSystem::phase1Idx)
61 else
62 return (pvIdx == 0) ? IOName::pressure<FluidSystem>(FluidSystem::phase1Idx) :
63 (state == Indices::twoPhases)
64 ? IOName::saturation<FluidSystem>(FluidSystem::phase0Idx)
66 }
67};
68
69} // end namespace Dumux
70
71#endif
A collection of input/output field names for common physical quantities.
@ p0s1
first phase pressure and second phase saturation as primary variables
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag Indices
Definition: porousmediumflow/sequential/properties.hh:59
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
std::string phasePresence() noexcept
I/O name of phase presence.
Definition: name.hh:147
static void initOutputModule(OutputModule &out)
Definition: dumux/porousmediumflow/2p/iofields.hh:42
Adds I/O fields specific to two-phase one-component model.
Definition: dumux/porousmediumflow/2p1c/iofields.hh:38
static std::string primaryVariableName(int pvIdx, int state)
Definition: dumux/porousmediumflow/2p1c/iofields.hh:52
static void initOutputModule(OutputModule &out)
Definition: dumux/porousmediumflow/2p1c/iofields.hh:41
Adds I/O fields specific to the two-phase model.