CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Running an airfoil case (https://www.cfd-online.com/Forums/openfoam/107603-running-airfoil-case.html)

 batta31 October 2, 2012 09:01

Running an airfoil case

Hi to everyone,
I want to run a simulation over a 2D airfoil with the following hypothesis:
It's a 2D, steady-state, 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? :)
Simone

 colinB October 2, 2012 09:43

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

 batta31 October 2, 2012 10:52

So you're suggesting:

-U fixedValue (equal to zero) over the airfoil for the no-slip 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

 colinB October 3, 2012 09:41

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

 batta31 October 3, 2012 10:23

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?

 colinB October 5, 2012 03:24

maybe this helps:

what is the internal field of your p file?
I set it to uniform 0

 batta31 October 5, 2012 06:12

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
{
}

top
{
}

bottom
{
}

foil
{
}

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.

 colinB October 5, 2012 07:04

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
{
}

outlet
{
}

foil
{
}

frontAndBack
{
type            empty;
}

and this is how my fvSolution file looked like:

Code:

solvers
{
p
{
solver          GAMG;
tolerance      1e-07;
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      1e-08;
relTol          0.1;
}
}

SIMPLE
{
nNonOrthogonalCorrectors 4;
pRefCell        0;
pRefValue      0;
}

relaxationFactors
{
default        0;
p              0.3;
U              0.7;
nuTilda        0.7;
}

note that there is a reference cell defined, of which I wasn't aware
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.

 saeid.oqaz October 7, 2012 11:27

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?

 batta31 October 8, 2012 02:38

@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 1e-06;
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.

 colinB October 16, 2012 03:37

Hi there,

Quote:
 (...) what is the internal field of your U file? is the freestream velocity? (...)
usually the internal field is a vector specified with the key word internal field
see therefore the user manual as reference.

Quote:
 (...) and colin you what solver use for this case? and in fvsolution dic GAMG relevant for P. i use CG. (...)
as Simone I used the simpleFoam solver, but my knowledge concerning the
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        Gauss linear;
}

divSchemes
{
default        none;
div(phi,U)      Gauss linearUpwind Gauss linear;
div(phi,nuTilda) Gauss linearUpwind Gauss linear;
}

laplacianSchemes
{
default        none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
laplacian(1,p)  Gauss linear corrected;
}

interpolationSchemes
{
default        linear;
interpolate(U)  linear;
}

{
default        corrected;
}

fluxRequired
{
default        no;
p              ;
}

NOTE: this is what I used for OF 1.7.1 eventually notation and settings
have changed

 All times are GMT -4. The time now is 08:26.