05-09-2012, 04:43 PM
Tutorial simpleFoam
A simpleFoam tutorial.pdf (Size: 893.34 KB / Downloads: 257)
Introduction
This tutorial explains how to implement a case comprising incompressible flow around a 2D-airfoil
in order to compute the lift and drag coefficients during transition from laminar to turbulent flow.
In that case, we define a modified turbulence model which be capable to distinct between laminar
and turbulent zones. The transition location has been specified as a section cutting the
2D airfoil in an arbitrary distance from the airfoil nose. The grid is provided by a FORTRAN
code generating a blockMeshDict file for a 2D airfoil section and is imported to the OpenFOAM
(http://www-roc.inria.fr/MACS/spip.php?rubrique69). The proposed turbulence model is Spalart-
Allmaras model. The simpleFoam solver (which is steady-state solver for incompressible, turbulent
flow) is used for both laminar and turbulent zones.
Geometry
The geometry consists of a 2D airfoil created by a FORTRAN code. The airfoil coordinates are
specified in an input file called Airfoil.data. The mesh parameters can be selected in the input.data
file. For running the FORTRAN code, you need to open a terminal and go to the directory of it,
then type make to compile and finally type ./Airfoil. The blockMeshDict file is generated and
we can use it on OpenFoam to produce our geometry. All relevant parameters are shown in figure
(1.1).
Boundary and initial conditions
Since our case is different to the standard OpenFOAM tutorial for airfoil2D, the boundary and initial
conditions are changed as below. After running the blockMeshDict, the generated mesh consists of
five parts which are inlet, outlet, top, bottom and wing. The free stream velocity and angle of
attack are set to 75[m/s] and 5 degree, respectively. The pressure field is considered as relative
freestream pressure, equal to zero. Since our turbulence model is SpalartAllmaras model and the
solver is simpleFoam, we also need to define t and ˜ as initial conditions, similar to the value of the
OpenFOAM tutorial. The freestream BC has the type inlet/outlet meaning that it looks locally (for
every face of the patch) at the mass flow rate. If the flow is going outside the boundary will be locally
zero gradient, if it is going inside the boundary will be locally fixedValue. The freestreampressure
BC is a zeroGradient BC but it fixes the flux on the boundary.
Lift and Drag Forces Coefficient
In order to compute the lift and drag coefficients, we can use forceCoeffs functionObject. The
functionObjects are general libraries that can be attached run-time to any solver, without having
to re-compile the solver. The forceCoeffs functionObject is available on the sonicFoam solver.
We need to add the below part to the system/controlDict and modify the values relevant to our
case. In this function, the liftDir and dragDir are defined based on the angle of attack. The
magUInf denotes the magnitude of the freestream velocity. Please note that since the dimension of
the pressure in the compressible flow has been set different to the dimension of the pressure in the
incompressible flow, we need to define rhoName as rhoInf.