Let’s Talk about Openfoam, Salome and Turbulent Flow Simulation :)

In this 5th tutorial, we will look into how to build an OpenFoam model from scratch by using Salome to do the CAD processing and the Meshing!

I’ll also give you some useful bits of knowledge about turbulence modeling in CFD analysis, so I hope this will be useful!

**Here’s the video:**

**What you will learn in this video:**

- How to prepare the Geometry in Salome
- How to mesh the inner Volume in Salome
- How to prepare the OpenFoam Case Study
- How to choose the OpenFoam Solver
- How to choose the turbulence Model
- How to convert the Mesh to OpenFoam
- How to set up all the OpenFoam Boundary Conditions and settings
- How to set up the residuals monitoring
- How to solve the simulation with PisoFoam
- How to check the convergence of the residuals
- How to post-processing the results with ParaFoam (Paraview)

If this video was helpful, please leave a like and subscribe to my channel, thank you!!

*What is Openfoam?*

Openfoam is currently the leading free and open-source solver for Computational Fluid Dynamics (CFD). It belongs to the Openfoam foundation and it is distributed under a GPL License. This GPL License gives you the freedom to redistribute the software and it garanties that the usage will remain free.

**Download the CAD File:**

https://www.mediafire.com/file/6kgn24035c8urk8/inner_flow_pipe.step/file

**Download all the files:**

https://www.mediafire.com/file/yrnh7i6kn8inylc/innerFlow3.zip/file

If you have any question of comment, let me know!

**Cyprien “OpenFoam with Salome is Awesome” Rusu**

Harish Kadam says

Thank you for detailed explanation. I am new to OpenFoam. I followed all steps suggested by you in this video, but facing time step continuity error,

$ pisoFoam

/*—————————————————————————*\

| ========= | |

| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |

| \\ / O peration | Version: 4.x |

| \\ / A nd | Web: http://www.OpenFOAM.org |

| \\/ M anipulation | |

\*—————————————————————————*/

/* Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt *\

| Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com |

\*—————————————————————————*/

Build : 4.x-f59a08eaaf41

Exec : C:/PROGRA~1/BLUECF~1/OpenFOAM-4.x/platforms/mingw_w64GccDPInt32Opt/bin/pisoFoam.exe

Date : Nov 16 2021

Time : 10:16:58

Host : “TECHNICHED14”

PID : 14792

Case : C:/users/harish.kadam/desktop/blueCFD/pipeflowturbulent

nProcs : 1

SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

fileModificationChecking : Monitoring run-time modified files using timeStampMaster

allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Create time

Create mesh for time = 0

PISO: Operating solver in PISO mode

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian

Selecting turbulence model type RAS

Selecting RAS turbulence model kEpsilon

kEpsilonCoeffs

{

Cmu 0.09;

C1 1.44;

C2 1.92;

C3 0;

sigmak 1;

sigmaEps 1.3;

}

No MRF models present

No finite volume options present

Starting time loop

Time = 1e-005

Courant Number mean: 1.25476e-005 max: 0.00742262

smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 5.74174e-007, No Iterations 2

smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 4.23099e-007, No Iterations 2

smoothSolver: Solving for Uz, Initial residual = 1, Final residual = 4.57543e-007, No Iterations 2

GAMG: Solving for p, Initial residual = 1, Final residual = 0.0464107, No Iterations 8

GAMG: Solving for p, Initial residual = 0.135765, Final residual = 0.00592209, No Iterations 1

GAMG: Solving for p, Initial residual = 0.0147659, Final residual = 0.00124552, No Iterations 1

time step continuity errors : sum local = 1.30031e-005, global = -3.81812e-007, cumulative = -3.81812e-007

GAMG: Solving for p, Initial residual = 0.00310257, Final residual = 0.000175858, No Iterations 2

GAMG: Solving for p, Initial residual = 0.00183327, Final residual = 0.000108886, No Iterations 1

GAMG: Solving for p, Initial residual = 0.000368488, Final residual = 2.00613e-005, No Iterations 3

time step continuity errors : sum local = 2.08304e-007, global = 6.43939e-009, cumulative = -3.75373e-007

GAMG: Solving for p, Initial residual = 0.000487098, Final residual = 2.6444e-005, No Iterations 1

GAMG: Solving for p, Initial residual = 0.000167354, Final residual = 1.17508e-005, No Iterations 1

GAMG: Solving for p, Initial residual = 0.000121706, Final residual = 6.66707e-007, No Iterations 5

time step continuity errors : sum local = 6.90125e-009, global = -2.79893e-010, cumulative = -3.75653e-007

smoothSolver: Solving for epsilon, Initial residual = 0.00433322, Final residual = 2.53814e-007, No Iterations 2

smoothSolver: Solving for k, Initial residual = 1, Final residual = 3.0396e-006, No Iterations 3

ExecutionTime = 1.149 s ClockTime = 2 s

Time = 2e-005

Courant Number mean: 0.00453989 max: 0.312971

smoothSolver: Solving for Ux, Initial residual = 0.876499, Final residual = 7.40084e-006, No Iterations 2

smoothSolver: Solving for Uy, Initial residual = 0.331287, Final residual = 6.29935e-006, No Iterations 2

smoothSolver: Solving for Uz, Initial residual = 0.33123, Final residual = 4.00057e-006, No Iterations 2

GAMG: Solving for p, Initial residual = 0.0278718, Final residual = 0.00114707, No Iterations 4

GAMG: Solving for p, Initial residual = 0.650173, Final residual = 0.0284286, No Iterations 1

GAMG: Solving for p, Initial residual = 0.194341, Final residual = 0.0156095, No Iterations 1

time step continuity errors : sum local = 1.21866e-005, global = 1.19451e-006, cumulative = 8.18862e-007

GAMG: Solving for p, Initial residual = 0.0636636, Final residual = 0.00464419, No Iterations 2

GAMG: Solving for p, Initial residual = 0.0435077, Final residual = 0.00282571, No Iterations 1

GAMG: Solving for p, Initial residual = 0.0132537, Final residual = 0.000757509, No Iterations 3

time step continuity errors : sum local = 4.43126e-007, global = 6.43491e-008, cumulative = 8.83211e-007

GAMG: Solving for p, Initial residual = 0.0193633, Final residual = 0.00110533, No Iterations 1

GAMG: Solving for p, Initial residual = 0.010751, Final residual = 0.000639609, No Iterations 1

GAMG: Solving for p, Initial residual = 0.0100564, Final residual = 9.93399e-007, No Iterations 10

time step continuity errors : sum local = 6.30176e-010, global = 2.4117e-010, cumulative = 8.83453e-007

smoothSolver: Solving for epsilon, Initial residual = 0.00930701, Final residual = 6.1697e-006, No Iterations 9

smoothSolver: Solving for k, Initial residual = 0.126378, Final residual = 9.94153e-006, No Iterations 15

ExecutionTime = 1.889 s ClockTime = 2 s

Time = 3e-005

Courant Number mean: 0.00458132 max: 0.345706

smoothSolver: Solving for Ux, Initial residual = 0.079592, Final residual = 9.85051e-006, No Iterations 19

smoothSolver: Solving for Uy, Initial residual = 0.0734624, Final residual = 9.7605e-006, No Iterations 17

smoothSolver: Solving for Uz, Initial residual = 0.0747674, Final residual = 9.53817e-006, No Iterations 33

GAMG: Solving for p, Initial residual = 0.373516, Final residual = 0.0285815, No Iterations 1

GAMG: Solving for p, Initial residual = 0.118773, Final residual = 0.0110359, No Iterations 1

GAMG: Solving for p, Initial residual = 0.038878, Final residual = 0.00372024, No Iterations 2

time step continuity errors : sum local = 1.21627e-006, global = 2.43328e-008, cumulative = 9.07785e-007

GAMG: Solving for p, Initial residual = 0.0451137, Final residual = 0.00318094, No Iterations 1

GAMG: Solving for p, Initial residual = 0.0321754, Final residual = 0.00209075, No Iterations 1

GAMG: Solving for p, Initial residual = 0.0352302, Final residual = 0.00211329, No Iterations 1

time step continuity errors : sum local = 6.26393e-007, global = -4.78897e-008, cumulative = 8.59896e-007

GAMG: Solving for p, Initial residual = 0.044912, Final residual = 0.00302395, No Iterations 1

GAMG: Solving for p, Initial residual = 0.0617553, Final residual = 0.00317765, No Iterations 1

GAMG: Solving for p, Initial residual = 0.0784996, Final residual = 8.53144e-007, No Iterations 12

time step continuity errors : sum local = 2.62425e-010, global = -9.51159e-011, cumulative = 8.59801e-007

smoothSolver: Solving for epsilon, Initial residual = 0.633209, Final residual = 9.77421e-006, No Iterations 158

bounding epsilon, min: -0.877744 max: 44673.1 average: 16.7755

smoothSolver: Solving for k, Initial residual = 0.635398, Final residual = 9.64688e-006, No Iterations 164

bounding k, min: -0.0882534 max: 5743.42 average: 2.20014

ExecutionTime = 3.361 s ClockTime = 4 s

Time = 4e-005

Courant Number mean: 0.00458765 max: 0.888047

smoothSolver: Solving for Ux, Initial residual = 0.614219, Final residual = 9.98473e-006, No Iterations 933

smoothSolver: Solving for Uy, Initial residual = 0.723961, Final residual = 9.9936e-006, No Iterations 909

smoothSolver: Solving for Uz, Initial residual = 0.717782, Final residual = 2.9617e-005, No Iterations 1000

GAMG: Solving for p, Initial residual = 0.296844, Final residual = 0.0118335, No Iterations 2

GAMG: Solving for p, Initial residual = 0.189836, Final residual = 0.00970302, No Iterations 1

GAMG: Solving for p, Initial residual = 0.364776, Final residual = 0.0230311, No Iterations 1

time step continuity errors : sum local = 1.30935e-005, global = -7.37501e-008, cumulative = 7.8605e-007

GAMG: Solving for p, Initial residual = 0.415525, Final residual = 0.0265175, No Iterations 1

GAMG: Solving for p, Initial residual = 0.651642, Final residual = 0.0331855, No Iterations 1

GAMG: Solving for p, Initial residual = 0.6128, Final residual = 0.0312075, No Iterations 1

time step continuity errors : sum local = 2.04255e-005, global = -3.62808e-008, cumulative = 7.4977e-007

GAMG: Solving for p, Initial residual = 0.634076, Final residual = 0.0320917, No Iterations 1

GAMG: Solving for p, Initial residual = 0.66057, Final residual = 0.0276819, No Iterations 1

GAMG: Solving for p, Initial residual = 0.552025, Final residual = 3.96026e-007, No Iterations 15

time step continuity errors : sum local = 2.18559e-010, global = 2.38381e-011, cumulative = 7.49793e-007

smoothSolver: Solving for epsilon, Initial residual = 0.700988, Final residual = 0.0240034, No Iterations 1000

bounding epsilon, min: -72675.7 max: 2.08377e+006 average: 4719.9

smoothSolver: Solving for k, Initial residual = 0.819294, Final residual = 0.00319799, No Iterations 1000

bounding k, min: -321.569 max: 91490.8 average: 188.567

ExecutionTime = 13.609 s ClockTime = 14 s

Time = 5e-005

Courant Number mean: 0.00472208 max: 4.10126

smoothSolver: Solving for Ux, Initial residual = 0.681157, Final residual = 1.07847e-005, No Iterations 1000

smoothSolver: Solving for Uy, Initial residual = 0.932983, Final residual = 9.57292e-006, No Iterations 83

smoothSolver: Solving for Uz, Initial residual = 0.780499, Final residual = 9.5243e-006, No Iterations 95

GAMG: Solving for p, Initial residual = 0.580381, Final residual = 0.0352027, No Iterations 2

GAMG: Solving for p, Initial residual = 0.00138076, Final residual = 4.17977e-005, No Iterations 2

GAMG: Solving for p, Initial residual = 0.00341274, Final residual = 0.00019635, No Iterations 1

time step continuity errors : sum local = 0.00825229, global = -7.92179e-005, cumulative = -7.84681e-005

GAMG: Solving for p, Initial residual = 0.00416669, Final residual = 0.000280274, No Iterations 1

GAMG: Solving for p, Initial residual = 0.00317651, Final residual = 0.000241823, No Iterations 1

GAMG: Solving for p, Initial residual = 0.00266199, Final residual = 0.000173116, No Iterations 1

time step continuity errors : sum local = 0.00673098, global = -9.70523e-005, cumulative = -0.00017552

GAMG: Solving for p, Initial residual = 0.00199272, Final residual = 0.000143573, No Iterations 1

GAMG: Solving for p, Initial residual = 0.00202467, Final residual = 0.000101054, No Iterations 1

GAMG: Solving for p, Initial residual = 0.00161367, Final residual = 6.07852e-007, No Iterations 8

time step continuity errors : sum local = 2.14735e-005, global = -7.05903e-007, cumulative = -0.000176226

We’re sorry, but the application crashed and safe stack tracing isn’t available in this current implementation of blueCFD-Core patches for OpenFOAM.

I tried your files, and simulate solution still facing this error. Please guide me to fix this problem.

Cyprien says

Hi Harish,

I noted that you are using the BlueCore install for windows.

This is using an old version of OpenFoam.

Because of that, many of the commands are probably not the same as I was using the latest version

Try to install the latest Openfoam ubuntu version on windows through WSL (Ubuntu for windows).