.. _python_API_user_defined_dynamics:

.. currentmodule:: flow360

**************************
User Defined Dynamics
**************************

User Defined Dynamics (UDD) in Flow360 enables the simulation of custom motion scenarios, fluid-structure interaction, and complex aerodynamic phenomena that go beyond standard prescribed motions. This powerful feature allows you to implement custom equations of motion, response to aerodynamic forces, and complex trajectory simulations directly within your CFD workflow.

.. grid:: 1

    .. grid-item-card:: 🔄 Angle of Attack Control
        :link: udd_alpha
        :link-type: doc
        
        Learn how to implement user-defined dynamics to control angle of attack based on simulation conditions or custom equations of motion.

    .. grid-item-card:: 💨 Force-Based Motion
        :link: udd_forces
        :link-type: doc
        
        Discover techniques for implementing motion responses to aerodynamic forces, enabling fluid-structure interaction and dynamic response simulations.

Key User Defined Dynamics Concepts
===============================

* Custom motion equations integration with CFD
* Real-time response to aerodynamic loads
* Coupled fluid-structure interaction
* Implementation of control systems in simulations
* Multi-body dynamics and relative motion

Applications
==========

User Defined Dynamics enables a wide range of advanced applications:

* Add custom equations to control settings of your simulations during runtime
* Flight control system evaluation in realistic flow conditions
* Propeller and rotor blade dynamics
* Moving control surfaces with feedback loops
* Free-flight trajectory prediction


Implementation Approaches
======================

Flow360 supports various methods for implementing User Defined Dynamics:

**Force-Based Motion:**

* Compute motion based on integrated aerodynamic forces
* Implement mass and inertia properties
* Model realistic dynamic responses

**Prescribed Function Motion:**

* Define custom mathematical functions for motion parameters
* Create complex motion patterns based on simulation time
* Implement non-standard oscillatory motions

**Control System Integration:**

* Implement PID controllers or other control laws
* Model sensor feedback and actuator dynamics
* Simulate closed-loop control scenarios

.. toctree::
   :hidden:

   udd_alpha
   udd_forces