Tutorial 2: An atmospheric boundary layer

This tutorial adds two features of a real atmosphere to Tutorial 1: A neutral surface layer: the Earth’s rotation (Coriolis force) and a temperature inversion that caps the boundary layer. It is ERF’s Neutral_ABL_Flat case, solved directly for the steady state. The run takes about 15 seconds.

You will learn to: drive the flow with a geostrophic wind, prescribe a temperature sounding and check the result with ERF’s own check script.

The physical problem

Above the boundary layer, the wind is in geostrophic balance: the Coriolis force balances the large-scale pressure gradient, and the wind is \((u_g, v_g) = (10, 0)\) m/s. Near the ground, friction slows the wind and turns it to the left (in the northern hemisphere). The result is the Ekman spiral.

The potential temperature is 300 K up to 700 m and rises above, 0.03 K/m. This stable inversion limits the depth of the boundary layer.

The input file

Tests/Canonical_RANS/Neutral_ABL_Flat/inputs_steady_neutral_flat differs from tutorial 1 in these lines:

# A larger horizontal domain, split into four boxes
mesh.n_cell        = 8 8 64
mesh.max_grid_size = 4 4

# Temperature sounding: 300 K to 700 m, 309 K at 1000 m, 0.03 K/m through the top
bc.theta_profile_z = 0. 700. 1000.
bc.theta_profile   = 300. 300. 309.
bc.zhi_theta_grad  = 0.03

# Coriolis forcing with a geostrophic wind of 10 m/s (f = 1e-4 1/s)
forcing.coriolis        = 1
forcing.coriolis_3d     = 0
forcing.latitude        = 90.
forcing.rotation_period = 125663.7061435917
forcing.geostrophic     = 1
forcing.ug              = 10.
forcing.vg              = 0.

# Initial profile: the log law with u* = 0.35 m/s (tutorial 1: 0.25 m/s)
bc.inflow_ustar     = 0.35
# The first guess's k with the wall-law length (the default is the closure's length)
bc.inflow_tke_length = unbounded

# Solver: four z-line sweeps, CFL cap 2
steady.sweep                   = zjacobi
steady.cfl_max                 = 2.
steady.zline_sweeps            = 4
steady.residual_ref_iterations = 100
steady.residual_drop_orders    = 2
turb.tke_floor = 1.e-6

# The cap of the geometric length (tutorial 1: 1e12)
turb.max_geom_lscale = 30.

The pressure-gradient force of tutorial 1 is replaced by the geostrophic forcing. The deck sets turb.max_geom_lscale = 30 (ERF’s default, and STEER’s before it became 100 m), and the line turb.face_mean is removed, so the face averages are arithmetic.

Why only two orders of residual drop? The boundary layer slowly entrains the warm air of the inversion and warms (by about 0.01 K per day) without ever stopping. The \(\theta\) and \(w\) residuals therefore level off about 2.5 orders below their starting value. A drop of 2 orders, together with steady.residual_tol, still gives a converged wind field.

Run the case

mkdir -p runs/flat && cd runs/flat
mpirun -n 2 ../../build-rel/steer ../../Tests/Canonical_RANS/Neutral_ABL_Flat/inputs_steady_neutral_flat

The run ends with

  2840  2.000e+00  zjacobi      1.793e-05  6.202e-06  5.720e-06  1.488e-05  7.754e-06  6.324e-08  6.816e-03
steer: steady after 2840 iterations (2840 over the run)

Unlike tutorial 1, all six residuals are non-zero: the Coriolis force couples \(u\) and \(v\), and the inversion couples \(w\) and \(\theta\). The largest wind speed is 11.1 m/s, slightly above the geostrophic wind (a low-level jet below the inversion), and \(u_* = 0.377\) m/s.

Check the result with ERF’s script

ERF provides a check script for this case. It reads the turbulence plotfile, which uses ERF’s variable names:

python3 ../../extern_erf/check_neutral.py --physics steady_neutral_flat_turb02840 steady_neutral_flat_turb02840/surf_hist.dat

It prints one line per check and ends with 0 check(s) failed. Among the checks:

u_star [m/s] plausible                         0.377402           0.35       0.15   abs yes
KE(k=0)/u*^2 vs 1/Cmu0^2                        3.23251         3.2325       0.05   rel yes
|U|(k=0) vs log law                              4.0235         4.0235        0.1   rel yes

What you have seen

  • Coriolis forcing and a sounding are set in the forcing and bc namespaces.

  • With rotation and stratification the solver needs a smaller CFL cap than the column (2 instead of 50).

  • ERF’s check scripts work directly on STEER’s turbulence plotfile.

Next: Tutorial 3: Flow over a hill adds terrain.