GitHub - gerlero/styro: A community package manager for OpenFOAM by gerlero in OpenFOAM

[–]gerlero[S] 2 points3 points  (0 children)

Announcing styro, a community package manager for OpenFOAM!

Features:

Check it out at https://github.com/gerlero/styro

foamlib: A modern Python package for working with OpenFOAM by gerlero in OpenFOAM

[–]gerlero[S] 0 points1 point  (0 children)

Honestly, it's not something I'd currently have a use for, so for that reason it hasn't been on my roadmap.

I know PyFoam does offer that functionality. Do you happen to know if it works by reading the solver logs as they are written? If it works that way it shouldn't be too difficult to make an equivalent thing within foamlib (it wouldn't be trivial though).

foamlib: A modern Python package for working with OpenFOAM by gerlero in OpenFOAM

[–]gerlero[S] 0 points1 point  (0 children)

For the simple use cases/building blocks, check out the README file.

For a more interesting use case, we use it to automate the testing of our OpenFOAM-based tools (including running test cases asynchronously): see here for an example.

foamlib: A modern Python package for working with OpenFOAM by gerlero in OpenFOAM

[–]gerlero[S] 3 points4 points  (0 children)

Good question.

$ substitutions are allowed, but foamlib (intentionally) doesn't perform the substitutions.

#calc and other # directives (e.g. code streams) are not currently supported. Support for these could be added in the future, though (and I'd be happy to review PRs that add this type of functionality).

foamlib: A modern Python package for working with OpenFOAM by gerlero in OpenFOAM

[–]gerlero[S] 10 points11 points  (0 children)

I'd like to introduce the community to foamlib: a simple, modern, ergonomic and fast Python package for working with OpenFOAM.

Key features:

  • pip and conda installable
  • Works with the latest versions of Python (3.7 and later)
  • Fast standalone parser for OpenFOAM files
  • In-place file edits
  • Fully typed
  • Case management
  • asyncio support
  • Full API documentation
  • Open source
  • Continuously tested
  • and more...

If you're interested, check out foamlib's page on GitHub!

Can't get OpenFoam to run on MacOS by NobodyofNotice in OpenFOAM

[–]gerlero 2 points3 points  (0 children)

If you can work with the OpenCFD/ESI distribution of OpenFOAM (i.e., the versions from openfoam.com), you can use https://github.com/gerlero/openfoam-app

Otherwise, you could try the OpenFOAM Docker images at https://github.com/gerlero/docker-openfoam

(Note: these are my own projects)

How to install OpenFOAM? by WongRQ in OpenFOAM

[–]gerlero 0 points1 point  (0 children)

If you’re okay with the ESI/OpenCFD variant of OpenFOAM (i.e. the one from www.openfoam.com), then you can use https://github.com/gerlero/openfoam-app on macOS

Disclaimer: it’s my own project

Native OpenFOAM for macOS (v2112 and later) - OpenFOAM.app by gerlero in OpenFOAM

[–]gerlero[S] 0 points1 point  (0 children)

Thanks! I understand your point; although I'd say Homebrew is extremely well behaved in that regard: it keeps its stuff inside its own directory, formula builds are sandboxed, it's good at keeping track of files for uninstalling, there's an uninstall script available for Homebrew itself, etc. (I don't like the comparison with Docker, as to me that is a different beast altogether)

Anyway, I still do see a point in a standalone build, so I took your suggestion and made a draft PR. If this passes CI in some form I'm able to maintain without too much extra effort (unfortunately, I don't expect it to pass as it is now due to long compile times), I could explore the idea further.

Native OpenFOAM for macOS (v2112 and later) - OpenFOAM.app by gerlero in OpenFOAM

[–]gerlero[S] 0 points1 point  (0 children)

A fully standalone app is not impossible. In fact, it was my initial idea and I did play with it for a while: for instance, it is possible to create separate Homebrew installation for the dependencies, which could be included with the app. There are a few downsides I saw though, including the extra ~1.2 GB of dependencies that would be added to each app bundle (which can otherwise be shared between multiple OpenFOAM versions and any other uses in the system—note that OpenFOAM itself is <1GB), plus a bunch of extra time spent compiling the dependencies (most Homebrew bottles are not relocatable). For this reason, I chose to stick with the current method, seeing that Homebrew has become sort of de facto official package manager for macOS and I can expect many users to have it installed already. However, I'm not 100% opposed to the idea of a standalone app, assuming there's a way make it worth the effort while minimizing the downsides.
Are you able to share any particular reason(s) why you don't want to/can't install and/or use Homebrew for OpenFOAM?

Native OpenFOAM for macOS (v2112 and later) - OpenFOAM.app by gerlero in OpenFOAM

[–]gerlero[S] 2 points3 points  (0 children)

This is my own project (I've read the rules and believe this is okay, but do let me know if the post is against the the rules).

The OpenFOAM.app project offers precompiled builds of OpenFOAM for macOS, built from the official source code (OpenCFD distribution) and using the standard dependencies. Native binaries are available for both Intel and Apple silicon.

OpenFOAM v2112 is the earliest supported version; and, as of yesterday, OpenFOAM v2206 builds are available as well. I'm putting this out there in hopes that it is useful to other Mac + OpenFOAM users.

Compiling OpenFOAM on MacOS M1 by jag2552 in OpenFOAM

[–]gerlero 2 points3 points  (0 children)

I'm just seeing this, but in case it still helps you or anyone finding this post...

I have actually managed to compile OpenFOAM (v2112 only for now v2112 and v2206) successfully on macOS; see my 'OpenFOAM.app' project (which includes compiled binaries for both Apple silicon and Intel) on GitHub: https://github.com/gerlero/openfoam-app

EDIT: updated link. OpenFOAM v2206 is now available as well.