(precursor_simulation)= # Precursor simulation A precursor simulation in our framework serves two purposes: it produces single-point statistics for the {ref}`synthetic eddy method `, similar to what a wind-tunnel database would provide, and it produces time-resolved inlet-plane recordings for {ref}`PODFS ` replay. The synthetic eddy method does not invent turbulence statistics; it reproduces statistics it is given. Those statistics have to come from somewhere, and a precursor simulation is the numerical equivalent of the physical experiment a wind engineer would otherwise run. Instead of measuring a developed boundary layer in a laboratory, the precursor grows one in silico and records its profiles, which are then replayed at the inlet of the application simulation. ## Why a precursor is worth the cost Running an extra simulation just to feed another one may seem wasteful, but it pays for itself in two ways. First, a precursor delivers a flow that is already turbulent and statistically developed, so the application simulation starts close to its final state and spends far less time reaching statistical convergence than it would if it had to spin up turbulence from rest. Second, the precursor can be run once on a representative configuration and its statistics reused across many application simulations that share the same terrain category and approach-flow conditions, amortising its cost over a whole study. ```{admonition} Recording for the SEM vs recording for PODFS What the precursor records depends on which inlet method consumes it. For the {ref}`SEM ` the precursor is reduced to two profiles, the mean velocity and the Reynolds stress, which the SEM uses to synthesise a fresh fluctuation field: only single-point statistics survive the recording. For {ref}`PODFS ` replay the precursor instead stores time-resolved snapshots of the inlet plane, from which the full coherent structure is compressed and played back. The SEM route is lighter to store and lets the statistics be retargeted, while the replay route carries the true phase organisation of a developed flow at a higher recording cost. ``` ## The wind-tunnel analogy Because the goal is to mimic a wind-tunnel database, the setup of a precursor simulation mirrors that of a physical boundary-layer wind tunnel, in which obstacles positioned along the tunnel floor shape the velocity and turbulence-intensity profiles before the flow reaches the test section. A typical wind-tunnel setup using the Counihan method {footcite:t}`kozmar2012physical` is illustrated below: ```{figure} /_static/img/theory/precursor_simulation/wind_tunnel.svg --- align: center width: 80% --- ``` Each element in this arrangement plays a distinct role in building the boundary layer over a short fetch, where nature would need kilometres of terrain: - the **grid** placed just after the inlet breaks the incoming uniform stream into an initial field of small-scale disturbances, seeding the turbulence; - the **castellated barrier** generates large eddies with a horizontal axis of rotation, which set the overall thickness and shear of the developing layer; - the **elliptical vortex generators** (the Counihan spires) create eddies with a vertical axis of rotation, redistributing momentum and filling out the turbulence-intensity profile; - the **roughness elements** covering the floor downstream of the spires determine the terrain category, fixing the wall friction and hence the shape of the mean logarithmic profile. ## Sizing the roughness elements The roughness elements are what tie the precursor to a specific terrain. Their size sets the aerodynamic roughness length $z_{0}$ that the developed boundary layer will exhibit, and they can be dimensioned with the relation proposed by {footcite:t}`ricci2018towards`: $$ z_{0}=0.5\frac{A_{r}}{A_{t}} $$ (category) where $z_{0}$ is the aerodynamic roughness of the terrain, $A_{r}$ is the frontal area of a single element normal to the wind direction, and $A_{t}$ is the ground area allotted to each element. The ratio $A_{r}/A_{t}$ is a packing density: closely spaced, tall elements raise $z_{0}$ toward city-centre values, while sparse, low elements lower it toward open-country values. Choosing the element geometry from equation {eq}`category` is therefore how a target terrain category is dialled into the precursor. ## Statistics extracted for the SEM Once the boundary layer is developed, the precursor is sampled the way a wind tunnel would be probed. The time history recorded along a vertical line of virtual pitot points is reduced into the two statistics the SEM consumes: - the **mean velocity profile** $\bar{u}_{\alpha}\left(z\right)$, the time average of the velocity at each height, and - the **Reynolds stress tensor** $R_{\alpha\beta}\left(z\right)$, the covariance of the velocity fluctuations at each height, which carries the turbulence intensities on its diagonal and the momentum-flux correlations off the diagonal. These two profiles are exactly the inputs of equations {eq}`bc_velocity_profile` and {eq}`bc_cholesky`, so the precursor and the SEM connect cleanly: the precursor produces $\bar{u}_{\alpha}$ and $R_{\alpha\beta}$, and the SEM turns them back into a transient inflow for the application simulation. The rate-of-strain moments $S_{\alpha\beta}$ are not stored, since they are recovered at the inlet from the velocity field by finite differences. ```{note} Reusing one precursor across several applications is recommended only when the domain length and the target turbulence intensities match those of the application; otherwise the developed profiles will not be representative of the approach flow the application needs. ``` ## Recording for PODFS The PODFS route does not reduce the precursor to profiles; it stores the inlet-plane fluctuation field over time, so the recording is a sequence of snapshots rather than a pair of statistics. Four parameters control its quality: - **Snapshot cadence.** The plane is sampled at a fixed interval $\Delta t_{s}$, chosen to resolve the highest temporal frequency of interest; too coarse a cadence aliases the high-frequency content that the Fourier-series step would otherwise capture. - **Record length.** The total recorded time fixes the Fourier period $T$ used in equation {eq}`bc_podfs_fourier`, so the record must span at least one full low-frequency cycle of the energy-carrying eddies for the replay to loop without a visible seam. - **Plane extent and resolution.** The sampled plane must cover the full inlet cross-section and be resolved finely enough that the energy-carrying eddies are captured on the analysis grid; this grid is decoupled from the inlet lattice and resampled at start-up. - **Statistical convergence.** As with the SEM statistics, the recording window must be long enough that the mean and the resolved fluctuation energy on the plane are converged; a record that is too short biases both the extracted mean and the mode energies. These snapshots are exactly the input of the offline PODFS build, which compresses them into the mean, the POD modes, and the Fourier coefficients consumed by equation {eq}`bc_podfs_reconstruct`. (precursor_abl_inflow)= ## ABL inflow: from inlet method to validation The pieces above form a single chain whose purpose is to deliver a faithful atmospheric boundary layer to the model. It is worth tracing that chain end to end, because each link constrains the next and a CWE simulation is only correct if every link holds. ```{figure} /_static/img/theory/inflow/precursor_chain.svg --- align: center width: 75% --- From precursor to inlet. A precursor simulation produces developed ABL turbulence that feeds the main run by one of two routes: extract the mean and Reynolds-stress profiles for the SEM, or record full inlet-plane snapshots for PODFS replay. Either way the resulting inflow is validated against the target ABL profiles, intensities and spectra before production use. ``` **Inlet method.** The choice of inlet condition decides which statistics can be imposed. The SEM imposes the single-point statistics, the mean profile and the Reynolds stress, directly, which is sufficient for many wind-loading studies and is the workhorse for ABL inflow in Nassu. **Mean and turbulence-intensity profiles.** Whatever the method, the inflow must carry the correct vertical structure: a mean velocity that grows logarithmically with height and a turbulence intensity that decays with height. Over flat homogeneous terrain these profiles are set by the friction velocity and the roughness length, and they are the most basic check on any ABL inflow. **Target spectra.** Matching the profiles is necessary but not sufficient. The fluctuation energy must also be distributed across frequencies the way the atmosphere distributes it, otherwise the gust loads on a structure will be wrong even when the intensities are right. The standard ABL references for this distribution are the von Karman spectral form (after the isotropic-turbulence theory of {footcite:t}`vonkarman1948progress`) and the Kaimal surface-layer spectrum {footcite:t}`kaimal1972spectral`, and comparing the inflow spectra against these models is how the eddy structure is validated. The relevance of the spectral content to gust buffeting of structures is discussed by {footcite:t}`solari2001probabilistic`. **Roughness length and the wall model.** The roughness length $z_{0}$ is not only an inlet parameter; the ground inside the domain must be rough to the same degree, or the boundary layer will relax away from its target as it travels over a too-smooth floor. This is enforced by a rough-wall model at the bottom boundary that imposes the correct wall stress for the chosen $z_{0}$ {footcite:t}`asmuth2021wall`. The inlet profile and the wall model must agree on $z_{0}$ for the boundary layer to remain in equilibrium across the domain. **Validation case.** The whole chain is exercised by an ABL validation case, in which a developed boundary layer is driven over a rough floor and its profiles, intensities and spectra are compared against the analytical and experimental references above {footcite:t}`wittwer2013statistical`. A successful ABL validation is what licenses the inflow setup for use in production wind-engineering studies. ```{warning} Validate the precursor before building anything on top of it. A downstream method can only carry the statistics or modes it takes from the precursor, so a precursor whose profiles, intensities or spectra are wrong yields an inlet that is wrong in the same way, whether it is fed through the SEM statistics or replayed by PODFS. Check the precursor's developed profiles and spectra against the references above first; debugging an application simulation is the wrong place to discover that the boundary layer it was fed never matched the target terrain. ``` ```{eval-rst} .. footbibliography:: ```