foamlib: A modern Python interface for interacting with OpenFOAM
Palabras clave:
OpenFOAM, Python, testing, SlurmResumen
We introduce foamlib, an open-source Python library developed for the purpose of interacting with OpenFOAM. foamlib provides an object-oriented interface for pre-processing, executing, and post-processing OpenFOAM cases, with capabilities for accessing and editing their related files. foamlib is mainly targeted towards testing and optimization runs, which commonly require executing a large number of different cases and analyzing their results programmatically. It has the capability to autodetect the steps needed to run a case, and will automatically arrange tasks so that multiple cases can run simultaneously without oversubscribing the available CPUs. It can even orchestrate runs across computing nodes in a Slurm-based cluster environment. foamlib includes its own custom parser and serializer for OpenFOAM files, which allows reading and writing these files even on systems without an OpenFOAM installation.In comparison with other related libraries also available, foamlib supports Python versions from 3.7 up to the latest release, and allows users to take advantage of modern Python features such as type checking and asynchronous programming. It can also read and write fields stored in files using OpenFOAM's optional mixed text/binary format. foamlib is distributed under a GPLv3 license as a registered Python package, as well as in the form of Docker images. It is compatible with the two major distributions of OpenFOAM.
Descargas
Publicado
Número
Sección
Licencia
Derechos de autor 2024 Asociación Argentina de Mecánica Computacional

Esta obra está bajo una licencia internacional Creative Commons Atribución 4.0.
Esta publicación es de acceso abierto diamante, sin ningún tipo de costo para los autores ni los lectores.
Solo se publicarán aquellos resúmenes que han sido aceptados para su publicación y han sido presentados en el congreso de AMCA.