# Resolve "Document if density and viscosity can be changed in freeflow tests"

requested to merge 984-freeflow-tests into master

In general, this MR should allow \varrho and \nu to be varied in the tests in test/freeflow/navierstokes. Background is that they are in the input files already but sometimes cannot be varied so far.

\partial_t \left(\varrho u\right) + \partial_x\left(\varrho u u\right) + \partial_y \left(\varrho u v\right) -2\partial_x\left(\varrho\nu\partial_x u\right) - \partial_y\left(\varrho\nu\left(\partial_y u + \partial_x v\right)\right) + \partial_x p - \varrho g_x - q_{v,x} =0
\partial_t \left(\varrho v\right) + \partial_x\left(\varrho u v\right) + \partial_y \left(\varrho v v\right) -2\partial_y\left(\varrho\nu\partial_y v\right) - \partial_x\left(\varrho\nu\left(\partial_y u + \partial_x v\right)\right) + \partial_y p - \varrho g_y - q_{v,y} =0
• Donea

Now the source term is calculated in a more automatic fashion.

• Sincos

Now the source term is calculated in a more automatic fashion.

• Angeli

Let f(t) = e^{-5\nu\pi^2 t}. Then terms in f(t) are storage and diffusion. Terms in f(t)^2 are advection and pressure gradient. As terms in f(t) and f(t)^2 have to cancel separately, the pressure gradient need a density like the advection term. When running the old code version it looks as if it was OK for \varrho \neq 1. But if I output the pressure and advective terms directly, I see that with my version they fit each other and with the current they don't. I suppose it is just other terms much larger that the pressure and advective terms don't have such a big effect.

• Channel

1d and 3d already use the dynamic viscosity, as it should be. With this MR also 2d uses the dynamic viscosity. Without the change of this MR, calculations of \varrho\neq 1 are also meaningful (as the pressure does only enter the calculation in one single cell) but the analytical solution and with it the L2 errors where not.

• Kovasnay

It converges with other densities, if UMFPack is used instead of BIGCStab. To figure out where the density has to go, I was inspired by https://downloads.hindawi.com/archive/2014/959038.pdf. Without the change of this MR, calculations of \varrho\neq 1 are also meaningful (as the pressure p(x) does only enter the calculation for one x-value) but the analytical solution and with it the L2 errors where not.

Closes #984 (closed)

Edited by Melanie Lipp