The aim of this page is to describe instructions and tools on how to generate terrain data for use with OF, in particular to model ABL flows.

## Contents

## 1 short description

The typical starting point for any ABL simulation is some source of digital terrain model (DTM - also called DEM. digital elevation model. see here for example) The processing of this data into STL format is required in order to work with SHM for creating the mesh. Alternatively, other meshing programs can use different surface grid formats. In any case the first step will normally be to choose the domain size, and then smooth the ends of the domain so that the inlet and outlet are flat area, and normally also the sides. This can be done with SAGA-gis for instance. The second important step is defining the roughness length distribution in the domain. In some cases a homogenous distribution can be used, according to inlet measurements. But in many cases a variable distribution, with areas with different roughness length are desired. The starting point is normally a satellite image, and the use of the Davenport scale for classifying the roughness length based on the vegetation/buildings in each area.

## 2 Terrain modelling

**(0) Matlab tool for processing a cloud of points.**

This is a nice Matlab tool to generate an STL file from a cloud of points. Typical usage is as simple as: data=load('data.xyz');

x=data(:,1);

y=data(:,2);

z=data(:,3);

stlwrite('landscape.stl',x,y,z,'mode','ascii');

The tool is here: File:Stlwrite.zip. Another Matlab tool, for data in surface format (ie, as in Matlab's surf function), can be found here: File:Surf2stl.m.gz. An example STL file, generated using this tool with the set of data from this link [1], can be found here: File:AskerveinHill20m.stl.gz.

**(1) Landscapes based on real life maps, using Blender.**

There is a description here on how to use Blender to generate a landscape based on real maps: [2].

## 3 Roughness length modelling

**(0) an OpenFoam utility for reading WAsP map files and converting to roughness height in a OF dictionary format and in the nut roughWall BC**

A page describing the utility can be found here Contrib/roughnessToFoam

## 4 Structured mesh generation for arbitrary landscapes with terrainBlockMesher

The blockMeshDict generator terrainBlockMesher can be downloaded here: [3]. It generates a blockMeshDict for an arbitrary terrain, using splines (note that this doesn't work for sharp edges, so not useful for urban flows). A fully structured mesh can then be generated using blockMesh. For details of usage, see the tutorials in the git cloning.