Skip to content
Snippets Groups Projects
Commit 5efc8fe4 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

Merge branch 'fix/restart-mpnc' into 'master'

[fix][mpnc] reimplement privarVariablesName in IOFields for restart of mpnc.

See merge request !1873
parents c48785f1 f4a0d549
No related branches found
No related tags found
1 merge request!1873[fix][mpnc] reimplement privarVariablesName in IOFields for restart of mpnc.
......@@ -66,6 +66,27 @@ public:
out.addVolumeVariable([](const auto& v){ return v.porosity(); },
IOName::porosity());
}
template <class ModelTraits, class FluidSystem, class SolidSystem = void>
static std::string primaryVariableName(int pvIdx, int state=0)
{
if (pvIdx < ModelTraits::numFluidComponents())
return "fugacity^"+ FluidSystem::componentName(pvIdx);
else if (pvIdx < ModelTraits::numEq()-1)
return "S_"+ FluidSystem::phaseName(pvIdx - ModelTraits::numFluidComponents());
else
{
switch (ModelTraits::pressureFormulation())
{
case MpNcPressureFormulation::mostWettingFirst :
return "p_"+ FluidSystem::phaseName(0);
case MpNcPressureFormulation::leastWettingFirst :
return "p_"+ FluidSystem::phaseName(ModelTraits::numFluidPhases()-1);
default: DUNE_THROW(Dune::InvalidStateException, "Invalid formulation ");
}
}
}
};
} // end namespace Dumux
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment