Spaces:
Sleeping
Sleeping
| title: 2d Predictor | |
| emoji: 👀 | |
| colorFrom: indigo | |
| colorTo: red | |
| sdk: gradio | |
| sdk_version: 6.0.1 | |
| app_file: app.py | |
| pinned: false | |
| license: mit | |
| short_description: Web-app and APIs to get NeuralFoil predictions | |
| Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference | |
| # NeuralFoil Airfoil Predictor (Hugging Face Space) | |
| This Space wraps [NeuralFoil](https://github.com/peterdsharpe/NeuralFoil) in a Gradio UI. | |
| It runs a NeuralFoil surrogate model to estimate airfoil aerodynamics (CL, CD, CM, transition locations, and an analysis confidence metric) for a single operating point. | |
| NeuralFoil is a neural-network-based surrogate for XFoil. | |
| Given an airfoil and operating conditions, it predicts aerodynamic coefficients and related quantities much faster than traditional CFD or XFoil. | |
| This Space only wraps that functionality and does **not** train any models itself. | |
| ## Features | |
| - **Airfoil definition** | |
| - By **name** via AeroSandbox (UIUC / NACA-style names, e.g. `naca4412`, `rae2822`, `clarky`) | |
| - By **`.dat` file upload** (XFoil-style coordinate file) | |
| - numpy coordinates | |
| - **Operating point inputs** | |
| - Angle of attack **α [deg]** | |
| - Reynolds number **Re [-]** | |
| - NeuralFoil **model size** (`xxsmall` … `xxxlarge`) | |
| - **Outputs** | |
| - Lift coefficient **CL** | |
| - Drag coefficient **CD** | |
| - Moment coefficient **CM** | |
| - Transition locations: **Top_Xtr**, **Bot_Xtr** (if available) | |
| - **analysis_confidence** + a crude textual interpretation | |
| - Full raw NeuralFoil output JSON (for power users / debugging) | |
| ## Running locally | |
| ### Quick Start (if already set up) | |
| ```bash | |
| ./run.sh | |
| # or | |
| source venv/bin/activate && python app.py | |
| ``` | |
| ### First Time Setup | |
| ```bash | |
| # 1. Create virtual environment | |
| python3 -m venv venv | |
| # 2. Activate virtual environment | |
| source venv/bin/activate # macOS/Linux | |
| # or | |
| venv\Scripts\activate # Windows | |
| # 3. Install dependencies | |
| pip install --upgrade pip | |
| pip install -r requirements.txt | |
| # 4. Run the app | |
| python app.py | |
| ``` | |
| The app will start on `http://127.0.0.1:7860` (or next available port). | |
| See [SETUP.md](SETUP.md) for detailed setup instructions and troubleshooting. | |
| ## License | |
| - NeuralFoil itself is MIT-licensed (see its own repository for details). | |
| - This Space is just a thin wrapper around NeuralFoil and AeroSandbox. | |
| ## Citation | |
| If you use NeuralFoil in your research, please cite: | |
| Both the tool itself (this repository), which includes the pre-print publication: | |
| ```bibtex | |
| @misc{neuralfoil, | |
| author = {Peter Sharpe}, | |
| title = {{NeuralFoil}: An airfoil aerodynamics analysis tool using physics-informed machine learning}, | |
| year = {2023}, | |
| publisher = {GitHub}, | |
| journal = {GitHub repository}, | |
| howpublished = {\url{https://github.com/peterdsharpe/NeuralFoil}}, | |
| } | |
| ``` | |
| And the author's PhD thesis, which has an extended chapter that serves as the primary long-form documentation for the tool: | |
| ```bibtex | |
| @phdthesis{aerosandbox_phd_thesis, | |
| title = {Accelerating Practical Engineering Design Optimization with Computational Graph Transformations}, | |
| author = {Sharpe, Peter D.}, | |
| school = {Massachusetts Institute of Technology}, | |
| year = {2024}, | |
| } | |
| ``` |