CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Smallest element, simpleFoam and CFL condition

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

Like Tree2Likes
  • 1 Post By ssss
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Display Modes
Old   October 30, 2014, 11:25
Default Smallest element, simpleFoam and CFL condition
  #1
New Member
 
Jonathan Bernardo
Join Date: Oct 2013
Location: Brazil
Posts: 2
Rep Power: 0
jbernardo is on a distinguished road
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
Thanks in advance.
Attached Images
File Type: jpg malha1.jpg (22.8 KB, 103 views)
File Type: jpg delt.jpg (24.9 KB, 106 views)

Last edited by jbernardo; October 30, 2014 at 13:07.
jbernardo is offline   Reply With Quote

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

Old   November 1, 2014, 14:49
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,516
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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.
wyldckat is offline   Reply With Quote

Old   November 3, 2014, 09:41
Default
  #4
New Member
 
Jonathan Bernardo
Join Date: Oct 2013
Location: Brazil
Posts: 2
Rep Power: 0
jbernardo is on a distinguished road
I was worried and confused about CFL condition in simpleFoam, even if I use a steady-state solver, this solver need a pseudo time to evolve to the solution, right? Then I thought that I would need to be careful with delt. I will try to learn more about it.
Thanks ssss for your reply, I'll never forget about it , when run a steady simulation, timestep or courant number is not involved in the simulation.

Now I understand about SIMPLE algorithm. (Wikipedia and openfoam wiki are good references)
When I was talking about same results, it was to two different DELT (delta_time_1 = 100000*delta_time_2) and not two different meshes, but thanks anyway, your advice about meshes will help me Bruno, in this moment I'll simulate in this mesh until I find the correct setup (I still need to learn how to set turbulence models and fan BCs), after this, I will do the convergence mesh test (Am I doing in the correct form?).

In this case I am using a steady state solver, but when you are using an transient solver, What do you do to find the smallest element?
Thanks all, Have a great week!!!
jbernardo is offline   Reply With Quote

Old   November 3, 2014, 10:21
Default adjustTimeStep in controlDict
  #5
Senior Member
 
fabian_roesler's Avatar
 
Fabian Roesler
Join Date: Mar 2009
Location: Bad Friedrichshall, Germany
Posts: 167
Rep Power: 8
fabian_roesler is on a distinguished road
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
fabian_roesler is offline   Reply With Quote

Old   November 3, 2014, 14:58
Default
  #6
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 179
Rep Power: 3
ssss is on a distinguished road
Just remember that:

Co=\dfrac{u \Delta x}{\Delta t}

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.
ssss is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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



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