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

2D Airfoil do not converge - pressure residuals do not go below 1e-4

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2019, 10:53
Default 2D Airfoil do not converge - pressure residuals do not go below 1e-4
  #1
New Member
 
Alberto Rinaldi
Join Date: Jul 2018
Posts: 5
Rep Power: 4
rinaldialberto is on a distinguished road
Hi there,

I am running a 2D simulation on a MH32 airfoil.
I generated an O-Grid mesh using construct2D and then converted using plot3DToFoam. The mesh diameter is 30x the chord length, y+<1 and max skewness < 30deg.

I'd like to solve it with simpleFoam, modelling turbulence using transient kOmegaSSTLM.

The simulation gives wrong results for Cd, Cl, Cm, Cp.
Is it a convergence problem?
Are the settings I am using correct?

I attach my codes.

Regards
Alberto

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

#include        "include/initialConditions"

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

internalField   uniform $flowVelocity;

boundaryField
{
    side
	{
		type  				inletOutlet;
		inletValue 			$internalField;
		value 				$internalField;
	}

    profile
    {
        type            noSlip;
    }


    #include "include/frontBackTopBottomPatches"
}


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

#include        "include/initialConditions"

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

internalField   uniform $pressure;

boundaryField
{
    side
    {
		type  				outletInlet;
		outletValue 		$internalField;
		value 				$internalField;
    }

    profile
    {
        type            zeroGradient;
    }


    #include "include/frontBackTopBottomPatches"
}

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

#include        "include/initialConditions"

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

internalField   uniform $turbulentKE;

boundaryField
{
    side
	{
		type			turbulentIntensityKineticEnergyInlet;			//	type  				inletOutlet;
		intensity		0.01;											//	inletValue 			$internalField;
		value			$internalField;									//	value 				$internalField;
	}


    profile
    {
        type            fixedValue;
        value           uniform 0;		//1e-15
    }

    #include "include/frontBackTopBottomPatches"
	
}


// ************************************************************************* //

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

#include        "include/initialConditions"

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

internalField   uniform $turbulentOmega;

boundaryField
{
    side
	{
		type			turbulentMixingLengthFrequencyInlet;	// type  				inletOutlet;
		mixingLength	1;										// inletValue 			$internalField;
		value			$internalField;							// value 				$internalField;
	}

    profile
    {
        type            omegaWallFunction;
        value           $internalField;
    }

    #include "include/frontBackTopBottomPatches"
}


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

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

internalField   uniform 0;

boundaryField
{
    profile
    {
        type  	fixedValue;
		value 	uniform 0;
    }

    "(top|bottom|side)"
    {
        type            calculated;
        value           uniform 0;
    }
}


// ************************************************************************* //
gammaInt:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      gammaInt;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];
#include        "include/initialConditions"

internalField   uniform $gammaInt;

boundaryField
{
    side
	{
		type  				inletOutlet;
		inletValue 			$internalField;
		value 				$internalField;
	}

    profile
    {
        type            zeroGradient;
    }


    #include "include/frontBackTopBottomPatches"
}

// ************************************************************************* //
ReTheta:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      ReThetat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];
#include        "include/initialConditions"

internalField   uniform $reTheta;

boundaryField
{
    side
	{
		type  				inletOutlet;
		inletValue 			$internalField;
		value 				$internalField;
	}

    profile
    {
        type           		zeroGradient;
    }


    #include "include/frontBackTopBottomPatches"
}


// ************************************************************************* //
frontBackTopBottomPatches
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/


top
{
    type empty;
}

bottom
{
    type empty;
}

// ************************************************************************* //
initialConditions:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/

flowVelocity		(14.96346075389735890650 1.04634710616194826405 0);
pressure            0;
turbulentKE         0.03375;
turbulentOmega      0.12166;
reTheta				584.3046;
gammaInt			1; 
// ************************************************************************* //
controlDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include        "../0/include/initialConditions"

application     simpleFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         20001;

deltaT          1;

writeControl    runTime;

writeInterval   5000;

purgeWrite      0;

writeFormat     binary;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

functions
{
	probes
	{
		functionObjectLibs ( "libsampling.so" );
		type probes;
		name probes;
		fields
		(
			U
			p
		);

		probeLocations
		(
			(-2 	0 		0) // front
			(0  	-1 	0) // right
			(0		1	0) // left
			(2	0		0) // back
		);
	}
    forceMagnitudes
    {
        type                forces;
        libs                ("libforces.so");
        writeControl        timeStep;
        writeInterval       1;
        patches             (profile);
        rho                 rhoInf;
        log                 true;
        rhoInf              1;
        CofR                (0 0 0);
    }
	forceCoefficients
    {
        type                forceCoeffs;
        libs                ("libforces.so");
        outputControl       timeStep;
        outputInterval       1;
        patches             (profile);
		pName				p;
		UName				U;
        rho                 rhoInf;
        log                 true;
        rhoInf              1;
        CofR                (0 0 0);
		liftDir				(0 1 0);
		dragDir				(1 0 0);
		pitchAxis			(0 0 1);
		magUInf				15;
		lRef				1;
		Aref				1;
    }
	yPlus
    {
        type            yPlus;
        libs            ("libfieldFunctionObjects.so");
        writeControl    writeTime;
    }
	
	pressure1
	{
		type            pressure;
		libs            ("libfieldFunctionObjects.so");
		calcTotal       yes; // yes | no
		calcCoeff       yes; // yes | no
		writeControl    writeTime;


		// Optional entries

		// Field names
		p               p;
		U               U;
		rho             rho;

		// Total pressure: freestream pressure
		pRef            $pressure;
		pInf            100000;

		// Total pressure: freestream velocity magnitude
		UInf            $flowVelocity;

		// Total pressure: freestream density
		rhoInf          1.2;
	}
	
	surfaces
	{
		type            surfaces;
		libs            ("libsampling.so");
		writeControl    writeTime;

		surfaceFormat   vtk;
		fields          (p U);

		interpolationScheme cellPoint;

		surfaces
		(
			//zNormal
			//{
			//	type            cuttingPlane;
			//	planeType       pointAndNormal;
			//	pointAndNormalDict
			//	{
			//		point   (0 0 0.05);
			//		normal  (0 0 1);
			//	}
			//	interpolate     true;
			//}

			profile
			{
				type            patch;
				patches         (profile);
				interpolate     true;
			}
		);
	}
	
	
	
	wallShearStress1
	{
		type        	wallShearStress;
		libs        	("libfieldFunctionObjects.so");
		writeControl    writeTime;
		patches     	(profile);
	}

}


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

ddtSchemes
{
    default steadyState;
}

gradSchemes
{
    default         cellLimited leastSquares 1;
    grad(p)         Gauss linear;
    grad(U)         Gauss linear;
}

divSchemes
{
    default         				none;
    div(phi,U)                      bounded Gauss linearUpwind grad(U);
    div(phi,k)                      bounded Gauss linear;
    div(phi,omega)                  bounded Gauss linear;
	div(phi,gammaInt)   			bounded Gauss linearUpwind grad;
    div(phi,ReThetat)   			bounded Gauss linearUpwind grad;
	
    div((nuEff*dev2(T(grad(U)))))   Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected 0.33;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         limited corrected 0.33;
}

wallDist
{
    method meshWave;
}


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

solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-10;	//1e-5;
        relTol          0.1;
        smoother        GaussSeidel;
		maxIter 		500;	//4;
        minIter 		1;
    }
	
	Phi
	{
		$p;
	}
	
    U
    {
        solver           smoothSolver;
        smoother         GaussSeidel;
        tolerance        1e-5;
        relTol           0.1;
        nSweeps          1;
		maxIter 4;
        minIter 1;
    }

    k
    {
        solver           smoothSolver;
        smoother         GaussSeidel;
        tolerance        1e-5;
        relTol           0.1;
        nSweeps          1;
		maxIter 3;
        minIter 1;
    }

    omega
    {
        solver           smoothSolver;
        smoother         GaussSeidel;
        tolerance        1e-5;
        relTol           0.1;
        nSweeps          1;
		maxIter 3;
        minIter 1;
    }
	
	"(gammaInt|ReThetat)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-8;
        relTol          0.1;
        maxIter         10;
    }
}

SIMPLE
{
   nNonOrthogonalCorrectors 1;
   residualControl
   {
		p               	5e-4;
        U               	1e-5;
        "(k|epsilon|omega|gammaInt|ReThetat)" 1e-5;
   }
}

potentialFlow
{
    nNonOrthogonalCorrectors 0;
}

relaxationFactors
{
    fields
    {
        p               0.8;
    }
    equations
    {
        "(U|k|omega)"   0.6;
        "(U|k|omega)Final" 1.0;
    }
}

cache
{
    grad(U);
}

// ************************************************************************* //
Attached Images
File Type: jpg convergenge.JPG (42.0 KB, 2 views)
File Type: jpg mesh1.jpg (180.8 KB, 2 views)
File Type: jpg mesh2.jpg (199.7 KB, 1 views)
rinaldialberto is offline   Reply With Quote

Reply

Tags
airfoil 2d, komegasstlm, mesh 2d, plot3dtofoam, simplefoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
static vs. total pressure auf dem feld FLUENT 17 February 26, 2016 13:04
Airfoil pressure distribution kanishkpanchal Main CFD Forum 2 December 7, 2009 13:21
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 02:15
Gas pressure question Dan Moskal Main CFD Forum 0 October 24, 2002 22:02
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) HB &DS CFX 0 January 9, 2000 13:19


All times are GMT -4. The time now is 00:14.