5.3.9 Tensor Viscosity Control

In many test problems it is not necessary to activate the 2D/3D tensor viscosity. But when strong slow shock fronts are aligned with the grid the Roe solver runs into problems and at least some additional 2D or 3D viscosity is necessary. And even if the Roe solver can handle sharp shocks by its own, the radiation transport algorithm might cause trouble because of the enormous opacity variations across a shock front. Here the tensor viscosity is useful, too.

`real c_vissmagorinsky`

:

A turbulent viscosity of Smagorinsky type can be activated e.g. withreal c_vissmagorinsky f=E15.8 b=4 & n='Turbulent eddy viscosity parameter (Smagorinsky type)' u=1 1.2

In many cases values around`0.5`

are sufficient to stabilize the code. Larger values (`1.2`

in the example above) are only necessary for some nasty under-resolved supergiant models. Setting`c_vissmagorinsky`

=`c_visartificial`

=`0.0`

skips the tensor viscosity step entirely.`real c_visartificial`

:

A standard artificial viscosity can be activated e.g. withreal c_visartificial f=E15.8 b=4 & n='Artificial viscosity tensor parameter' u=1 1.2

In many cases values around`0.5`

are sufficient to stabilize the code. Larger values (`1.2`

in the example above) are only necessary for some nasty under-resolved supergiant models. Setting`c_vissmagorinsky`

=`c_visartificial`

=`0.0`

skips the tensor viscosity step entirely.`real c_visprturb`

:

The Prandtl number for turbulent mixing can be specified e.g. withreal c_visprturb f=E15.8 b=4 & n='Turbulent Prandtl number' u=1 8.0

Values between`1.0`

and`10.0`

appear reasonable. Note that larger values lead to smaller amounts of turbulent mixing! A value of`0.0`

switches off the turbulent mixing terms (but not the entire tensor viscosity).`real c_vistensordiag`

:

The factor in the stress tensor in front of of the diagonal terms can be set withreal c_vistensordiag f=E15.8 b=4 & n='Diagonal factor for viscous stress tensor' u=1 & c0='typically 1.0 1.0

This is not really parameter one would try to adjust. The total amount of viscosity should be controlled with`real c_vissmagorinsky`

and`real c_visartificial`

. But the parameter can be used to tentatively switch off the diagonal terms completely or to change its importance compared to the other terms.`real c_vistensoroff`

:

The factor in the stress tensor in front of of the off-diagonal terms can be set with e.g.real c_vistensoroff f=E15.8 b=4 & n='Off-diagonal factor for viscous stress tensor' u=1 & c0='typically 0.5 0.5

This is not really parameter one would try to adjust. The total amount of viscosity should be controlled with`real c_vissmagorinsky`

and`real c_visartificial`

. But the parameter can be used to tentatively switch off the off-diagonal terms completely or to change its importance compared to the other terms.`real c_vistensordiv`

:

The factor in the stress tensor in front of of the divergence terms (also on the diagonal) can be set with e.g.real c_vistensordiv f=E15.8 b=4 & n='Divergence factor for viscous stress tensor' u=1 & c0='typically -1./3. 0.0

This is not really parameter one would try to adjust. The total amount of viscosity should be controlled with`real c_vissmagorinsky`

and`real c_visartificial`

. But the parameter can be used to switch off the divergence terms completely or to change its importance compared to the other terms. These divergence terms can be used to reduce the effect of the tensor viscosity in the case of isotropic compression. But this reduction (`c_vistensordiv`

=`-0.333333`

in 3D,`c_vistensordiv`

=`-0.5`

in 2D) is usually switched off.`integer n_viscellsperchunk`

:

The number of cells per box (or ``chunk'') treated by the tensor viscosity scheme at one call (and by one thread) can be set e.g. withinteger n_viscellsperchunk f=I9 b=4 & n='Number of cells per viscosity chunk' & c0='0 => old chopping' & c0='12000: reasonable value' 20000

It can be adjusted to improve cache efficiency and to modify the work load distribution onto the threads (in case of parallel runs with OpenMP). Due to the special handling of boundary cells the overhead per call increases significantly for small chunks. Typically larger chunk sizes (compared the the hydrodynamics chunk sizes set with`integer n_hydcellsperchunk`

, see Sect. 5.3.7) are adequate. On the other hand they should not be too large to limit the usage of temporary memory and to allow parallelization (the distribution of chunks to threads): For simulations with activated OpenMP on a parallel machine the chunk size has to be made small enough to allow at least as many chunks as processors available. This is particularly important for models with a small number of grid points (e.g. 2D models).