  Sand fences are widely applied to prevent soil erosion by wind in areas
affected by desertification. Sand fences also provide a way to reduce the
emission rate of dust particles, which is triggered mainly by the impacts of
wind-blown sand grains onto the soil and affects the Earth's climate. Many
different types of fence have been designed and their effects on the sediment
transport dynamics studied since many years. However, the search for the
optimal array of fences has remained largely an empirical task. In order to
achieve maximal soil protection using the minimal amount of fence material, a
quantitative understanding of the flow profile over the relief encompassing the
area to be protected including all employed fences is required. Here we use
Computational Fluid Dynamics to calculate the average turbulent airflow through
an array of fences as a function of the porosity, spacing and height of the
fences. Specifically, we investigate the factors controlling the fraction of
soil area over which the basal average wind shear velocity drops below the
threshold for sand transport when the fences are applied. We introduce a cost
function, given by the amount of material necessary to construct the fences. We
find that, for typical sand-moving wind velocities, the optimal fence height
(which minimizes this cost function) is around $50\,$cm, while using fences of
height around $1.25\,$m leads to maximal cost.
