SkillAgentSearch skills...

CfdOF

Computational Fluid Dynamics (CFD) for FreeCAD based on OpenFOAM solver

Install / Use

/learn @jaheyns/CfdOF
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

CfdOF: A Computational fluid dynamics (CFD) workbench for FreeCAD

This workbench aims to help users set up and run CFD analyses within the FreeCAD modeller, and serves as a front-end (GUI) for the popular OpenFOAM® CFD toolkit (www.openfoam.org, www.openfoam.com). It guides the user in selecting the relevant physics, specifying the material properties, generating a mesh, assigning boundary conditions and choosing the solver settings before running the simulation. Best practices are built in to maximise the stability of the solvers.

screenshot

Disclaimer: This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM® and OpenCFD® trade marks

Features

Current:

Flow physics

  • Incompressible, laminar flow (simpleFoam, pimpleFoam)
  • Support for various RANS, LES and DES turbulent flow models
  • Incompressible free-surface flow (interFoam, multiphaseInterFoam)
  • Compressible buoyant flow (buoyantSimpleFoam, buoyantPimpleFoam)
  • High-speed compressible flow (HiSA)
  • Porous regions and porous baffles
  • Basic material database
  • Flow initialisation with potential flow solver
  • Solution of arbitrary passive scalar transport functions

Meshing

  • Cut-cell Cartesian meshing with boundary layers (cfMesh)
  • Cut-cell Cartesian meshing with baffles and moving mesh regions (snappyHexMesh)
  • Tetrahedral meshing using Gmsh, including conversion to polyhedral dual mesh
  • Post-meshing check mesh
  • Support for dynamic mesh adaptation for supported solvers

Post-processing and monitoring

  • Postprocessing using Paraview
  • Basic support for force-based function objects (Forces, Force Coefficients)
  • Basic support for probes

Other features

  • Runs on Windows 7-11 and Linux
  • Unit/regression testing
  • Case builder using an extensible template structure
  • Macro scripting

Platforms supported

Linux

Any system on which FreeCAD and the prerequisites listed below can be installed.

Windows

Windows 7-11; 64-bit version is required.

macOS

Not widely tested, but success has been reported. See the following forum post for instructions.

Getting started

Prerequisites

The CfdOF workbench depends on the following external software, some of which can be automatically installed (see below for instructions).

Setting up the CfdOF workbench

Windows

The latest release or development FreeCAD build can be obtained (64 bit version) and installed by respectively running the installer or extracting the .7z archive to a directory <FreeCAD-directory>. In the latter case, FreeCAD can be run in place (<FreeCAD-directory>\bin\FreeCAD.exe).

CfdOF itself is installed into FreeCAD using the Addon manager:

  • Run FreeCAD
  • Select Tools | Addon manager ...
  • Select CfdOF in the list of workbenches, and click "Install/update"
  • Restart FreeCAD
  • For installation of dependencies, see below

Note: The CfdOF workbench can be updated at any time through the Addon manager.

Dependency installation

Dependencies can be checked and installed conveniently from the CfdOF Preferences panel in FreeCAD. In the FreeCAD window, select CfdOF | Open preferences. The dependencies can be installed as individual components or as part of a docker container (refer to the Docker container install section below).

The OpenFOAM installation is via the BlueCFD Core port of OpenFOAM (version 2024-1) or the OpenCFD MinGW package. Note that only version 2212 of the latter is currently supported due to an apparent bug affecting the operation of the createPatch utility in later versions.

OpenFOAM can be installed manually using the above links, or by clicking the relevant button in the Preferences panel described above. If you experience problems running OpenFOAM in CfdOF, please make sure you have a working installation by following instructions on the relevant websites.

To interface correctly with the OpenFOAM installation, CfdOF needs to be able to write to its install location. Some users experience problems using a location inside C:\Program Files due to restrictions imposed by Windows User Account Control. It is therefore suggested to install to an alternative location, preferably in your home directory.

If OpenFOAM is installed with administrator privileges using the above packages, then Microsoft MPI will also optionally be installed. If not, then it will be necessary to download and install it manually from here. MPI is needed in order to run in parallel.

Set the OpenFOAM install directory in the preferences panel to the BlueCFD install directory, or the directory ending in the 'vXXXX' subfolder (where XXXX is the version number installed) in the case of the MinGW package. It will be automatically detected in the default install locations.

Any version of ParaView can be installed, by following the above link or clicking the relevant button in the Preferences panel. Set the ParaView install path in the preferences panel to the 'paraview.exe' file in the 'bin' subfolder of the ParaView installation. Common defaults will be detected if it is left blank.

Likewise, cfMesh and HiSA can be installed from the Preferences panel. Do not close it until the 'Install completed' message is received. Note that the OpenFOAM installation must be in a writable location for cfMesh and HiSA to be installed successfully.

Choosing the "Check dependencies" option will verify that all prerequisites have been successfully installed.

Linux

AppImages of the latest release or development versions of FreeCAD can be downloaded and run directly without installation. Note that you will have to enable execution permission on the downloaded file to run it. Otherwise, FreeCAD can be built from the source code at https://github.com/FreeCAD/FreeCAD .

Note:

  • Installations of FreeCAD via Linux package managers make use of your local Python installation. Therefore you might need to install additional Python packages to get full functionality. The dependency checker (see below) can help to diagnose this.
  • Note that the 'Snap' container installed through some distributions' package managers can be problematic as it does not allow access to system directories, and therefore OpenFOAM has to be installed in the user's home directory to be runnable from FreeCAD.
  • The 'Flatpak' version of FreeCAD requires the default output deirectory to be in the user's home directory. For example: /home/<USER>/cfdof.

For the reasons above we recommend the AppImage as the most robust installation option on Linux.

CfdOF itself is installed into FreeCAD using the Addon manager:

  • Run FreeCAD
  • Select Tools | Addon manager ...
  • Select CfdOF in the list of workbenches, and click "Install/update"
  • Restart FreeCAD
  • For installation of dependencies, see below

Note: The CfdOF workbench can be updated at any time through the Addon manager.

Dependency installation

Dependencies can be checked and some of them installed conveniently from the CFD Preferences panel in FreeCAD. In the FreeCAD window, select Edit | Preferences ... and choose "CfdOF".

The dependencies can be installed manually, or as part of a docker container (refer to Docker container install below). Manual installation may be undertaken for OpenFOAM (Foundation or OpenCFD versions), Paraview and Gmsh (optional) by using the links above or your distribution's package manager. Note, however, that the OpenFOAM packages bundled in some Linux distributions may be out of date or incomplete; for example, the standard Debian and Ubuntu packages do not include the build command 'wmake' and therefore cannot be used with the optional components 'HiSA' and 'cfMesh'. We therefore recommend installation of the packages supplied through the official websites above. Please make sure the install the 'development' package where available (usually named with the suffix '-devel' or '-dev') to be sure that the optional components 'HiSA' and 'cfMesh' can be compiled with 'wmake'.

Set the OpenFOAM install directory in the preferences panel - examples of typical install locations are /opt/openfoam10 /usr/lib/openfoam/openfoam2306, or /home/user/OpenFOAM/OpenFOAM-10 (it will be automatically detected in common default install locations). Note that if you have loaded the desired OpenFOAM environment already before starting FreeCAD, the install directory should be left blank.

cfMesh and HiSA can be installed using the Preferences panel described above, and can be downloaded and built from t

Related Skills

View on GitHub
GitHub Stars639
CategoryDevelopment
Updated14h ago
Forks120

Languages

Python

Security Score

100/100

Audited on Mar 24, 2026

No findings