13#ifndef DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1PNC_ADVECTIVE_FLUX_HH
14#define DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1PNC_ADVECTIVE_FLUX_HH
20template<
int nComp,
bool useM,
int repCompEqIdx>
21struct NavierStokesMassOnePNCModelTraits;
23template<
class IsothermalTraits>
24struct NavierStokesEnergyModelTraits;
26template<
class ModelTraits>
36template<
int nComp,
bool useM,
int repCompEqIdx>
39 template<
class NumEqVector,
class UpwindFunction>
41 const UpwindFunction& upwind)
44 static constexpr bool useMoles = ModelTraits::useMoles();
45 static constexpr auto numComponents = ModelTraits::numFluidComponents();
46 static constexpr auto replaceCompEqIdx = ModelTraits::replaceCompEqIdx();
47 static constexpr bool useTotalMassBalance = replaceCompEqIdx < numComponents;
49 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
52 const auto eqIdx = ModelTraits::Indices::conti0EqIdx + compIdx;
54 if (eqIdx == replaceCompEqIdx)
57 auto upwindTerm = [&]()
59 if constexpr (useMoles)
60 return [compIdx](
const auto& volVars) {
return volVars.molarDensity()*volVars.moleFraction(compIdx); };
62 return [compIdx](
const auto& volVars) {
return volVars.density()*volVars.massFraction(compIdx); };
65 flux[eqIdx] += upwind(upwindTerm);
69 if constexpr(useTotalMassBalance)
71 auto upwindTerm = [&]()
73 return [](
const auto& volVars) {
return volVars.density(); };
76 flux[replaceCompEqIdx] += upwind(upwindTerm);
82template<
int nComp,
bool useM,
int repCompEqIdx>
84:
public AdvectiveFlux<NavierStokesMassOnePNCModelTraits<nComp, useM, repCompEqIdx>>
typename NumEqVectorTraits< PrimaryVariables >::type NumEqVector
A vector with the same size as numbers of equations This is the default implementation and has to be ...
Definition: numeqvector.hh:34
static void addAdvectiveFlux(NumEqVector &flux, const UpwindFunction &upwind)
Definition: 1pnc/advectiveflux.hh:40
Specifies a number properties of non-isothermal free-flow flow models based on the specifics of a giv...
Definition: freeflow/navierstokes/energy/model.hh:47
Traits for the Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1pnc/model.hh:68