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

How to compute CD and CL values on OpenFOAM?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 19, 2023, 13:35
Default How to compute CD and CL values on OpenFOAM?
  #1
New Member
 
Adityan Rajesh
Join Date: Mar 2023
Posts: 1
Rep Power: 0
Adityan_Rajesh is on a distinguished road
Heyy everyone, I am still a beginner on OpenFOAM.
I actually wanted to do a simulation of NACA0012 at an angle of 4 degrees, under a Reynolds Number of 2 million.
I first Simulated it using ANSYS Fluent, wherein I got the
CL value at 0.44
CD value at 0.0088

These results were kinda within the range, with the CD value slightly off, most likely that the SA model overpredicts drag.

But on OpenFOAM,
I don't know why, I get my CL value at only 0.23, instead of 0.44.

The temperature is 293K, viscosity at 1.71e-5 and rho at 1.25.
Velocity at around 51.4 m/s

Can anyone help me out on the files, shared here.

U FILE:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2212                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (51.3417 3.5901 0.0000);

boundaryField
{
    inlet
    {
        type            freestreamVelocity;
        freestreamValue	$internalField;
    }

    outlet
    {
        type            freestreamVelocity;
        freestreamValue	$internalField;
    }

    airfoil
    {
        type            noSlip;
    }

    frontAndBackPlanes
    {
        type            empty;
    }
}


// ************************************************************************* //
p FILE
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2212                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            freestreamPressure;
        freestreamValue	uniform 0;
    }

    outlet
    {
        type            freestreamPressure;
        freestreamValue	uniform 0;
    }

    airfoil
    {
        type            zeroGradient;
    }

    frontAndBackPlanes
    {
        type            empty;
    }
}


// ************************************************************************* //
nut FILE
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2212                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 1.7157857e-5;

boundaryField
{
    inlet
    {
        type            freestream;
        freestreamValue $internalField;
    }

    outlet
    {
        type            freestream;
        freestreamValue $internalField;
    }

    airfoil
    {
        type            nutUSpaldingWallFunction;
	  Cmu			0.09;
	  kappa		0.41;
	  E			9.8;
        value           uniform 0;
    }

    frontAndBackPlanes
    {
        type            empty;
    }
}


// ************************************************************************* //
nuTilda
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2212                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 6.863143119e-5;

boundaryField
{
    inlet
    {
        type            freestream;
        freestreamValue $internalField;
    }

    outlet
    {
        type            freestream;
        freestreamValue $internalField;
    }

    airfoil
    {
        type            fixedValue;
        value           uniform 0;
    }

    frontAndBackPlanes
    {
        type            empty;
    }
}


// ************************************************************************* //
controlDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2212                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     simpleFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         500;

deltaT          1;

writeControl    timeStep;

writeInterval   10;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions
{
    momErr
    {
        type            momentumError;
        libs            (fieldFunctionObjects);
        executeControl  writeTime;
        writeControl    writeTime;
    }

    contErr
    {
        type            div;
        libs            (fieldFunctionObjects);
        field           phi;
        executeControl  writeTime;
        writeControl    writeTime;
    }


    turbulenceFields1
    {
        type            turbulenceFields;
        libs            (fieldFunctionObjects);
        fields
        (
            k
            epsilon
            nut
            nuEff
            R
            devReff
            L
            I
        );

        executeControl  writeTime;
        writeControl    writeTime;
    }

    mag1
    {
        type            mag;
        libs            (fieldFunctionObjects);
        field           turbulenceProperties:R;

        result          magR;
        executeControl  writeTime;
        writeControl    writeTime;
    }
    
    forceCoeffs1
    {	
	type            forceCoeffs;
    	libs            ("libforces.so");
    	patches         (airfoil);
	p               p;
    	U               U;
    	rho             rhoInf;
	rhoInf	    1.25;
	pRef            0;
	porosity        no;
	writeFields     yes;
	CofR            (0.05334 0 0);
	liftDir         (-0.06975647374412530077595883519414 0.99756405025982424761316268064426 0);
	dragDir         (0.99756405025982424761316268064426 0.06975647374412530077595883519414 0);
	pitchAxis       (0 0 1);
	magUInf         51.46714;
	lRef            0.5334;
	Aref            0.5334;
	outputControl timeStep;
	outputInterval 500;
    }
}


// ************************************************************************* //
The chord length is 0.5334 m
Adityan_Rajesh 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



All times are GMT -4. The time now is 20:03.