CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Boundary conditions for 2D Navie-Stockes simulation

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By olivierG

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 7, 2011, 10:46
Default Boundary conditions for 2D Navie-Stockes simulation
  #1
New Member
 
Join Date: Feb 2011
Posts: 20
Rep Power: 15
L1011 is on a distinguished road
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
Attached Images
File Type: png Capture d’écran 2011-03-07 à 08.58.17.png (33.3 KB, 61 views)
L1011 is offline   Reply With Quote

Old   March 9, 2011, 06:33
Default
  #2
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 18
olivierG is on a distinguished road
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
mm.abdollahzadeh and mechy like this.
olivierG is offline   Reply With Quote

Old   March 9, 2011, 23:32
Default
  #3
New Member
 
Join Date: Feb 2011
Posts: 20
Rep Power: 15
L1011 is on a distinguished road
Hi Olivier,

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

L1011
L1011 is offline   Reply With Quote

Old   December 11, 2012, 11:26
Default
  #4
Member
 
VS
Join Date: Nov 2012
Posts: 86
Rep Power: 14
VSass is on a distinguished road
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?
VSass is offline   Reply With Quote

Old   December 11, 2012, 13:08
Default
  #5
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 18
olivierG is on a distinguished road
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
olivierG is offline   Reply With Quote

Old   December 13, 2012, 09:17
Default rhosimplecfoam
  #6
Member
 
Join Date: Oct 2012
Posts: 47
Rep Power: 14
sh.d is on a distinguished road
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?
pleas help me?
sh.d is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Impinging Jet Boundary Conditions Anindya Main CFD Forum 25 February 27, 2016 13:58
CFX does not continue Shafiul CFX 10 February 17, 2011 08:57
Boundary conditions for pipework simulation metro OpenFOAM Running, Solving & CFD 0 August 12, 2010 04:13
transient simulation of a rotating rectangle icesniffer CFX 1 August 8, 2009 08:25
Need help about boundary conditions for a francis runner flow simulation Rodrigo Escobar Moragas Main CFD Forum 1 October 26, 1998 09:20


All times are GMT -4. The time now is 11:39.