CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Understanding residuals and how long it takes to solve

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By wkernkamp
  • 1 Post By wkernkamp
  • 1 Post By wkernkamp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2024, 02:02
Default Understanding residuals and how long it takes to solve
  #1
New Member
 
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2
Lt72884 is on a distinguished road
Thanks for the welcome to the forums. Im hoping to learn alot while i am here I am new to CFD, as in, never done cfd before. I took fluids class but it has been a few years since i have graduated. CFD was not required but now im interested in it.

I have the openfoam workbench installed into freecad. I have done the following:

Made my geometry of a wing
Created a block about 8 meters by 1 meter by 1 meter around the wing
Cut the wing out of said block to create flow domain
Added boundary conditions
Set fluid and physical properties
Meshed at 10mm using GMSH
Write and run the solver

Here are my questions... is it normal to be at 6.5 hours and its only done 500 iterations and its still not complete?

Why does it take so long? and should it be taking this long? I have 12 cores and 32GB of ram running on an SSD.

What are "residuals" and what is the graph of iterations vs residuals about?

thanks and please be patient while i learn this new stuff.

lastly, is there another workflow i should be following rather than using the cfdof workbench? if so, i will need a good tutorial to follow

system specs:
Windows 10
4GB GPU AMD
32GB ram
2TB SSD
12 core Intel
Attached Images
File Type: jpg openfoam solver.jpg (83.1 KB, 24 views)
Lt72884 is offline   Reply With Quote

Old   May 8, 2024, 18:05
Default
  #2
Senior Member
 
Will Kernkamp
Join Date: Jun 2014
Posts: 372
Rep Power: 14
wkernkamp is on a distinguished road
The sum of all the face fluxes into and out of a cell for each flow quantity should be zero for a steady flow solution. The iterative process modifies the flow quantities in the cell to reduce this mismatch, called the residual. This is like a Gauss-Seidel iteration on a matrix. Except that the nonlinear fluid flow equations change when the solution vector changes.


Your residuals plot looks fine. The residuals are smoothly being reduced except the turbulent energy k. That has to do with the turbulent boundary layer still developing.


The time per iteration is very slow. Your box 8x1x1 at 0.01 mesh size would yield at least 8 million cells. However, there is probably refinement near the wing surface. What is your total number of cells? I think the number of cells is too large for your computer. Try with a mesh size setting of 0.04m. That should speed up the calculation with a factor 64. You now are doing about 48 seconds per iteration. With the coarser grid you would get 0.75 seconds per iteration. The quality of your solution may not be as good.


For CFD, the most important factor determining the solution speed is the memory bandwidth. It seems to me that you are running on a desktop or laptop. That is not ideal, but fine for familiarization.


You can look around here: OpenFOAM benchmarks on various hardware to see what computers have good performance. You may try the benchmark yourself to see where you are at. For a desktop, you would want an intel 13th or 14th gen; an AMD 7000X3D both with dual channel DDR5; or a MAC M1, M2 or M3.
Lt72884 likes this.
wkernkamp is offline   Reply With Quote

Old   May 8, 2024, 18:44
Default
  #3
New Member
 
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2
Lt72884 is on a distinguished road
Thank you for the reply on what residuals are. I remeber the Guass-Sidel matrix in my numerical methods class a few years back. I will go and take a look at some of these things and see what i can learn.

As for the amount of cells, i do not know how to find that information in freecad using the CFDof workbench yet. I know you can, i just have not learned that part yet.

So far its been 22 hours and its still calculating. Most likely it will end at the default 2000 iteration mark. Once i get paraview working again, i should be able to view the results. I was hoping prepomax could read them as well.

Yes, my machine is a desktop machine. It has 32GB of GDDR5 dual channel ram, and a 13th gen intel with 12 cores. One thing i didnt do was to set openfoam to use all my cores. in freecad cfdof i think it defaults to 1 or 4 cores..

This is the first test i have ever run.

i do have another question. Originally the sim would fail within 5 minutes when i had it set to 12m/s laminar flow, but as soon as i switched it from laminar to RANS, it has been caclulating for these 22 hours just fine..Why is that? what is it that caused laminar to fail? Is there a specific way i can only use laminar?

Bare in mind i have had fluids class 2 years ago. I do know what laminar means but i do not know all the specifics behind it as fluids covered so much material.

thanks for the help and your expertise in this adventure of mine haha
Lt72884 is offline   Reply With Quote

Old   May 8, 2024, 19:13
Default
  #4
Senior Member
 
Will Kernkamp
Join Date: Jun 2014
Posts: 372
Rep Power: 14
wkernkamp is on a distinguished road
You are right to let it finish. It should be a few more hours only. You probably have a decent result. That can be your baseline for comparison with results with coarser grids.



I can only guess as to what goes wrong with the laminar flow calculation:
1. In a laminar flow calculation over a wing, the flow will separate, always. Basically, now you will be simulating turbulence which requires very small cells.
2. Not sure how the mesh is near the surface and what boundary condition is applied. Can be wrong, can be cell size too large for the chosen approach.


The 13th gen intel memory has been successfully overclocked to DDR5-7200. If it is now at say 5200, you will get a proportional gain. That is 7200 MT/s, or 3600 Hz (because it is Double Data Rate or DDR).
Lt72884 likes this.
wkernkamp is offline   Reply With Quote

Old   May 8, 2024, 19:31
Default
  #5
New Member
 
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2
Lt72884 is on a distinguished road
super fasinating to me to see all my math and hard work i did in school actually mean something now.

I took a wind turbine blade, and cut it into 15 sections with a band saw so i could see how the profile changed over its length. Then i traced each cross section onto paper and scaned it into my PC. I then found the scale factor, and traced one of the airfoils in sketchup pro and freecad so i could make a model of the blade and practice FEA as well as CFD on it.

once the calcs are done, i would like to find the force the wind is pushing on the blade at the 12m/s velocity i set. That is possible correct?

Thank you for the help.
Lt72884 is offline   Reply With Quote

Old   May 8, 2024, 23:11
Default
  #6
Senior Member
 
Will Kernkamp
Join Date: Jun 2014
Posts: 372
Rep Power: 14
wkernkamp is on a distinguished road
Yes possible:


https://www.youtube.com/watch?v=KTH6yLzb4V0


and a Thesis: https://www.google.com/url?sa=t&sour...uh5l6gsZRlp2Yk


Basically, your turbine blades are modeled within a rotating region within the mesh as shown here: https://www.google.com/url?sa=t&sour...2_jrQtsyaBCOlY


OpenFOAM will handle the interpolation between the boundaries of the rotating part and the static part.
Lt72884 likes this.
wkernkamp is offline   Reply With Quote

Old   May 9, 2024, 00:30
Default
  #7
New Member
 
Matt
Join Date: Feb 2024
Posts: 19
Rep Power: 2
Lt72884 is on a distinguished road
well it finished, 90GB strong and 1 day:19:47 seconds. Now its time to actually see what it did.

Ill see if paraview works, if not, what else can i use? PrePoMax?

thanks
Lt72884 is offline   Reply With Quote

Old   May 9, 2024, 02:10
Default
  #8
Senior Member
 
Will Kernkamp
Join Date: Jun 2014
Posts: 372
Rep Power: 14
wkernkamp is on a distinguished road
I have not used OF through freecad. I am on linux and type paraFoam &
Tuat starts paraview after creating a case.foam file that helps paraview find the data.
wkernkamp is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 14:34.