Grid hierarchy
Iterative solvers remove short-wavelength errors quickly and long-wavelength errors slowly. Coarser grids help: a
long wave on the fine grid is a short wave on a coarse grid, and coarse iterations are cheap. STEER builds a
hierarchy of coarser meshes for this purpose. Grid sequencing (steady.sequencing, Solution algorithm)
uses it: it solves on the coarse meshes first and interpolates each result to the next finer mesh. The code is in
Source/MeshHierarchy and Source/Transfer.
Coarse levels
mesh.hierarchy_levels = \(L > 1\) adds \(L - 1\) coarser meshes of the same domain.
mesh.hierarchy_ratio = \(q\) (2 or 4, default 2) is the coarsening from one level to the next in x and y:
mesh.hierarchy_levels = 3 with \(q = 2\) makes levels 1 and 2 two and four times coarser than level 0
(refinement 2 2 1), and mesh.hierarchy_levels = 2 with \(q = 4\) makes one level four times coarser
(refinement 4 4 1). The coarsest level is the same grid in both. With 4 4 1 there is no middle level: level 0
starts from the coarsest, more smoothed solution, prolonged by 4 in one step. On the Truly_Neutral_Hill_3D
restart deck (32 x 32 cells, 2 ranks, four orders of residual drop) level 0 took 2699 iterations after 2 2 1
and 2754 after 4 4 1, against 3494 without sequencing.
Horizontal coarsening only. Level \(l\) has \(n_x/q^l \times n_y/q^l\) cells. The vertical levels are never coarsened: every level has the vertical levels of level 0, so the first cell and the wall model are the same on all levels.
Smoothed ground. The ground of level \(l\) is level 0’s ground sampled at its nodes, then smoothed on level \(l\)’s own grid by \(n_l = p\,(q^l - 1)\) passes of the filter
\[h \leftarrow h + \beta\,(h_{i+1,j} + h_{i-1,j} + h_{i,j+1} + h_{i,j-1} - 4h), \qquad \beta = \tfrac18,\]where \(p\) is
terrain.hierarchy_passes. Level 0 is not smoothed. The filter damps every Fourier mode without changing its sign and removes the grid-scale checkerboard in one pass. Coarser levels therefore keep less terrain relief; on the Askervein test mesh the relief is 124, 108 and 63 m on levels 0, 1 and 2.Own mesh. Each level follows its own ground with the run’s
terrain.smoothingandterrain.gamma_m, and computes its own metrics and Poisson solvers.Same ranks. Level \(l\)’s boxes are level 0’s boxes coarsened by \((q^l, q^l, 1)\), on the same MPI ranks. For this,
mesh.n_cellandmesh.max_grid_sizein x and y must be divisible by \(q^{L-1}\), and level 0 is laid out so that every level coarsens it exactly. That layout can differ from the one without a hierarchy, so a level-0 result can differ from an \(L = 1\) run in the last bits.Restart. The coarse levels are rebuilt from level 0.
mesh.hierarchy_levels,mesh.hierarchy_ratioandterrain.hierarchy_passesmay change across a restart.
Coarse cells over steep terrain. The horizontal cell size grows by \(q\) per level while the vertical size
does not, so the aspect ratio grows by \(q\) too. The run prints a mesh-quality report per level. If STF smoothing is limited on a coarse
level, the report suggests raising terrain.hierarchy_passes, lowering terrain.gamma_m or using fewer levels.
Transfer operators
Two operators move a solution between a fine level \(l_f\) and a coarse level \(l_c\), with ratio \(r = q^{l_c - l_f}\) in x and y. Since z is never coarsened, both work level by level in the vertical. Grid sequencing uses the prolongation; the solver does not call the restriction, which the transfer unit tests keep as the reference the prolongation is checked against.
Restriction (fine to coarse) conserves mass:
\(\theta\), \(k\) and \(p'\) at cell centres: the volume-weighted mean of the \(r \times r\) fine cells, \(q_c = \sum J_f q_f / \sum J_f\).
\(u\) and \(v\): the face flux. A coarse x-face covers \(r\) fine x-faces:
\[a_{x,c}\, u_c\, r = \sum_{b=0}^{r-1} a_{x,f}\, u_f .\]\(w\): the vertical flux \(\Omega\) of the \(r^2\) fine z-faces, \(a_{z,c}\,\Omega_c\, r^2 = \sum a_{z,f}\,\Omega_f\), then \(w_c\) from \(\Omega_c\) with the coarse slopes.
Each coarse face carries the total flux of the fine faces it covers. The coarse divergence is therefore the volume-weighted mean of the fine one,
and a divergence-free fine field restricts to a divergence-free coarse field, over flat ground and terrain alike.
Prolongation (coarse to fine):
Each field is interpolated bilinearly at its own staggered location, level by level. Next to a non-periodic domain face the interpolation is extended linearly. A field \(a + bx + cy + dxy\) is reproduced exactly when each non-periodic direction has at least two coarse cells.
\(k\) is bounded below by
turb.tke_floor.The fine level’s boundary conditions are applied.
A SIMPLEC pressure correction on the fine level makes the field divergence-free. The interpolated \(p'\) is kept.
Bilinear interpolation is not conservative, so restriction after prolongation does not return the original coarse field exactly; it applies a mild smoothing.
Over terrain the coarse ground is smoothed, so a prolonged field is an initial guess on the fine mesh, not an interpolant of a fine solution.
The transfer operators have no inputs. Their tests are listed in Testing.