version 3.8
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// 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_TWOP_ONEC_IO_FIELDS_HH
14#define DUMUX_TWOP_ONEC_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 // use default fields from the 2p model
33
34 // output additional to TwoP output:
35 out.addVolumeVariable([](const auto& v){ return v.priVars().state(); },
37 }
38
39 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
40 static std::string primaryVariableName(int pvIdx, int state)
41 {
42 using Indices = typename ModelTraits::Indices;
43
44 if (ModelTraits::priVarFormulation() == TwoPFormulation::p0s1)
45 return (pvIdx == 0) ? IOName::pressure<FluidSystem>(FluidSystem::phase0Idx) :
46 (state == Indices::twoPhases)
47 ? IOName::saturation<FluidSystem>(FluidSystem::phase1Idx)
49 else
50 return (pvIdx == 0) ? IOName::pressure<FluidSystem>(FluidSystem::phase1Idx) :
51 (state == Indices::twoPhases)
52 ? IOName::saturation<FluidSystem>(FluidSystem::phase0Idx)
54 }
55};
56
57} // end namespace Dumux
58
59#endif
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/2p/iofields.hh:30
Adds I/O fields specific to two-phase one-component model.
Definition: porousmediumflow/2p1c/iofields.hh:26
static std::string primaryVariableName(int pvIdx, int state)
Definition: porousmediumflow/2p1c/iofields.hh:40
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/2p1c/iofields.hh:29
@ p0s1
first phase pressure and second phase saturation as primary variables
A collection of input/output field names for common physical quantities.
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
std::string phasePresence() noexcept
I/O name of phase presence.
Definition: name.hh:135
Definition: adapt.hh:17
Adds I/O fields specific to the two-phase model.