.. _python_API_periodic:

.. currentmodule:: flow360

****************************
Periodic Boundary Conditions
****************************

This example details the configuration and simulation of flow through a stator passage, employing rotational periodic boundary conditions via the Flow360 Python API.
It outlines the procedure from importing a pre-existing mesh, defining the operating conditions using Mach and Reynolds numbers, specifying boundary conditions including rotational periodicity, configuring the Spalart-Allmaras turbulence model, and setting up various outputs like surface and slice data before initiating the simulation run.

.. literalinclude:: ../../../../../Flow360/examples/advanced_simulations/turbomachinery/periodic_BC.py
  :language: python
  :linenos:

Notes
=====

- Rotational periodicity between ``periodic-1`` and ``periodic-2`` surfaces is established using ``fl.Periodic`` combined with ``fl.Rotational``.
- ``fl.SlipWall`` boundary conditions are applied to the ``bottomFront`` and ``topFront`` surfaces, acting as buffer regions to improve convergence behavior near the inlet.
- ``fl.SliceOutput`` is utilized to extract detailed flow field data at specified cross-sections (Inlet, Outlet, TrailingEdge, Wake) for post-processing.
