Initial conditions
The steady solver starts from an initial field. A good initial field is already close to the solution, so the solver needs fewer iterations. STEER builds the initial field in two steps:
Initial profile. A wind profile is placed on the mesh by height above the local ground.
Mass-consistent adjustment. The field is corrected so that it conserves mass, which bends the flow over and around the terrain.
The method is that of mass-consistent wind models such as WindNinja (Forthofer et al. 2014) and follows
FastWindTerrain. No FastWindTerrain code is copied (it uses a Cartesian immersed-boundary mesh), but every parameter
has the same meaning. The code is in Source/Initializer and Source/ColumnGuess; the inputs are in the
init namespace (Input reference).
Options
init.first_guess selects the initial profile:
Value |
Initial profile |
Recommended for |
|---|---|---|
|
Fluid at rest. |
Tests only. |
|
The inflow profile of Boundary conditions (log law, power law or file). |
Cases without Coriolis forcing; flat cases with an inversion. |
|
The steady solution of a single vertical column, computed first (below). |
Terrain cases with Coriolis forcing. |
|
A parent run’s checkpoint ( |
A finer patch inside a coarser run. |
init.projection (default 1) switches the mass-consistent adjustment on or off. With 0, the solver’s own pressure
correction removes the divergence in its first iteration.
Initial profile from the inflow profile
With init.first_guess = profile:
\(u_0, v_0\) are the inflow profile at each face’s height above the ground, \(h = \max(z_\mathrm{face} - z_\mathrm{ground}, h_\mathrm{min})\), where \(h_\mathrm{min}\) is
init.z_agl_min.\(w_0 = 0\), except on the ground faces, where \(w_0 = u_0 z_x + v_0 z_y\) (no flow through the ground).
\(\theta\) is the sounding
bc.theta_profileat the absolute height, and \(p = 0\).\(k\) is the profile’s equilibrium value. Above \(z_i\) =
init.k_decay_height(0: no decay) it decays:\[k = k_\mathrm{prof}(h)\, e^{-(h - z_i)/z_i} \quad (h > z_i), \qquad k = k_\mathrm{prof}(h) \quad (h \le z_i).\]
Initial profile from a single column
With Coriolis forcing, the steady wind turns with height (the Ekman spiral). The inflow profile has no such turning,
so the solver must first spend many iterations on the slow inertial adjustment. init.first_guess = column avoids
this: it first solves the horizontally uniform problem of the case, a single vertical column, and uses its steady
profile as the initial profile.
The column has the vertical grid of the case over flat ground. It solves for the horizontal wind, written as the complex number \(u + iv\), and for \(k\):
In the neutral column \(\theta\) is held at the sounding (the stratified column below solves for it).
\(\nu\), \(\gamma_k\), \(P_s\), \(P_b\), \(\varepsilon\) come from the turbulence model of Turbulence model.
The ground of the neutral column uses the neutral log law; the top and the Rayleigh layer are those of the case. Its roughness is
bc.surface_z0; with a roughness map (bc.surface_z0_file) the column takes one value,init.column_z0, which must then be given.
Forest canopy. When the run has a canopy (Forest canopy) the column carries it: the layer profile \(f_k\)
of the level’s drag field (its mean over the domain’s columns) enters the momentum equation as the drag
\(-f_k |W| W\), linearised along the wind about each step’s start (the derivative diagonal of the 3-D rows; a
lagged \(|W|\) would hand the balance speed back and forth at the column’s large steps), and with canopy.tke
the \(k\) equation gains the wake production \(\beta_p f |W|^3\), the short-circuit sink
\(\beta_d f |W| k\) on the Patankar diagonal and the closure’s length cap \(L \le \alpha/f\), the same terms
as the 3-D stage’s on a flat column. The first guess and an inflow column made from it then carry the forest: on
Tests/Canonical_RANS/Canopy_Drag with a uniform 20 m canopy (LAI 3) the 3-D run starts from the column with
first residuals of \(10^{-9}\) against 1 from the profile, and reaches the verdict in 1082 iterations against
2046 (rt_canopy_column). The column is horizontally uniform and sits on the flat levels, so the canopy must be
the same in every column and the terrain flat: on a terrain-following mesh even a canopy of uniform height gives
each column its own layer profile, and a canopy whose \(f\) differs between columns (a forest on part of the
domain) stops the run, naming init.first_guess (use profile there, or an inflow table). Deep inside a dense
uniform canopy the column’s balances are closed forms, \(|W| = \sqrt{F/f}\) for a pressure-gradient force
\(F\) and \(\beta_p |W|^3 = \beta_d |W| k + C_{\mu 0}^3 k^{3/2}/\alpha\), which the unit tests
ColumnCanopy.* pin.
The column is marched to steady state with implicit (backward Euler) steps that grow from 10 s to \(10^5\) s. It
has converged when the largest change of \(u, v\) and \(k\) (and \(\theta\) in a stratified column) over a
step, relative to their scale, is below
init.column_tol. This typically takes 100–200 steps and a few hundredths of a second. If it has not converged
after init.column_max_iterations steps, the run stops.
The converged \(u, v, k\) are then placed on the mesh by height above the local ground, exactly as the inflow
profile is; \(\theta\) stays the sounding (the stratified column below can set it). The table is written to
io.column_guess_file (default column_guess.dat in the run directory), in full precision, so it reads back as a
bc.inflow_file exactly.
An inflow face keeps the case’s inflow profile; the solver reconciles the two.
Requirements. The column option needs:
a horizontal forcing:
forcing.geostrophic = 1or a non-zeroforcing.pressure_gradient;the SIMPLEC stage (
steady.stage = simplecorsimplec_newton);a
surface_layerground with the default wall \(k\) (bc.surface_zrefis not supported), neutral unlessinit.column_stability = heat_flux(thenbc.surface_stability = heat_flux) ormolwith a non-zeroinit.column_mol(bc.surface_stability = heat_fluxallowed: the run takes the column’s flux);with a non-neutral steady column, a Rayleigh layer on \(\theta\) (below; the time-marching column needs none);
a
slip_wall,geostrophicorno_slip_walltop;bc.rayleigh_fieldseither containing bothuandvor neither;with a pressure gradient but no Coriolis force: a neutral sounding or a Rayleigh layer on
uandv(the steady column only);with a forest canopy (Forest canopy): flat terrain and a canopy that is the same in every column (below).
init.k_decay_height cannot be used with it. Otherwise the run stops with a message naming
init.first_guess.
Stratified column. With a non-neutral surface (init.column_stability, the forms of
amrTerrain’s 1-D column solver) the column also solves for \(\theta\),
with the deck’s gradient bc.zhi_theta_grad at the top and, at the ground, Monin–Obukhov similarity for a
surface temperature \(\theta_s\) (ERF’s Businger–Dyer \(\psi_m\), \(\psi_h\), or QNSE’s on the stable
side with bc.surface_stable_functions = qnse, stable functions):
\(U_1\), \(\theta_1\): the first cell’s speed and potential temperature at height \(z_1\);
\(\zeta\) from the bulk Richardson number, as ERF’s surface-temperature solve: \(\zeta = \mathrm{Ri}_b\,(\ln - \psi_m)^2/(\ln - \psi_h)\), \(\mathrm{Ri}_b = z_1 g (\theta_1 - \theta_s)/(U_1^2 \theta_0)\) held in [
init.column_rib_min,init.column_rib_max] (default ±4, ERF’s), solved by ERF’s fixed point under-relaxed by a half. Businger–Dyer’s linear stable \(\psi\) has a root only for \(\mathrm{Ri}_b < 0.2\) (\(\zeta = \mathrm{Ri}_b \ln/(1 - 5\,\mathrm{Ri}_b)\)), so with them the bound is at most 0.19 (\(\zeta = 3.8\ln\)); QNSE’s \(\phi\) levels off and needs no further cap. The flux takes the full \(\theta_1 - \theta_s\), as in ERF and WRF;\(q\): the kinematic surface heat flux (K m/s, upward > 0), implicit in \(\theta_1\);
the wall \(k\) the surface layer’s (Axell and Liungman 2001, Eq. 16): \(k_1 = (u_*^3 + \kappa B z_1)^{2/3}/C_{\mu 0}^2\), \(B = g q/\theta_0\) for an upward flux only.
surface_temperature fixes \(\theta_s\) (init.column_surface_theta). mol and heat_flux fix
\(1/L\) (init.column_mol) or \(q\) (bc.surface_heat_flux), and the column finds the \(\theta_s\)
that gives it by the secant method. The search is on \(1/L\) for mol, so it reaches every \(L\) the
column allows, also those past its largest downward flux. \(\zeta\) is taken at the first cell centre,
\(z_1/L\), as in the 3-D wall model.
Heat budget. At steady state the surface flux has to leave (or enter) the column somewhere. The top passes
almost nothing: its flux is the deck’s gradient times a diffusivity at the floor. The Rayleigh layer on
\(\theta\) is therefore the column’s heat source or sink, and a non-neutral column requires it
(bc.rayleigh_zdamp > 0 and theta in bc.rayleigh_fields). The most stable column the deck allows (the
smallest \(L\), the largest downward flux) depends on that layer’s height and strength, on the wind and on the closure’s length cap
turb.max_geom_lscale: on Tests/Canonical_RANS/Column_Target the smallest \(L\) is below 500 m with a
30 m cap and about 700 m with the default 100 m. A request beyond it stops the run, naming the smallest
\(L\) (or the largest flux) reached. The numbers that follow are for a 30 m cap. On the unit test’s 64 m
column (Rayleigh layer above 48 m) the smallest \(L\) is 414 m; on a 120 m deck with the Bolund vertical grid the largest downward flux is −0.029 K m/s with the
Rayleigh layer above 80 m and −0.022 K m/s above 100 m.
The log prints the flux, \(L\) and \(\theta_s\) reached, and the column’s total steps and columns. With
mol and bc.surface_stability = heat_flux the 3-D run takes the column’s flux as bc.surface_heat_flux.
The wall \(k\) is the surface layer’s, \((u_*^3 + \kappa B z_1)^{2/3}/C_{\mu 0}^2\); amrTerrain’s column
uses the additive form \((u_*^2 + (\kappa B z_1)^{2/3})/C_{\mu}^2\), up to \(2^{1/3}\) larger for an
upward flux.
Target wind. init.column_target_u, init.column_target_v at init.column_target_height (amrTerrain’s
met-mast forcing): the geostrophic wind needed to keep a given wind at a given height under each stratification.
After each converged column the geostrophic wind and the column’s Rayleigh reference wind are multiplied by
\(R = U_\mathrm{target}/U(z_t)\) (complex: scaled and turned), the pressure gradient by \(R\,|R|\) (the
stress goes with the square of the speed), and the column is solved again, until \(|R - 1| < 10^{-4}\).
\(U(z_t)\) is MOST’s profile below the first cell centre and linear in \(\ln(z + z_0)\) above. The 3-D run
then takes that forcing. It reaches the target only if nothing holds its wind to the deck’s inflow profile, so a
target is refused with a Rayleigh layer on \(u, v\), a sponge or an inflow face, and with a stratified column
over a neutral 3-D surface. For an inflow case, set bc.inflow_profile = column (the run’s own column): the
faces and the sponge then take the target column itself.
Time-marching column. init.column_time > 0 marches the same column in physical time instead: backward Euler
steps of init.column_dt (the last step ends at init.column_time), \(\nu_t\) taken from the closure at
each step without the steady column’s relaxation, and no convergence test. It is the form of ERF’s near-1-D column
with a stratified inflow: a column heated or cooled at a fixed rate has no steady state, so it needs no
Rayleigh layer on \(\theta\), and the table is its state at init.column_time. The surface is fixed: the
neutral wall law (mol with init.column_mol = 0, \(\theta\) held), surface_temperature, or
heat_flux, where the flux \(q\) = bc.surface_heat_flux enters the first cell as given (explicit, no search
for \(\theta_s\)) and MOST gives \(u_*\) and \(L\) from it, as ERF’s flux surface:
solved by the fixed point under-relaxed by a half (from the previous step’s \(\zeta\), then from 0 if that
fails, to \(10^{-10}\)),
\(\theta_* = -q/u_*\). A downward flux too large for the wind has no root and stops the run, naming
bc.surface_heat_flux (at any step, and at the final state). With a slip top, bc.zhi_theta_grad = 0 and no Rayleigh layer on \(\theta\) the
column’s heat content \(\sum \theta\,\Delta z\) then grows by \(q t\) to round-off (the unit test
ColumnMarching.SurfaceFluxBudget). The target wind and a non-zero init.column_mol need the steady column; the
bulk Richardson bounds are refused with heat_flux (no bulk Richardson number is solved). The log and the table
header give the surface of the final state; with surface_temperature the flux printed is the one at
init.column_time only. The 3-D run is steady and has no such time: a marched \(\theta\) with a fixed flux and
no heat sink is not a steady state of a periodic deck. The table is meant as the bc.inflow_file of a deck with an
inflow face (with simplec.theta = frozen), or as a first guess alone (the example deck
stops after one iteration, steady.max_iterations = 1).
On four stratified columns (240 × 10 m levels, 9 h, Tests/Canonical_RANS/Column_Marching) the
column is within 9 % of ERF’s bulk Richardson number between 46 and 73 m and within 1 % of its speed at 300 m, the
same for steps of 1, 10 and 60 s; a 9 h column of 1 s steps takes about 2 s. The march is first order in time and
stayed stable up to 3600 s steps; steps up to about 300 s keep the bulk Richardson number within 0.002 of the 1 s
column, while 3600 s steps damp the inertial oscillation (U(300 m) 1–3 % low).
The first cell’s k. By default (init.column_wall_k = fixed) the marching column holds the first cell’s
\(k\) at the surface layer’s wall value, as the steady column and the 3-D run do:
(Axell and Liungman 2001, Eq. 16). init.column_wall_k = solved solves the first cell’s \(k\) with the
equation of the other cells instead: no \(k\) flux through the ground, the shear production from the mean of
the wall law’s gradient at the first centre (\(u_*/(\kappa (z_1 + z_0))\) when neutral, MOST’s otherwise) and the
layer difference above, the buoyancy production or destruction, the closure’s dissipation. The layer difference is
smaller than the wall law’s gradient, so in a neutral surface layer the solved \(k_1\) settles below the
log-layer value \(u_*^2/C_{\mu 0}^2\): at 0.77 of it for \(z_1/z_0 = 5\) and 0.74 for \(z_1/z_0 \ge 30\)
(a discrete constant-stress layer; 0.76 in ColumnMarching.SolvedWallK), with a \(k\) minimum at the first
cell. The closer agreement with ERF’s first-cell \(k\) below is therefore partly this discretisation, not
evidence that the solved value is the more physical one. In the four columns
the solved first-cell \(k\) is 1.2–1.3 times ERF’s (the wall value is about 1.9 times), and the bulk Richardson
number moves 1–2 % of its value towards ERF’s (6.5–8 % below it, from 8–9 %). The speed at 300 m and \(\theta\)
change by at most 0.01 m/s and 0.01 K. The 3-D run keeps the wall value either way.
Restart. The checkpoint holds the state, not the adjusted forcing or the column’s flux, and init.* keys are
refused on a restart. The log lists the inputs a restart deck needs in their place (forcing.ug,
forcing.vg, forcing.pressure_gradient, bc.surface_heat_flux), with all their digits.
On the Bolund case 4 deck with \(L\) = 250 m and 7.58 m/s at 5 m, the column gives \(u_*\) = 0.509 m/s (0.5085 m/s measured). That agreement mainly reflects MOST at 5 m with the chosen \(z_0\) and target. The flux, \(q\) = −0.039 K m/s, is sustained by the Rayleigh layer and has no measured counterpart.
The column’s \(\theta\) goes into the io.column_guess_file table (a bc.inflow_file for a run with the same
stratification). The 3-D first guess takes the column’s \(\theta\), by height above the ground, when the 3-D run
shares the column’s surface (bc.surface_stability = heat_flux); otherwise \(\theta\) is the sounding.
When to use it. On the 2-D and 3-D hills the column start halves the iterations (Results). On the flat
Neutral_ABL_Flat case it does not converge: the column’s \(k\) at the sharp inversion base differs from the
3-D solution, and a slow oscillation of \(k\) develops there. Use profile for that case.
Initial field from a parent run
With init.first_guess = nest the run is a patch: a finer mesh inside a coarser parent run. The initial field
is the parent’s checkpoint (bc.nest_parent) interpolated onto the patch, then the mass-consistent adjustment
below. The code is in Source/NestParent.
Placement. The patch refines the parent by \(r\) = bc.nest_ratio (2, the default, 4, 8 or 16) in x and y
and keeps the parent’s z-levels (refinement \(r\,r\,1\)):
each patch cell edge lies on a parent cell face, to \(10^{-4}\) of a parent cell;
the patch’s z inputs (
mesh.n_cellz,mesh.prob_loz,mesh.prob_hiz,mesh.dz0,mesh.stretch_ratio,mesh.zlevels_file) give the parent’s z-levels bit for bit (the checkpoint stores them as hexadecimal floats);the patch keeps 2 parent cells from every non-periodic face of the parent, so the interpolation never reads the parent’s boundary ghost cells. Along a periodic direction of the parent the patch may reach the parent’s faces, and its ghost cells then read the periodic neighbours; a patch periodic in a direction must span the parent’s full width there, from the same
mesh.prob_lo.
Any other placement stops the run, naming bc.nest_parent and listing each fault. The patch’s terrain is its own;
it should be the parent’s terrain on the finer cells.
Interpolation. Each field is interpolated at its own staggered point, bilinearly in x and y on each \(\zeta\)-level, with no vertical interpolation. For a patch cell centre \(i\) (index from the patch’s low corner) and a parent offset \(o\) (the parent cell under the patch’s first cell), the parent position is
and the value is \((1 - t)\,q_I + t\,q_{I+1}\) with \(I = \lfloor X \rfloor\), \(t = X - I\), in each
horizontal direction (at a face on a parent face the code takes \(I - 1\) with \(t = 1\); the value is the
same). \(t\) is a multiple of \(1/(2r)\); with \(r\) a power of two, \(t\) and \(1 - t\) are exact
in binary and the weights are mirror-symmetric, so the values are reproducible bit for bit.
u uses the face axis in x and the centre axis in y; v the reverse; w,
\(\theta\), \(k\) and \(p\) the centre axes. A linear field is reproduced exactly. The parent’s cells
are read on the patch’s own box layout, so the result does not depend on the number of ranks.
Values per level, not per height. Where the patch’s ground \(z_s\) differs from the parent’s interpolated
ground by \(\Delta z_s\), a patch point sits higher or lower than the parent point it takes its value from by about
\(\Delta z_s (1 - \zeta/H)\). For \(u, v, k\), which follow the height above the ground, this matters little.
\(\theta\) keeps the parent’s value, so in a sounding with lapse rate \(\Gamma\) it is off by about
\(\Gamma\,\Delta z_s (1 - \zeta/H)\) near the ground: 0.01 K in Nest_Patch_Hill (the same smooth hill on both
meshes), of order 0.1–0.3 K for a ridge that the patch resolves tens of metres higher in an inversion of 0.01 K/m.
Ground flux. After the interpolation, \(w\) on the ground faces is set so that no mass crosses the ground with
the patch’s own slopes (\(\Omega = 0\)), as for profile: the adjustment keeps the ground flux fixed, so the
first guess must carry it.
Checkpoint format. The parent checkpoint must be format 2, which stores the z-levels. A format-1 checkpoint (from an earlier version) still restarts, but as a nest parent it stops the run; rerun the parent to write format 2.
The patch’s faces use its own bc.* boundary types. With bc.<face> = nest a lateral face takes the parent’s
field (Boundary conditions, Nest faces). An inflow face, a Rayleigh damping layer and a side sponge
use the bc.inflow_* profile and the sounding, not the parent’s field. init.z_agl_min, init.k_decay_height and init.obrien act on a profile and are refused with
nest. Grid
sequencing (steady.sequencing = 1) is refused with nest: the patch starts on its own mesh from the parent.
Frozen θ. With simplec.theta = frozen the patch holds the parent’s \(\theta\), interpolated as above, for
the whole run (Solution algorithm, prescribed potential temperature). The parent may have solved
\(\theta\) or held it. The log gives the range and the mean of the held field. The ground ghost cells of
\(\theta\) are extended from the patch’s own first two cells, as on the sequenced levels. An inflow face of
the patch still takes its \(\theta\) from bc.theta_profile; with nest faces on all lateral faces every
lateral ghost value is the parent’s, and bc.theta_profile (which the deck must still give) is not used.
canopy.heat_frozen = blend is refused: the parent’s \(\theta\) may already carry the leaves’ heat.
steady.stage = unsteady is refused (not tested). Tests/Canonical_RANS/Nest_Faces (rt_nest_faces_frozen)
checks that \(\theta\) does not change over the run and equals the parent’s, interpolated.
What the patch does not take from the parent:
The buoyancy force. If the parent solved \(\theta\), its velocity and \(p'\) balance a force the patch does not carry, and the patch departs from the parent, more as \(U/(N h)\) falls (Solution algorithm, Limits, gives the test’s numbers). A parent that also held \(\theta\) has no such mismatch.
The parent’s ground. \(\theta\) is carried with the \(\zeta\)-level. Where the patch’s ground differs from the parent’s by \(\delta h\) in a domain of height \(H\), \(N^2\) changes by about \(\delta h/(H - h)\) (0.23 % at most in the test; 5 % for a crest 50 m sharper in a 1000 m domain).
The first cell’s \(N^2\). It is the held field’s own gradient between the first two cells (the ground extension), not the wall-law value of a parent that solved \(\theta\).
The surface stability.
bc.surface_stabilityandbc.surface_heat_fluxare the patch deck’s own, and are not compared with the parent’s: give the patch the parent’s values. A parent that solved \(\theta\) with a fixed heat flux has no steady \(\theta\); the patch holds the \(\theta\) of its last iteration.
Nests in one run
A deck can name nests: finer meshes that run in the same process after the outer domain. Each nest gives its name and
its two horizontal corners only (Input reference, nest):
nest.names = hill edge
nest.hill.lo = 400 300 # x y (m)
nest.hill.hi = 1200 900
nest.edge.lo = 1200 300
nest.edge.hi = 1500 600
The outer domain runs to its end and writes its checkpoint. Then each nest runs in turn, in the order of
nest.names, as a patch of that checkpoint. A nest has no deck of its own. It takes the outer deck and replaces
what a patch must have (Source/Nests.H):
the mesh: its corners in x and y, twice the outer cells there (refinement 2 2 1), the outer z-levels and
mesh.max_grid_size, one grid level; periodic only in a periodic outer direction that the nest spans whole;the faces:
bc.xlo,bc.xhi,bc.yloandbc.yhi = nest(periodicwhere the nest is periodic), withbc.nest_parentthe outer run’s last checkpoint; the ground and the top as the outer domain’s; no side sponge; the outer deck’s Rayleigh layer without u, v and k (on those it would relax towards the inflow profile, not the outer field), so with the defaultbc.rayleigh_fieldsa layer on w and theta; withnest.damping = outerthe outer deck’s layer as it is; no relaxation zone;the start:
init.first_guess = nest; the outer deck’sinit.projection,init.alpha_handinit.alpha_valso apply to each nest’s correction, while its otherinit.*keys andio.column_guess_fileset up the outer first guess only; no grid sequencing; nosteady.probes_fileand noio.restart;the outputs:
io.plot_file,io.chk_fileandio.turb_plot_filewith_<name>appended, for exampleplt_hill00096.
The rest is the outer domain’s. The terrain is the outer deck’s, and a terrain.type = agnesi hill stays at the
outer domain’s centre, so the nest’s ground equals the outer ground on the nodes they share. The terrain mapping must
then give the same heights above the ground too: terrain.smoothing = 0 (BTF) and 2 (Sullivan) set each node’s
height from its own ground and z-level, but STF (1, the default) smooths each level over the mesh’s whole ground,
so with nests over terrain other than flat it is refused. ERF also uses only BTF on its refined levels. The forcing is the outer
run’s final forcing: forcing.ug, forcing.vg, the horizontal forcing.pressure_gradient and
bc.surface_heat_flux after any adjustment made by a column first guess.
If the outer domain does not reach steady (steady.max_iterations, steady.residual_tol,
steady.residual_drop_orders), STEER stops after the outer run and no nest runs; the message names the outer domain’s
last checkpoint. If a nest does not reach steady, the other nests still run; then STEER stops with an error that names
each such nest and its last checkpoint.
The placement rules are those of a patch above: corners on the outer cell faces, at least 2 outer cells inside each
non-periodic outer face. A corner within 1e-4 cells of an outer face is moved onto it. Nests may touch but not
overlap, and a nest may not cover the whole outer domain in x and y (it would have no nest face). Every nest’s inputs,
its box layout (for example steady.line_overlap against its narrowest box) and its boundary inputs are checked
before the outer domain starts, so a fault in a nest stops the run before any work is done.
With nests the outer deck needs steady.stage = simplec or simplec_newton and io.write_checkpoint = 1.
Buildings are refused. With simplec.theta = frozen each nest holds the θ it starts from, the outer domain’s
interpolated.
A nest’s result is that of the same patch run on its own: Tests/Canonical_RANS/Nests_One_Process compares the two
bit for bit, and the outer domain with and without nests. It also checks that each nest’s ground equals the outer
ground on their shared nodes, and that the nest’s u, averaged to the outer cells, stays close to the outer u.
Limits of this one-way form:
The nests do not feed back into the outer domain: each nest takes the outer field on its faces, and the outer field does not change.
nest.feedback = defectorrelaxadds the feedback (Two-way nests (nest.feedback = defect), Two-way nests by relaxation (nest.feedback = relax)).Two nests that touch each take the outer values on their shared face, but each corrects its own net flux, so their normal velocities there differ.
The outer Rayleigh layer damps u and v (relaxing towards the inflow profile); a nest’s damps w and theta only, unless
nest.damping = outer. Near the top the nest’s u and v may therefore differ from the outer domain’s.A nest’s convergence is measured against its own first residuals, not the outer domain’s. A nest starts close to its steady state, so
steady.residual_drop_ordersmay take longer to reach thansteady.residual_tol.The Rayleigh layer relaxes the nest’s theta towards the deck’s profile, as the outer domain’s does.
The check of each nest before the outer run uses the deck’s forcing; the nest itself runs with the outer run’s final forcing (they differ only after a column first guess adjusts it).
A one-way nest cannot be restarted within the run. To continue one, run it as a patch on its own (a deck like
Tests/Canonical_RANS/Nests_One_Process/inputs_nest) withio.restart. A joint run (nest.feedback = defectorrelax) restarts from its joint record (Boundary conditions, Two-way nests, Restart).A nest is not checked against the outer sponge or the outflow face beyond the 2-cell margin; a nest placed in the sponge takes a damped field on its faces.
terrain.nest_blend_widthis not used by the nests (their ground already equals the outer ground on their faces); nor aresteady.probes_fileandio.restart.
Mass-consistent adjustment
The initial profile \(\mathbf u_0\) does not conserve mass over terrain. The adjustment finds the field \(\mathbf u\) closest to \(\mathbf u_0\) that does (Sherman 1978):
\(\lambda\): a Lagrange multiplier (a potential), with \(\lambda = 0\) on inflow and outflow faces and no flux through walls, the ground and the top.
\(\alpha_h, \alpha_v\): horizontal and vertical transmissivity (
init.alpha_h,init.alpha_v).
The equation is solved by the Poisson solver of Solution algorithm, terrain cross terms included.
Choosing α. Only the ratio \(\alpha_v/\alpha_h\) matters. A smaller ratio allows less vertical motion, so the flow goes around steep terrain rather than over it, as in stable air. In Sherman’s notation \(\alpha_v/\alpha_h\) is \(\alpha_1/\alpha_2\), WindNinja’s stability parameter. Ratios of 0.1 and above are practical; smaller ratios need more Poisson iterations.
With \(\alpha_v \ne \alpha_h\) this one solve always uses the gmres_fft back end, whatever
solver.poisson_backend says, and the log says so. The SIMPLEC stage keeps solver.poisson_backend.
O’Brien correction
init.obrien = 1 (off by default) first sets the vertical flux \(\Omega_0\) from column continuity, integrating
from the ground up, and removes the remaining flux at the top with a weight that grows with height (O’Brien 1970):
where \(D^h\) is the horizontal part of the divergence and the top residual is removed with the weight \(f_k^2\). It is meant for initial profiles taken from soundings or other models.
The resulting field
The initial field is divergence-free to the Poisson tolerance, and \(\theta\), \(k\), \(p\) are consistent with the sounding. It is a starting point, not a RANS solution: it does not satisfy the momentum equations.
A restart (io.restart) cannot be combined with init.first_guess: the checkpoint already holds the state.