version 3.8
porousmediumflow/mineralization/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//
14#ifndef DUMUX_MINERALIZATION_IO_FIELDS_HH
15#define DUMUX_MINERALIZATION_IO_FIELDS_HH
16
17#include <dumux/io/name.hh>
18
19namespace Dumux {
20
25template<class NonMineralizationIOFields>
27{
28public:
29 template <class OutputModule>
30 static void initOutputModule(OutputModule& out)
31 {
32 using SolidSystem = typename OutputModule::VolumeVariables::SolidSystem;
33
34 // output of the model without mineralization
35 NonMineralizationIOFields::initOutputModule(out);
36
37 // additional output
38 for (int i = 0; i < SolidSystem::numComponents - SolidSystem::numInertComponents; ++i)
39 {
40 out.addVolumeVariable([i](const auto& v){ return v.solidVolumeFraction(i); },
41 IOName::solidVolumeFraction<SolidSystem>(i));
42 }
43 }
44
45 template <class ModelTraits, class FluidSystem, class SolidSystem>
46 static std::string primaryVariableName(int pvIdx, int state = 0)
47 {
48 static constexpr int nonMinNumEq = ModelTraits::numEq() - ModelTraits::numSolidComps() + ModelTraits::numInertSolidComps();
49
50 if (pvIdx < nonMinNumEq)
51 return NonMineralizationIOFields::template primaryVariableName<ModelTraits, FluidSystem, SolidSystem>(pvIdx, state);
52 else
53 return IOName::solidVolumeFraction<SolidSystem>(pvIdx - nonMinNumEq);
54 }
55};
56
57} // end namespace Dumux
58
59#endif
Adds I/O fields specific to a NCMin model.
Definition: porousmediumflow/mineralization/iofields.hh:27
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porousmediumflow/mineralization/iofields.hh:46
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/mineralization/iofields.hh:30
A collection of input/output field names for common physical quantities.
Definition: adapt.hh:17