next up previous contents index
Next: 7.1.12 Dust/molecules/hydrogen ionization: General Up: 7.1 Parameter file: rhd.par Previous: 7.1.10 Hydrodynamics control (MHD   Contents   Index

Subsections


7.1.11 Tensor-viscosity control

In most test problems it is not necessary to activate the 2D/3D tensor viscosity anymore. Even when strong slow shock fronts are aligned with the grid the Roe solver does not run into problems anymore, even without any additional 2D or 3D viscosity. However, 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 might become useful. In fact, there are two separate tensor-viscosity routines by now:

The classical one is controlled by c_visSmagorinsky, c_visArfificial, etc. Its use was recommeded for the old version of the Roe solver. Nowadays, it is only kept for compatability reasons.

The new ``point-to-point'' tensor viscosity is controlled by c_visP2Pcoeff, etc.see Sect.7.1.11.10 below). It has better stability properties than the old version. However, due to the improved stability of the Roe solver itself the use of this new tensor viscosity formulation is actually less often necessary than the old one.


7.1.11.1 integer n_visiter

While this parameter is named analogously to n_hyditer, it controls a somewhat different behavior of the viscosity step. While positive values of n_visiter have no meaning, so far, a negative value specifies the number of hydrodynamics substeps per viscosity step (or rather: how often the viscosity step is called during the hydrodynamics iteration). The parameter can be set e.g. with
integer n_visiter f=I4 b=4 n='Number of tensor-viscosity iterations' &
  c0='<0: Number of hydro substeps per viscosity substep' &
  c1=' 0: One tensor-viscosity substep per global time step (old, default)' &
  c2='>0: Not implemented, yet'
-1
Possible values are: For models with long radiative relaxation time scales, a large value of n_hyditer can lead to a significant speed up. Choosing a small negative value for n_visiter means that the tensor-viscosity sub step is called sufficiently often. Note, there is not parameter n_vismaxiter. So far, this parameter is only recognized by the HYD module.


7.1.11.2 real c_vissmagorinsky

A turbulent viscosity of Smagorinsky type can be activated e.g. with
real c_vissmagorinsky f=E15.8 b=4 &
    n='Turbulent eddy viscosity parameter (Smagorinsky type)'     u=1
0.5
In many cases values around 0.5 are sufficient to stabilize the code. Larger values are only necessary for some nasty under-resolved supergiant models. Setting c_vissmagorinsky = c_visartificial = c_visexpansion = c_vislinear = c_visp2pcoeff = 0.0 skips the classical tensor-viscosity step entirely.


7.1.11.3 real c_visartificial

A standard artificial viscosity can be activated e.g. with
real c_visartificial f=E15.8 b=4 &
    n='Artificial viscosity tensor parameter'                     u=1
0.5
In many cases values around 0.5 are sufficient to stabilize the code. Larger values are only necessary for some nasty under-resolved supergiant models.


7.1.11.4 real c_visexpansion

An additional viscosity can be activated e.g. with
real c_visexpansion f=E15.8 b=4 &
    n='Expansion viscosity tensor parameter'                     u=1
1.2
While the standard artificial viscosity acts on compressed regions, this viscosity acts in expansion areas. Ususally, it is not activated (c_visexpansion = 0.0). However, it might be useful in cases were strong localized expansions cause problems.


7.1.11.5 real c_vislinear

Another viscosity can be activated e.g. with
real c_vislinear f=E15.8 b=4 &
    n='Linear viscosity tensor parameter'                     u=1
1.2
In the formulae for the standard (artificial, compression, Smagorinsky) viscosity velocity gradients appear. That means that in regions with smooth small-amplitude flows these types of viscosity essentially vanish. Here, the linear viscosity comes in. It uses $\sqrt{R_{\rm gas}T}$ as approximation for the sound speed that is used in the formula for the kinematic viscosity. Ususally, it is not activated (c_vislinear = 0.0). It might be useful to damp small-amplitude almost linear waves.

7.1.11.6 real c_visprturb

The Prandtl number for turbulent mixing can be specified e.g. with
real 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).

7.1.11.7 real c_vistensordiag

The factor in the stress tensor in front of of the diagonal terms can be set with
real 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 parameters like 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.

7.1.11.8 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 parameters like 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.

7.1.11.9 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 parameters like 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.

In addition to the standard tensor viscosity described above, there is a "point-to-point" viscosity.
It relies on a completely different discretization. It should conserve angular momentum exactly and guarantee positivity of dissipated energy (for sufficiently small time steps). The "point-to-point" viscosity can be used in addition to the standard one - or without.


7.1.11.10 real c_visp2pcoeff

The strength of the viscosity can be controlled with e.g.
real c_visp2pcoeff f=E15.8 b=4 &
    n='Point to point viscosity coefficient'                      u=1
0.20
This parameter is somewhat analogous to real c_visartificial, see 7.1.11.3. But it acts on compression, expansion, and shear flows. A value of 0.0 switches it off.


7.1.11.11 real c_visp2phypsmagorinsky

This parameter can be set with e.g.
real c_visp2phypsmagorinsky f=E15.8 b=4 &
    n='Smagorinsky parameter for point-to-point viscosity'        u=1
0.3
This parameter is equivalent to real c_vissmagorinsky (see 7.1.11.2) with the classical implementation of the viscosity tensor. A value of 0.0 switches it off. Values of 0.3 or 0.5 are reasonable. Although the underlying formula (and theory) is more complex, the effects are rather similar to that of real c_visp2pcoeff. If additional smoothing is required, either of these parameters (or both) can be set to non-zero values.

7.1.11.12 real c_visp2phypartificial

This parameter can be set with e.g.
real c_visp2phypartificial f=E15.8 b=4 &
    n='Artificial point-to-point tensor-viscosity parameter'      u=1
0.0
This parameter is equivalent to real c_visartificial (see 7.1.11.3) with the classical implementation of the viscosity tensor. A value of 0.0 switches it off. Values of 0.3 to 1.0 are reasonable. The viscosity controlled with this parameter is meant to act mostly on shocks.

7.1.11.13 real c_visp2phypexpansion

This parameter can be set with e.g.
real c_visp2phypexpansion f=E15.8 b=4 &
    n='Parameter for point-to-point expansion tensor viscosity'   u=1
0.0
This parameter is equivalent to real c_visexpansion (see 7.1.11.4) with the classical implementation of the viscosity tensor. A value of 0.0 switches it off. The viscosity controlled with this parameter is meant to limit or smooth strong expansion events where density, pressure, temperature, and/or entropy can drop significantly. This parameter is not frequently set to non-zero values.

7.1.11.14 real c_visp2pdivrhov

This parameter can be set with e.g.
real c_visp2pdivrhov f=E15.8 b=4 &
    n='Point-to-point mass-flux-divergence viscosity coefficient' u=1
0.0
A value of 0.0 switches it off. Values of 0.5 or even 2.0 are reasonable. The viscosity controlled with this parameter acts only on compressible flow configurations, i.e., in near-incompressible low-Mach-number flows it should have hardly any effect. Still, it can be used in exacly such a case to dampen spurious sound waves for example at the very top of the computational box.

7.1.11.15 real c_visp2pincl1

The interaction with the edge neighbor cells with indices ( $\pm 1 \pm 1 + 0$) can be specified with e.g.
real c_visp2pincl1 f=E15.8 b=4 &
    n='Point to point viscosity inclined cell factor 1'           u=1
1.0
Common values are 1.0 (interaction is considered) and 0.0 (no interaction with these cells). The usual value is 1.0.

7.1.11.16 real c_visp2pincl2

The interaction with the corner neighbor cells with indices ( $\pm 1 \pm 1 \pm 1$) can be specified with e.g.
real c_visp2pincl2 f=E15.8 b=4 &
    n='Point to point viscosity inclined cell factor 2'           u=1
0.0
Common values are 1.0 (interaction is considered) and 0.0 (no interaction with these cells). The usual value is 0.0 to save some computation time.


7.1.11.17 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. for an Intel Macintosh with
integer n_viscellsperchunk f=I9 b=4 &
  n='Number of cells per viscosity chunk' &
  c0='0 => old chopping' &
  c1='50000: reasonable value'
100000
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.7.1.8.9) 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.D models). An example is given for the Hitachi SR8000 in Sect.4.6.5.


next up previous contents index
Next: 7.1.12 Dust/molecules/hydrogen ionization: General Up: 7.1 Parameter file: rhd.par Previous: 7.1.10 Hydrodynamics control (MHD   Contents   Index