25#ifndef DUMUX_MPNC_IO_FIELDS_HH
26#define DUMUX_MPNC_IO_FIELDS_HH
28#include <dune/common/exceptions.hh>
42 template <
class OutputModule>
45 using VolumeVariables =
typename OutputModule::VolumeVariables;
46 using FluidSystem =
typename VolumeVariables::FluidSystem;
48 for (
int i = 0; i < VolumeVariables::numFluidPhases(); ++i)
50 out.addVolumeVariable([i](
const auto& v){
return v.saturation(i); },
51 IOName::saturation<FluidSystem>(i));
52 out.addVolumeVariable([i](
const auto& v){
return v.pressure(i); },
53 IOName::pressure<FluidSystem>(i));
54 out.addVolumeVariable([i](
const auto& v){
return v.density(i); },
55 IOName::density<FluidSystem>(i));
56 out.addVolumeVariable([i](
const auto& v){
return v.mobility(i); },
57 IOName::mobility<FluidSystem>(i));
59 for (
int j = 0; j < VolumeVariables::numFluidComponents(); ++j)
60 out.addVolumeVariable([i,j](
const auto& v){
return v.moleFraction(i,j); },
61 IOName::moleFraction<FluidSystem>(i, j));
64 for (
int j = 0; j < VolumeVariables::numFluidComponents(); ++j)
65 out.addVolumeVariable([j](
const auto& v){
return v.fugacity(j); },
66 "fugacity^"+ FluidSystem::componentName(j));
69 out.addVolumeVariable([](
const auto& v){
return v.porosity(); },
73 template <
class ModelTraits,
class Flu
idSystem,
class Sol
idSystem =
void>
76 if (pvIdx < ModelTraits::numFluidComponents())
77 return "fugacity^"+ FluidSystem::componentName(pvIdx);
78 else if (pvIdx < ModelTraits::numEq()-1)
79 return "S_"+ FluidSystem::phaseName(pvIdx - ModelTraits::numFluidComponents());
82 switch (ModelTraits::pressureFormulation())
85 return "p_"+ FluidSystem::phaseName(0);
87 return "p_"+ FluidSystem::phaseName(ModelTraits::numFluidPhases()-1);
88 default: DUNE_THROW(Dune::InvalidStateException,
"Invalid formulation ");
A collection of input/output field names for common physical quantities.
Enumeration of the formulations accepted by the MpNc model.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:139
Adds I/O fields specific to the mpnc model.
Definition: porousmediumflow/mpnc/iofields.hh:40
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porousmediumflow/mpnc/iofields.hh:74
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/mpnc/iofields.hh:43