Commit 6fb9c777 authored by Chris Greenshields's avatar Chris Greenshields Committed by Andrew Heather
Browse files

TUT: aerofoilNACA0012 tutorial for rhoSimpleFoam and rhoPimpleFoam

The tutorial demonstrates generation of a C-grid mesh using blockMesh
The geometry is provided by a surface mesh (OBJ file) of the NACA0012 aerofoil
The case is setup with a freestream flow speed of Ma=0.72

Thanks to Kai Bastos at Duke University for the geometry and helpful input.
parent 497ae4f4
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Tinlet 298;
dimensions [0 0 0 1 0 0 0];
internalField uniform $Tinlet;
boundaryField
{
freestream
{
type inletOutlet;
inletValue uniform $Tinlet;
value $inletValue;
}
wall
{
type zeroGradient;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Uinlet (200 0 0);
dimensions [0 1 -1 0 0 0 0];
internalField uniform $Uinlet;
boundaryField
{
freestream
{
type freestreamVelocity;
freestreamValue uniform $Uinlet;
}
wall
{
type noSlip;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
freestream
{
type calculated;
value uniform 0;
}
wall
{
type compressible::alphatWallFunction;
value uniform 0;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
kInlet 0.01;
dimensions [0 2 -2 0 0 0 0];
internalField uniform $kInlet;
boundaryField
{
freestream
{
type inletOutlet;
inletValue uniform $kInlet;
value uniform $kInlet;
}
wall
{
type kqRWallFunction;
value uniform $kInlet;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object mut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
freestream
{
type calculated;
value uniform 0;
}
wall
{
type nutkWallFunction;
type nutkWallFunction;
value uniform 0;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
omegaInlet 10;
dimensions [0 0 -1 0 0 0 0];
internalField uniform $omegaInlet;
boundaryField
{
freestream
{
type inletOutlet;
inletValue uniform $omegaInlet;
value uniform $omegaInlet;
}
wall
{
type omegaWallFunction;
value uniform $omegaInlet;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
pOut 1e5;
dimensions [1 -1 -2 0 0 0 0];
internalField uniform $pOut;
boundaryField
{
outlet
{
type waveTransmissive;
field p;
psi thermo:psi;
gamma 1.4;
fieldInf $pOut;
lInf 5;
value uniform $pOut;
}
freestream
{
type freestreamPressure;
freestreamValue uniform $pOut;
}
wall
{
type zeroGradient;
}
#includeEtc "caseDicts/setConstraintTypes"
}
// ************************************************************************* //
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
rm constant/geometry/boundaryLayer.obj > /dev/null 2>&1
#------------------------------------------------------------------------------
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
application="$(getApplication)"
runApplication blockMesh
runApplication transformPoints -scale "(1 0 1)"
runApplication extrudeMesh
runApplication $application
#------------------------------------------------------------------------------
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type hePsiThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleInternalEnergy;
}
mixture // air at room temperature (293 K)
{
specie
{
molWeight 28.9;
}
thermodynamics
{
Cp 1005;
Hf 0;
}
transport
{
mu 1.82e-05;
Pr 0.71;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
RASModel kOmegaSST;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
domain
{
xMin -4;
xMax 4;
zMin -2;
zMax 2;
// Number of cells
zCells 80; // aerofoil to far field
xUCells 30; // upstream
xMCells 30; // middle
xDCells 40; // downstream
// Mesh grading
zGrading 40; // aerofoil to far field
xUGrading 5; // towards centre upstream
leadGrading 0.2; // towards leading edge
xDGrading 10; // downstream
}
aerofoil
{
xLead 0;
zLead 0;
xTrail 1;
zTrail 0;
xUpper 0.3;
zUpper 0.06;
xLower 0.3;
zLower -0.06;
}
geometry
{
aerofoil
{
type triSurfaceMesh;
file "NACA0012.obj";
}
cylinder
{
type searchableCylinder;
point1 ($:aerofoil.xUpper -1e3 0);
point2 ($:aerofoil.xUpper 1e3 0);
radius $:domain.zMax;
}
}
vertices
(
project ($aerofoil.xLower -0.1 $domain.zMin) (cylinder)
($aerofoil.xTrail -0.1 $domain.zMin)
($domain.xMax -0.1 $domain.zMin)
project ($domain.xMin -0.1 $aerofoil.zLead) (cylinder)
project ($aerofoil.xLead -0.1 $aerofoil.zLead) (aerofoil)
project ($aerofoil.xTrail -0.1 $aerofoil.zTrail) (aerofoil)
($domain.xMax -0.1 $aerofoil.zTrail)
project ($aerofoil.xLower -0.1 $aerofoil.zLower) (aerofoil)
project ($aerofoil.xUpper -0.1 $aerofoil.zUpper) (aerofoil)
project ($aerofoil.xUpper -0.1 $domain.zMax) (aerofoil)
project ($aerofoil.xTrail -0.1 $domain.zMax) (aerofoil)
($domain.xMax -0.1 $domain.zMax)
project ($aerofoil.xLower 0.1 $domain.zMin) (cylinder)
($aerofoil.xTrail 0.1 $domain.zMin)
($domain.xMax 0.1 $domain.zMin)
project ($domain.xMin 0.1 $aerofoil.zLead) (cylinder)
project ($aerofoil.xLead 0.1 $aerofoil.zLead) (aerofoil)
project ($aerofoil.xTrail 0.1 $aerofoil.zTrail) (aerofoil)
($domain.xMax 0.1 $aerofoil.zTrail)
project ($aerofoil.xLower 0.1 $aerofoil.zLower) (aerofoil)
project ($aerofoil.xUpper 0.1 $aerofoil.zUpper) (aerofoil)
project ($aerofoil.xUpper 0.1 $domain.zMax) (aerofoil)
project ($aerofoil.xTrail 0.1 $domain.zMax) (aerofoil)
($domain.xMax 0.1 $domain.zMax)
);
blocks
(
hex ( 7 4 16 19 0 3 15 12)
($:domain.xUCells 1 $:domain.zCells)
edgeGrading
(
$:domain.leadGrading $:domain.leadGrading $:domain.xUGrading $:domain.xUGrading
1 1 1 1
$:domain.zGrading $:domain.zGrading $:domain.zGrading $:domain.zGrading
)
hex ( 5 7 19 17 1 0 12 13)
($:domain.xMCells 1 $:domain.zCells)
simpleGrading (1 1 $:domain.zGrading)
hex ( 17 18 6 5 13 14 2 1)
($:domain.xDCells 1 $:domain.zCells)
simpleGrading ($:domain.xDGrading 1 $:domain.zGrading)
hex ( 20 16 4 8 21 15 3 9)
($:domain.xUCells 1 $:domain.zCells)
edgeGrading
(
$:domain.leadGrading $:domain.leadGrading $:domain.xUGrading $:domain.xUGrading
1 1 1 1
$:domain.zGrading $:domain.zGrading $:domain.zGrading $:domain.zGrading
)
hex ( 17 20 8 5 22 21 9 10)
($:domain.xMCells 1 $:domain.zCells)
simpleGrading (1 1 $:domain.zGrading)
hex ( 5 6 18 17 10 11 23 22)
($:domain.xDCells 1 $:domain.zCells)
simpleGrading ($:domain.xDGrading 1 $:domain.zGrading)
);
edges
(
project 4 7 (aerofoil)
project 7 5 (aerofoil)
project 4 8 (aerofoil)
project 8 5 (aerofoil)
project 16 19 (aerofoil)
project 19 17 (aerofoil)
project 16 20 (aerofoil)
project 20 17 (aerofoil)
project 3 0 (cylinder)
project 3 9 (cylinder)
project 15 12 (cylinder)
project 15 21 (cylinder)
);
boundary
(
aerofoil
{
type wall;
faces
(
(4 7 19 16)
(7 5 17 19)
(5 8 20 17)
(8 4 16 20)
);
}
inlet
{
type patch;
inGroups (freestream);
faces
(
(3 0 12 15)
(0 1 13 12)
(1 2 14 13)
(11 10 22 23)
(10 9 21 22)
(9 3 15 21)
);
}
outlet
{
type patch;
inGroups (freestream);
faces
(
(2 6 18 14)
(6 11 23 18)
);
}
back
{
type empty;
faces
(
(3 4 7 0)
(7 5 1 0)
(5 6 2 1)
(3 9 8 4)
(9 10 5 8)