FreeFOAM The Cross-Platform CFD Toolkit
PDRFoam.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 
25 Application
26  PDRFoam
27 
28 Description
29  Solver for compressible premixed/partially-premixed combustion with
30  turbulence modelling.
31 
32  Combusting RANS code using the b-Xi two-equation model.
33  Xi may be obtained by either the solution of the Xi transport
34  equation or from an algebraic exression. Both approaches are
35  based on Gulder's flame speed correlation which has been shown
36  to be appropriate by comparison with the results from the
37  spectral model.
38 
39  Strain effects are incorporated directly into the Xi equation
40  but not in the algebraic approximation. Further work need to be
41  done on this issue, particularly regarding the enhanced removal rate
42  caused by flame compression. Analysis using results of the spectral
43  model will be required.
44 
45  For cases involving very lean Propane flames or other flames which are
46  very strain-sensitive, a transport equation for the laminar flame
47  speed is present. This equation is derived using heuristic arguments
48  involving the strain time scale and the strain-rate at extinction.
49  the transport velocity is the same as that for the Xi equation.
50 
51  For large flames e.g. explosions additional modelling for the flame
52  wrinkling due to surface instabilities may be applied.
53 
54  PDR (porosity/distributed resistance) modelling is included to handle
55  regions containing blockages which cannot be resolved by the mesh.
56 
57 Usage
58  - PDRFoam [OPTION]
59 
60  @param -case <dir> \n
61  Specify the case directory
62 
63  @param -parallel \n
64  Run the case in parallel
65 
66  @param -help \n
67  Display short usage message
68 
69  @param -doc \n
70  Display Doxygen documentation page
71 
72  @param -srcDoc \n
73  Display source code
74 
75 \*---------------------------------------------------------------------------*/
76 
77 #include <finiteVolume/fvCFD.H>
83 #include <engine/ignition.H>
84 #include <OpenFOAM/Switch.H>
85 #include <finiteVolume/bound.H>
86 
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 
89 int main(int argc, char *argv[])
90 {
91  #include <OpenFOAM/setRootCase.H>
92 
93  #include <OpenFOAM/createTime.H>
94  #include <OpenFOAM/createMesh.H>
97  #include "createFields.H"
100  #include <finiteVolume/CourantNo.H>
102 
103  scalar StCoNum = 0.0;
104 
105  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107  Info<< "\nStarting time loop\n" << endl;
108 
109  while (runTime.run())
110  {
113  #include <finiteVolume/CourantNo.H>
114  #include "setDeltaT.H"
115 
116 
117  runTime++;
118 
119  Info<< "\n\nTime = " << runTime.timeName() << endl;
120 
121  #include "rhoEqn.H"
122  #include "UEqn.H"
123 
124  // --- PISO loop
125  for (int corr=1; corr<=nCorr; corr++)
126  {
127  #include "bEqn.H"
128  #include "ftEqn.H"
129  #include "huEqn.H"
130  #include "hEqn.H"
131 
132  if (!ign.ignited())
133  {
134  hu == h;
135  }
136 
137  #include "pEqn.H"
138  }
139 
140  turbulence->correct();
141 
142  runTime.write();
143 
144  Info<< "\nExecutionTime = "
145  << runTime.elapsedCpuTime()
146  << " s\n" << endl;
147  }
148 
149  Info<< "\n end\n";
150 
151  return 0;
152 }
153 
154 
155 // ************************ vim: set sw=4 sts=4 et: ************************ //