  A fully-resolved direct-numerical-simulation (DNS) approach for investigating
flexible bodies forced by a turbulent incoming flow is designed to study the
flapping motion of a flexible flag at moderate Reynolds number. The incoming
turbulent flow is generated by placing a passive grid at the inlet of the
numerical domain and the turbulence level of the flow impacting the flag can be
controlled by changing its downstream distance from the grid. The computational
framework is based on the immersed boundary method for dealing with arbitrary
geometries and implemented using a graphics-processing-unit (GPU) accelerated
parallelisation to increase the computational efficiency. The grid-induced
turbulent flow is first characterised by means of the comparison with
well-known results for decaying turbulence and a scale-by-scale analysis. Then,
the flag-in-the-wind problem is revisited by exploring the effect of the
turbulence intensity on self-sustained flapping. Whilst the latter is still
manifesting under strong fluctuations, the main features of the oscillation
(including its amplitude and frequency) are altered by turbulence, whose
fingerprint can also be qualitatively detected by spectral analysis. Besides
their relevance for advancing the fundamental understanding of fluid-structure
interaction in turbulence, these findings have potential impact for related
applications, e.g., aeroelastic energy harvesting or flow control techniques.
