version 3.10-dev
porenetwork/2p/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//
12#ifndef DUMUX_PNM_TWOP_IO_FIELDS_HH
13#define DUMUX_PNM_TWOP_IO_FIELDS_HH
14
17
18namespace Dumux::PoreNetwork {
19
25{
26public:
27 template <class OutputModule>
28 static void initOutputModule(OutputModule& out)
29 {
30 // use default fields from the 2p model
32 using VolumeVariables = typename OutputModule::VolumeVariables;
33 using FS = typename VolumeVariables::FluidSystem;
34
36
37 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
38 { return fluxVarsCache.pcEntry(); }, "pcEntry");
39
40 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
41 { return fluxVarsCache.transmissibility(FS::phase0Idx); }, "transmissibilityW");
42
43 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
44 { return fluxVarsCache.transmissibility(FS::phase1Idx); }, "transmissibilityN");
45
46 auto volumeFluxW = [](const auto& fluxVars, const auto& fluxVarsCache)
47 {
48 auto upwindTerm = [](const auto& volVars) { return volVars.mobility(FS::phase0Idx); };
49 using std::abs;
50 return abs(fluxVars.advectiveFlux(FS::phase0Idx, upwindTerm));
51 };
52 out.addFluxVariable(volumeFluxW, "volumeFluxW");
53
54 auto volumeFluxN = [](const auto& fluxVars, const auto& fluxVarsCache)
55 {
56 auto upwindTerm = [](const auto& volVars) { return volVars.mobility(FS::phase1Idx); };
57 using std::abs;
58 return abs(fluxVars.advectiveFlux(FS::phase1Idx, upwindTerm));
59 };
60 out.addFluxVariable(volumeFluxN, "volumeFluxN");
61 }
62
63 template <class ModelTraits, class FluidSystem, class SolidSystem = void>
64 static std::string primaryVariableName(int pvIdx, int state = 0)
65 {
66 return TwoPIOFields::template primaryVariableName<ModelTraits, FluidSystem, SolidSystem>(pvIdx, state);
67 }
68};
69
70} // end namespace Dumux::PoreNetwork
71
72#endif
static void initOutputModule(OutputModule &out)
Definition: porenetwork/common/iofields.hh:28
Adds output fields specific to the PNM 2p model.
Definition: porenetwork/2p/iofields.hh:25
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porenetwork/2p/iofields.hh:64
static void initOutputModule(OutputModule &out)
Definition: porenetwork/2p/iofields.hh:28
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/2p/iofields.hh:30
Definition: discretization/porenetwork/fvelementgeometry.hh:24
Adds I/O fields specific to the two-phase model.