# Smallest element, simpleFoam and CFL condition

 Register Blogs Members List Search Today's Posts Mark Forums Read

October 30, 2014, 11:25
Smallest element, simpleFoam and CFL condition
#1
New Member

Jonathan Bernardo
Join Date: Oct 2013
Location: Brazil
Posts: 2
Rep Power: 0
Hello all,
I am mechanical engineering student (third year), and I am new in OpenFOAM.
I have some questions .

I am looking for the smallest element in my mesh to determine my CFL condition.
As referred in the OpenFOAM user guide, I tried to follow the rule :
delt < (Co * delx) / v
I usually use Co = 0.75

1. How can I find this "delx" (The smallest element size to get the correct deltaT)??
2. Using the utility "checkMesh", I got "Minimum face area" , Is a good idea to use "delx" as "Minimum face area"?

I always create my meshes in snappyHexMesh, before to generate my mesh in snappyHexMesh, I need to create the blockMesh, so I use delx that I set in blockMesh to calculate delt. But in this case I have some elements smaller than the elements in blockMesh. (see malha1.jpg)

The last question I have is:
3. How does simpleFoam work with CFL condition?
I mean, about choose of delt, I never saw simpleFoam code (cuz I dont understand much about C++). I ran the same problem with two differents delt (delt1 = 100000*delt2), and I got the same results!
The unique difference is about time step continuity errors (see delt.jpg).

Sorry I am learning English too
Attached Images
 malha1.jpg (22.8 KB, 103 views) delt.jpg (24.9 KB, 106 views)

Last edited by jbernardo; October 30, 2014 at 13:07.

 October 30, 2014, 18:53 #2 Senior Member   anonymous Join Date: Aug 2014 Posts: 179 Rep Power: 3 You're running a steady simulation so your timestep or courant number is not involved in your simulation. jbernardo likes this.

 November 1, 2014, 14:49 #3 Super Moderator   Bruno Santos Join Date: Mar 2009 Location: Lisbon, Portugal Posts: 8,516 Blog Entries: 34 Rep Power: 86 Greetings to all! @jbernardo: Welcome to the forum! To add to ssss' answer, and since you said you don't know C++ very well, perhaps the formal mathematical equations are easier to understand? Here you have a brief explanation on SIMPLE method, which is used by simpleFoam: http://openfoamwiki.net/index.php/Op...hm_in_OpenFOAM Perhaps you're looking for a transient solver like pisoFoam or pimpleFoam, which do indeed require CFL? As for using two meshes with different resolutions and getting the same results: well, that is good! You're half-way to having a mesh study complete, to ascertain if your results are good or not Best regards, Bruno jbernardo likes this. __________________ OpenFOAM: Frequently Asked Questions | Useful links for building and using Forum: How to ask for help | Posting code and output with [CODE] My to-do list and when I'll be able to come to the forum: http://wyldckat.github.io And please: Read this before sending private messages to me

 November 3, 2014, 10:21 adjustTimeStep in controlDict #5 Senior Member     Fabian Roesler Join Date: Mar 2009 Location: Bad Friedrichshall, Germany Posts: 167 Rep Power: 8 Hi When using adjustTimeStep in controlDict you don't have to bother which element is ther smallest as OpenFOAM adjusts the time step to the maximum Courant number. And this is important now: This doens't allways have to be the smallest element! The deltaT in controlDict defines only the first time step width. During solving, the time step width is determined by the max Courant number automatically. Hope this is clear. Cheers Fabian

 November 3, 2014, 14:58 #6 Senior Member   anonymous Join Date: Aug 2014 Posts: 179 Rep Power: 3 Just remember that: The Courant number is not only restricted by your smallest element, velocity is also involved in the courant number. If you want your transient solver to aumotically set the proper Courant Number you need to add to your controlDict: Code: ```adjustTimeStep yes; //automatically set the Courant number maxCo 0.8; // limit maximum Courant number maxDeltaT 0.9; // Maximum timeStep between simulations``` Be always careful with your maximum Courant number, PIMPLE solvers may use larger Courant number than PISO ones, but I would never go beyond 2.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

All times are GMT -4. The time now is 09:15.