From 6a1fa49a33a5d9b73dcff9c905091a8f39f90ed4 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Thu, 7 Jan 2021 17:36:33 +0100 Subject: [PATCH] [bugfix][navierstokes][radsym] Fix rotational symmetric Navier-Stokes with pressure normalization --- dumux/freeflow/navierstokes/staggered/localresidual.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dumux/freeflow/navierstokes/staggered/localresidual.hh b/dumux/freeflow/navierstokes/staggered/localresidual.hh index b0abdc46ba..82c9af5702 100644 --- a/dumux/freeflow/navierstokes/staggered/localresidual.hh +++ b/dumux/freeflow/navierstokes/staggered/localresidual.hh @@ -86,6 +86,8 @@ class NavierStokesResidualImpl<TypeTag, DiscretizationMethod::staggered> using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>; using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices; + static constexpr bool normalizePressure = getPropValue<TypeTag, Properties::NormalizePressure>(); + using CellCenterResidual = CellCenterPrimaryVariables; using FaceResidual = FacePrimaryVariables; @@ -192,7 +194,11 @@ public: // Pressure term (needed because we incorporate pressure in terms of a surface integral). // grad(p) becomes div(pI) + (p/r)*n_r in cylindrical coordinates. The second term // is new with respect to Cartesian coordinates and handled below as a source term. - source += insideVolVars.pressure()/r; + const Scalar pressure = + normalizePressure ? insideVolVars.pressure() - problem.initial(scvf)[Indices::pressureIdx] + : insideVolVars.pressure(); + + source += pressure/r; } } -- GitLab