
[Sponsors] 
June 22, 2011, 22:56 

#21 
Senior Member
Martin Hegedus
Join Date: Feb 2011
Posts: 469
Rep Power: 11 
Interesting, I ran 0 degrees angle of attack on the simpleFoam airfoil2D example and it failed to converge and then ran 2.2e6 degrees and it converged.
OpenFOAM AirFoil2D example Not sure what the story is. Maybe I missed a switch or something. Anyone have an idea? 

June 23, 2011, 04:17 

#22  
Senior Member
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 10 
Quote:
I just did a quick simulation of a test case on a 136x96 CVs structured mesh: http://turbmodels.larc.nasa.gov/flatplate.html The Reynolds number based on length "1" is 5e6, I used the SpalartAllmaras turbulence model and the simpleFoam algorithm for solving the coupled, steady state incompressible NSequations. It's converged below 1e8 an the residuals decrease is logarithmic (see attached plot). As for the numerical settings, those are as follows: fvSolution: Code:
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 2.0.0   \\ / A nd  Web: www.OpenFOAM.com   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver PCG; preconditioner DIC; tolerance 1e12; relTol 0.01; } U { solver PBiCG; preconditioner DILU; tolerance 1e12; relTol 0.01; } nuTilda { solver PBiCG; preconditioner DILU; tolerance 1e12; relTol 0.01; } } SIMPLE { nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; residualControl { p 1e8; U 1e8; nuTilda 1e8; } } relaxationFactors { default 0; p 0.3; U 0.7; nuTilda 0.7; } // ************************************************************************* // Code:
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 2.0.0   \\ / A nd  Web: www.OpenFOAM.com   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; grad(p) Gauss linear; grad(U) Gauss linear; } divSchemes { default none; div(phi,U) Gauss linearUpwind grad(U); div(phi,nuTilda) Gauss linearUpwind grad(nuTilda); // div(phi,U) Gauss upwind; // div(phi,nuTilda) Gauss upwind; div((nuEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes { default none; laplacian(nuEff,U) Gauss linear corrected; laplacian((1A(U)),p) Gauss linear corrected; laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; laplacian(1,p) Gauss linear corrected; } interpolationSchemes { default linear; interpolate(U) linear; } snGradSchemes { default corrected; } fluxRequired { default no; p ; } // ************************************************************************* // Greetings, Felix. 

June 23, 2011, 04:57 

#23 
Senior Member
Martin Hegedus
Join Date: Feb 2011
Posts: 469
Rep Power: 11 
Thanks, can you post the input decks for the state variables? I'm interested in knowing the boundary conditions you used.


June 23, 2011, 06:59 

#24 
Senior Member
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 10 
You're welcome.
Of course, I will add the boundary conditions later when I come home from work. So far I can tell you: INLET: U: fixedValue (1 0 0) p: zeroGradient nuTilda: fixedValue 5e7 (i guess...) nut: calculated OUTLET: U: zeroGradient p: fixedValue 0 nuTilda: zeroGradient nut: calculated WALL: U: fixedValue (0 0 0) p: zeroGradient nuTilda: fixedValue 0 nut: fixedValue 0 TOP and BOTTOM (in front of the plate): all: symmetryPlane I used 2e7 as viscosity to achieve a reynolds number of 5e6 with the specified inlet velocity. Greetings, Felix 

June 23, 2011, 12:44 

#25 
Senior Member
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 10 
Here are the BC files, as promised.
U: Code:
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 2.0.0   \\ / A nd  Web: www.OpenFOAM.com   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 1 0 0 0 0]; internalField uniform (1 0 0); boundaryField { "(bottomtop)" { type symmetryPlane; } outlet { type zeroGradient; } inlet { type fixedValue; value $internalField; } plate { type fixedValue; value uniform (0 0 0); } "(frontback)" { type empty; } } // ************************************************************************* // Code:
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 2.0.0   \\ / A nd  Web: www.OpenFOAM.com   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 2 0 0 0 0]; internalField uniform 0; boundaryField { "(bottomtop)" { type symmetryPlane; } outlet { type fixedValue; value $internalField; } inlet { type zeroGradient; } plate { type zeroGradient; } "(frontback)" { type empty; } } // ************************************************************************* // Code:
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 2.0.0   \\ / A nd  Web: www.OpenFOAM.com   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class volScalarField; object nuTilda; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 1 0 0 0 0]; internalField uniform 5.0e7; boundaryField { "(bottomtop)" { type symmetryPlane; } outlet { type zeroGradient; } inlet { type fixedValue; value $internalField; } plate { type fixedValue; value uniform 0; } "(frontback)" { type empty; } } // ************************************************************************* // Code:
/** C++ **\  =========    \\ / F ield  OpenFOAM: The Open Source CFD Toolbox   \\ / O peration  Version: 2.0.0   \\ / A nd  Web: www.OpenFOAM.com   \\/ M anipulation   \**/ FoamFile { version 2.0; format ascii; class volScalarField; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 1 0 0 0 0]; internalField uniform 5.0e7; boundaryField { "(bottomtop)" { type symmetryPlane; } "(outletinlet)" { type calculated; } plate { type fixedValue; value uniform 0; } "(frontback)" { type empty; } } // ************************************************************************* // 

June 23, 2011, 17:52 

#26 
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 430
Rep Power: 16 
Martin, threads I was referring to are:
SimpleFoam convergence problems Comparison of axisymmetric case, Starccm+ and OpenFOAM nevertheless today I found this one: Convergence where Henry W. explains the topic about p residuals stagnation, in post #2 he states: "We don't normalise the residuals the same way as other codes and one consequence is that p may appear not to converge adequately. However, we find that so long as U has converged well it doesn't matter that the p residual is higher. The best thing is to look at the way the fields are evolving." Problem isn't clear for me, though. Regards
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D. Research Scientist Research Center for Computational Methods (CIMEC)  CONICET/UNL Tel: 543424511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe  Argentina. http://www.cimec.org.ar 

June 23, 2011, 19:01 

#27  
Senior Member
Martin Hegedus
Join Date: Feb 2011
Posts: 469
Rep Power: 11 
Quote:
However, if something isn't clear to so many people, then there might be a problem. I know, OpenFOAM has been used by a lot of people and one would expect this issue to be taken care of in the past... So the problem isn't clear for me either. If I didn't know that so many people used the code for such a length of time, from past experience developing my own codes, I'd say there is a good chance there is a bug in the code. Sadly, I have a lot of experience with bugs, more than I want! Thus the strong need for V&V. However, on this thread FelixL presented residuals that went past 1.e8 and seemed to keep going. Given that the airfoil2D case residuals, except at zero angle of attack, fell to the region of 1.0e10 to 1.0e12, I suspect that FelixL's flat plate will bottom out at 1.0e12 or a little past that, probably 1.0e13. Therefore it seems that 1.0e6 is not machine zero for OpenFOAM. For the airfoil case I ran 8, 4, 2, 1, 0.5, 0.01, 0.001, 2.2e6, and 0 degrees angle of attack. For angles of attack greater than 0.01, the residuals dropped below 1.0e10. Angles less than 0.01 will be a little different because of the fine vertical grid spacing at z=0 and the fact that the wake must exit the back end. There will be a little bit of a convergence battle going on there. However, that does not explain the jump in residual from an angle of attack of 2.2e6 to 0. 

June 23, 2011, 19:21 

#28 
Senior Member
Martin Hegedus
Join Date: Feb 2011
Posts: 469
Rep Power: 11 
Thanks for the decks. I'm trying to compile OpenFOAM 2.0 now and ran into "calls to overloaded 'XYZ' is ambigous' errors. I guess I'll need to update my version of gcc.
Can you do me a favor and run your flat plate case with the top farfield B.C. as freestream rather than symmetry? If you don't have the time, I understand. The numerics of the freestream and symmetry boundary are somewhat similar in the sense they both impose a value of p and tangential velocity (which should be somewhat similar since the boundary is sufficiently far away) and the normal velocity is 0. The idea is to see if the airfoil2D issue shows up. 

June 24, 2011, 02:21 

#29 
Senior Member
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 10 
Good morning, everyone,
I'm making this quick, will comment later. I ran the test Martin requested using freestream as the top boundary condition. My experience with this BC isn't really good so I tend to avoid it. The plot below shows, that the pressureresiduals stall at about 1e5 and the other residuals stall later as a consequence of that. Greetings, Felix. 

June 24, 2011, 02:49 

#30  
Senior Member
Martin Hegedus
Join Date: Feb 2011
Posts: 469
Rep Power: 11 
Quote:


June 24, 2011, 03:03 

#31  
Senior Member
Martin Hegedus
Join Date: Feb 2011
Posts: 469
Rep Power: 11 
Quote:
I have no idea why the code is doing this, other than to say there is a bug. 

June 24, 2011, 03:27 

#32  
Senior Member
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 10 
Good morning, Martin,
at first let me comment on your post #28: Quote:
It means: when the flux vector at the boundary points inwards, the velocity is set to a fixed value of freestreamValue and the pressure is set to zeroGradient. If the flux vector points outwards, it's vice versa. According to your experiences there might be an explanation: if the freestream velocity is parallel to the boundary (like in my flat plate case), the flux vector component normal to the boundary is zero. This could be causing all this trouble getting the residuals down to machine precision. This might actually explain why it's working for you when you set a slight velocity component in boundary normal direction. Or is the domain of your airfoil case circular? Greetings, Felix. 

June 24, 2011, 04:07 

#33  
Senior Member
Martin Hegedus
Join Date: Feb 2011
Posts: 469
Rep Power: 11 
Quote:
Quote:
Is the switch for in/out for the freestream B.C. based on the local normal velocity or the freestream normal velocity component, i.e. Vinf dot n? The plate example should be forcing the flow outward by a small amount, granted very small. 

June 24, 2011, 04:18 

#34 
Senior Member
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 10 
It is common practice to set U, nuTilda, k, epsilon etc. to fixedValue and pressure to zeroGradient everywhere where the flux vector is expected to point inside the domain. Accordingly, U, nuTilda, and so on have to be set to zeroGradient and pressure to a fixedValue everywhere where the flux vector points outside the domain.
Problem is, sometimes (e.g. when you have a vortex shedding problem) you might have regions with inflow at the outlet. That's where the inletOutlet BC comes in handy. As far as I know, the switch for in/out is determined by the freestream velocity. So the velocity vector should be tangential at the top boundary at my flat plate test case, no outward flow there (i.e. same as symmetry). But to confirm that I would need to check the results which I can't access right now. Greetings, Felix. 

June 24, 2011, 09:39 

#35 
Member
Patricio Bohorquez
Join Date: Mar 2009
Location: Jaén, Spain
Posts: 94
Rep Power: 9 

June 24, 2011, 11:14 

#36 
Member
Patricio Bohorquez
Join Date: Mar 2009
Location: Jaén, Spain
Posts: 94
Rep Power: 9 
A better convergence result was found by eliminating the outer domain (which was aligned with the free stream) and by replacing it with a hemisphere. Then, setting as inlet (outlet) boundary condition fixedValue (zeroGradient) for velocity and zeroGradient (fixedValue) for pressure, I reached machine zero.
Last edited by pbohorquez; June 25, 2011 at 04:50. 

June 24, 2011, 15:14 

#37 
Senior Member
Martin Hegedus
Join Date: Feb 2011
Posts: 469
Rep Power: 11 
I messed up describing the outer boundary for the airfoil2D case. It is a box with the inlet being the front, top, and bottom sides. Not a C grid. The back side is the outlet.
I changed the inlet condition to a wall and set the values (fixedValue) to the freestream values. It converged. Plot is shown below. I then took the case above and set the pressure to zero gradient for the inlet boundary, and that converged to. I then wanted to set the front face to freestream V and zero gradient pressure and the top and bottom to freestream p and zero gradient V, unfortunately I didn't have the time to extract the front face from the inlet boundary. The cell faces for the front face are not a continuous set. 

June 24, 2011, 15:36 

#38 
Senior Member
Martin Hegedus
Join Date: Feb 2011
Posts: 469
Rep Power: 11 
Thanks for all the input.


Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Superlinear speedup in OpenFOAM 13  msrinath80  OpenFOAM Running, Solving & CFD  18  March 3, 2015 06:36 
Crosscompiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingww64  wyldckat  OpenFOAM Announcements from Other Sources  3  September 8, 2010 06:25 
Modified OpenFOAM Forum Structure and New MailingList  pete  Site News & Announcements  0  June 29, 2009 05:56 
64bitrhel5 OF installation instructions  mirko  OpenFOAM Installation  2  August 12, 2008 18:07 
OpenFOAM Debian packaging current status problems and TODOs  oseen  OpenFOAM Installation  9  August 26, 2007 13:50 