62    static Scalar 
flux(
const Problem& problem,
 
   63                       const Element& element,
 
   64                       const FVElementGeometry& fvGeometry,
 
   65                       const ElementVolumeVariables& elemVolVars,
 
   66                       const SubControlVolumeFace& scvf,
 
   68                       const ElementFluxVariablesCache& elemFluxVarsCache)
 
   71        const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
 
   72        const auto& outsideScv = fvGeometry.scv(scvf.outsideScvIdx());
 
   73        const auto& insideVolVars = elemVolVars[insideScv];
 
   74        const auto& outsideVolVars = elemVolVars[outsideScv];
 
   75        const auto computeLambda = [&](
const auto& v){
 
   76            if constexpr (numEnergyEq == 1)
 
   77                return v.effectiveThermalConductivity();
 
   78            else if constexpr (numEnergyEqFluid == 1)
 
   79                return (phaseIdx != sPhaseIdx)
 
   80                        ? v.effectiveFluidThermalConductivity()
 
   81                        : v.effectiveSolidThermalConductivity();
 
   83                return v.effectivePhaseThermalConductivity(phaseIdx);
 
   86        auto insideLambda = computeLambda(insideVolVars);
 
   87        auto outsideLambda = computeLambda(outsideVolVars);
 
   90        insideLambda *= insideVolVars.extrusionFactor();
 
   91        outsideLambda *= outsideVolVars.extrusionFactor();
 
   94        const auto lambda = 
faceTensorAverage(insideLambda, outsideLambda, scvf.unitOuterNormal());
 
   97        const auto& fluxVarsCache = elemFluxVarsCache[scvf];
 
   99        Dune::FieldVector<Scalar, GridView::dimensionworld> gradTemp(0.0);
 
  100        for (
auto&& scv : scvs(fvGeometry))
 
  103            if (phaseIdx < numEnergyEqFluid)
 
  104                gradTemp.axpy(elemVolVars[scv].temperatureFluid(phaseIdx), fluxVarsCache.gradN(scv.indexInElement()));
 
  106               gradTemp.axpy(elemVolVars[scv].temperatureSolid(), fluxVarsCache.gradN(scv.indexInElement()));
 
  110        return -1.0*
vtmv(scvf.unitOuterNormal(), lambda, gradTemp)*Extrusion::area(fvGeometry, scvf);