
[Sponsors] 
October 2, 2012, 10:01 
Running an airfoil case

#1 
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 4 
Hi to everyone,
I want to run a simulation over a 2D airfoil with the following hypothesis: It's a 2D, steadystate, laminar, incompressible simulation so I've modified the simpleFoam solver, switching the turbulence to "off". I've also build a "C mesh" over the airfoil. What I'm now troubling with are the boundary conditions: I thought that the most appropriate BCs would be:  freestream BC for velocity (everywhere except on the foil, where I've put the no slip condition); freestreamPressure for the pressure; openFoam doesn't like these condition, I think because there isn't a "reference value" for the pressure, but also USING a reference value for the pressure, the simulation "explode" and doesn't converge to any reasonable result. This is my problem. Has anyone any suggestion? Thanks in advance Simone 

October 2, 2012, 10:43 

#2 
Senior Member
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9 
Why don't you use fixed value and zero Gradient?
With these two you should be able to define your system sufficiently for both velocity and pressure. freestream doesn't make any sense since you know your velocity in most parts of your domain regards 

October 2, 2012, 11:52 

#3 
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 4 
So you're suggesting:
U fixedValue (equal to zero) over the airfoil for the noslip condition; U fixedValue (different from zero and equal to my desired velocity) over the other patches; p zeroGradient on every patch except inside the domain where i can fix an arbitrary value? Thanks again Colin 

October 3, 2012, 10:41 

#4 
Senior Member
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9 
not exactly:
all values you know you should specify with fixed value. That includes the velocity at the inlet and in the internal field all values you don't know you assign with zero Gradient that includes all pressure values (outlet foil inlet) and velocity at the outlet. The velocity on the foil depends on whether you want to take into account friction or not If so set it to zero if not use slip 

October 3, 2012, 11:23 

#5 
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 4 
This is the error I get if I use zeroGradient for every pressure patch:
FOAM FATAL IO ERROR: Unable to set reference cell for field p Please supply either pRefCell or pRefPoint Because of that I had thought to set a reference value in one patch. Is there another solution to fix this problem? 

October 5, 2012, 04:24 

#6 
Senior Member
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9 
maybe this helps:
what is the internal field of your p file? I set it to uniform 0 

October 5, 2012, 07:12 

#7 
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 4 
Me too!
Here's the full list of my patches and relative BC for P: internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 0; } outlet { type zeroGradient; } top { type zeroGradient; } bottom { type zeroGradient; } foil { type zeroGradient; } front { type empty; } back { type empty; } } if instead of inlet BC set as fixedValue I would set it as zeroGradient I'll obtain that error. 

October 5, 2012, 08:04 

#8 
Senior Member
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9 
I found an old p file from my graduation thesis:
(at that time I used OF 1.7.1): Code:
dimensions [0 2 2 0 0 0 0]; internalField uniform 0; boundaryField { wInlet { type zeroGradient; } outlet { type zeroGradient; } foil { type zeroGradient; } frontAndBack { type empty; } Code:
solvers { p { solver GAMG; tolerance 1e07; relTol 0.1; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; } U { solver smoothSolver; smoother GaussSeidel; nSweeps 2; tolerance 1e08; relTol 0.1; } } SIMPLE { nNonOrthogonalCorrectors 4; pRefCell 0; pRefValue 0; } relaxationFactors { default 0; p 0.3; U 0.7; nuTilda 0.7; } anymore. This would make your fixedValue definition at the inlet for the pressure obsolete, which I think is better, for you don't know, what pressure values there actually are Further I have to mention, that I didn't use a top and bottom patch for my flow was inclined! Finally I would suggest you to collect all patches with the same properties in one patch (e.g. frontAndBack instead of separate patches front, back > simply collect the node numbers in the blockMeshDict in one patch definition), this improves readability. 

October 7, 2012, 12:27 

#9 
New Member
saeid oqaz
Join Date: Feb 2012
Posts: 19
Rep Power: 4 
hi Simone & colin
i working on same project but in 3D. i have 2 question. what is the internal field of your U file? is the freestream velocity? and colin you what solver use for this case? and in fvsolution dic GAMG relevant for P. i use CG. can u attach fvSchemes file & B.C file for U? Last edited by saeid.oqaz; October 7, 2012 at 12:57. 

October 8, 2012, 03:38 

#10 
Member
Simone
Join Date: Sep 2012
Posts: 95
Rep Power: 4 
@Colin:
I try to run your mesh with "zeroGradient" everywhere on "my" solver with this parameters for p: solvers { p { solver PCG; preconditioner DIC; tolerance 1e06; relTol 0.01; } It runs and doesn't create problems! So I can't still understand where the problem is. @Saeid: For U i used fixedValue everywhere except on the outlet patch where i put zero gradient. For the solver I can tell you that, since my simulation is steady, I used simpleFoam solver. 

October 16, 2012, 04:37 

#11  
Senior Member
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 9 
Hi there,
Quote:
see therefore the user manual as reference. Quote:
solvers is limited and I used the GAMG according to a recommendation. My settings for U you can read from my previous posts and the fvSchemes looks as follows: Code:
ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; grad(p) Gauss linear; grad(U) Gauss linear; } divSchemes { default none; div(phi,U) Gauss linearUpwind Gauss linear; div(phi,nuTilda) Gauss linearUpwind Gauss linear; div((nuEff*dev(grad(U).T()))) 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 ; } have changed 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
MRFSimpleFoam wind turbine case continuity error  ysh1227  OpenFOAM Running, Solving & CFD  0  May 23, 2012 06:26 
MRFSimpleFoam wind turbine case diverges  ysh1227  OpenFOAM Running, Solving & CFD  0  May 22, 2012 09:59 
Inviscid 2D Airfoil Case  doug  OpenFOAM Running, Solving & CFD  8  October 13, 2010 08:06 
Airfoil boundary condition  Frank  Main CFD Forum  1  April 21, 2008 19:36 
oscillating airfoil test case  Akbar  Main CFD Forum  1  July 22, 2005 12:49 