version 3.10-dev
porousmediumflow/3p/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_THREEP_IO_FIELDS_HH
14#define DUMUX_THREEP_IO_FIELDS_HH
15
16#include <dumux/io/name.hh>
17
18namespace Dumux {
19
25{
26public:
27 template <class OutputModule>
28 static void initOutputModule(OutputModule& out)
29 {
30 using VolumeVariables = typename OutputModule::VolumeVariables;
31 using FluidSystem = typename VolumeVariables::FluidSystem;
32
33 // register standardized output fields
34 for (int phaseIdx = 0; phaseIdx < VolumeVariables::numFluidPhases(); ++phaseIdx)
35 {
36 out.addVolumeVariable([phaseIdx](const auto& v){ return v.saturation(phaseIdx); },
37 IOName::saturation<FluidSystem>(phaseIdx));
38 out.addVolumeVariable([phaseIdx](const auto& v){ return v.pressure(phaseIdx); },
39 IOName::pressure<FluidSystem>(phaseIdx));
40 out.addVolumeVariable([phaseIdx](const auto& v){ return v.density(phaseIdx); },
41 IOName::density<FluidSystem>(phaseIdx));
42 }
43
44 out.addVolumeVariable( [](const auto& v){ return v.porosity(); },
46 out.addVolumeVariable( [](const auto& v){ return v.permeability(); },
48 }
49
50 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
51 static std::string primaryVariableName(int pvIdx, int state = 0)
52 {
53 switch (pvIdx)
54 {
55 case 0: return IOName::pressure<FluidSystem>(FluidSystem::gPhaseIdx);
56 case 1: return IOName::saturation<FluidSystem>(FluidSystem::wPhaseIdx);
57 default: return IOName::saturation<FluidSystem>(FluidSystem::nPhaseIdx);
58 }
59 }
60};
61
62} // end namespace Dumux
63
64#endif
Adds I/O fields specific to the three-phase model.
Definition: porousmediumflow/3p/iofields.hh:25
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/3p/iofields.hh:28
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porousmediumflow/3p/iofields.hh:51
A collection of input/output field names for common physical quantities.
std::string permeability() noexcept
I/O name of permeability.
Definition: name.hh:131
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:127
Definition: adapt.hh:17