# Wing external flow (tutorial)

 Register Blogs Members List Search Today's Posts Mark Forums Read

December 24, 2016, 12:19
Wing external flow (tutorial)
#1
New Member

Paul
Join Date: Dec 2016
Posts: 2
Rep Power: 0
Dear all,
I'm new to OF 3.0.x, coming from realms of lifting line theories and panel method. My goal is to study wing/wake interference in both OF and 3D panel method.

I wonder, if there is any tutorial for external flow over 3D wings or airplane. A common practice in aerospace is to make a spherical domain around the object (wing) and prescribe freestream (farfield) BC on the boundary. So far I have found only tutorials, where the domain is a box corresponding to a wind tunnel.
All of these tutorial are working for me, but are quite useless in aerospace world since we need to change angle of attack and side slip angle.

So I decided to make my own tutorial: I have a rectangular wing with l=6000mm, c=1000mm and NACA 0010 airfoil. I created a spherical domain with R=15000mm around the wing with freestream and frestreamPressure BC. Running simpleFoam with laminar turbulence model, after 200 iterations it gives for alpha=5.7deg CL=0.39, CM=-0.09, which I consider as realistic. Panel method gives for the same case CL=0.42

So far so good, but when I try to run potentialFoam, it ends with sigFpe error:

Code:
```Calculating potential flow
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::adjustPhi(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&) at ??:?
Floating point exception```
I assume the issue is related to the freestream BCs, since the "wind tunnel" domain was working OK. Please does anyone have any experience with this? How should I update the BCs to make the potentialFoam work?

Best regards
Paul

p:
Code:
```/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
version     2.0;
format      ascii;
class       volScalarField;
object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
FREE
{
type            freestreamPressure;
value           uniform 0;
}

SYM
{
type symmetryPlane;
}
WING
{
}

}

// ************************************************************************* //```
U:

Code:
```/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
version     2.0;
format      ascii;
class       volVectorField;
object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (10 0 1);

boundaryField
{
FREE
{
type freestream;
freestreamValue uniform (10 0 1);
}
SYM
{
type symmetryPlane;

}

WING
{
// 		type fixedValue;
// 		value	 uniform (0. 0. 0.);
type slip;

}

}

// ************************************************************************* //```
Attached Images
 fig55.jpg (54.9 KB, 51 views) fig54.jpg (55.0 KB, 46 views)

 December 25, 2016, 14:43 potentialFoam bug? #2 New Member   Paul Join Date: Dec 2016 Posts: 2 Rep Power: 0 After a day spent trying to fix the problem, I'm thinking about a bug in potential foam. When I set a "traditional wind tunnel" BCs: Code: ```inlet: U - fixed value, p - zero gradient outlet: U - zero gradient, p - fixed value``` potentialFoam runs without problem. When i set BCs of the spherical boundary: Code: ```U: type freestream; freestreamValue uniform (10 0 1); p: type freestreamPressure; value uniform 0;``` then the potentialFoam asks to set reference cell for field Phi. When I provide: Code: ```potentialFlow { nNonOrthogonalCorrectors 20; PhiRefCell 0; PhiRefValue 0; }``` then potentialFoam crashes with the error mentioned above. Maybe I'm missing something important, but the fact that I can run the case using simpleFoam and get realistic results, points me to an idea that potentialFoam can not handle this type of mixed BC. Please do you have any ideas to solve the case using potentialFoam?

 September 10, 2017, 17:10 #3 New Member   Terence Annarelli Join Date: Aug 2017 Location: France Posts: 7 Rep Power: 8 Hi, I have no - for now - idea about why potentialfoam does not handle these mixed BC, but as I am working these days on an aeronautic problem, I īm very interested in your spherical domain. I had many problems these days trying to set properly a wind tunnel with AoA and slip angle which vary. Could you hint me about the method you used in order to create the spherical domain please ? with Blockmesh it seems difficult . I plan to test it with a NACA 2418 wing for which I have "real" lift and drag coefficients. I am of course willing to help you and investigate simplefoam and potentialfoam for my case. Thanks in advance for your help ! Sent from my iPhone using CFD Online Forum mobile app

 September 16, 2017, 15:49 #4 New Member   Terence Annarelli Join Date: Aug 2017 Location: France Posts: 7 Rep Power: 8 About the potentialFoam crash, it seems I had the same problem until I set up some reference values in fvSolution file. Using this post : --> FOAM FATAL IO ERROR: Unable to set reference cell for field p Please supply

 Tags external flow