Hello,
I'm trying to simula
Hello,
I'm trying to simulate the flow over a cylinder. But I'm having a lot of trouble getting the calculations to run correctly (using OF1.3 on 20cpu's). The cylinder (diameter = 0.3m, length = 0.6m) is supported between two symmetry planes with the b.c. set to 'wall'. The b.c. for the inflow and outflow planes are set to 'inflow' and 'outflow'. The top and bottom planes are also set to 'symmetry'. The mesh is unstructured, with roughly 4 milion cells and y+ about 1. CheckMesh gives no warnings or errors. The velocity is 50 m/s, resulting in a Reynolds number of 1 milion. At this Reynolds number no von Karman vortex street develops, so I am running simpleFoam. I tried running with the laminar and ke turbulence model, resulting with both models in very high pressures and velocities, normal velocity components at the cylinder wall and increasing time step continuity errors. The solver stops in a dozen to a few hundred iterations. The solver settings I have copied from the pitzDaily tutorial, but I have tried various different settings as suggested in http://www.cfdonline.com/OpenFOAM_D...ges/1/996.html and http://www.cfdonline.com/OpenFOAM_D...es/1/1671.html by Henry Weller and Hrvoje Jasak. This has had no positive effect. What can I do to get this calculation to run? Any help would be appreciated. best regards, Roland 
Run potentialFoam first
Run potentialFoam first

And then solve the laminar Nav
And then solve the laminar Navier Stokes equations at a low Reynolds number, such that you'd expect a nice von Karman vortex street. Use icoFoam for that.
Frank 
Thank you for your help, Eugen
Thank you for your help, Eugene and Frank. I will try this out now.
Frank, what is the benefit of first running it at such a low Reynolds number (of order 1e2 instead of 1e6)? best Regards, Roland 
I mean that you have to increa
I mean that you have to increase the complexity of your model step by step and just be sure that your computational model 'works'. A good check is first run potentialFoam, then icoFoam and finally simpleFoam.
Frank 
I've tried running both in pot
I've tried running both in potentialFoam and icoFoam. Below is the Umag plot from the potentialFoam calculation. As you can see no smooth solution is calculated.
The icoFoam shows a similar velocity distribution the first few timesteps (mean and max. Courant number < 1), but after a number of steps the solution explodes. Any ideas? http://www.cfdonline.com/OpenFOAM_D...ges/1/4272.jpg best regards, Roland 
Yon need some nonorthogonal c
Yon need some nonorthogonal correctors: add 5 or 6 and you will get a beautiful solution.
Hrv 
Hi,
Would it be possible to
Hi,
Would it be possible to see your grid? Vincent 
Increasing the nonorthogonal
Increasing the nonorthogonal correcters helped a lot. However close to the wall the solution still explodes (see first attached picture).
The simulation is performed with the following fvSolution settings. The time step is 0.01, resulting in a Courant number of 0.14. After about 10 steps the Courant number starts to increase and the solution diverges. solvers { p AMG 1e08 0 100; U BICCG 1e07 0; } PISO { momentumPredictor yes; nCorrectors 2; nNonOrthogonalCorrectors 5; pRefCell 0; pRefValue 0; } Below I have also included some images of the lefthand side of the grid. The width of the grid is 2 times the diameter of the cylinder. The very fine mesh close to the wall of the cylinder is needed for the turbulent calculation I want to use this mesh for later on. Thank you for your help. Best regards, Roland http://www.cfdonline.com/OpenFOAM_D...ges/1/4276.jpg http://www.cfdonline.com/OpenFOAM_D...ges/1/4277.jpg http://www.cfdonline.com/OpenFOAM_D...ges/1/4279.jpg http://www.cfdonline.com/OpenFOAM_D...ges/1/4278.jpg 
Dear Roland
The mesh you ha
Dear Roland
The mesh you have looks nice, with the exception of that you have quite a large jump in the aspect ratio between your hex and tetmesh. You have a Re=1e6, so clearly your flow is turbulent and should be run like that. When you say that you are using keps model is it a lowReyolds model or does it use a walllaw. In the case of the later, your y+ should be mush larger. Did you try run the problem one a coarser mesh where you will have more articial dissipation and convergence should be more easely obtained. Regards /Joakim 
After succesfully running a si
After succesfully running a simulation of the flow over a cylinder (thanks to everyone on the forum who assisted me on this), I'm am now trying to perform a similar simulation on a more complex geometry (a car).
The setup of the two cases is similar (i.e. same element sizes, velocity, etc), but the car mesh has a larger domain and is more complex. Due to the increased complexity of the car geometry (eg. corners with a small radius), the quality of the mesh is less than that of the cylinder mesh (checkMesh detects 143 highly skew faces and 12305 severely nonorthogonal faces. The onorthogonality check is OK though. The total number of faces is 21783604.) Also the car domain is decomposed in 20 parts, whereas the cylinder was decomposed in only 10 parts. Both times using Metis. Unfortunately the steps I used to get a converging solution for the cylinder do not work on the car. Here is What I did for the cylinder: 1. start with a high viscosity (0.146) to keep the Reynolds number low 2. after 25 iterations multiply viscosity by 10, repeat this until the correct viscosity is reached 3. switch turbulence from laminar to kEpsilon, with low relaxation factors 4. after 25 iterations increase relaxation factors, repeat this For the car simulation I've tried the same scheme, but never with satisfactory results. See the attached simpleFoam.log file for a typical result. Below are the relevant parts of fvSolotion and fvSchemes I used for this. I've tried changing the number of orthogonal correctors, the tolerances, relaxation factors and viscosity, but always with similar results. Can you give me any suggestion on how to do this correctly? Thanks in advance. best regards, Roland http://www.cfdonline.com/OpenFOAM_D...hment_icon.gif simpleFoam.log // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p AMG 1e08 1e04 1000; U BICCG 1e07 0; k BICCG 1e06 0; epsilon BICCG 1e06 0; R BICCG 1e06 0; nuTilda BICCG 1e06 0; } SIMPLE { nNonOrthogonalCorrectors 6; pRefCell 0; pRefValue 0; } relaxationFactors { p 0.3; U 0.7; k 0.01; epsilon 0.01; R 0.7; nuTilda 0.5; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; grad(p) Gauss linear; grad(U) Gauss linear; } divSchemes { default none; div(phi,U) Gauss limitedLinearV 1; div(phi,k) Gauss limitedLinear 1; div(phi,epsilon) Gauss limitedLinear 1; div(phi,R) Gauss upwind; div(R) Gauss linear; div(phi,nuTilda) Gauss upwind; div((nuEff*dev(grad(U).T()))) Gauss linear; } laplacianSchemes { default none; laplacian(nuEff,U) Gauss linear corrected; laplacian(1A(U),p) Gauss linear limited 1; laplacian(DkEff,k) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; laplacian(DREff,R) Gauss linear corrected; laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; } interpolationSchemes { default linear; interpolate(U) linear; } snGradSchemes { default corrected; } fluxRequired { default no; p; } // ************************************************** *********************** // 
Your run recipe sounds massive
Your run recipe sounds massively too complex: You should basically use real material properties and flow rate, firstorder convection discretisation, limit some laplacian schemes, give it a decent (uniform) initial guess for the turbulence and just run it. It will work  the mesh is in fact not too bad.
Here are the changes to the setup I would do: Solvers: p AMG 1e08 0.01 200; SIMPLE nNonOrthogonalCorrectors 1; // 0 should work as well relaxationFactors p 0.3; U 0.5; k 0.5; epsilon 0.5; divSchemes div(phi,U) Gauss upwind; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; div(R) Gauss linear; div(phi,nuTilda) Gauss upwind; div((nuEff*dev(grad(U).T()))) Gauss linear; laplacianSchemes laplacian(nuEff,U) Gauss linear limited 0.7; laplacian(1A(U),p) Gauss linear limited 1; laplacian(DkEff,k) Gauss linear limited 0.7; laplacian(DepsilonEff,epsilon) Gauss linear limited 0.7; laplacian(DREff,R) Gauss linear corrected; laplacian(DnuTildaEff,nuTilda) Gauss linear limited 0.7; Thius will run about 1020 times faster (!) than the setup you've got now. Once you get a firstorder solution, you can switch to secondorder discretisation. I'm interested to see if you can get it working properly; I take it you know how to estimate initial turbulence. Hrv 
Hrv, thank you for your help.
Hrv, thank you for your help.
With the settings you suggested the simulation is running much better (and faster). However it is still not going well, see attached log. http://www.cfdonline.com/OpenFOAM_D...hment_icon.gif simpleFoam.zip As you can see I switched turbulence off. I did this as k and epsilon exploded (bounded) after about 10 iterations, even after I decreased their relaxation factors. To estimate the initial turbulence I used equation 2.8 and 2.9 from the liddriven cavity flow tutorial. This gives me k=0.375 and epsilon=0.0419. Any suggestions? best regards, Roland 
Hrv: p AMG 1e08 0.01 200;
Hrv: p AMG 1e08 0.01 200;
Has the AMG solver been further optimized for parallel usage in 1.4? If I recall correctly, you said some time back that setting the no. of equations at the top level to around 2030 was optimal for parallel. 
After experimenting with my se
After experimenting with my settings a bit I can now run a satisfactory simulation (with turbulence switched off).
Because the pressure had trouble converging I set: p AMG 1e08 0.001 200; and nNonOrthogonalCorrectors 2; However epsilon (and to a lesser extend k) keeps diverging whenever I try to run with turbulence on. I'm using the kEpsilon model with wall functions and my y+ should be roughly 40. I've tried all sorts of things to get it running. Low relaxation factor (this does delay the divergence), starting from a converged laminar solution, etc. My fvSchemes and fvSolution are specified as advised by Hrvoje above. What can I do to improve convergence on turbulence? Thanks in advance. with best regards, Roland 
I have found the (probable) ca
I have found the (probable) cause of my problem: my initial estimate of epsilon was wrong.
For external flows apparently a better estimate is: epsilon = (cmu * k^2) / (nu * mu_t/mu), with 1<mu_t/mu<10. Calculations are going much better now, but convergence is still not as good as I had hoped. best regards, Roland 
My case is UNSTEADY FLOW for i
My case is UNSTEADY FLOW for incompressible viscous 2D flow over cylinder. can any body suggest in which
application (like icofoam or coodles etc) I should make my case. and wt should be the scheme and solver and whole detail for Re 3000. Regards Ranjan Kumar 
Search the Running/Solving CFD
Search the Running/Solving CFD forum for a detailed thread by Frank Bos who performed many validations for circular cylinder. All your questions are answered there. Use circular cylinder as a keyword. Please try and make use of the search function. It is much more efficient.

Hrv's setup above is convergin
Hrv's setup above is converging for me on a 350,000 cell 3D spheroid. I want to now switch to second order discretisation, and I've been waiting for hours for the residuals get to zero AND stay there! Will it ever completely close? And, must I wait for closure before changing schemes? Every time I've made even minor adjustments to the scheme "on the fly" it seems to wreck the analysis. My single AMD 64 3800+ with 1GB of 800MHz DDR2 is crunching away.

Success. After all residuals
Success. After all residuals but pressure stayed at zero, I changed from upwind to linear, leaving the relaxation factors low. Now closing in on a 750,00 cell model. Thanks to all for the great code and the information in this forum.

All times are GMT 4. The time now is 07:10. 