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

Courant number goes crazy

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By cfdonline2mohsen
  • 2 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 28, 2013, 15:40
Default Courant number goes crazy
  #1
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Hello everyone,

I'm new to OpenFOAM. I'm using interFoam to simulate a simple two-phase flow. First I used a very simple geometry, it worked very well. Then I moved that to a complex geometry, the problem came. I monitored the Umax and Pmax. At the very beginning, everything worked well. After some steps, courant number increased directly to several thousands then went to infinity. At the same time, samething happened to Umax and Pmax. I don't know what is the reason. I think since it works with the simple geometry, it should work with the complex geometry as well. Is there anyone who has a similar experience before? Can anyone help me with this?

Thanks
pechwang is offline   Reply With Quote

Old   May 28, 2013, 22:30
Default
  #2
Member
 
Gregoire Junqua
Join Date: Jun 2011
Location: China
Posts: 58
Blog Entries: 1
Rep Power: 15
gregjunqua is on a distinguished road
Hi
This occur for me when i don't compute the current number
http://www.openfoam.org/docs/user/cavity.php . Did you check it out?
gregjunqua is offline   Reply With Quote

Old   May 28, 2013, 22:38
Default
  #3
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Hi,

I used adjust time step, the time step will change based on the previous courant number. But right now, I have no idea.

Quote:
Originally Posted by gregjunqua View Post
Hi
This occur for me when i don't compute the current number
http://www.openfoam.org/docs/user/cavity.php . Did you check it out?
pechwang is offline   Reply With Quote

Old   June 1, 2013, 14:09
Default Limiting the Courant Number
  #4
New Member
 
Tom
Join Date: Nov 2011
Location: Atlanta, Ga
Posts: 21
Rep Power: 15
Irish09 is on a distinguished road
Hello,

I would suspect that your time step is becoming too large to stay stable. As the Courant number grows, and with a fixed mesh, all that can change is the timestep. Try limiting the value that the courant number can reach, in essence setting a maximum timestep value, for stability. You will have to decide what a sufficient value is, maybe using a value from the stable and simple geometry as the maximum.
Irish09 is offline   Reply With Quote

Old   June 10, 2013, 10:18
Default
  #5
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Hi Thomas,

I set the maximum Courant to 0.25 and the maximum time step is 1. However, when I monitored the Courant number, it changed so fast that it changed from 0.2 to around 3000 in one time step. I don't know why.

Quote:
Originally Posted by Irish09 View Post
Try limiting the value that the courant number can reach, in essence setting a maximum timestep value, for stability.
pechwang is offline   Reply With Quote

Old   June 10, 2013, 11:46
Default
  #6
Senior Member
 
cfdonline2mohsen's Avatar
 
Mohsen KiaMansouri
Join Date: Jan 2010
Location: CFD Lab
Posts: 118
Rep Power: 16
cfdonline2mohsen is on a distinguished road
Quote:
Originally Posted by Irish09 View Post
Hello,

I would suspect that your time step is becoming too large to stay stable. As the Courant number grows, and with a fixed mesh, all that can change is the timestep. Try limiting the value that the courant number can reach, in essence setting a maximum timestep value, for stability. You will have to decide what a sufficient value is, maybe using a value from the stable and simple geometry as the maximum.
Dear Pengchuan & Thomas

According to the definition of CFL (or Courant) number Co=U*deltat/Deltax.
Since your mesh is constant (not dynamic mesh) then the Max Co depends on 2 parameters: deltat & Max U, so Max Co depends also on Max U.
as you said in your case Max U becomes very large so Co number too.
there is something about Time step control in section 2.3.6 of user guide for interFoam solver that I quote in here:
" Time step control is an important issue in free surface tracking since the surface-tracking algorithm is considerably more sensitive to the Courant number Co than in standard fluid flow calculations. Ideally, we should not exceed an upper limit Co=0.5 in the region of the interface. In some cases, where the propagation velocity is easy to predict, the user should specify a fixed time-step to satisfy the Co criterion. For more complex cases, this is considerably more difficult. interFoam therefore offers automatic adjustment of the time step as standard in the controlDict. The user should specify adjustTimeStep to be on and the the maximum Co for the phase fields, maxAlphaCo, and other fields, maxCo, to be 0.5. The upper limit on time step maxDeltaT can be set to a value that will not be exceeded in this simulation, e.g. 1.0. "

Try adjustTimeStep and see what happens.
Afterward, there is another issue regarding bounded schemes in fvsheme so that you can use schemes that bound a quantity between desired values. Take a deep look at them to see whether you can use it in your case.
ScarFace and tonnykz like this.
__________________
“If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.”
cfdonline2mohsen is offline   Reply With Quote

Old   June 10, 2013, 22:17
Default
  #7
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Hi Mohsen,

Thank you for your reply. I did use the adjust time step and I did exactly the same as the tutorial. What confused me was the same setup worked for the simple geometry but it didn't work for the complex model. I don't know why. And I was stuck here for about a whole month.
pechwang is offline   Reply With Quote

Old   June 11, 2013, 05:35
Default
  #8
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi pechwang,

I am using interFoam for complex simulations a lot of times. For a beginner is this Kind of solver a very heavy meal


Summarize:

- As shown above you are using Co=0.25 and adjustableRunTime yes
- You think that you Simulation "should/must" work couse it run with a simple mesh befor


So first:

- 2D and 3D are completely different, so you can not handle the Argument, that the simulation should/must work with your complex geometry

- How did you generate your mesh?
- Is it a snappyHexMesh mesh?
- Is it a tet-mesh or hexadominant or just hex cells?

- you checked out the output of the application checkMesh?

- Did you set your BC correct ?
In some cases a 2D case is working with not good BC too but in a 3D simulation everythings wrong after a few iterations.

- Did you check to set your Co-Max to 0.1 ?
- Did you try to start with a very very low time step (e.g. 0.00000001)

- You can check out some simulations (interFoam) on my Homepage

General interFoam tutorials:

http://www.holzmann-cfd.de/index.php...asen/interfoam

Videos and Inspiration:

http://www.holzmann-cfd.de/index.php/brueckensimulation
http://www.holzmann-cfd.de/index.php/bierflasche
http://www.holzmann-cfd.de/index.php...oladenueberzug
http://www.holzmann-cfd.de/index.php...lischer-sprung
http://www.holzmann-cfd.de/index.php...abenbefuellung
http://www.holzmann-cfd.de/index.php/brunnen


After you told me more Information about the mesh and other stuff (see above), I can help you in a better way.

Good luck,

Tobi
ScarFace and CFD- like this.
Tobi is offline   Reply With Quote

Old   June 11, 2013, 15:37
Default
  #9
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Hi Tobi,

Thank you for your reply. Both my simple geometry and complex geometry are in 3D. I use blockMesh to generate basic hex cells. I generate the blockMeshDict file by hand. And both meshes work in icoFoam and simpleFoam.
I have attached my setup in the attachment. If you have time, please have a look at it. Thank you so much.

Pengchuan

Quote:
Originally Posted by Tobi View Post
Hi pechwang,

- How did you generate your mesh?
- Is it a snappyHexMesh mesh?
- Is it a tet-mesh or hexadominant or just hex cells?

Tobi
Attached Files
File Type: zip test case.zip (25.8 KB, 10 views)
pechwang is offline   Reply With Quote

Old   June 11, 2013, 15:42
Default
  #10
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Give me 1 hour I have to set up my home phone
Tobi is offline   Reply With Quote

Old   June 11, 2013, 16:18
Default
  #11
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
At the moment non case is working.

I am wondering how you set up your controlDict and you fvSchemes!

I change that now and test again
Tobi is offline   Reply With Quote

Old   June 11, 2013, 16:20
Default
  #12
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Hi Tobi,

I copied them from the dambreak tutorial. I only made some small changes on them.

Thanks,
Pengchuan
pechwang is offline   Reply With Quote

Old   June 11, 2013, 16:28
Default
  #13
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

I added a picture.
Is that setup correct?

I am a bit confused of the "sence" of that simulation!

1. inlet is in the inner side (red)
2. outlet is at the outer side
3. Velocity is cross due to inlet and outlet ??

Any symmetric? I can not find the meaning and sence of the simulation.

PS: complex geometry is not working (blockMesh failed)
Tobi is offline   Reply With Quote

Old   June 11, 2013, 16:42
Default
  #14
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Hi Tobi,

I cannot see the picture. But yes, inlet is inner radius and outlet is outer raidus. I use cyclic boundary condition on the two side walls. Basiclly it is a part of the whole 360 model. I applied zero pressure conditions at the inlet and outlet. Right now, for these two models, I just want to see the propogation of oil in the domain. I want to see whether there is some pattern changes after changing the geometry.
As to the complex model, maybe it is out of memory, maybe I need to change the number of elements to a smaller number.
pechwang is offline   Reply With Quote

Old   June 11, 2013, 17:07
Default
  #15
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by pechwang View Post
Hi Tobi,
As to the complex model, maybe it is out of memory, maybe I need to change the number of elements to a smaller number.
I have 36 GB of memory

Well okay I understand what you wanna do.
Here the picture!
Attached Images
File Type: jpg screen.jpg (44.1 KB, 166 views)
Tobi is offline   Reply With Quote

Old   June 11, 2013, 17:14
Default
  #16
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Thanks Tobi. What are the small pyramids on the top surface? Maybe the blockMeshDict file is broken. I attach a new one for you. Does the simple geometry work?
Attached Files
File Type: zip blockMeshDict.zip (1.9 KB, 5 views)
pechwang is offline   Reply With Quote

Old   June 11, 2013, 17:48
Default
  #17
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi, that are vectors
So the setup is correct?
Tobi is offline   Reply With Quote

Old   June 12, 2013, 09:27
Default
  #18
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Yes. The setup is right for the simple geometry. Since the complex had some problems, one of my friend changed the boundary conditions to zero pressure on the two parallel walls. But I think that was not right. Thanks.
pechwang is offline   Reply With Quote

Old   June 13, 2013, 08:00
Default
  #19
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by pechwang View Post
Yes. The setup is right for the simple geometry. Since the complex had some problems, one of my friend changed the boundary conditions to zero pressure on the two parallel walls. But I think that was not right. Thanks.
Hi,

the simple geometry is not working at my computer (2.2.x)
Did you calculate that one with variable time step couse in the case you have a fix time step declared.
Tobi is offline   Reply With Quote

Old   June 13, 2013, 09:24
Default
  #20
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Hi Tobi,

Yes, I used adjust time step in the simple case once. The simple case didn't work on you comoputer? I'm kind of confusing now. It worked on my computer. But I didn't use parallel computing for these two cases.
pechwang is offline   Reply With Quote

Reply

Tags
courant number increasing, interfoam


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Courant number fireman FLUENT 7 September 11, 2021 12:33
Stable boundaries marcoymarc CFX 33 March 13, 2013 07:39
Courant number and CFL number snandish13 STAR-CCM+ 3 January 7, 2013 05:14
LES near wall model & courant number kasim CFX 5 March 16, 2008 19:23
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 03:58


All times are GMT -4. The time now is 11:22.