A new series of 10 tutorials about Freecad CfdOf

The collection of tutorials can be seen here: https://youtube.com/playlist?list=PL9H9jQE7y0a5jhlyACRzsdfnx-42AYCCX

I attached the models. In order to keep the file size small, I deleted the mesh, so create the mesh before running the simulation. Please note that I recorded the tutorials before the change in 2D modelling:https://forum.freecadweb.org/viewtopic.php?f=37&t=66741

Thanks to the German “Kurzarbeit” (= short-time work) and Corona lockdown, I had time to record some tutorials about Freecad CfdOF. Of course, there are a lot of real good tutorial. My objective was to record tutorials for advanced users and tutorials that provide a deeper understanding of the methods in CFD.

The tutorials #2 - #5 can be regarded as a verification of CFD, the results of the CFD-simulation are compared to analytical solutions. These tutorials show the difference between a laminar flow and a turbulent flow, the use of boundary conditions and show how to add boundary conditions that are not given in the CfdOF Workbench itself. Tutorials #8, #9 and #10 are advanced tutorials, they show how to set up a simulation with 2 phasis, a transient simulation and how to invoke a new solver (rhoPimpleFoam).

I really enjoyed recording these tutorials, I hope you enjoy watching them as well. When I started with Freecad, many tutorials - especially the tutorials by r-frank, anisim and Pawel Lojek - helped me a lot. I am very grateful for that. I hope that my tutorials will make the CfdOF community even bigger and that more users will use this marvellous software.

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: German/Germany (de_DE)

Tutorial #1: Getting started

This tutorial shows how to install Freecad CfdOF and how to build up a simple simulation.

Physics Model: steady, single phase, incompressible, Viscous, Turbulence (RANS)
3D Model
Fluid: Water
Mesher: CfMesh
Solver Openfoam: SimpleFoam
Link:https://youtu.be/OS4sbbBtZUw
Tutorial #5 Journal Bearing.FCStd (21.9 KB)
###############################################################################

Tutorial #2: Tube Flow

In this tutorial, the flow of water in a tube with a diameter shift was calculated. In order to show the effects of a laminar and a turbulent flow, both physics models were used and compared. These results were compared with the analytical solution.

Physics Model: steady, single phase, incompressible, Viscous
In order to show the difference between turbulent and laminar flow, both models were calculated
3D Model
Fluid: Water
Mesher: CfMesh with refinements
Solver Openfoam: SimpleFoam
Link: https://youtu.be/Vo6PRvtJYVc
Tutorial #4 Couette Flow.FCStd (12.3 KB)
################################################

Tutorial #3: Simulation of 2 Plates

The simplicity of this model is hard to beat: This model only contains one cube. The boundary conditions inlet and outlet are not used for the simulation, specifying a velocity on the upper surface of the cube is sufficient. The velocity distribution that results in this model is very close to Newton’s definition of shear stress tau, so the forces determined in the CFD can be compared with the analytical model.

Physics Model: steady, single phase, incompressible, Viscous
In order to show the difference between turbulent and laminar flow, both models were calculated
3D Model
Fluid: Oil
Mesher: gMesh with refinements
Solver Openfoam: SimpleFoam
Link: https://youtu.be/5HMtEuLlsto
Tutorial #3 Simulation of 2 plates.FCStd (17 KB)
#################################################

Tutorial #4: Couette Flow

Again, a very simple model: The geometrical body is a hollow tube, generated in the part workbench. The boundary condition “rotatingWallVelocity” cannot be generated with Freecad CfdOF, for this reason, the “U” file must be edited. This simulation is equal to the Couette equations, as a verification of CFD, the resulting torques are compared.

Physics Model: steady, single phase, incompressible, Viscous, laminar flow
3D Model
Fluid: Oil
Mesher: CfMesh
Solver Openfoam: SimpleFoam
Link: https://youtu.be/Gu5qhZ6UL9g
Tutorial #2 Tube Flow.FCStd (24.1 KB)
#############################################

Tutorial #5: Journal bearing

Journal bearings are used in mechanical engineering to support shafts. This tutorial is very similar to the tutorial with the Couette flow. The difference is the eccentricity of the shaft. This eccentricity leads to a lifting force. This lifting force is compared to an analytical solution.

Physics Model: steady, single phase, incompressible, Viscous, turbulence (RANS)
3D Model
Fluid: Oil
Mesher: CfMesh with refinements
Solver Openfoam: SimpleFoam
Link: https://youtu.be/JtUuMXlOV6k
Tutorial #1 Getting started.FCStd (21.8 KB)

Tutorial #6: Flow around a car

In order to build up a simulation model, a simple car is created using the part design workbench. The air resistance and the lifting force is calculated. With the force generated by the air resistance and the area of the vehicle, the drag coefficient cw can be calculated.

Physics Model: steady, single phase, incompressible, Viscous, turbulence (RANS)
3D Model
Fluid: Air
Mesher: CfMesh with refinements
Solver Openfoam: SimpleFoam
Link: https://youtu.be/KWbUaiE9SBc
Tutorial #8 simulation of a flow with 2 phasis.FCStd (31.5 KB)
#######################################################

Tutorial #7: Wind Turbine

Torque is generated by converting a flow into a rotation on the rotor blades. In this tutorial, a very simple model of a wind turbine is created using the Part Workbench. To create the boundary condition “RotatingWallVelocity”, the “U” file containing the speeds is edited.

Physics Model: steady, single phase, incompressible, Viscous, turbulence (RANS)
3D Model
Fluid: Air
Mesher: CfMesh with refinements
Solver Openfoam: SimpleFoam
Link:https://youtu.be/Q10MbSFEiEM
Tutorial #7 Wind Turbine.FCStd (41.3 KB)
################################

Tutorial #8: Simulation of a 2 phasis flow

The use of a multi-phase physics model is shown in this tutorial. Using the part design workbench, a simple model is built up.

Physics Model: transient, multi-phase, incompressible, Viscous, laminar
2D Model
Fluid: Water / Air
Mesher: gmesh
Solver Openfoam: Interfoam
Link: https://youtu.be/H5vWh0NG6z0
Tutorial #6 Flow around a car.FCStd (245 KB)
Please note that this tutorial was created before the change in 2D-modelling: https://forum.freecadweb.org/viewtopic.php?f=37&t=66741

####################################################

Tutorial #9: von Karman vortex

The need for a transient simulation is shown in this tutorial: In this simulation, air flows around a pillar. After a short time, vortices form as a result of vibration processes, the so-called Karman vortices.

Physics Model: transient, single phase, incompressible, Viscous, laminar
2D Model
Fluid: Air
Mesher: gmesh
Solver Openfoam: PimpleFoam
Link: https://youtu.be/gzDfP9ohJdA

Regarding the simulation model, I had asked a question in the forum, many thanks to thschrader for his great help: https://forum.freecadweb.org/viewtopic.php?f=37&t=58848

Please note that this tutorial was created before the change in 2D-modelling: https://forum.freecadweb.org/viewtopic.php?f=37&t=66741
Tutorial #10 Organ Pipe.FCStd (35.4 KB)
############################################################################

Tutorial #10: Organ Pipe

The development of the model took a long time and was very complicated, but the result is impressive: The excitation and vibration behavior of an organ pipe can also be simulated with FreeCad CfdOF.

This video shows by comparing incompressible flow with compressible flow why a compressible physics model must be used to calculate the vibrational behaviour of an air column. Freecad CfdOF can address a solver (“buoyantPimpleFoam”) that can calculate a compressible physics model, but test calculations showed that the solution will not converge.

Physics Model: transient, single phase, compressible, Viscous, laminar
2D Model
Fluid: Air
Mesher: CfMesh with refinements
Solver Openfoam: rhoPimpleFoam
Link: https://youtu.be/JbTz6gHiEsc

Please note that this tutorial was created before the change in 2D-modelling: https://forum.freecadweb.org/viewtopic.php?f=37&t=66741
Tutorial #9 von Karman vortex.FCStd (23.7 KB)

Well done, these are really great.

Did some tutorials with the new cfdof version.
Thanks for your work, very interesting stuff!
TechBernd_tuto8.FCStd (23.4 KB)
TechBernd_tuto10.FCStd (29.9 KB)
TechBernd_tuto9.FCStd (21.5 KB)
Done with bluecfd-core 2020 and
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27428 (Git)
Build type: Release
Branch: master
Hash: 27460358508a2057e0ec57a418641435f12628dd
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: German/Germany (de_DE)

Thank you for sharing this. YouTube tutorials for CfdOF and FEM workbenches are always appreciated. I plan to prepare some in the near future too.

Wow, quite a body of work!
Though isn’t it better to use v0.20 for FEM related activities?

A very usefully series !
A couple of time you referee to some PDF-tutorials named “CFD Tutorial xx” - Do you know a place where they can be obtained somehow ?

A suggestion for a new video: How to make a CFD with two (or more) incoming flow with different densities and velocities. For example like the one I have attached with a pipe with an airflow sticking into an big air stream. Blue surfaces are inlets. Without assuming “potential flow”.

/Rene’
RSH_Two_Flows.FCStd (30.3 KB)

The PDF toy referenced would be much appreciated:). Thank you for the tutorials.

bernd did you see this?

Great series. I just found the playlist the other day. I’m slowly making my way through them. Thanks for sharing them.

Tutorial #11: Simple Combustion with reactingFoam

I’m very excited to announce the latest release: I’ve recorded a new tutorial about reactingFoam. Methane and air react in a reactor vessel. The “conversion” of the solver from PimpleFoam to reactingFoam and the review of the results with Paraview is shown.

The hottest video I have ever recorded - temperatures above 2000 K were achieved.

The openFoam-tutorial that I used as a template for reactingFoam can be found here:
https://github.com/OpenFOAM/OpenFOAM-6
https://github.com/OpenFOAM/OpenFOAM-6/tree/master/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D

Physics Model: transient, multiple phasis with chemical reactions, viscous, laminar flow
2D Model
Fluid: methane, air, water, carbon dioxide
Mesher: CfMesh
Solver Openfoam: reactingFoam
Link: https://youtu.be/TnPm4SVmdp0
Tutorial #11 Simple Combustion.FCStd

Great idea :sunglasses:

The super YouTube CFD videos bring me to this forum.

Well done.

Tutorial #12: Simple Combustion with reactingFoam

In addition to my tutorial #11, I have recorded the next tutorial about explosive combustion using reactingFoam.

The openFoam-tutorial that I used as a template for reactingFoam can be found here:
https://github.com/OpenFOAM/OpenFOAM-6
https://github.com/OpenFOAM/OpenFOAM-6/tree/master/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D

The original goal was to set up a simulation similar to combustion in an internal combustion engine. I was only partially able to do this due to the instability of reactingFoam. Nevertheless, I have shown that this type of combustion can be simulated with reactingFoam.

Physics Model: transient, multiple phasis with chemical reactions, viscous, laminar flow
2D Model
Fluid: methane, air, water, carbon dioxide
Mesher: CfMesh
Solver Openfoam: reactingFoam
Link to the video: https://youtu.be/fvdZFCL6DHM
Tutorial#12_ExplosiveCombustion.FCStd

Tutorial #13: Kelvin-Helmholtz instability with interFoam

I recorded a new tutorial about the Kelvin-Helmholtz instability. The resulting vortices are awesome.

For this simulation, I tried to use the dynamic refinement, but this leads to an error:
Error Dynamic Mesh Refinement.JPG
For this reason I used a very high-resolution mesh with an edge length of 0.5 mm. This increases the computing time on my computer to 2 hours and 44 minutes.

I took the experimental setup from the video by “Sixty Symbols” and the University of Nottingham, it’s a video well worth seeing: https://youtu.be/mf_143gkKSQ

Physics Model: transient, multiple phasis, viscous, laminar flow
2D Model
Fluid:water / Sea Water
Mesher: CfMesh
Solver Openfoam: interFoam
Link to the video: https://youtu.be/w7ZKDwps1p4

Please find the model attached.

Tutorial #14: Simulation of Bubbles with InterFoam

In this video tutorial I tried to simulate air bubbles in water. The result is quite pleasing, but due to the fact that surface tension is not taken into account, the bubbles look different. In this tutorial, a material flow is used for the multiphase simulation with the Interfoam solver, i.e. there is an inlet and an outlet.

Physics Model: transient, multiple phasis, viscous, laminar flow
2D Model
Fluid:water / air
Mesher: CfMesh
Solver Openfoam: interFoam
Link to the video: https://youtu.be/6Z3n_nfo5AU

Please find the model attached.

Thanks for the new video.
Surface-tension: you can edit the sigma-parameter in transportProperties.
surface_tension.JPG
I ran the sim using a finer mesh + surface-tension, to get a better resolution of the bubbles.
max cell size 0,25 mm, 200000 cells. But there are still bubbles (the blue ones) with a smeared out
alpha-air, so the resolution is still too coarse.
bubbles.JPG

thschrader : Thank you very much for your comments on the consideration of surface tensions in InterFoam! I linked your post in the description of my YouTube video.

Hallo,

can you tell me how to add surface tension?

Thank you in advance!