Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iydon/of.yaml
Python Interface to OpenFOAM Case (Configured Using YAML)
https://github.com/iydon/of.yaml
openfoam python yaml
Last synced: 2 months ago
JSON representation
Python Interface to OpenFOAM Case (Configured Using YAML)
- Host: GitHub
- URL: https://github.com/iydon/of.yaml
- Owner: iydon
- License: gpl-3.0
- Created: 2022-01-10T15:33:26.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-31T18:03:32.000Z (over 1 year ago)
- Last Synced: 2024-10-11T23:48:52.432Z (3 months ago)
- Topics: openfoam, python, yaml
- Language: Python
- Homepage: https://pypi.org/project/ifoam
- Size: 8.63 MB
- Stars: 16
- Watchers: 5
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Citation: CITATION.cff
Awesome Lists containing this project
README
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![GPL-3.0 License][license-shield]][license-url]
๐ขโฌ๐ฉโฌ๐ฉ
โฌโฌโฌโฌโฌ
๐ฉโฌ๐ฉโฌ๐ฉ
โฌโฌโฌโฌโฌ
๐ฉโฌ๐ฉโฌ๐ฉ
OpenFOAM.YAML
Python Interface to OpenFOAM Case (Configured Using YAML)
Explore the docs ยป
View Demo/Tutorial
ยท
Report Bug
ยท
Request Feature
Table of Contents
## About the Project
This repository was originally designed to solve the problem of complex OpenFOAM case structure, and the solution was to re-present the original cases using the common configuration file format YAML. Later, since there is a corresponding package for the YAML format in Python, I wrote this Python interface package for OpenFOAM, and then I added progress bars to most OpenFOAM solvers by analyzing log files in real time. Although there are still many details to be specified in this repository, its function of generating cases and calling solvers is ready for preliminary use, for example, I used this package to generate cases in batch in my own project. In the future I would like to integrate the post-processing steps into this interface package as well.
## Getting Started
This project currently uses Poetry to manage Python dependencies. I've heard good things about [PDM](https://github.com/pdm-project/pdm) so far, and may provide PDM support subsequently.
### Installation
```sh
pip3 install ifoam[full]
```### Demo
Save the following demo code as a separate file (e.g. `demo.py`).
```python
from foam import Foamfoam = Foam.fromDemo('cavity')
foam['foam']['system', 'controlDict', 'endTime'] = 1.0
foam.save('cavity')
foam.cmd.all_run()
```Running the demo code in the virtual environment results in the following output.
```sh
$ python demo.pyFoam.fromPath('.../of.yaml/foam/demo/7/cavity.yaml', warn=False)
Running blockMesh on .../of.yaml/cavity using 1 processes if in parallel
Running icoFoam on .../of.yaml/cavity using 1 processes if in parallel
100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 1.0/1.0 [00:02<00:00, 2.24s/it]
```## Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repository and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request## License
Distributed under the GPL-3.0 License. See `LICENSE.txt` for more information.
## Contact
Iydon Liang - [@iydon](https://github.com/iydon) - liangiydon_AT_gmail.com
[contributors-shield]: https://img.shields.io/github/contributors/iydon/of.yaml.svg?style=for-the-badge
[contributors-url]: https://github.com/iydon/of.yaml/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/iydon/of.yaml.svg?style=for-the-badge
[forks-url]: https://github.com/iydon/of.yaml/network/members
[stars-shield]: https://img.shields.io/github/stars/iydon/of.yaml.svg?style=for-the-badge
[stars-url]: https://github.com/iydon/of.yaml/stargazers
[issues-shield]: https://img.shields.io/github/issues-closed/iydon/of.yaml.svg?style=for-the-badge
[issues-url]: https://github.com/iydon/of.yaml/issues
[license-shield]: https://img.shields.io/github/license/iydon/of.yaml.svg?style=for-the-badge
[license-url]: https://github.com/iydon/of.yaml/blob/master/LICENSE.txt