ENH: update nacaAirfoil tutorial to use prostar4 mesh

- Replaces prostar3 mesh format, which we no longer support.
- Update initial conditions to use regex and include file.
This commit is contained in:
Mark Olesen 2016-10-07 19:11:50 +02:00
parent ba6f59a79e
commit 91ed12d91c
19 changed files with 169 additions and 79 deletions

View File

@ -14,32 +14,27 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
internalField uniform $temperature;
boundaryField
{
INLE1
"(inlet|outlet).*"
{
type inletOutlet;
inletValue uniform 300;
value uniform 300;
inletValue uniform $temperature;
value $internalField;
}
OUTL2
{
type inletOutlet;
inletValue uniform 300;
value uniform 300;
}
SYMP3
"sym.*"
{
type empty;
}
WALL10
"wall.*"
{
type zeroGradient;
}

View File

@ -14,35 +14,37 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 1 -1 0 0 0 0];
internalField uniform (600 148.16 0);
internalField uniform $flowVelocity;
boundaryField
{
INLE1
"inlet.*"
{
type supersonicFreestream;
pInf 100000;
TInf 300;
UInf (600 148.16 0);
pInf $pressure;
TInf $temperature;
UInf $flowVelocity;
gamma 1.4;
value uniform (600 148.16 0);
value $internalField;
}
OUTL2
"outlet.*"
{
type inletOutlet;
inletValue uniform (600 148.16 0);
value uniform (600 148.16 0);
inletValue uniform $flowVelocity;
value $internalField;
}
SYMP3
"sym.*"
{
type empty;
}
WALL10
"wall.*"
{
type noSlip;
}

View File

@ -21,21 +21,18 @@ internalField uniform 0;
boundaryField
{
INLE1
"(inlet|outlet).*"
{
type calculated;
value uniform 0;
}
OUTL2
{
type calculated;
value uniform 0;
}
SYMP3
"sym.*"
{
type empty;
}
WALL10
"wall.*"
{
type compressible::alphatWallFunction;
Prt 0.85;

View File

@ -15,35 +15,33 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 2 -3 0 0 0 0];
internalField uniform 25000;
internalField uniform $turbulentEpsilon;
boundaryField
{
INLE1
"(inlet|outlet).*"
{
type inletOutlet;
inletValue uniform 25000;
value uniform 25000;
inletValue uniform $turbulentEpsilon;
value $internalField;
}
OUTL2
{
type inletOutlet;
inletValue uniform 25000;
value uniform 25000;
}
SYMP3
"sym.*"
{
type empty;
}
WALL10
"wall.*"
{
type epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 25000;
value uniform $turbulentEpsilon;
}
}

View File

@ -0,0 +1,15 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
flowVelocity (600 148.16 0);
pressure 100000;
temperature 300;
turbulentKE 1000;
turbulentEpsilon 25000;
// ************************************************************************* //

View File

@ -15,32 +15,30 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [0 2 -2 0 0 0 0];
internalField uniform 1000;
internalField uniform $turbulentKE;
boundaryField
{
INLE1
"(inlet|outlet).*"
{
type inletOutlet;
inletValue uniform 1000;
value uniform 1000;
inletValue uniform $turbulentKE;
value $internalField;
}
OUTL2
{
type inletOutlet;
inletValue uniform 1000;
value uniform 1000;
}
SYMP3
"sym.*"
{
type empty;
}
WALL10
"wall.*"
{
type kqRWallFunction;
value uniform 1000;
value $internalField;
}
}

View File

@ -21,21 +21,18 @@ internalField uniform 0;
boundaryField
{
INLE1
"(inlet|outlet).*"
{
type calculated;
value uniform 0;
}
OUTL2
{
type calculated;
value uniform 0;
}
SYMP3
"sym.*"
{
type empty;
}
WALL10
"wall.*"
{
type nutkWallFunction;
Cmu 0.09;

View File

@ -14,34 +14,36 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include/initialConditions"
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 100000;
internalField uniform $pressure;
boundaryField
{
INLE1
"inlet.*"
{
type zeroGradient;
}
OUTL2
"outlet.*"
{
type waveTransmissive;
field p;
psi thermo:psi;
gamma 1.3;
fieldInf 100000;
fieldInf $pressure;
lInf 1;
value uniform 100000;
value $internalField;
}
SYMP3
"sym.*"
{
type empty;
}
WALL10
"wall.*"
{
type zeroGradient;
}

View File

@ -5,6 +5,13 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
rm -f constant/polyMesh/boundary > /dev/null 2>&1
rm -f constant/polyMesh/boundary > /dev/null 2>&1
# Don't need these extra files (from star4ToFoam conversion)
rm -f \
constant/cellTable \
constant/polyMesh/cellTableId \
constant/polyMesh/interfaces \
constant/polyMesh/origCellId > /dev/null 2>&1
#------------------------------------------------------------------------------

View File

@ -4,13 +4,33 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name
application=$(getApplication)
runApplication star3ToFoam prostar/nacaAirfoil
# Convert mesh from resources directory
runApplication star4ToFoam -scale 1 \
$FOAM_TUTORIALS/resources/geometry/nacaAirfoil/nacaAirfoil
# Symmetry plane -> empy
sed -i -e 's/symmetry\([)]*;\)/empty\1/' constant/polyMesh/boundary
runApplication $application
# Don't need these extra files (from star4ToFoam conversion)
rm -f \
constant/cellTable \
constant/polyMesh/cellTableId \
constant/polyMesh/interfaces \
constant/polyMesh/origCellId > /dev/null 2>&1
if isParallel "$@"
then
# Parallel
runApplication decomposePar
runParallel $(getApplication)
else
# Serial
runApplication $(getApplication)
fi
#------------------------------------------------------------------------------

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 6;
method simple;
simpleCoeffs
{
n (3 2 1);
delta 0.001;
}
hierarchicalCoeffs
{
n (3 2 1);
delta 0.001;
order xyz;
}
// ************************************************************************* //

View File

@ -0,0 +1,8 @@
nacaAirfoil
~~~~~~~~~~~
* large domain with airfoil section near centre
* extremely non-orthogonal, highly skew mesh refined around the airfoil
* running at Mach 1.78
* limited corrected 0.5 on all laplacianSchemes because the mesh is so poor
* run to t = 0.02 with nextWrite; change to stopAt endTime to continue running
* deltaT can be increased later in the run to 2e-07

View File

@ -0,0 +1,15 @@
! ------------------------------
! PROSTAR file of NACA airfoil
! 40000 cells, 80860 points
! scaling = meters
! ------------------------------
ctable 2 fluid ,,,,,,
ctname 2 fluid
*set icvo mxv - 1" << nl
vread nacaAirfoil.vrt icvo,,,coded
cread nacaAirfoil.cel icvo,,,add,coded
*set icvo
! end