/Design_Airfoil_with_RL

Airfoil Design project with Reinforcement Learning

Primary LanguagePython

Design_Airfoil_with_RL

This repository contains the code and resources for a project aimed at optimizing the design of 3D propellers using Reinforcement Learning (RL). The project employs a CFD-based reward system to enhance the aerodynamic performance of propeller designs.

⚠️This README is not perfect⚠️, and even if you follow the Installation and Usage, it will not work correctly. If you have more questions, please contact me to daehwa001210@gmail.com.

Table of Contents

Project Overview

The goal of this project is to design an optimized 3D propeller using reinforcement learning techniques. Traditional mathematical approaches struggle with the complexity and nonlinearity of airfoil design. By leveraging RL, the project efficiently explores a vast design space, automates the optimization process, and provides real-time feedback for continuous improvement.

Features

  • Reinforcement Learning Model: Utilizes PPO (Proximal Policy Optimization) for training.
  • CFD Simulation: Integrates OpenFOAM for aerodynamic simulations.
  • Signed Distance Function (SDF): Enhances the input representation for the RL model.
  • Automated Optimization: Automates the design and evaluation process of propellers.
  • Multi-Objective Optimization: Considers multiple performance metrics such as lift, drag, and structural stability.

Installation

To set up the project, follow these steps:

  1. Clone the repository:
    git clone https://github.com/daehwa00/3D-propeller-Design.git
    cd 3D-propeller-Design
  2. Install the required Python dependencies:
    pip install -r requirements.txt
  3. Install OpenFOAM:
    • Follow the instructions specific to your operating system to install OpenFOAM.

Usage

To train the RL model and optimize propeller designs, use the following commands:

  • Train the Model:
    python train.py
  • Run Simulations:
    python simulation.py
  • Evaluate Results:
    python main_verification.py

Simple Architecture Diagram

arch
  • State ( s_t ): The current airfoil shape.
  • SDF: The Signed Distance Function applied to the airfoil shape.
  • Agent: The RL agent that determines the action ( a_t ).
  • Action ( a_t ): The agent's output action, modifying the airfoil shape.
  • New State ( s_{t+1} ): The resulting airfoil shape after applying the action.
  • CFD: The computational fluid dynamics simulation to evaluate the new airfoil.
  • Calculate Reward: The process of computing the reward based on the CFD results (Cl and Cd).

Environment Validation

CL CD CM

To ensure the reliability of the simulation results, a comparison between experimental data and simulation outcomes was conducted. The validation results showed that while the lift coefficient (Cl) matched well with experimental data, the drag coefficient (Cd) and moment coefficient (Cm) did not align as closely.

I am looking for someone with CFD skills to take this project forward.

These results highlight the need for further research to improve the accuracy of Cd and Cm predictions. If you are interested in collaborating to advance this research, please feel free to contact me.

Environment Simulation

The environment simulation is set up to validate the aerodynamic performance of the designed propellers. The simulations are conducted using OpenFOAM, which provides a robust framework for computational fluid dynamics (CFD) analysis. Key validation parameters include:

  • Reynolds Number (Re): 170000
  • Dynamic Viscosity (( \mu )): ( 1.5 m^2/s )
  • Flow Velocity (U): 2.55 m/s

Validation results include comparisons of lift coefficients (Cl), drag coefficients (Cd), and moment coefficients (Cm) across various angles of attack (AoA).

Agent Action Design

RL_airfoil_action

The agent's action generates a 2D output ((x, r)) representing points on a plane. These points are connected to form a Convex Hull, which is then used as the airfoil shape. This method allows the RL model to iteratively improve the airfoil design by adjusting the position and radius of these points.

Results

The project successfully demonstrates the capability of reinforcement learning to optimize 3D propeller designs. Key results include:

  • Improved lift-to-drag ratio.
  • Efficient exploration of the design space.
  • Convergence to optimal designs without manual intervention. airfoil_animation_with_labels (1)

This figure continues to show the creation of a high lift-drag airfoil. In the lower right-hand corner of the figure, we've represented airfoil's lift-drag ratio.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.