{"id":22127458,"url":"https://github.com/fluiddyn/fluidsimfoam","last_synced_at":"2025-10-12T09:30:50.638Z","repository":{"id":218330674,"uuid":"746031101","full_name":"fluiddyn/fluidsimfoam","owner":"fluiddyn","description":"Python framework for OpenFOAM (publish-only mirror). For issues and merge requests, https://foss.heptapod.net/fluiddyn/fluidsimfoam","archived":false,"fork":false,"pushed_at":"2024-01-23T12:53:33.000Z","size":1601,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"branch/default","last_synced_at":"2025-04-05T09:03:10.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluiddyn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2024-01-20T21:36:43.000Z","updated_at":"2025-01-23T07:00:37.000Z","dependencies_parsed_at":"2024-01-21T09:44:43.287Z","dependency_job_id":null,"html_url":"https://github.com/fluiddyn/fluidsimfoam","commit_stats":null,"previous_names":["fluiddyn/fluidsimfoam"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/fluiddyn/fluidsimfoam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluiddyn%2Ffluidsimfoam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluiddyn%2Ffluidsimfoam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluiddyn%2Ffluidsimfoam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluiddyn%2Ffluidsimfoam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluiddyn","download_url":"https://codeload.github.com/fluiddyn/fluidsimfoam/tar.gz/refs/heads/branch/default","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluiddyn%2Ffluidsimfoam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010939,"owners_count":26084837,"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-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2024-12-01T17:18:55.279Z","updated_at":"2025-10-12T09:30:50.014Z","avatar_url":"https://github.com/fluiddyn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Fluidsimfoam\n\n[![PyPI](https://img.shields.io/pypi/v/fluidsimfoam)](https://pypi.org/project/fluidsimfoam/)\n[![Documentation Status](https://readthedocs.org/projects/fluidsimfoam/badge/?version=latest)](https://fluidsimfoam.readthedocs.io/en/latest/?badge=latest)\n\nPython framework for [OpenFOAM]\n\n\u003c/div\u003e\n\n\u003c!-- start-intro --\u003e\n\n[OpenFOAM] is a very popular open-source C++ [CFD] framework. With\nFluidsimfoam, we try to **design and propose a new workflow for OpenFOAM\nbased on Python**. However, experienced OpenFOAM users won't be lost because\nFluidsimfoam produces in the end standard OpenFOAM cases and it's always\npossible to come back to the standard OpenFOAM workflow.\n\nFluidsimfoam can be seen as a workflow manager for OpenFOAM or a Python\nwrapper around OpenFOAM. It only uses OpenFOAM commands on the background\nand is thus NOT a rewrite of OpenFOAM!\n\nFluidsimfoam should be especially useful for:\n\n- automatisation of simulation launching for example for parametric studies or optimization,\n- programmatic generation of complex and parametrized input files (for example `blockMeshDict`) and initial conditions,\n- programmatic control of a simulation at runtime (an example\n  [here](https://foss.heptapod.net/fluiddyn/fluidsimfoam/-/tree/branch/default/doc/examples/scripts/2023sed-parametric)).\n\nHowever, Fluidsimfoam is not restricted to these usages and should be\nconvenient, especially for people knowing Python, for any OpenFOAM usages for\nwhich C++ programming is not needed.\n\nWorking with OpenFOAM implies writting and modifying a lot of input files\ndescribing a simulation. The method described in the official OpenFOAM\ndocumentations is to copy an existing simulation directory and to modify the\ninput files by hand.\n\nWith Fluidsimfoam, we introduce the possibility to describe not only one case\n(as shown in the [OpenFOAM tutorials]), but sets of similar simulations. The\ndescription of one set of simulations is done in Python (and possibly with\n[Jinja] templates) in a small Python package that we call a \"[Fluidsim] solver\".\n\n```{warning}\n\n\"[Fluidsim] solver\" and \"OpenFOAM solvers\" are very different things. A\nFluidsim solver is a small Python package describing a set of simulations.\nFluidsimfoam allows one to write Fluidsim solvers based for the simulations\non OpenFOAM.\n\n```\n\nAs shown in [our tutorials], with a Fluidsimfoam solver, it becomes very easy to\n\n- launch/restart simulations with Python scripts and terminal commands,\n- load simulations, read the associated parameters/data and produce nice figures/movies.\n\nThere are open-source solvers (some of them [are included in our main\nrepository](https://foss.heptapod.net/fluiddyn/fluidsimfoam/-/tree/branch/default/doc/examples))\nand it is not be difficult to write your own solver based on your OpenFOAM\ncases. For example, to produce a solver from an existing case, one can run\n\n```sh\nfluidsimfoam-initiate-solver cylinder -c $FOAM_TUTORIALS/basic/potentialFoam/cylinder\n```\n\nThis command creates a solver `fluidsimfoam-cylinder` that can be used to run\nthe simulation described in the [Flow around a\ncylinder](https://www.openfoam.com/documentation/tutorial-guide/2-incompressible-flow/2.2-flow-around-a-cylinder)\ntutorial. But this solver can very easily be improved to be parametrized and to\nproduce some input files programmatically. For example, the mesh of this\ntutorial is produced with the `blockMesh` OpenFOAM utility and the\n`blockMeshDict` is quite complex and contains a `#codeStream` directive (which\nimplies writting C++ and compilations). With Fluidsimfoam, you can avoid this\nstep and produce the `blockMeshDict` programmatically with a nice Python API\nand a nice mechanism to add and store parameters.\n\nThe best way to use Fluidsimfoam is to write or use a solver adapted for your\nparticular use case. However, one can also use Python functions and classes\nprovided by Fluidsimfoam for some common tasks, like parsing/writting input\nfiles, modifying field files, writting `blockMeshDict` files, etc.\n\nFluidsimfoam is now usable but still in quite early development. There are\nstill very low hangling fruits not yet implemented (for example, [restart\nutilities](https://foss.heptapod.net/fluiddyn/fluidsimfoam/-/issues/40),\n[production of figures and\nmovies](https://foss.heptapod.net/fluiddyn/fluidsimfoam/-/issues/38), etc.) and\nour documentation does not reflect what people can and will be able to do with\nthis tool. One goal is to get the equivalent of [Snek5000], our Fluidsim\nframework for the [CFD] code [Nek5000]. Looking at the [Snek5000] tutorials\nshould give a good idea of what Fluidsimfoam will soon allow.\n\n```{admonition} Contributing\n\nThis project is young and we need any kind of feedback and [contributions].\nDon't be afraid that the project is not hosted on Github. If you think that\nthis project is interesting please *star* [our repository on\nHeptapod](https://foss.heptapod.net/fluiddyn/fluidsimfoam) and/or [open\nissues](https://foss.heptapod.net/fluiddyn/fluidsimfoam/-/issues) with\nfeedback, feature requests or bug reports. Moreover, we would be very happy to\nwelcome new core developers, so if you like OpenFOAM and Python, do not\nhesitate!\n\n```\n\nFor our examples, we currently target OpenFOAM v2206 but it should be possible\nto write Fluidsimfoam solvers targeting any recent OpenFOAM versions.\n\n[fluiddyn]: https://fluiddyn.readthedocs.io\n[fluidsim]: https://fluidsim.readthedocs.io\n[fluidfoam]: https://fluidfoam.readthedocs.io\n[openfoam]: https://openfoam.org/\n[OpenFOAM tutorials]: https://www.openfoam.com/documentation/tutorial-guide\n[nek5000]: https://nek5000.mcs.anl.gov/\n[snek5000]: https://snek5000.readthedocs.io\n[Jinja]: https://jinja.palletsprojects.com\n[contributions]: https://fluidsimfoam.readthedocs.io/en/latest/CONTRIBUTING.html\n[our tutorials]: https://fluidsimfoam.readthedocs.io/en/latest/tutorials.html\n[CFD]: https://en.wikipedia.org/wiki/Computational_fluid_dynamics\n\n\u003c!-- end-intro --\u003e\n\nSee more in [Fluidsimfoam documentation](https://fluidsimfoam.readthedocs.org).\n\n## Install\n\n\u003c!-- start-install --\u003e\n\nCurrently, it still makes sense to install Fluidsimfoam like we, the\nfluidsimfoam developers, install it, i.e. in a dedicated controlled virtual\nenvironment created by [PDM]. After installing [PDM] (for example with\nsomething like `pipx install pdm`), the following commands should install and\nactivate the virtual environment:\n\n```sh\nhg clone https://foss.heptapod.net/fluiddyn/fluidsimfoam\ncd fluidsimfoam\npdm install\npdm venv activate\n```\n\n[pdm]: https://pdm-project.org\n\n\u003c!-- end-install --\u003e\n\n## Related projects\n\n- [Fluidfoam] Another [Fluiddyn] package (like Fluidsimfoam) to use/plot OpenFOAM\n  data. Will be used by Fluidsimfoam.\n\n- [PyFoam] ([PyPI package](https://pypi.org/project/PyFoam/),\n  [hg repo](http://hg.code.sf.net/p/openfoam-extend/PyFoam)) Python utilities for\n  OpenFOAM. GNU GPL. Still maintained.\n\n- [PythonFlu] ([wiki](https://openfoamwiki.net/index.php/Contrib_pythonFlu))\n\n- [Swak4Foam] Popular set of utilities for OpenFOAM. Can be used in\n  Fluidsimfoam solvers.\n\n[PyFoam]: https://openfoamwiki.net/index.php/Contrib/PyFoam\n[PythonFlu]: http://pythonflu.wikidot.com/\n[Swak4Foam]: https://openfoamwiki.net/index.php/Contrib/swak4Foam\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluiddyn%2Ffluidsimfoam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluiddyn%2Ffluidsimfoam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluiddyn%2Ffluidsimfoam/lists"}