CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Boundary conditions for 2D Navie-Stockes simulation (http://www.cfd-online.com/Forums/openfoam/85796-boundary-conditions-2d-navie-stockes-simulation.html)

 L1011 March 7, 2011 10:46

Boundary conditions for 2D Navie-Stockes simulation

1 Attachment(s)
Hi Foamers!

In the past days I tried to set the case of a simple 2D-incompressible simulation of an airfoil using a O-mesh with the influence of both viscosity and turbulence (SST model) using pisoFoam.

As shown on the figure below, the topology of my case is made of:
1. a body
2. an internal field
3. an inlet/outlet
on which I have to set boundary conditions; basically a freestream velocity vector and an adiabatic/no-splip boundary at wall.

Based on searches in the forum I have 3 questions for you:

A) In the 0/ folder, why do we need to set boundary conditions for all the working variables on all the boundaries? (For example, at wall, couldn't we just set the velocity to 0 instead of adding also a BC for the pressure ?)

B) How can I set non-reflecting boundary conditions for the farfield?

C) Based on my experience, I tried the boundary conditions mentioned hereafter. The computation ran properly but I do not get the right cp distribution nor aerodynamic coefficient values. Did I make a major mistake?

Code:

``` /*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  1.4.1                                | |  \\  /    A nd          | Web:      http://www.openfoam.org              | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ // Field Dictionary FoamFile {     version        2.0;     format          ascii;     root            "";     case            "";     instance        "";     local          "";     class          volVectorField;     object          U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 1 -1 0 0 0 0]; internalField  uniform (25 0 0); boundaryField {     inlet-outlet     {         type            fixedValue;         value          uniform (25 0 0);     }     body                {         type            fixedValue;     value          uniform (0 0 0)     }     defaultFaces        {         type            empty;     } } // ************************************************************************* //```
Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  1.4.1                                | |  \\  /    A nd          | Web:      http://www.openfoam.org              | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ // Field Dictionary FoamFile {     version        2.0;     format          ascii;     root            "";     case            "";     instance        "";     local          "";     class          volScalarField;     object          p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 2 -2 0 0 0 0]; internalField  uniform 82714; boundaryField {     inlet-outlet     {         type            zeroGradient;     }     body                {         type            zeroGradient;     }     defaultFaces        {         type            empty;     } } // ************************************************************************* //```
Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  1.7.1                                | |  \\  /    A nd          | Web:      www.OpenFOAM.com                      | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      volScalarField;     location    "0";     object      k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 2 -2 0 0 0 0]; internalField  uniform 0.001; boundaryField {     inlet-outlet     {         type            fixedValue;         value          uniform 0.001;     }     body     {         type            zeroGradient;     }     defaultFaces     {         type            empty;     } } // ************************************************************************* //```
Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  1.7.x                                | |  \\  /    A nd          | Web:      www.OpenFOAM.com                      | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      volScalarField;     location    "0";     object      mut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [1 -1 -1 0 0 0 0]; internalField  uniform 0; boundaryField {     inlet-outlet     {         type            calculated;         value          uniform 0;     }     body                {         type            mutLowReWallFunction;         Cmu            0.09;         kappa          0.41;         E              9.8;         value          uniform 0;     }     defaultFaces        {         type            empty;     } } // ************************************************************************* //```
Code:

``` /*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  1.7.1                                | |  \\  /    A nd          | Web:      www.OpenFOAM.com                      | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      volSymmTensorField;     object      R; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 2 -2 0 0 0 0]; internalField  uniform (0 0 0 0 0 0); boundaryField {     inlet-outlet      {         type            kqRWallFunction;         value          uniform ( 0 0 0 0 0 0 );     }     body     {         type            kqRWallFunction;         value          uniform ( 0 0 0 0 0 0 );     }   defaultFaces     {         type            empty;     } } // ************************************************************************* //```
Thank you very much and have a good week!

L1011

 olivierG March 9, 2011 06:33

Hello,

A) There is not "default condition" in OF, so you must set boundary condition for all variables.

B)
1) For airfoil simulation, first rule is to set your far field domain to 30 - 50 chord lenght. From your picture, you are at 2 only, and you will have big reflexion and distorsion in the u and p field.

2) Your boundary conditions are not optimal. Try:
For U, at inlet-outlet, try the inletOutlet condition
For p, at inlet-outlet, try outletInlet
For k, at inlet-outlet: inletOutlet, and for your wall: fixedValue if y+<1 or kqRWallFunction if y+>30
For omega (if kw SST), the same, i.e inletOutlet and omegaWallFunction at wall.
For mut, seem ok if you use a low Re turbulence model (kw SST is not a low Re model), or mutWallFunction
For R, at inlet-outlet you should try inletOutlet too.

FvScheme: don't forget to use Gauss upwind for div scheme with k/epsilon/omega at first.
FvSolution: set tolerance for omega/k/epsion to a low value , i.e 1e-15, and play with relTol (start at 0.1 to ...1e-6)

Hope this help
olivier

 L1011 March 9, 2011 23:32

Hi Olivier,

Thank you for your hints, I'll try to make a comparative study with the results already get.

L1011

 VSass December 11, 2012 11:26

OivierG,

your post was very helpful to me also,but i want to ask if there is any specific reason or criteria for using outletInlet for p and not inletOutlet?
The same question occurs for velocity.How do we choose one or the other?

 olivierG December 11, 2012 13:08

hello,

outletInlet use zeroGradient in case of inflow, and fixedValue for outflow,
inletOutlet use fixedValue for inflow, and zeroGradient for outflow,
so you see that you will use inletOutlet for U at both inlet & outlet, and outletInlet for p (inlet & outlet).
You may try the opposite (i.e use a fixed outflow velocity), but this is realy not a good idea.

regards,
olivier

 sh.d December 13, 2012 09:17

rhosimplecfoam

Hi
I want simulate a supercritical airfoil by using rhosimplecfoam.mach number is 0.5.but, I do not know what boundary conditions should I use?:confused:
pleas help me?

 All times are GMT -4. The time now is 06:53.