{"id":15023233,"url":"https://github.com/wyllduck/openfoam-toolchain-for-rocket-aerodynamic-analysis","last_synced_at":"2025-07-21T20:37:13.128Z","repository":{"id":177628217,"uuid":"660669251","full_name":"WyllDuck/OpenFOAM-ToolChain-for-Rocket-Aerodynamic-Analysis","owner":"WyllDuck","description":"This project provides a complete toolchain for evaluating different rocket geometries at subsonic, transonic, and supersonic regimes. The work contained in this repository is part of a student project carried out at the Technical University of Munich (TUM) under the Master of Science (M.Sc) in Aerospace (year 2023).","archived":false,"fork":false,"pushed_at":"2023-12-19T12:07:15.000Z","size":17309,"stargazers_count":23,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T23:13:14.025Z","etag":null,"topics":["aerodynamics","automation","cfd","cfmesh","classyblocks","free","meshing","openfoam","opensource","rocket","singlespecies","subsonic","supersonic","template","templating","transonic"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WyllDuck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-06-30T14:41:05.000Z","updated_at":"2025-03-19T17:43:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"b5c43fc1-cce5-46dc-9972-46e945d1c938","html_url":"https://github.com/WyllDuck/OpenFOAM-ToolChain-for-Rocket-Aerodynamic-Analysis","commit_stats":{"total_commits":93,"total_committers":4,"mean_commits":23.25,"dds":0.4516129032258065,"last_synced_commit":"c421e8e255d43b53f92f2b5c3f33683d074e3508"},"previous_names":["wyllduck/spherecases","wyllduck/openfoam-toolchain-for-rocket-aerodynamic-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WyllDuck/OpenFOAM-ToolChain-for-Rocket-Aerodynamic-Analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyllDuck%2FOpenFOAM-ToolChain-for-Rocket-Aerodynamic-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyllDuck%2FOpenFOAM-ToolChain-for-Rocket-Aerodynamic-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyllDuck%2FOpenFOAM-ToolChain-for-Rocket-Aerodynamic-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyllDuck%2FOpenFOAM-ToolChain-for-Rocket-Aerodynamic-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WyllDuck","download_url":"https://codeload.github.com/WyllDuck/OpenFOAM-ToolChain-for-Rocket-Aerodynamic-Analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WyllDuck%2FOpenFOAM-ToolChain-for-Rocket-Aerodynamic-Analysis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266375741,"owners_count":23919618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aerodynamics","automation","cfd","cfmesh","classyblocks","free","meshing","openfoam","opensource","rocket","singlespecies","subsonic","supersonic","template","templating","transonic"],"created_at":"2024-09-24T19:58:51.481Z","updated_at":"2025-07-21T20:37:13.103Z","avatar_url":"https://github.com/WyllDuck.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Automatized \u0026 Modular OpenFOAM Workspace to Generate Large Aerodynamic Databases for Subsonic and Supersonic Vehicles \n__by Félix Martí Valverde__\n\nThis project provides a complete toolchain for evaluating different rocket geometries at subsonic, transonic, and supersonic regimes. The work contained in this repository is part of a student project carried out at the _Technical University of Munich_ (TUM) under the _Master of Science (M.Sc) in Aerospace_ (year 2023) which aims to provide a standalone and verified methodology to extract aerodynamic characteristics of a rocket using 3D CFD simulation with pressure and density based solvers found in OpenFOAM (ESI group distribution). \n\n![PNG Image](images/results.png)\n\n## HIGHLIGHTS\n\n\u003cul\u003e\n  \u003cli\u003e🚀Generation of specific OpenFOAM workspace using templates and \u003ci\u003eJSON\u003c/i\u003e configuration files. Powered by \u003ci\u003eJinja2\u003c/i\u003e, a Python module.🚀\u003c/li\u003e\n\n  \u003cli\u003e📂Structured Layout for automatic generation of large aerodynamic databases.📂\u003c/li\u003e\n\n  \u003cli\u003e🤖Automatic generation of CFD reports with the generation of predefined images through Paraviews Python API.🤖\u003c/li\u003e\n\n  \u003cli\u003e⚙️Planned execution in series of multiple OpenFOAM simultations⚙️\u003c/li\u003e\n\n  \u003cli\u003e🐋Use of containers to speed up deployment of a CFD server🐳 (5%⬇️ drop in efficiency)\u003c/li\u003e\n\n  \u003cli\u003e🤓Examples of OpenFOAM workspaces using \u003ci\u003erhoPimpleFOAM\u003c/i\u003e and \u003ci\u003erhoCentralFoam\u003c/i\u003e at subsonic, transonic, and supersonic regimes.🤓\u003c/li\u003e\n\u003c/ul\u003e\n\n## INTRODUCTION\n\nComputational Fluid Dynamics (CFD) tools from providers like ANSYS (Fluent) or Siemens (Star-CCM+) can be a financial burden on small businesses and startups alike. Thus, open-source alternatives like OpenFOAM are becoming increasingly appealing to reduce development costs. However, OpenFOAM has largely remained a research tool reserved for academia due to its lack of documentation, the high level of expertise required, and a lack of standardization and Graphical User Interface (GUI). This project identifies these shortcomings and aims to streamline the process, which is generally reserved for academia, thus easing the commercial adoption of this tool. \n\nThe entirety of the code has been publicly released in this repository to promote investigation using open-source and free tools. The results obtained during the development phase have been validated against wind tunnel data. The validation methodology can be found in the report \"_Toolchain for Aerodynamic Characterization of a Rocket During Ascent using OpenFOAM_\" along with the results obtained. Additionally, a set of simulation files for OpenFOAM (ESI group distribution) are also provided below to give a complete overview of the parameters used. \n\n### links\n\nSIMULATIONS FILES: https://1drv.ms/f/s!AhNN3_xNz6xdhe1IEGJ-niuFxb3V3g?e=uLhchQ\n\nREPORT: https://1drv.ms/b/s!AhNN3_xNz6xdhex7se7BjiaeyGrojg?e=m3ClFa\n\nCAD FILES: https://1drv.ms/f/s!AhNN3_xNz6xdhK0CDDJZs5zly81P_w?e=NSELu2\n\n## SETUP\n\nTo set up the workspace download OpenFOAM ESI (www.openfoam.com) and the following additional tools which are necessary to run the full toolchain. Note that _SALOME_ is used to generate the surface of the vehicle from an initial _STEP_ file into an _STL_ file. More information on the procedure can be found in the report, and an example of the _SALOME_ file can be found in the _CAD FILES_ folder link above (file extension .hdf). \n\n\u003cul\u003e\n  \u003cli\u003eParaview\u003c/li\u003e\n  \u003cli\u003eGNUPLOT\u003c/li\u003e\n  \u003cli\u003ePython 3\u003c/li\u003e\n  \u003cli\u003eSALOME\u003c/li\u003e\n  \u003cli\u003eGitHub\u003c/li\u003e  \n\u003c/ul\u003e\n\nNecessary Python modules for the execution of the pipeline are _jinja2-cli_ which can be installed using:\n\n```python3 -m pip install jinja2-cli```\n\n__OPTIONAL__\n\nOther additional Python modules need to be installed to test solvers using structured meshes. In the folder _sphereMesh_ a Python file named _sphere.py_ uses a Python module named _classyblocks_ (https://github.com/damogranlabs/classy_blocks) to generate a structured mesh around a sphere.\n\n```python3 -m pip install classy-blocks```\n\nAdditional tools that may interest the user to interact with the server and write the code are: \n\u003cul\u003e\n  \u003cli\u003eMobaXterm\u003c/li\u003e\n  \u003cli\u003eVisual Studio Code (VSC)\u003c/li\u003e\n  \u003cli\u003eXLaunch\u003c/li\u003e\n\u003c/ul\u003e\n\nAlso, the project explores different alternatives to execute OpenFOAM on personal computers that might run Windows exclusively. In the report, \na performance analysis reveals drops in performance of up to 5% due to the use of containers (with Docker).\n\n## CONTENT\n\nThe repository contains 3 fundamental folders: _rocketMesh_, _templates_, and _postProcessingTools_\n\n\u003cul\u003e\n  \u003cli\u003e\u003cb\u003erocketMesh\u003c/b\u003e: This folder contains a set of meshes of increasing resolution named R1 to R6. The user can choose from them to compute the solution.\u003c/li\u003e\n  \u003cli\u003e\u003cb\u003etemplates\u003c/b\u003e: This folder contains templates of OpenFOAM workspace which use different \u003ci\u003esolvers\u003c/i\u003e (e.g.\u003ci\u003erhoPimpleFoam\u003c/i\u003e, \u003ci\u003erhoSimpleFoam\u003c/i\u003e, etc.) and tune other parameters. The user must provide additional parameters using a \u003ci\u003eJSON\u003c/i\u003e file to generate a complete OpenFOAM workspace.\u003c/li\u003e\n  \n  \u003cli\u003e\u003cb\u003epostProcessingTools\u003c/b\u003e: Set of tools to generate: \n    \u003cul\u003e\n      \u003cli\u003eReal-time monitoring plots for residuals and aerodynamic coefficients.\u003c/li\u003e\n      \u003cli\u003eAutogenerated reports on single simulations containing images and stats (nº of iterations, CPU time, final aerodynamic coefficients, etc.).\u003c/li\u003e\n      \u003cli\u003eAutogenerated Excel table (\u003ci\u003eCSV\u003c/i\u003e files) with multiple simulations, same data as reports.\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/li\u003e\n\u003c/ul\u003e\n\nAdditional folders contained in the repository are extra resources that might come in handy. The submodule folder _OpenFOAM-ToolChain-helperFunctions_ (https://github.com/WyllDuck/OpenFOAM-ToolChain-helperFunctions) contains all the Python scripts used to calculate atmospheric conditions for each simulation and also scripts to extract the wind tunnel data to compare the CFD results to. \n\n## EXECUTION\n\nWhat follows is a diagram found in the report (see link to file above) that shows how to feed a configuration file (_JSON_ file) to a template to obtain a configured OpenFOAM simulation workspace. In the second stage of the diagram we find an explaination of how to automatically execute a series of linked simulations. For that the user must provide a list of OpenFOAM workspaces and an ordering list of execution.  \n\n\u003e [!IMPORTANT]  \n\u003e The __run__ folder is automatically generated as the storage location if non-existent when the automatic execution of simulation starts.\n\n\u003e [!IMPORTANT]\n\u003e Also, the configuration files used to template the OpenFOAM workspace are generated using a Python script. This script can be found in the submodule folder _OpenFOAM-ToolChain-helperFunctions_ (https://github.com/WyllDuck/OpenFOAM-ToolChain-helperFunctions), please visit that repository for further information. \n\n![SVG Image](images/workflow.svg)\n\n\u003e [!NOTE]\n\u003e For an easy and reliable setup of OpenFOAM in any local machine it is recommended to use 🐋Docker. For more information on how to use docker in combination with OpenFOAM go to https://github.com/jakobhaervig/openfoam-dockerfiles. The recommended docker file containing extra modules required to run this particular toolchain can be in the repository's main folder.  \n\n### EXAMPLE\n\nTo execute a single example CFD simulation using the toolchain in this repository follow these instructions:\n\n1. Create the specific OpenFOAM file using the templating software. Note that, you \u003cb\u003emust\u003c/b\u003e navigate to the \u003cb\u003etemplates\u003c/b\u003e folder and generate the \u003cb\u003etodo\u003c/b\u003e folder, or any other save location for the generated OpenFOAM workspaces.\n\n```bash\ncd templates\nmkdir -p ../todo\n./template_run.sh config.json rhoCentralFoam ../todo/rhoCentralFoamExample\n```\n\nThe \u003cb\u003etemplate_run.sh\u003c/b\u003e takes 3 parameters. First the address to the \u003ci\u003eJSON\u003c/i\u003e configuration file, then the address to the template file (all the templates should be stored in the \u003ci\u003etemplates\u003c/i\u003e folder), and finally the address where the newly generated OpenFOAM workspace will be stored. \n\n\u003e [!IMPORTANT]\n\u003e Modify the following parameters in the _JSON_ configuration file to tailor the OpenFOAM workspace to your specific machine and paths: mesh_file, nprocessors (multiply the numbers in the list to get the total nº of threads). \n\n2. Go to the _rocketMesh_ folder to generate the mesh that you will be using in this simulation.\n\n```bash\ncd ../rocketMesh/rocketShort/noFinSupport/R1\n./Allclean\n./Allrun\n```\n\nIt is recommended to first clean the workspace to make sure that no residual files remain in the project.\n\n3. Navigate to the main folder and run the OpenFOAM workspace generated in 1. that should be stored in the \u003ci\u003etodo\u003c/i\u003e folder.\n\n```bash\ncd ../../../..\n./run.sh input.txt rhoCentralFoamExample\n```\n\nThe _run.sh_ script takes 2 arguments. A list setting the order of execution of the simulations and the first element on the list that you want to execute. \n\n__OPTIONAL - MONITORING PLOTS__\n\n4. Monitoring residuals and aerodynamic coefficients of the CFD simulation being executed. You must use a new terminal since the previous terminal is occupied computing the CFD solutions.\n\n```bash\ncd postProcessingTools\n./plot_forceCoeffs.sh ../run/rhoCentralFoamExample/postProcessing/forceCoeffs1/0/coefficient.dat\n\n./plot_residuals.sh ../run/rhoCentralFoamExample/postProcessing/solverInfo1/0/solverInfo.dat\n```\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"images/residuals_central.svg\" alt=\"Image 1\" width=\"350\" /\u003e\n  \u003cimg src=\"images/coeffs_central.svg\" alt=\"Image 2\" width=\"450\" /\u003e\n\u003c/p\u003e\n\n__OPTIONAL - AFTER COMPUTATIONS DONE__\n\n6. Generated a report and predefined images for all simulations located in the _run_ folder, and a _CSV_ file containing all relevant metrics of all simulations in the _run_ folder. Note that in the current example only one simulation, _rhoCentralFoamExample_ should be in the _run_ folder. \n\n```bash\npython3 genAllTable.py run #FOLDER1 FOLDER2 FOLDER3 ...\n```\n\nThe Python script takes as arguments a list of path directories containing OpenFOAM workspaces. In this example, the OpenFOAM workspace _rhoCentralFoamExample_ is stored in the _run_ folder and no other location contains more OpenFOAM workspaces.\n\n\u003e [!IMPORTANT]\n\u003e This command will only generate images if the Python instruction _\"from paraview.simple import *\"_ if successfull. This requires a correct installation of Paraview which might be difficult depending on the user's programing experience. A solution is proposed in document _postProcessingTools/automaticImg/VTKtoIMAGE.py_ for the correct importation of the resource.\n\n### HOW TO ADD CONFIGURABLE PARAMETERS TO THE TEMPLATES\n\nNavigate to the example configuration _JSON_ file located in the main folder. This file must contain all the parameters that the selected template requires. Following the example previously presented you can visit the template _rhoCentralFoam_ and look for files with the extension _.j2_. This extension tells the _template_run.sh_ script that that file contains configurable parameters that must be written using Jinja2. Some of these parameters can be directly copied from the _JSON_ file, while others use Jinja2 logic (for loops, if conditions, etc.) which can be found in https://jinja.palletsprojects.com/en/2.10.x/\n\nTo add configurable parameters to a template follow these steps\n\n1. Change the extension of the file to _.j2_. It is recommended to use git's commands when changing the file's name to keep track of past changes.\n\n```bash\ngit mv file1 file1.j2\n```\n\n2. Add Jinja2 syntax (https://jinja.palletsprojects.com/en/2.10.x/) to template the file\n3. Add the new parameters to your _JSON_ configuration file. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyllduck%2Fopenfoam-toolchain-for-rocket-aerodynamic-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwyllduck%2Fopenfoam-toolchain-for-rocket-aerodynamic-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwyllduck%2Fopenfoam-toolchain-for-rocket-aerodynamic-analysis/lists"}