44 using VolumeVariables =
typename OutputModule::VolumeVariables;
45 using FluidSystem =
typename VolumeVariables::FluidSystem;
51 for (
int phaseIdx = 0; phaseIdx < VolumeVariables::numFluidPhases(); ++phaseIdx)
53 for (
int compIdx = 0; compIdx < VolumeVariables::numFluidComponents(); ++compIdx)
55 out.addVolumeVariable([phaseIdx,compIdx](
const auto& v){
return v.moleFraction(phaseIdx,compIdx); },
57 if (VolumeVariables::numFluidComponents() < 3)
58 out.addVolumeVariable([phaseIdx,compIdx](
const auto& v){
return v.massFraction(phaseIdx,compIdx); },
62 out.addVolumeVariable([phaseIdx](
const auto& v){
return v.molarDensity(phaseIdx); },
66 out.addVolumeVariable([](
const auto& v){
return v.priVars().state(); },
73 using Indices =
typename ModelTraits::Indices;
74 static constexpr auto numStates = 3;
75 using StringVec = std::array<std::string, numStates>;
78 if (state == Indices::firstPhaseOnly
79 || (state == Indices::bothPhases && ModelTraits::setMoleFractionsForFirstPhase()))
80 idxSecComps = FluidSystem::phase0Idx;
82 idxSecComps = FluidSystem::phase1Idx;
88 static const StringVec p0s1SwitchedPvNames = {
95 static const StringVec p1s0SwitchedPvNames = {
102 switch (ModelTraits::priVarFormulation())
106 : p0s1SwitchedPvNames[state-1];
109 : p1s0SwitchedPvNames[state-1];
110 default: DUNE_THROW(Dune::InvalidStateException,
"Invalid formulation ");