.. _python_API_aeroacoustics:

.. currentmodule:: flow360

**************************
Aeroacoustics
**************************

This script demonstrates the setup for obtaining aeroacoustic results for a quadcopter configuration using the Flow360 Python API.
It outlines the process of defining rotating zones, configuring an unsteady simulation vital for capturing time-varying flow features,
and setting up aeroacoustic outputs based on the Ffowcs-Williams and Hawkings (FWH) analogy.
The example focuses on specifying acoustic observer locations and retrieving the resulting acoustic data.

.. literalinclude:: ../../../../../Flow360/examples/post_processing/special_features/aeroacoustics.py
  :language: python
  :linenos:

Notes
=====

- The script showcases the configuration of aeroacoustic data computation using ``fl.AeroAcousticOutput`` and the definition of microphone locations via ``fl.Observer``.
- It illustrates how to retrieve both the total acoustic results aggregated over all sources and the acoustic contributions from individual surfaces after the simulation concludes.
- A simulation forking strategy (using the ``fork_from`` argument in ``project.run_case``) is employed to initialize the flow field before adding the specific acoustic output requests for the final simulation phase.
