version 3.10-dev
porenetwork/2pnc/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_2P_NC_IO_FIELDS_HH
13#define DUMUX_PNM_2P_NC_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 2pnc model
32
33 using VolumeVariables = typename OutputModule::VolumeVariables;
34 using FS = typename VolumeVariables::FluidSystem;
35
37
38 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
39 { return fluxVarsCache.pcEntry(); }, "pcEntry");
40
41 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
42 { return fluxVarsCache.transmissibility(FS::phase0Idx); }, "transmissibilityW");
43
44 out.addFluxVariable([](const auto& fluxVars, const auto& fluxVarsCache)
45 { return fluxVarsCache.transmissibility(FS::phase1Idx); }, "transmissibilityN");
46
47 auto volumeFluxW = [](const auto& fluxVars, const auto& fluxVarsCache)
48 {
49 auto upwindTerm = [](const auto& volVars) { return volVars.mobility(FS::phase0Idx); };
50 using std::abs;
51 return abs(fluxVars.advectiveFlux(FS::phase0Idx, upwindTerm));
52 };
53 out.addFluxVariable(volumeFluxW, "volumeFluxW");
54
55 auto volumeFluxN = [](const auto& fluxVars, const auto& fluxVarsCache)
56 {
57 auto upwindTerm = [](const auto& volVars) { return volVars.mobility(FS::phase1Idx); };
58 using std::abs;
59 return abs(fluxVars.advectiveFlux(FS::phase1Idx, upwindTerm));
60 };
61 out.addFluxVariable(volumeFluxN, "volumeFluxN");
62 }
63};
64
65} // end namespace Dumux::PoreNetwork
66
67#endif
static void initOutputModule(OutputModule &out)
Definition: porenetwork/common/iofields.hh:28
Adds output fields specific to the PNM 2pnc model.
Definition: porenetwork/2pnc/iofields.hh:25
static void initOutputModule(OutputModule &out)
Definition: porenetwork/2pnc/iofields.hh:28
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/2pnc/iofields.hh:30
Definition: discretization/porenetwork/fvelementgeometry.hh:24
Adds I/O fields specific to the twop-nc model.