13#ifndef DUMUX_MPNC_IO_FIELDS_HH
14#define DUMUX_MPNC_IO_FIELDS_HH
16#include <dune/common/exceptions.hh>
30 template <
class OutputModule>
33 using VolumeVariables =
typename OutputModule::VolumeVariables;
34 using FluidSystem =
typename VolumeVariables::FluidSystem;
36 for (
int i = 0; i < VolumeVariables::numFluidPhases(); ++i)
38 out.addVolumeVariable([i](
const auto& v){
return v.saturation(i); },
39 IOName::saturation<FluidSystem>(i));
40 out.addVolumeVariable([i](
const auto& v){
return v.pressure(i); },
41 IOName::pressure<FluidSystem>(i));
42 out.addVolumeVariable([i](
const auto& v){
return v.density(i); },
43 IOName::density<FluidSystem>(i));
44 out.addVolumeVariable([i](
const auto& v){
return v.mobility(i); },
45 IOName::mobility<FluidSystem>(i));
47 for (
int j = 0; j < VolumeVariables::numFluidComponents(); ++j)
48 out.addVolumeVariable([i,j](
const auto& v){
return v.moleFraction(i,j); },
49 IOName::moleFraction<FluidSystem>(i, j));
52 for (
int j = 0; j < VolumeVariables::numFluidComponents(); ++j)
53 out.addVolumeVariable([j](
const auto& v){
return v.fugacity(j); },
54 "fugacity^"+ FluidSystem::componentName(j));
57 out.addVolumeVariable([](
const auto& v){
return v.porosity(); },
61 template <
class ModelTraits,
class Flu
idSystem,
class Sol
idSystem =
void>
64 if (pvIdx < ModelTraits::numFluidComponents())
65 return "fugacity^"+ FluidSystem::componentName(pvIdx);
66 else if (pvIdx < ModelTraits::numEq()-1)
67 return "S_"+ FluidSystem::phaseName(pvIdx - ModelTraits::numFluidComponents());
70 switch (ModelTraits::pressureFormulation())
73 return "p_"+ FluidSystem::phaseName(0);
75 return "p_"+ FluidSystem::phaseName(ModelTraits::numFluidPhases()-1);
76 default: DUNE_THROW(Dune::InvalidStateException,
"Invalid formulation ");
Adds I/O fields specific to the mpnc model.
Definition: porousmediumflow/mpnc/iofields.hh:28
static std::string primaryVariableName(int pvIdx, int state=0)
Definition: porousmediumflow/mpnc/iofields.hh:62
static void initOutputModule(OutputModule &out)
Definition: porousmediumflow/mpnc/iofields.hh:31
A collection of input/output field names for common physical quantities.
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:127