Skip to content
Snippets Groups Projects
Commit 7291c461 authored by Timo Koch's avatar Timo Koch
Browse files

[ff][onep] Enable auxiliary flux to add stabilization term in the problem

parent 6da02609
No related branches found
No related tags found
1 merge request!3350[test][stokes] Add stabilized Box-Box donea test
......@@ -24,11 +24,23 @@
#ifndef DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_LOCAL_RESIDUAL_HH
#define DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_LOCAL_RESIDUAL_HH
#include <type_traits>
#include <dumux/common/numeqvector.hh>
#include <dumux/common/properties.hh>
namespace Dumux {
/*!
* \ingroup NavierStokesModel
* \brief Traits class to be specialized for problems to add auxiliary fluxes
* \note This can be used, for example, to implement flux stabilization terms
*/
template<class Problem>
struct ImplementsAuxiliaryFluxNavierStokesMassOneP
: public std::false_type
{};
/*!
* \ingroup NavierStokesModel
* \brief Element-wise calculation of the Navier-Stokes residual for single-phase flow.
......@@ -79,7 +91,7 @@ public:
}
/*!
* \brief Evaluatex the mass flux over a face of a sub control volume.
* \brief Evaluate the mass flux over a face of a sub control volume.
*
* \param problem The problem
* \param element The element
......@@ -97,7 +109,14 @@ public:
{
FluxVariables fluxVars;
fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
return fluxVars.flux(0);
auto flux = fluxVars.flux(0);
// the auxiliary flux is enabled if the trait is specialized for the problem
// this can be used, for example, to implement flux stabilization terms
if constexpr (ImplementsAuxiliaryFluxNavierStokesMassOneP<Problem>::value)
flux += problem.auxiliaryFlux(element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf);
return flux;
}
};
......
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