Courant number goes crazy
Hello everyone,
I'm new to OpenFOAM. I'm using interFoam to simulate a simple twophase 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 
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? 
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:

Limiting the Courant Number
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. 
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:

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 surfacetracking 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 timestep 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. 
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. 
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 :rolleyes: 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 tetmesh 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 CoMax 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.holzmanncfd.de/index.php...asen/interfoam Videos and Inspiration: http://www.holzmanncfd.de/index.php/brueckensimulation http://www.holzmanncfd.de/index.php/bierflasche http://www.holzmanncfd.de/index.php...oladenueberzug http://www.holzmanncfd.de/index.php...lischersprung http://www.holzmanncfd.de/index.php...abenbefuellung http://www.holzmanncfd.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 
1 Attachment(s)
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:

Give me 1 hour :) I have to set up my home phone :D

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 
Hi Tobi,
I copied them from the dambreak tutorial. I only made some small changes on them. Thanks, Pengchuan 
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) 
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. 
1 Attachment(s)
Quote:
Well okay I understand what you wanna do. Here the picture! 
1 Attachment(s)
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?

Hi, that are vectors :)
So the setup is correct? 
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.

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. 
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. 
All times are GMT 4. The time now is 17:57. 