|
[Sponsors] |
May 28, 2013, 15:40 |
Courant number goes crazy
|
#1 |
Member
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13 |
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 |
|
May 28, 2013, 22:30 |
|
#2 |
Member
|
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? |
|
May 28, 2013, 22:38 |
|
#3 | |
Member
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13 |
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:
|
||
June 1, 2013, 14:09 |
Limiting the Courant Number
|
#4 |
New Member
Tom
Join Date: Nov 2011
Location: Atlanta, Ga
Posts: 21
Rep Power: 15 |
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. |
|
June 10, 2013, 10:18 |
|
#5 |
Member
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13 |
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. |
|
June 10, 2013, 11:46 |
|
#6 | |
Senior Member
Mohsen KiaMansouri
Join Date: Jan 2010
Location: CFD Lab
Posts: 118
Rep Power: 16 |
Quote:
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.
__________________
“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.” |
||
June 10, 2013, 22:17 |
|
#7 |
Member
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13 |
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. |
|
June 11, 2013, 05:35 |
|
#8 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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 |
|
June 11, 2013, 15:37 |
|
#9 |
Member
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13 |
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 |
|
June 11, 2013, 16:20 |
|
#12 |
Member
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13 |
Hi Tobi,
I copied them from the dambreak tutorial. I only made some small changes on them. Thanks, Pengchuan |
|
June 11, 2013, 16:28 |
|
#13 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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) |
|
June 11, 2013, 16:42 |
|
#14 |
Member
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13 |
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. |
|
June 11, 2013, 17:07 |
|
#15 | |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Quote:
Well okay I understand what you wanna do. Here the picture! |
||
June 11, 2013, 17:14 |
|
#16 |
Member
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13 |
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?
|
|
June 12, 2013, 09:27 |
|
#18 |
Member
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13 |
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.
|
|
June 13, 2013, 08:00 |
|
#19 | |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Quote:
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. |
||
June 13, 2013, 09:24 |
|
#20 |
Member
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13 |
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. |
|
Tags |
courant number increasing, interfoam |
|
|
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 |