A Modified Version of The Reactingfoam Tutorial For Les
A Modified Version of The Reactingfoam Tutorial For Les
Modifying creatFields.H
again in createFields.H we substitute RAS with LES in lines 61-63 and we also comment lines 72-74:
Compiling
We then change the file Make/files into:
reactingFoamLES.C
EXE = $(FOAM_USER_APPBIN)/reactingFoamLES
In the file Make/files again we change the RAS libraries with the LES ones, and add
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude\
EXE_INC = \ EXE_INC = \
-I../XiFoam \ -I../XiFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels/RAS \ -I$(LIB_SRC)/turbulenceModels/LES \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
| |
| |
EXE_LIBS = \ EXE_LIBS = \
-lcompressibleRASModels \ -lcompressibleLESModels \
-lcombustionThermophysicalModels\ -lcombustionThermophysicalModels \
http://openfoamwiki.net/index.php/Tut_reactingFoam_firstTutorial
wget http://openfoamwiki.net/images/b/b6/ReactingFoamCase.tar.gz
mkdir ReactingFoamCase
mv ReactingFoamCase.tar.gz ReactingFoamCase
cd ReactingFoamCase
tar xzf ReactingFoamCase.tar.gz
rm ReactingFoamCase.tar.gz
chemkin folder
The files *inp* contain the chemical reaction mechanisms, with the chemical elements, the species involved and
all the chemical reactions in the mechanism. For example the file chem.inp contains a simple one step reaction
mechanism for heptane (C7H16):
ELEMENTS
H O C N
END
SPECIE
C7H16 O2 N2 CO2 H2O
END
REACTIONS
C7H16 + 11O2 => 7CO2 + 8H2O 5.00E+8 0.0 15780.0! 1
FORD / C7H16 0.25 /
FORD / O2 1.5 /
END
chemkin folder
The file therm.dat instead contains for each species coefficients to compute heat capacity, hentalpy, enthropy,
heat of reactions. For example:
THERMO ALL
200.000 1000.000 5000.000
(CH2O)3 70590C 3H 6O 3 G 0200.00 4000.00 1500.00 1
0.01913678E+03 0.08578044E-01-0.08882060E-05-0.03574819E-08 0.06605143E-12 2
-0.06560876E+06-0.08432507E+03-0.04662286E+02 0.06091547E+00-0.04710536E-03 3
0.01968843E-06-0.03563271E-10-0.05665404E+06 0.04525265E+03 4
(CH3)2SICH2 61991H 8C 3SI 1 G 0200.00 2500.00 1500.00 1
0.01547852E+03 0.01065700E+00-0.01234345E-05-0.01293352E-07 0.02528715E-11 2
-0.06693076E+04-0.05358884E+03 0.02027522E+02 0.04408673E+00-0.03370024E-03 3
0.01484466E-06-0.02830898E-10 0.03931454E+05 0.01815821E+03 4
AL 62987AL 1 G 0200.00 5000.00 0600.00 1
0.02559589E+02-0.01063224E-02 0.07202828E-06-0.02121105E-09 0.02289429E-13 2
0.03890214E+06 0.05234522E+02 0.02736825E+02-0.05912374E-02-0.04033938E-05 3
0.02322343E-07-0.01705599E-10 0.03886795E+06 0.04363880E+02 4
constant folder
In the constant/thermophysicalProperties file we change the path of the chemical files:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
thermoType hMixtureThermo<reactingMixture>;
CHEMKINFile "/cluster/samples/reactingFoam/chemkin/chem.inp";
CHEMKINThermoFile "/cluster/samples/reactingFoam/chemkin/therm.dat";
inertSpecie N2;
becomes -------->
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
thermoType hMixtureThermo<reactingMixture>;
CHEMKINFile "chemkin/chem.inp";
CHEMKINThermoFile "chemkin/therm.dat";
inertSpecie N2;
constant folder
From the tutFiles directory we copy the chemistryProperties file
cp ../reactingFoamLES/tutFiles/chemistryProperties constant/
where the sequential solver is selected:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
chemistry on;
turbulentReaction off;
Cmix Cmix [ 0 0 0 0 0 0 0 ] 1.0 ;
//chemistrySolver ODE;
//chemistrySolver EulerImplicit;
chemistrySolver sequential;
initialChemicalTimeStep 1.0e-8;
constant folder
We also need a file for the LES properties, we take it from a LES tutorial, for example coodles:
cp /chalmers/sw/unsup/OpenFOAM/OpenFOAM-1.5.x/tutorials/coodles \
/pitzDaily/constant/LESProperties constant/
And we choose the Smagorinsky for the turbulence model:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
LESModel Smagorinsky;
printCoeffs off;
delta cubeRootVol;
system folder
In the file system/controlDict file we change the name of the application to reactingLESFoam
boundaryField
{
inlet
{
type fixedValue;
value uniform 0.0;
}
lowerInlet
{
type fixedValue;
value uniform 0.0;
}
outlet
{
type zeroGradient;
}
upperWall
{
type zeroGradient;
}
cp 0/C7H16 0/CH4
Accordingly the constant/thermophysicalProperties file should be updated:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
thermoType hMixtureThermo<reactingMixture>;
//CHEMKINFile "chemkin/chem.inp";
CHEMKINFile "chemkin/WD2steps.inp";
CHEMKINThermoFile "chemkin/therm.dat";