Immersed terrain
By default the mesh follows the ground (Terrain-following coordinates). With
terrain.representation = immersed_forcing the mesh is flat and the ground is a surface inside it. Cells below the
ground are solid, and the cells the ground cuts carry the form 7 wall law of ERF
(erf.if_wall_form = fraction_stress) and Kynema-SGF (wall_form 7), as the walls of Buildings do. The
choice is made once, at start-up, and cannot change across a restart.
Status. A flat or sloping ground (terrain.type = flat, agnesi, xyz or erf_grid) in a neutral
run with SIMPLEC and either line sweep (steady.sweep), laterally periodic or with inflow and outflow faces
(Open faces).
The roughness length is one value or a map (bc.surface_z0_file, Roughness map). Stratification, buildings
and nests on an immersed ground are not supported yet; a forest canopy is, without canopy.heat = fixed; Limits lists what the run refuses. body_fitted remains the default and its answers are
unchanged.
Input |
Default |
Effect |
|---|---|---|
|
|
|
|
required ( |
The height of the terrain’s zero level above the mesh’s lower face (m): the ground itself with
|
|
two cells (2 max(dx, dy)) |
|
|
|
A solid fraction below it becomes 0, and one within it of 1 becomes 1 (≥ 1e-4). |
|
|
\(C_0\) of the lee turn (Lee turn): turns the flow down with the ground in the lee cut cells. 0.25 is the value chosen on a ridge. |
|
|
\(\epsilon\) of the lee turn: the width of the ramp that brings it in where the ground turns from windward to lee. |
The ranges are in Input reference.
Geometry
The ground’s height is
with \(h_0\) = terrain.flat_height and \(h_t\) the height terrain.type gives (0 for flat; the
hill of agnesi; the interpolated file of xyz or erf_grid). It is evaluated at the mesh’s nodes, as the
body-fitted ground is, and the mesh itself stays flat. Over a cell’s footprint the ground is piecewise linear on the
four triangles that the footprint’s centre (at the mean of the four corner heights) makes with each pair of
neighbouring corners. Along a cell’s edge it is the straight line between the two nodes, so the two cells that share
a face see the same ground on it. A smooth hill is therefore a continuous surface, not a staircase of flat tiles
with side walls.
Every quantity is a mean over the footprint (or over a face’s edge) of
for a level \(t\), which has a closed form on a triangle and on a segment (Source/ImmersedSurface_K.H).
\(M_0\) is the part of the footprint whose ground lies below \(t\), \(M_1\) the depth of fluid below
\(t\), and \(M_2\) twice that fluid’s first moment about the ground. For the layer between the levels
\(z_b\) and \(z_t\), of height \(\Delta\):
\(\beta\) is the cell’s solid fraction and \(D\) the mean height of the cell’s fluid above the ground. In a
cell wholly above the ground \(D\) is the cell centre’s height above the footprint’s mean ground. A layer wholly
below the ground is solid (\(\beta = 1\)). Velocities in solid cells are held at zero, and \(k\) at its
floor. The blocked part of an x or y face is \(1 - (m_1(z_t) - m_1(z_b))/\Delta\) with \(m_1\) the same mean
along the face’s edge, and that of a z face at the level \(z\) is \(1 - M_0(z)\). Fractions within
terrain.small_volfrac of 0 or 1 are rounded; a face next to a solid cell is blocked and one between two fluid
cells is open, as for buildings.
Wall cells. A cell is a wall cell where the blocked part of its low z face exceeds that of its high z face (or,
in a fluid cell, where its low face is blocked). The difference is the horizontal area of ground in the cell, as a
part of the footprint; over a column these areas add to 1. On a slope a column has several wall cells. The test has
no tolerance, unlike the buildings’ wall cells, which need the difference to exceed buildings.small_volfrac: on a
slope that rises through \(n\) layers across a column the blocked part changes by about \(1/n\) per layer,
and a tolerance above that drops most of the column’s roof (with a tolerance of 0.1, a slope of 0.15 on 80 m
columns of 1 m layers keeps a third of its footprint as roof; unit test
ImmersedSurface.RoofsAddToTheFootprintOnASlopeThroughManyLayers). The ground has no side walls: the
differences of the x and y faces are the same surface, whose area the z faces already count. A vertical step in the terrain’s data becomes a slope across one cell.
Closure of the faces. Before the rounding, the open parts of a cell’s faces close: a uniform wind parallel to
a plane ground has no net flux through them, and the same holds for the four-triangle surface. The rounding of
the fractions (terrain.small_volfrac, and the rule that a face next to a solid cell is blocked) changes a face
by at most terrain.small_volfrac of its area in the cells it rounds.
Distances. The two distances of the wall law are the mean heights above the ground of the fluid of the wall cell and of the cell above it (the reference cell),
For a flat ground in a layer of height \(\Delta\), with \(\Delta_r\) the height of the reference cell, they are
When the ground lies on a cell face, the cell above it is the wall cell with \(\beta = 0\) and \(d_1 = \Delta / 2\). The closure’s wall distance is \(D\) in every cell (Turbulence).
The ground must lie between the top of the mesh’s first layer and the bottom of its top layer everywhere. The
plotfile fields building_beta and building_wall show the solid fraction and the wall cells
(Output files). The node heights in the plotfile are the flat mesh’s.
Cost. A terrain-following mesh keeps its near-ground layer height over the whole relief. A flat mesh needs that layer height from the lowest to the highest ground: \(H_r/\Delta\) more layers for a relief \(H_r\), when the layers are uniform. The ridge of Verification has the same layer height as its body-fitted reference far from the ridge (66 against 64 layers); on the crest the body-fitted layers are 10 % thinner.
Wall law
The friction velocity of the cut cell is
with \(U_1\) and \(U_2\) the speeds parallel to the ground in the cut cell and in the reference cell,
\(\kappa\) the von Kármán constant and \(z_0\) = bc.surface_z0, or the column’s value of the map
bc.surface_z0_file (Roughness map). This is the neutral form of the
body-fitted surface layer (Boundary conditions) at the two distances. The distances are exact: the
buildings’ law floors them at 10 \(z_0\), which the ground’s law does not, since
\(\ln((d + z_0)/z_0) > 0\) for every \(d > 0\). With \(\beta = 0\) the law is the
body-fitted neutral one read at the first cell’s centre (the body-fitted default; bc.surface_zref and
bc.surface_denominator_floor have no counterpart here).
The whole stress is a sink in the cut cell’s momentum rows, as for a building’s roof; the reference cell gives
its speed only.
Slope
On a sloping ground the wall law reads the heights above the ground (\(d_1, d_2\)) and the horizontal speed \(\sqrt{u^2 + v^2}\), acts on the ground’s horizontal area in the cell, and is a sink on \(u\) and \(v\). This is ERF’s form. The ground has no side walls (Geometry), and the closure’s distance is \(D\) (Turbulence).
Forms tried and removed. Three other forms were tried on a 2-D ridge (\(H\) = 200 m, \(a\) = 200 m) against the body-fitted run on the same mesh, at 10 m above the ground. With the form above the rms of dS is 14.5 % on 80 m columns of 15.6 m layers and 9.8 % on 160 m columns of 7.8 m layers. A wall law along the ground’s normal (distance along the normal, speed parallel to the ground, the slope’s area) gave 14.1 % and 9.3 %. On the ridges and the hill of Verification it differed from the form above by 0.3 % or less of the far-field speed. Side walls with a wall law on the steps where the ground drops by more than a layer to the next column gave 14.1 % and 9.1 %, and lowered the lee overspeed of the 160 m mesh from +9.7 to +5.9 %. The crest deficit of the 80 m mesh stayed (−25.0 % without, −27.2 % with). A variant with no slip on the step faces was not measured on this ridge. With those side walls, a closure distance from the column centre’s ground, on footprints steeper than the layer, brought \(\nu_t\) beside the steps close to the body-fitted value and changed the rms by 0.3 points or less (9.1 to 8.8 % and 14.1 to 14.3 %). The three forms lowered the rms by 0.7 points or less and left the coarse mesh’s crest deficit, and were removed. Other changes (the distance along the ground’s normal for the closure, the distance to the nearest wall rectangle, the cell top’s height, no shear production in wall cells beyond a distance, and \(\nu_t\) from the local speed and strain) changed the rms by 0.3 points or less, or raised it.
Diffusion across the cut cell’s top face. The cut cell’s speed stands for its fluid centroid, not its cell centre. The viscous flux of \(u\) and \(v\) between the cut cell and the reference cell therefore uses the distance between the two points where the speeds are known,
in the residual and in the implicit rows; the diagonal gains the same amount, so the row sums are kept. With the cell-centre spacing the cut cell came out slow and the cell above it fast, by up to 5 % of the log law. Buildings keep the cell-centre spacing, and so do \(k\) and \(\theta\) across that face: in a log layer the flux of \(k\) there is zero.
Body forces. The pressure-gradient forcing, the Coriolis force and buoyancy act on the open part of each face’s control volume (the face’s open fraction), so a solid layer takes no force and the cut cell takes the force on its fluid. The steady balance of a column driven by a force \(F\) is then \(u_*^2 = F D\) with \(D\) the fluid’s depth. Buildings keep the force on the whole control volume.
Heat. The ground takes no heat. The diffusive flux of \(\theta\) through the blocked part of every face is
closed, in the residual and in the implicit rows (each coupling times the face’s open part, the diagonal kept), as
for \(k\). A solid cell’s \(\theta\) therefore reaches no fluid cell, also through the side faces on a steep
slope where a column’s ground drops by more than a layer to the next column (unit test
ImmersedTerrain.ThetaIsNotConductedThroughTheGround). Without this closure the solid cells would conduct
\(\theta\) as fluid cells do. A uniform bc.theta_profile is still required (Limits), so the answers of the
runs that are accepted do not change; the closure is in place for a stratified immersed ground.
Turbulence
The closure sees the ground as it sees a building with buildings.wall_tke = on (Buildings, Turbulence):
the cut cell relaxes \(k\) to the wall value \(u_*^2 / C_{\mu 0}^2\), the diffusive flux of \(k\) into
the ground is closed, and the length scale takes the distance to the ground. That distance is \(D\), the mean
height of the cell’s fluid above the ground: \(d_1\) in a wall cell, as in the wall law, and the cell centre’s
height above the ground under it elsewhere. It is the vertical height, as the body-fitted closure’s. The initial
profile, the inflow profile, the Rayleigh layer and the convection blend (convection.hybrid_height) read heights
above the immersed ground too, through the same helper as on a body-fitted mesh. In a layer the ground cuts that
height is the centroid of the layer’s open part, half the open height, at cell centres and at the x and y faces:
the inflow profile then gives a cut face the wind at the height the wall law reads it.
Where the ground under a footprint spans more than the cell’s layer, \(D\) averages over the footprint’s deep corner and can exceed the cell’s height above the ground below its centre several times; a smaller distance there did not lower the error (Slope).
Shear in the cut cell. The closure’s central difference in the cut cell reads the solid cell below it, where the wind is 0. The vertical gradients of \(u\) and \(v\) there are taken from the wall law at the cell’s fluid centroid,
with \(u_*\) the cut cell’s friction velocity (Wall law), \(d_1\) its fluid centroid’s height and
\((u_c, v_c)\) its wind. This is the gradient the body-fitted ground’s first cell takes. Where the cut cell’s
wind is exactly 0 it has no direction and the gradient is set to 0. The other terms of \(S^2\) are unchanged. It applies with both values of turb.shear_stencil.
Shear above the cut cell. In the first full cell above the cut cell the closure’s central difference would place the cut cell’s speed at its cell centre. There the vertical gradients of \(u\) and \(v\) are taken as
with \(u_c\) the cut cell’s value, \(u_{k+1}\) that of the cell above the reference cell, \(h\) the
spacing between the reference cell’s centre and the next, and \(f_2 = \Delta/2\),
\(f_3 = \Delta + \Delta_r/2\), \(f_4 = f_3 + h\). The first factor is the gradient of a log profile through
the two points, at the reference cell. \(R\) is the ratio of the central difference to the true gradient of a log
profile for a ground on the cut cell’s bottom face, so the cell makes the error the body-fitted ground’s first
interior cell makes. With \(\beta = 0\) (the ground on a layer’s face) the expression is the closure’s central difference
\((u_{k+1} - u_c)/(2 \Delta_r)\), on stretched layers too. This follows the
rule of ERF’s erf.if_flat_wall_dissipation and Kynema-SGF #2067 (an immersed wall repeats the flat ground’s
discretisation), applied here to the shear.
With turb.shear_stencil = log_law (Log-consistent shear near the ground) this formula is not used: every fluid cell above the cut
cell takes the log-law gradient through its two neighbours, at the fluid centroids’ distances, which is the
expression above with \(R = 1\) in the first full cell. The cut cell takes the wall law’s gradient (above)
and the solid cells keep the closure’s \(S^2\). For a log profile the result is exact from the cut cell
upwards on flat ground.
Restart
A checkpoint of an immersed run holds a file ImmersedTerrain with a hash of terrain.type and its keys (the
hill’s inputs, or the terrain file’s contents and its interpolation inputs), terrain.flat_height,
terrain.small_volfrac and the roughness: bc.surface_z0, or with bc.surface_z0_file the SHA-256 of the
file’s contents with terrain.idw_neighbors and terrain.idw_power (the file’s path is not in the hash; a
map that cannot be read stops the run, with or without a stage). A
restart with another value of one of them, with a map in place of a value or a value in place of a map, or with the other terrain.representation, stops naming io.restart. The ground’s heights are not in
the checkpoint: a restart computes them from the inputs, which the hash pins. The record’s version is 3; a
checkpoint written before sloping grounds (version 1) or before the wall-cell test lost its tolerance (version 2) is
refused, with a message naming the two versions. A restart reads the bc inputs in a stage only, so a restart of
an immersed run names a steady.stage.
terrain.lee_turn and terrain.lee_turn_ramp are not in the hash: they are model parameters, like the
turbulence inputs, and a restart may change them (Lee turn). The lee turn’s rates are not in the checkpoint;
the first iteration after a restart computes them from the restored wind.
Verification
Tests/Canonical_RANS/Immersed_Column is the 1-D neutral column of Test cases on 67 flat layers of
15.625 m, with the ground at \((2 + f)\) layers, so that \(f\) is the cut cell’s solid fraction. A force
\(F\) drives it. The friction velocity recomputed from the plotfile with the law above must equal \(F D\),
and the speeds are compared with the log law of \(u_* = \sqrt{F D}\).
f |
Iterations |
\(u_*^2/(F D) - 1\) |
Cut cell vs log law at \(d_1\) |
Cell above |
Two cells above |
|---|---|---|---|---|---|
0 |
2266 |
−5.3e-7 |
0.00 % |
−0.89 % |
−1.33 % |
0.3 |
2284 |
−4.1e-7 |
+0.36 % |
−0.85 % |
−1.44 % |
0.7 |
2363 |
−2.0e-7 |
+1.77 % |
−0.77 % |
−1.75 % |
0.9 |
2509 |
−6.9e-8 |
+5.64 % |
−0.65 % |
−2.01 % |
At \(f = 0\) the column equals the body-fitted column of 65 layers within 4.2e-9 in \(u\) and 1.0e-8 in \(k\). The cut cell’s excess over the log law follows from the law. With \(u_*^2\) fixed at \(F D\) and \(e_1, e_2\) the relative differences of the cut cell and the reference cell from the log law, \((1 - \beta)(1 + e_1)^2 + \beta (1 + e_2)^2 = 1\), so \(e_1 \approx -e_2\,\beta/(1 - \beta)\): the reference cell’s small deficit, of the size the body-fitted column has in its first cells, is multiplied by \(\beta/(1 - \beta)\) in the cut cell (9 at 0.9, 99 at 0.99).
The same columns with turb.shear_stencil = log_law (rt_log_shear_column_*). The deck has no length cap, so
the log law holds, and \(k\) is compared with the local balance \(u_*^2 (1 - d/D)/C_{\mu 0}^2\) (shear
production equal to dissipation at the stress \(u_*^2 (1 - d/D)\)):
f |
Iterations |
\(u_*^2/(F D) - 1\) |
Cut cell vs log law at \(d_1\) |
Speed, three cells above |
\(k\), three cells above |
|---|---|---|---|---|---|
0 |
2313 |
−5.5e-7 |
0.00 % |
−0.14 to −0.30 % |
−0.5 to −1.6 % |
0.3 |
2339 |
−4.3e-7 |
+0.03 % |
−0.07 to −0.23 % |
−0.5 to −1.5 % |
0.7 |
2440 |
−2.1e-7 |
+0.01 % |
0.00 to −0.19 % |
−0.2 to −1.3 % |
0.9 |
2606 |
−7.2e-8 |
−0.12 % |
+0.01 to −0.18 % |
+0.1 to −1.2 % |
With central the same three cells have \(k\) 13 to 22 %, 7 to 14 % and 4 to 7 % above the local balance.
With a capped length the cut cell’s speed is lower than the log law with log_law (Log-consistent shear near the ground, Limits).
These numbers are for turb.face_mean = logarithmic, which the decks set: with it and the spacing \(s\), the
flux of a log profile across the cut cell’s top face is \(u_*^2\) exactly. With the default arithmetic the
same flux is 1.10 \(u_*^2\) at \(f = 0\) and 1.43 \(u_*^2\) at 0.9, and the column at 0.9 has its cut cell
24 % above the log law and the three cells above it 3 to 4 % below.
Tests/Canonical_RANS/Immersed_Ridge_2D compares a sloping immersed ground with the same ground on a
terrain-following mesh, with the recommended turbulence setting (Turbulence model) in both. The wind is
read at fixed heights above the ground from the fluid cells. Differences are in percent of the body-fitted
far-field speed at that height (the crest speed: of the body-fitted crest speed).
Case |
Iterations bf / immersed |
Quantity |
20 m |
40 m |
80 m |
|---|---|---|---|---|---|
Wind along a ridge, slopes to 18° |
5298 / 3962 |
Largest difference |
1.3 % |
1.1 % |
0.8 % |
Wind across a ridge, slopes to 7° |
6297 / 4878 |
Crest speed |
−2.2 % |
−2.2 % |
−2.4 % |
Lee minimum |
−13.8 % |
−7.9 % |
−4.2 % |
||
Round hill, slopes to 12° |
2441 / 2180 |
Crest speed |
−3.9 % |
−2.9 % |
−2.3 % |
Lee minimum |
−24.4 % |
−11.1 % |
−2.1 % |
With no flow over the slope (the wind along the ridge) the two representations agree within 1.3 %. About 1 % of
that is present on flat ground: the closure’s central difference of a logarithmic profile over-estimates the
shear in the first cells above the wall cell, and more so above a cut cell, whose neighbour lies closer to the
ground (the column above; Tests/Canonical_RANS/Immersed_Column/README.md). With flow over the ridge or the
hill the immersed runs decelerate more in the lee near the ground, and are 2 to 5 % slower in the far field of
the periodic domain (where the ridge’s tail is still 3.7 m high). The cause of the lee difference is not isolated; the case’s README lists what was not
tested. No growth of the GMRES iteration count was seen with the sloping ground, so the
Poisson preconditioner is unchanged.
Open faces
An immersed ground may meet inflow and outflow faces. Three rules apply at the faces.
An inflow face that lies in the ground (face fraction 1) carries no flow: its normal velocity is set to 0 after the inflow profile is filled. A cut face carries the profile over its open part.
The inflow profile’s height is measured from the immersed ground. A point in the layer the ground cuts takes the centroid of the layer’s open part, which is the height the wall law assigns to the cut cell’s wind. The damping heights and the first guess (
init.first_guess = profile) do the same. From this first guess the periodic column at \(f = 0.9\) withturb.shear_stencil = log_lawlevels off with its \(u\) and \(w\) residuals near 2e-8 (each pressure solve leaves a uniform \(w\) near 1e-10); its CTest solves the pressure tosimplec.pressure_reltol = 1e-6. From the layer’s centre instead, the coarse Askervein pair stops in its first pressure solve.The outflow face needs nothing new: the solid cells next to it are at rest, and the mass balance of the two faces counts open areas.
Tests/Canonical_RANS/Immersed_Open_Faces carries a log-law inflow over flat immersed ground to an outflow
face, 2560 m downstream, and compares the outflow column with the body-fitted channel at equal height above the
ground. With the default settings (turb.shear_stencil = central, terrain.small_volfrac = 0.005):
\(f\) |
iterations |
\(u\) (%) |
\(k\) (%) |
|---|---|---|---|
0 |
122 |
0.10 |
0.67 |
0.3 |
122 |
0.19 |
3.35 |
0.5 |
123 |
0.33 |
4.75 |
0.7 |
124 |
0.55 |
3.97 |
0.9 |
128 |
1.25 |
6.37 |
0.99 |
139 |
3.45 |
25.4 |
1 |
122 |
0.00 |
0.02 |
The body-fitted channel takes 122 iterations. The flux through the outflow face equals that through the inflow
face in every run. The differences are largest where the cut cell is thin; terrain.small_volfrac merges such
cells into the ground. CTest rt_immersed_open_faces runs the setting of the real-terrain cases
(turb.shear_stencil = log_law, terrain.small_volfrac = 0.1) at \(f\) = 0, 0.5, 0.95 and 1: the
differences are 0.8 % in \(u\) and 5.5 % in \(k\) at 0.5, and 0.1 % and 0.5 % at 0.95, where the cut
cell is merged into the ground. Its limits (1.5 % and 8 %) are these with a margin. The body-fitted column is
interpolated in \(\ln(z + z_0)\).
Four further CTests run the same channel and setting with one option of the open faces each, against the body-fitted channel with the same option:
CTest |
Option |
\(f = 0.5\): \(u\), \(k\) (%) |
\(f = 0.95\): \(u\), \(k\) (%) |
|---|---|---|---|
|
|
0.28, 2.7 |
0.07, 2.0 |
|
|
0.83, 5.2 |
0.13, 0.5 |
|
wall side faces moving at 8 m/s |
1.41, 8.7 |
0.45, 4.6 |
|
|
0.78, 5.7 |
0.13, 0.6 |
The limits are 1.5 % and 8 % (2 % and 10 % with the side walls). With the side walls the columns differ across
the channel, so the fluxes are the means over \(y\); they agree to round-off. The sponge relaxes towards the
inflow profile in solid cells too; those cells stay at rest, as the solid cells’ equations hold them. With
bc.rayleigh_height = absolute (the default) the height is measured from the terrain’s zero, as on a mesh that
follows the terrain: the immersed mesh starts \(h_f\) = terrain.flat_height below it, and that offset is
taken out (unit test ImmersedTerrain.AbsoluteRayleighHeightIsFromTheTerrainZero).
Grid resolution
The horizontal velocity lives on the column faces. Where the ground rises by \(\Delta h\) across a column, every layer of that column below the downstream node’s ground has its downstream face shut (the faces are exact for the piecewise-linear ground, Geometry), so the air must turn up inside one column. On a terrain-following mesh it follows the slope. The immersed ground therefore needs columns narrow enough that \(\Delta h\) is small near the crest; the layer thickness matters much less.
Tests/Canonical_RANS/Immersed_Ridge_Resolution measures this on a 2-D Witch of Agnesi ridge, 200 m high with
half-width 500 m (largest slope 0.26), periodic, with the measured cases’ settings (terrain.small_volfrac = 0.1,
turb.shear_stencil = log_law). The crest speed-up at 10 m above the ground, \(\Delta S_{10}\), is the speed
over the run’s own far-field speed at that height, minus 1. Layers of 2 m:
dx (m) |
\(\Delta h\) per column (m) |
Crest \(\Delta S_{10}\), terrain-following / immersed |
Gap at 10 m |
Gap at 40 m |
|---|---|---|---|---|
64 |
17 |
1.133 / 0.652 |
−0.48 |
−0.10 |
32 |
8 |
1.148 / 0.857 |
−0.29 |
−0.05 |
16 |
4 |
1.159 / 1.032 |
−0.12 |
−0.02 |
The terrain-following value changes by 0.03 over the sweep. The immersed one shrinks its gap by a factor of 1.6 to 2.4 per halving of dx, about first order. Each run is divided by its own far field, and the immersed far field is slower by 3.0, 2.6 and 1.6 % at dx = 64, 32 and 16 m; the crest speed at 10 m, immersed over terrain-following, is 0.751, 0.842 and 0.928. At dx = 64 m, layers of 2, 8, 16 and 32 m (aspect ratios dx/dz from 32 to 2) give the same immersed crest value at 40 m, 0.71, and values from 0.51 to 0.65 at 10 m with no monotone trend. The immersed lee minimum is deeper than the terrain-following one at every dx and converges more slowly than the crest. The extra \(k\) above the crest (1.87 against 0.97 m²/s² at dx = 64 m) follows the shear at the top of the slow layer, not the other way round: capping the shear production there removed most of the extra \(k\) and left the speed gap.
Askervein (wind from 210°, Tests/Real_Terrain/Immersed_Terrain_Cases, dx = 23.4 m, largest slope 0.41 along the
wind, \(\Delta h\) up to 9.7 m) shows the same pattern. At the hilltop, 10 m above the ground, the speed-up is
0.71 terrain-following and 0.48 immersed (gap −0.22) and \(k\) is 2.0 times larger; at 40 m the gap is −0.04.
Averaged over the columns, the gap at 10 m is −0.12 on the windward slopes (slope above 0.15), −0.34 on the lee slopes
and −0.015 on the flat ground, and it correlates with the slope along the wind (+0.50 over the hill). The steepest
columns rise 9.7 m, about twice the guide below and close to the ridge at dx = 32 m (8 m per column, gap −0.29). With
2 m layers, the wall-cell rule without a tolerance (Geometry) leaves this run unchanged (the same 70827 wall cells;
364 against 363 iterations; largest change in \(u\) 0.002 m/s). The numbers come from
Tests/Real_Terrain/Immersed_Terrain_Cases/compare_fields.py.
Guide. Choose dx so that the ground rises by about 5 m or less across one column on the slopes that matter (dx \(\lesssim\) 5 m divided by the largest slope); on the ridge this leaves a crest gap of about −0.12 at 10 m. The layers can then be a few metres thick. Expect the lee to need finer columns than the crest. The guide comes from one ridge, on which the rise per column and the columns per half-width change together.
Hybrid mesh
On the flat mesh the ground cuts many layers per column on a slope, and Grid resolution shows the crest error
that this leaves. With terrain.representation = hybrid the mesh follows a smooth surface \(h_s\) that lies at
or below the terrain everywhere, and the ground is immersed in it as on the flat mesh:
with \(h_t\) the terrain’s height at the nodes, \(w\) = terrain.hybrid_half_width and
\(\overline{m}^{\,w}\) the mean of \(m\) over the same square. The square holds
\(\lfloor w/\Delta x \rfloor\) nodes on each side of the node in x and \(\lfloor w/\Delta y \rfloor\) in y.
It wraps across a periodic face and is cut at any other face. Every node of the square of a node lies in its own
square, so the mean of the minima is at most \(h_t\) (the outer minimum only removes round-off). The mesh’s
lower face is \(h_s\), and its levels follow it as a body-fitted mesh follows the ground
(Terrain-following coordinates; terrain.smoothing and terrain.gamma_m apply). The ground is at
\(h_0 + h_t\) with \(h_0\) = terrain.flat_height, as on the flat mesh, so the gap
between the lower face and the ground is never smaller than \(h_0\). \(w = 0\) gives \(h_s = h_t\), a body-fitted mesh with the ground \(h_0\) above its lower face. A flat \(h_s\) would give the flat mesh’s ground; a wide square approaches it.
Lower face, column by column. \(h_0 \ge 0\). Where a column’s first cell holds solid (\(\beta > 0\)),
the lower face lies inside the terrain: the surface layer gives no stress there and no wall row for k, so the cell
is held at rest with k at turb.tke_floor (as every solid cell), and the immersed wall law acts at the ground
above it. Where the first cell holds none, which needs \(h_0 = 0\) and \(h_s = h_t\), the lower face is
the ground and the surface layer acts on it as on a body-fitted mesh, along the mesh’s slope. With \(h_0 > 0\)
every column is of the first kind. With \(h_0 = 0\) the second kind is where the envelope meets the terrain:
flat parts wider than the square, and next to faces that are not periodic, where the square is cut. The run prints
how many columns are of each kind (unit tests SurfaceLayer.ImmersedColumnsOfAHybridMesh and
HybridTerrain.ImmersedColumnsWhereTheFirstCellIsCut).
Why. The flat mesh’s crest error grows with the rise of the ground across one column. On the hybrid mesh the
ground cuts the levels at the slope of \(\delta\), not of \(h_t\), so a narrow square leaves the immersed
ground cutting few layers per column. The gap is then small, so the layers through it can keep the first layer’s
thickness: with mesh.zlevels_file uniform up to above the largest gap, every cut cell and the cells above it
have the same thickness, as on the flat mesh. This holds where the gap is small. On three of the four 128 m sites
of Tests/Real_Terrain/Sites_128m, where the default width leaves gaps of 220 to 320 m, levels uniform at 4 m to
above the gap had not reached the steady verdict with lusgs (r stalled, swung or fell slowly), while the
terrain-following decks’ levels (2 m layers to 20 m, then stretched) converged in 204 to 327 iterations; on the
fourth, Altamont Pass, it is the other way round. No rule for the levels is given yet: the site’s README lists the runs.
What. The envelope is computed once, at start-up, on every rank from the whole surface (one value per domain
node), so it does not depend on the boxes or the rank count (Source/HybridTerrain.cpp). The cut geometry
(Geometry) measures the ground from each node’s own height on a level. On a sloping level this integrates the
height above the ground along the level, and on a flat level it is the flat mesh’s (unit tests
ImmersedSurface.SlopedMeshMatchesTheShearedClosedForm and ImmersedSurface.HybridKernelsOnAFlatMeshMatchImmersed).
The wall law, the shear of the first full cell and the closure use the mesh’s metric, as on the flat mesh. The run
prints the gap’s range and the height to which the layers keep the first one’s thickness. The refusals are those of
the flat mesh (Limits), except that terrain.smoothing and terrain.gamma_m are accepted. The ground must
lie at or below the bottom of each column’s top layer. The restart hash
includes terrain.hybrid_half_width in metres, so a restart with another width is refused even where both give the
same node count. The square is cut at a face that is not periodic, so on ground that still slopes there the gap is
lopsided: on a ramp it is 0 at the low face and 1.5 times the interior gap at the high face. A width below one cell
gives no envelope (the mesh follows the terrain, as with 0), and flat terrain gives the flat immersed mesh; the run
and the deck checker warn of both.
Pressure in the solid. The pressure is 0 in the solid cells, as the Poisson solution leaves it there. On a
sloping level the x face’s pressure gradient holds the slope term \(-z_x\,\partial p/\partial z\), the mean of
four vertical differences of \(p\), and at a cut cell the lower ones span the solid boundary. With
\(p \approx -17\) Pa in the fluid and \(z_x \approx 0.3\), that difference gave a force of about 1 Pa/m,
some 30 times the real gradient, which turned the flow round in the cut cells of the windward slope and raised
\(k\) above the crest. The momentum residual therefore takes the gradient of a copy of \(p\) in which each
solid cell holds the value of the first cell above it that is not solid, in the valid columns, one ghost column on
each side and the ghost layer below the domain (hybrid_solid_pressure, unit test
HybridTerrain.SolidPressureMakesTheSlopedGradientExact). The slope term then takes no difference across the
boundary. On the flat mesh \(z_x = 0\) and the copy is not made. The copy makes the gradient of a pressure
that varies only along the level exact. With a vertical gradient \(b = \partial p/\partial z\) it leaves
about \(z_x b/4\) to \(z_x b/2\) at the first open faces above the solid, an error that does not shrink
with the layers’ thickness; linear extrapolation from the two cells above would remove it. The Poisson operator’s
cross terms still take the solid cells’ 0 at cut cells, so the correction and the momentum gradient differ there
(the converged answer does not depend on it, the path to it may).
Ridge. The ridge of Grid resolution with an inflow face (log law, \(u_* = 0.35\) m/s, \(z_0 = 0.1\) m), an outflow face, no Coriolis force, layers of 2 m and \(w = 128\) m. The crest \(\Delta S_{10}\) minus the terrain-following value, and \(k\) at 10 m over the terrain-following value:
dx (m) |
Terrain-following \(\Delta S_{10}\) |
Immersed, \(h_0 = 2\) m |
Hybrid, \(h_0 = 2\) m |
Hybrid, \(h_0 = 0\) |
\(k_{10}\) ratio, immersed / hybrid \(h_0 = 2\) m |
|---|---|---|---|---|---|
64 |
0.946 |
−0.487 |
−0.028 |
−0.039 |
2.20 / 1.05 |
32 |
0.959 |
−0.294 |
−0.011 |
−0.015 |
1.74 / 1.01 |
16 |
0.945 |
−0.126 |
0.000 |
−0.005 |
1.25 / 1.00 |
Without the pressure copy the hybrid values at dx = 64 and 32 m were −0.30 and −0.27, with \(k_{10}\) 2.9 times the terrain-following value. The hybrid runs took 340 to 420 iterations to \(r < 10^{-4}\), the terrain-following ones 440 to 920.
Choosing w. The same ridge (gentle: \(H\) = 200 m, \(a\) = 500 m, largest slope 0.26) and a steep one (\(H\) = 400 m, \(a\) = 250 m, slope 1.0), \(h_0\) = 2 m, against the terrain-following run on the same mesh. The speed difference is counted at 5, 10, 20, 40, 80, 120, 160 and 200 m above the ground in every column; “> 0.25” is the number of those points that differ by more than 0.25 m/s; \(\Delta S_{10}\) is the crest speed at 10 m minus the terrain-following one (7.6 m/s on the gentle ridge, 12.6 m/s on the steep one at dx = 32 m):
Ridge, dx (m) |
\(w\) (cells) |
Largest gap / relief |
Iterations (terrain-following) |
> 0.25 m/s |
\(\Delta S_{10}\) (m/s) |
Largest difference (m/s) |
|---|---|---|---|---|---|---|
gentle, 64 |
0 / 1 / 2 |
0 / 0.08 / 0.16 |
823 / 569 / 381 (917) |
0 / 68 / 19 of 1024 |
+0.04 / −0.22 / −0.11 |
0.07 / 0.88 / 0.61 |
gentle, 64 |
4 / 8 / 16 |
0.38 / 0.70 / 0.90 |
896 / 1085 / 992 |
346 / 503 / 523 |
−1.01 / −1.71 / −1.97 |
2.6 / 3.6 / 3.7 |
gentle, 32 |
0 / 1 / 2 / 4 |
0 / 0.04 / 0.08 / 0.16 |
436 / 432 / 463 / 360 (710) |
0 / 0 / 43 / 1 of 2048 |
+0.05 / −0.02 / −0.15 / −0.05 |
0.07 / 0.24 / 0.49 / 0.27 |
gentle, 32 |
8 / 16 |
0.38 / 0.69 |
447 / 485 |
317 / 644 |
−0.47 / −0.95 |
1.3 / 2.7 |
steep, 32 |
0 / 1 |
0 / 0.08 |
r near 1e-3 after 20000 / Poisson stop (6171) |
|||
steep, 32 |
2 / 4 / 8 / 16 |
0.16 / 0.38 / 0.70 / 0.90 |
3459 / 2606 / 2122 / 1983 |
67 / 1008 / 1017 / 445 |
−0.66 / −4.93 / −5.51 / −3.62 |
1.7 / 7.0 / 6.8 / 5.1 |
On the gentle ridge every width converges, and up to a gap of 0.16 of the relief (128 m at both spacings: the gap follows \(w\) in metres, not in cells) the speeds stay within about 0.25 m/s of terrain-following in fewer iterations. On the steep ridge widths of 0 and 1 cell do not converge; 2 cells converge in about half the terrain-following iterations with a crest 0.66 m/s low, and wider ones leave the crest 4 to 6 m/s low. At dx = 64 m the steep ridge has about four columns per half-width; terrain-following there gives a crest 6 m/s below its dx = 32 m value, and no width came within 0.25 m/s of it.
tools/hybrid_width.py turns these two rules into a range for a given terrain and mesh, before a run. It builds
\(h_s\) as the code does for every width up to --max-cells cells and reports the slope of \(h_s\), the
largest gap and the gap over the relief (max − min of \(h_t\) after a least-squares plane is removed). The
lower end is 2 cells where the terrain’s slope exceeds 0.5 and 0 otherwise. The upper end is the widest width whose
largest gap is at most 0.2 of the relief (between the 0.16 and 0.38 of the runs above). It suggests the lower end
when it lies within the range, and otherwise says that no width meets both and gives the spacing at which 2 cells
would fit (exit status 2). The upper end measures agreement with terrain-following, not with measurements: where
terrain-following is itself in error (a cliff, a separated lee) a larger difference need not be worse.
python3 tools/hybrid_width.py --deck inputs --terrain-file terrain.xyz
The rules come from two analytic ridges only. A terrain file is interpolated linearly to the nodes (STEER uses
inverse-distance weights) and terrain.smoothing is not applied.
Defaults. Without the keys, terrain.flat_height is the thickness of the mesh’s first layer and
terrain.hybrid_half_width is 2 cells (twice the larger of dx and dy; a direction of one cell does not count).
No single width suits every terrain: 2 cells is the narrowest that converged on the steep ridge, and on the gentle
one it stays within 0.61 m/s of terrain-following. The log names each default it sets. On the measured cases, at
these defaults, against terrain-following on the same mesh (rms error of the speed-up against the measurements, or
of \(U\) against the tunnel):
Case |
Terrain-following → hybrid |
Iterations (terrain-following / hybrid) |
|---|---|---|
Askervein 210°, lines A / AA / B |
0.122 / 0.081 / 0.120 → 0.155 / 0.146 / 0.155 |
202 / 235 |
Bolund 270°, line B |
0.113 → 0.024 |
189 / 189 |
Bolund 239°, line A |
0.075 → 0.124 |
209 / 209 |
Bolund 90°, line B |
0.164 → 0.180 |
222 / 394 |
Ishihara smooth ridge, \(U\) (m/s) |
0.27 → 0.17 |
537 / 619 |
Ishihara rough ridge, \(U\) (m/s) |
0.57 → 0.55 |
655 / 664 |
Big Southern Butte 222°, speed at the 40 sensors at 3 m (m/s) |
3.20 → 5.94 |
410 / 1094 |
The hybrid mesh is closer to the measurements behind the Bolund cliff and on the smooth ridge, and further from them on Askervein, the other two Bolund directions and Big Southern Butte. Most masts differ from terrain-following by more than 0.25 m/s at these defaults, so the representation changes the answer on these sites.
On Big Southern Butte (dx = 137 m) the default width gives a largest gap of 294 m on 780 m of relief (0.37), and
the hybrid run is close to the flat immersed one (rms 6.14 m/s): the speed at the two sensors on the top is 10.8 m/s
low, against 3.2 m/s for terrain-following. tools/hybrid_width.py reports that no width meets both rules on this
mesh. The run reached \(r < 10^{-4}\) after 570 iterations (terrain-following 260) and stopped on
steady.residual_tol after 1094, in 58 times the terrain-following run’s time on 3 ranks (114 layers against 40; part of the run shared the
machine with other jobs).
The 2-cell default comes from 2-D ridges with a half-width of at least 4 cells. A round hill has a larger gap for the
same width (about 0.26 of the relief at a half-width of 8 cells, 0.58 at 4), and on narrow features the default
lies above the tool’s upper end. The run warns when the largest gap exceeds 0.2 of the ground’s height range and
names tools/hybrid_width.py. The gap is about the slope times the width while the square is narrower than the
feature; once it spans a crest the crest gap is up to 1.2 times that.
Lee turn
In the cut cells the ground is a staircase of partly solid cells. Where the ground falls away along the wind, the
cut cells pass the flow on through their open faces, but nothing turns it down with the ground: \(w\) in a cut
cell sees the closed parts of its faces and the wall law, not the slope. Over a ridge, the wind at 10 m above the
ground in the lee is then slower than on the terrain-following mesh, and the deficit grows with the number of
layers the ground crosses over one cell. terrain.lee_turn (\(C_0\), off by default) adds a term that turns
the flow down with the ground in the lee cut cells.
Fig. 7 (a) A lee column: in a cut cell (grey) \(w\) is relaxed towards \(w_t\), the slope times the wind \(U_r\) of the first fully fluid cell above (\(k_r\)). \(n\) counts the layers the ground crosses over one cell. (b) The weight \(f\) against \(-w_t/|U_r|\) for three values of \(\epsilon\).
In a cut cell (\(0 < \beta < 1\)) the target is the vertical velocity of a flow that follows the ground,
with \((s_x, s_y) = \nabla h\) the ground’s slope in the cell and \((u_r, v_r)\) the horizontal wind at the first cell above the cut cell with \(\beta = 0\) (the reference cell; each component the mean of its two faces, weighted by their open parts as in Open faces). Where \(w_t < 0\) (the lee), the \(w\) rows gain the sink
with
\(\Delta z = J\,\Delta\zeta\) the cut cell’s height, \(\Delta x, \Delta y\) the mesh spacings,
\(|U_r| = \max(\sqrt{u_r^2 + v_r^2}, 10^{-3}\) m/s), \(C_0\) = terrain.lee_turn and \(\epsilon\) =
terrain.lee_turn_ramp. A windward cut cell (\(w_t \ge 0\)) and a fluid or solid cell take nothing.
\(n\) is the number of layers the ground drops over one cell. A ground that crosses several layers per cell has several cut cells in a column. The power 2 is empirical: it was chosen on the ridge below, where \(n\) and \(n^{1/2}\) left a deficit that grew with \(n\). Where \(n > 1\), \(\lambda = C_0 |\nabla h|^2 \Delta x^2 |U_r| / \Delta z^3\) (for \(s_y = 0\)), so the rate grows quickly as the layers are refined at a fixed \(\Delta x\); in practice \(w\) then sits at \(w_t\).
\(f\) brings the term in from 0 where the ground turns from windward to lee, so that the rate does not switch on and off between iterations near a crest.
The form of the rate, a coefficient of order one times \(|U|/\Delta z\), is that of the drag forcing of Kynema-SGF (
DragForcing.cpp, \(C_d = 10/\Delta z\)). Kynema-SGF caps its rate at \(1/\Delta t\); here the term is implicit in \(a_P\), which does not need the cap for diagonal dominance.A \(w\) row on a z face takes the mean of its two cells’ \(\lambda\) and \(\lambda w_t\), as the building rates do. The ground’s own row (the mesh’s lower face) and blocked faces take nothing.
\(\lambda\) and \(w_t\) are recomputed at each residual evaluation from the current wind and are frozen within the line solves; the converged state is the same as with them updated in the solve. On a z face between a cut cell and another cell the term vanishes at the \(\lambda\)-weighted mean of the two cells’ \(w_t\); the face above the highest cut cell of a column takes half of that cell’s rate. The term changes the steady state by moving \(w\) in the lee cut cells, which the open faces carry to \(u\) and \(v\) through continuity.
With
terrain.type = flatthe slope is 0 and the term would be 0;terrain.lee_turn> 0 is refused there.
Results for a periodic 2-D Agnesi ridge (terrain.hill_shape = ridge_x, height 80 m, half-width 200 m, largest
slope 0.26; 12.8 km long; 78 stretched layers with a 2.4 m first layer; neutral, terrain.small_volfrac = 1e-4)
against the terrain-following run on 12.5 m cells: rms of the speed difference at 10 and 40 m above the ground
over \(|x| < 3\) km.
Mesh |
rms 10 m, off → \(C_0\) = 0.25 (m/s) |
rms 40 m (m/s) |
Iterations |
|---|---|---|---|
hybrid, dx = 100 m |
1.09 → 0.22 |
1.22 → 0.32 |
170 / 133 |
hybrid, dx = 50 m |
0.65 → 0.18 |
0.43 → 0.03 |
165 / 161 |
hybrid, dx = 25 m |
0.12 → 0.036 |
0.055 → 0.017 |
160 / 157 |
flat immersed mesh, dx = 50 m |
0.95 → 0.53 |
0.82 → 0.41 |
130 / 126 |
flat immersed mesh, dx = 25 m |
0.70 → 0.53 |
0.49 → 0.34 |
150 / 147 |
On the flat mesh the term removes about half of the 10 m difference on 50 m cells and a quarter on 25 m cells. The flat-mesh runs keep a deficit that does not shrink from 50 to 25 m cells (0.53 m/s in both), which the term does not address; the hybrid mesh is the recommended representation over terrain in any case.
On two 128 m real-terrain sites on the hybrid mesh (an AWAKEN-area site and a site at 40.66 N, 86.87 W), against the terrain-following run on the same levels, at 10 m above the ground:
Site, |
rms (m/s), off → 0.25 |
Columns with \(|\Delta S|\) > 0.25 m/s |
> 1 m/s |
Iterations |
|---|---|---|---|---|
AWAKEN area, 1e-4 |
0.077 → 0.064 |
195 → 138 |
7 → 0 |
256 / 256 |
AWAKEN area, 1e-3 |
0.080 → 0.069 |
227 → 169 |
7 → 0 |
158 / 157 |
40.66 N, 86.87 W, 1e-4 |
0.061 → 0.048 |
87 → 56 |
10 → 5 |
147 / 140 |
40.66 N, 86.87 W, 1e-3 |
0.062 → 0.049 |
94 → 64 |
10 → 5 |
141 / 136 |
At 40 m no column differs by more than 0.25 m/s with the term on at either site. The largest overspeed against the terrain-following run is +0.28 m/s with the term on, against +0.12 m/s without it. The number of iterations does not grow.
\(C_0\) = 0.25 was chosen from 0.1, 0.15 and 0.25 on the ridge: the 10 m rms on 100 m cells is 0.68, 0.45 and 0.22 m/s, and on 25 m cells 0.059, 0.029 and 0.036 m/s. 0.25 is a compromise across resolutions. Larger values were also run (hybrid ridge, iterations to \(r < 10^{-4}\), at most 3000):
\(C_0\) |
dx = 100 m |
dx = 50 m |
dx = 25 m |
|---|---|---|---|
0.25 |
133, rms 0.22 m/s |
161, rms 0.18 m/s |
157, rms 0.036 m/s |
0.3 |
not steady (\(r\) stays at 0.055) |
157 |
|
0.35 |
not steady |
599 |
|
0.5 |
133, rms 0.40 m/s |
not steady |
not steady |
1 |
135, rms 0.68 m/s |
not steady |
|
10 |
134, rms 1.19 m/s |
On 100 m cells a larger \(C_0\) converges but overturns the flow (the rms grows again). On 50 and 25 m cells
the iteration settles into a cycle: \(w_t\) is lagged, and a strong pull of \(w\) towards it changes the
reference wind through continuity, which moves \(w_t\) at the next residual. terrain.lee_turn is therefore
bounded by 0.25, the largest value that reached a steady state on all three meshes. 0.25 sits close to this limit;
on a mesh or terrain not tested here, a smaller value may be needed for a steady state.
On the flat immersed ridge of Verification (100 m high, 40 m cells), the term brings the 20 m lee minimum from
13.0 % to 9.7 % of the far-field speed below the body-fitted run, and the rms from 6.4 % to 5.0 % (CTest
rt_immersed_ridge_lee, 4809 iterations against 4822).
Limits of the lee turn:
It is calibrated against the terrain-following mesh on smooth terrain, not against measurements. Where the flow separates behind a steep edge, turning it down with the ground may not be right; this has not been tested.
It acts on \(w\) only. The wall law and the turbulence of the cut cell are unchanged.
The target uses the wind of the reference cell, which in a log profile is faster than the wind at the cut cell’s height, so \(w_t\) is steeper than a ground-following flow at that height would give.
It is not run with
buildings.type(refused with an immersed ground).Above \(C_0 \approx 0.3\) the lagged target leads to a cycle in place of a steady state (see the table above); an under-relaxed \(w_t\) might lift this limit and is not tried here.
Roughness map
bc.surface_z0_file (boundary conditions) gives each ground column its own \(z_0\), for a surface such as
water beside land. An immersed ground and the ground of a hybrid mesh read the same map as the body-fitted ground:
the map is interpolated once, at start-up, to the centre of each column, and a column’s value is that of its cut
cell wherever the ground cuts the column. The value enters:
the wall law of the cut cell (Wall law), and through its \(u_*\) the wall value of \(k\);
the strain of the cut cell and the corrected strain of the cell above it (Turbulence);
with
turb.shear_stencil = log_law, the log-law gradient of every cell above the wall cell;the closure’s length \(\kappa (d + z_0)\), as in a body-fitted run;
on a hybrid mesh, the surface layer of the columns whose lower face is the ground, as in a body-fitted run.
The log names the map as the wall law’s \(z_0\). terrain.idw_neighbors and terrain.idw_power apply to
the map as they do in a body-fitted run.
Roughness step. Tests/Canonical_RANS/Immersed_Roughness_Step is the channel of Open faces with
\(z_0\) = 0.03 m up to \(x\) = 1120 m and 0.3 m beyond. The step lies inside a box, so a box holds both
values. The map changes \(u\) of the body-fitted run by up to 24.3 %. Each ground is compared with the
body-fitted run with the same map, at equal height above the ground, in percent of the body-fitted value
(turb.shear_stencil = log_law, terrain.small_volfrac = 0.1; \(F\) is the solid fraction of the cut
cell, \(H\) the ground’s height in the first layer of the hybrid mesh):
Ground |
Iterations |
\(u\) |
\(k\), away from the step |
\(k\), first 400 m after it |
\(k\), wall cell |
|---|---|---|---|---|---|
body-fitted |
121 |
— |
— |
— |
— |
immersed, \(F = 0\) |
120 |
0.07 |
0.62 |
0.47 |
0.21 |
immersed, \(F = 0.3\) |
121 |
0.96 |
8.3 |
27.1 |
4.6 |
immersed, \(F = 0.7\) |
126 |
2.81 |
14.0 |
51.6 |
10.2 |
hybrid, \(H = 0\) |
121 |
0.00 |
0.00 |
0.00 |
0.00 |
hybrid, \(H = 0.5\) |
125 |
2.04 |
12.5 |
40.8 |
5.9 |
A ground on a face (\(F = 0\), \(H = 0\)) reproduces the body-fitted run. A ground that cuts a cell
differs as it does on a uniform ground (Open faces), and more just downstream of the step: there the new
internal layer grows from less than one layer to a few layers, \(k\) changes across it within one or two
cells, and a cut cell’s centre samples it at another height than the body-fitted centres. The limits bound the
cut cell’s known difference, not the map. The test rt_immersed_roughness_step bounds the
first, second and fourth columns at 4, 18 and 13 %; the third is printed only.
Bolund. The decks of Tests/Real_Terrain/Immersed_Terrain_Cases for Bolund 270° and 239°, with the map of
Tests/Real_Terrain/WindNinja2019/bolund_z0_map.py (0.0003 m over water, 0.015 m over land; see the
boundary conditions) in place of the uniform 0.01 m, and the inflow log law of the water
(bc.inflow_z0 = 0.0003, \(u_*\) for the same reference wind). The hybrid mesh is at its defaults. The
number is the rms error of the speed-up against the masts at 5 m (line B, 4 masts, for 270°; line A, 5 masts, for
239°), with the iterations in brackets:
Case |
Terrain-following |
Immersed |
Hybrid |
|---|---|---|---|
270°, uniform \(z_0\) |
0.113 (189) |
0.032 (213) |
0.024 (189) |
270°, map |
0.088 (157) |
0.064 (360) |
0.061 (156) |
239°, uniform \(z_0\) |
0.075 (209) |
0.133 (210) |
0.124 (209) |
239°, map |
0.079 (174) |
0.129 (188) |
0.126 (172) |
All six runs with the map reach the steady verdict. With the map the three grounds are closer to each other for
270° than with the uniform value: the terrain-following run moves towards the masts and the immersed and hybrid
runs away from them (the mast behind the cliff, M8: measured -0.56, the three runs -0.46, -0.64 and -0.62). For
239° the map changes each number by at most 0.004. The immersed run for 270° takes 360 iterations: its residual
falls to 2e-4, rises to 9e-4 between iterations 240 and 270, and then falls to the verdict. The uniform rows are
those of Tests/Real_Terrain/Immersed_Terrain_Cases/README.md and of Hybrid mesh. The hybrid runs with the
map were sampled with another script than those rows; it gives 0.032 (188 iterations) for the hybrid run for 270°
with the uniform value, where the table has 0.024. The runs with the map are not a test of the
repository: the Bolund terrain and masts are not redistributed (Tests/Real_Terrain/WindNinja2019/README.md
names the data and its providers).
Limits
The mesh must have one hierarchy level. On a periodic mesh a terrain that is not periodic (a file, a hill whose tails have not decayed at the sides) makes a step across the seam, which the geometry treats as a slope across one cell.
bc.zlo = surface_layer,bc.surface_stability = neutral,bc.surface_wall_k = dirichlet, a uniformbc.theta_profileandturb.closure = klare required. The refusals in this list apply to a run with no stage too (the Poisson backend in a stage only).Both line sweeps apply (
steady.sweep): the solid cells and the wall law are rows of the same line systems. Earlier versions refusedlusgson an immersed ground. Withlusgs(the CPU default) the immersed ridge of Verification meets the limits of itszjacobideck (CTestrt_immersed_ridge_lusgs), and the four 128 m sites ofTests/Real_Terrain/Sites_128mreach the steady verdict on the hybrid mesh in 204 to 359 iterations. On the same levels (zlevels_128m_hybrid.txt), Altamont Pass took 359 iterations withlusgs, wherezjacobihad r = 0.13 after 350; the other three sites converged withlusgsonly on other levels, so theirzjacobiruns (r between 0.02 and 0.17 after 150 to 440 iterations) are not a like-for-like comparison. Only the default options oflusgshave been run on an immersed ground:steady.line_ghosts = zero,steady.line_overlap> 0,steady.line_order = diagonalandsteady.line_alternate = 1have not.buildings.type = immersed_forcingstill needszjacobi.buildings.type, nests,init.first_guess = column,steady.probes_file,steady.stage = simplec_newtonandsteady.stage = unsteadyare refused. The column’s and the probes’ heights are measured from the mesh’s lower face, not from the immersed ground.A forest canopy (
canopy.type) stands on the immersed ground (the drag field of a cut cell).canopy.heat = fixedis refused: the run is neutral.bc.surface_zrefandbc.surface_denominator_floorare refused when given: the immersed wall law reads the cut cell and the cell above it at their exact distances and has no floor.The
ustarfield of the turbulence plotfile and themean_ustarmonitor are those of the mesh’s lower face, which lies in solid cells (0.0094 m/s in the column at \(f = 0.5\), where the ground’s \(u_*\) is 0.351 m/s). The ground’s \(u_*\) follows from the cut cell’s speed and the wall law above; an output for it is not in this version.solver.poisson_backend = mlmgis refused (its operator has no solid cells). For a 1-D column usegmres_fft: withgmres_mlmgthe pressure of a column differs between columns by round-off, \(v\) and \(w\) grow to about 1e-9, and a column that starts with \(v = w = 0\) does not meet the stop rule. The mesh of an immersed ground is flat, so the FFT-preconditioned solve always applies.terrain.smoothing,terrain.gamma_m,terrain.hierarchy_passesandterrain.nest_blend_widthare refused when given: nothing follows or smooths a ground.terrain.flat_heightand the whole ground must lie between the top of the mesh’s first layer and the bottom of its top layer: a cut cell may not be the body-fitted ground’s first cell, whose \(k\) row would share the two wall values, and the law needs a cell above the cut cell.On a slope the reference cell of a wall cell is the cell above it, which can be a wall cell itself. Where that cell is solid (a slope steeper than the layers resolve), \(d_2 = 0\) and the law uses the wall cell alone.
bc.outflow_transport = from_velocityis refused: at the outflow face it slows the cut cell to 0.71 of the log law at \(f = 0.5\) and lifts \(w\) to 0.19 m/s in the outflow column.mirror(the default) applies. The first-guess field of a run with no stage is written before the solid inflow faces are set to 0.A thin cut cell (\(f\) above about 0.9) moves faster than the log law (Wall law), which lowers the shear and \(k\) of the cell above it: 0.27 against 0.34 m2/s2 at \(f = 0.9\) and 0.21 at 0.99 with
turb.shear_stencil = log_lawin the open-face channel.terrain.small_volfrac = 0.1merges these cells into the ground and removes the dip (Open faces).The cut cell’s shear reads the cell’s plain face means of \(u\) and \(v\) at the vertical distance \(d_1\). The wall law of the momentum equations weights the faces by their open part. Next to a blocked side face the two differ.
Stretched layers (
mesh.stretch_ratio) are accepted; the column is verified on uniform layers only.turb.face_mean: the column decks setlogarithmic, for which the flux of a log profile across the cut cell’s top face is exact (Verification). The ridge and hill decks use the recommended turbulence setting and keep the defaultarithmeticin both runs: with that setting the force-driven column’s first full cell is 1.8 % above the log law witharithmeticand 4.9 % withlogarithmic(body-fitted: 0.4 % and 2.1 %).A cut cell that is nearly solid: with \(f = 0.98\) and 0.99 the column above does not reach the steady verdict in 6000 iterations with the deck’s settings, with either backend; \(f = 0.95\) does (2612 iterations). At 0.99 it reaches it with
simplec.pressure_reltol = 1e-8(2863 iterations) orsteady.cfl_max = 10(3175). The cause is not identified. The cut cell is then 43 % above the log law (the factor \(\beta/(1 - \beta)\) above) and the cells above it within 2.6 %.terrain.small_volfrac(default 0.005) rounds only fractions above 0.995 to solid, so such cells can occur.The wall value of \(k\) relaxes at the rate \(u_*/d_1\), so the \(k\) residual of a nearly solid cut cell starts large (308 at \(f = 0.99\) against 2.6 at 0.5) and its drop is measured from there.
The column is verified with \(z_0\) = 0.1 m on 15.6 m layers. With \(z_0\) = 1 m the cells above the cut cell are 1.3 to 2.9 % below the log law at \(f = 0.7\).
Against the terrain-following mesh the wind over a ridge and a round hill is 2 to 5 % lower, and lower still in the lee near the ground (Verification); the cause is not isolated. Not run on an immersed ground: stretched layers on a slope.