.. _python_API_alpha_sweep:

.. currentmodule:: flow360

**************************
Alpha Sweep
**************************

This example demonstrates how to configure and manage a series of simulations to perform an angle of attack (alpha) sweep for the ONERA M6 wing using the Flow360 Python API. It covers setting up a baseline simulation configuration, modifying the angle of attack across a specified range, submitting each case, retrieving results, and performing basic post-processing to calculate and plot aerodynamic coefficients.

.. literalinclude:: ../../../../../Flow360/examples/post_processing/monitoring/alpha_sweep.py
    :language: python
    :linenos:

Notes
=====

- The script iterates through a predefined range of angles of attack, updating the ``operating_condition.alpha`` within the ``SimulationParams`` object for each iteration.
- Each angle of attack is submitted as an individual simulation case using ``project.run_case``, allowing for parallel processing and organized results management within a single project structure.
- Basic post-processing is shown, calculating the mean lift (CL) and drag (CD) coefficients from the converged portion (last 10%) of the simulation history to generate an aerodynamic polar plot (CL vs. CD).
