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

Smallest element, simpleFoam and CFL condition

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By ssss
  • 2 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 30, 2014, 10: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, 970 views)
File Type: jpg delt.jpg (24.9 KB, 964 views)

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

Old   October 30, 2014, 17:53
Default
  #2
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 12
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, 13:49
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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 and elmo555 like this.
__________________
wyldckat is offline   Reply With Quote

Old   November 3, 2014, 08: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, 09:21
Default adjustTimeStep in controlDict
  #5
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18
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, 13:58
Default
  #6
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 12
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

Old   September 7, 2016, 16:09
Default
  #7
Member
 
Obad
Join Date: Sep 2013
Posts: 42
Rep Power: 12
Obad is on a distinguished road
Hi guys, I also have a question about the CFL number that I would like to add to this discussion.

The time discretization schemes given in Open Foam (at least in the User's Guide) are all implicit except the steadyState scheme.
What I learned is that for fully implicit schemes the CFL number is not important.

So why is it still necessary to keep CFL low in Open Foam?

Would be nice if someone could enlighten me
Obad is offline   Reply With Quote

Old   September 15, 2016, 02:29
Default segregated solver
  #8
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18
fabian_roesler is on a distinguished road
You're solving coupled equations - pressure, velocity, etc. - in a segregated way. So you will always have explicit terms inside your equations and thus you have to consider the CFL number.

Cheers

Fabian
fabian_roesler is offline   Reply With Quote

Old   September 22, 2016, 13:11
Default
  #9
Member
 
Obad
Join Date: Sep 2013
Posts: 42
Rep Power: 12
Obad is on a distinguished road
In my understanding we always have the choice to solve a problem explicitly or fully implicitly.

Yes for incompressible flow we have a pressure and velocity equation that are coupled and can for example be solved iteratively (pressure correction, projection method etc.). However, even here we have the choice how the different terms (convective, pressure and viscous term) are treated.

When I am thinking about compressible flow it's the same. All the terms (convective, pressure and viscous) can be discretized implicitly and in the end a big matrix must be solved iterativly.
Obad is offline   Reply With Quote

Old   September 22, 2016, 13:34
Default
  #10
Member
 
Obad
Join Date: Sep 2013
Posts: 42
Rep Power: 12
Obad is on a distinguished road
I think I got it

The big advantage of implicit schemes in general is that you don't have to stick to the CFL condition. This means, larger time steps can be used in order to achieve a steady solution. The downside is of course, that a large matrix must be solved.

However, when using implicit schemes to get a time accurate unsteady solution of the flow, then of course one has to think about CFL.

So when using an unsteady solver in OF, the solver expects that we want to have a time accurate solution, even if we are actually only interested at the steady outcome, right?
That's why CFL is also important for implicit schemes.
Obad is offline   Reply With Quote

Old   September 27, 2017, 11:50
Default
  #11
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 10
randolph is on a distinguished road
Quote:
Originally Posted by fabian_roesler View Post
You're solving coupled equations - pressure, velocity, etc. - in a segregated way. So you will always have explicit terms inside your equations and thus you have to consider the CFL number.

Cheers

Fabian
Why is that?
randolph 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 18:06.