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) 2011-2015 OpenFOAM Foundation
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 
24 Application
25  PDRFoam
26 
27 Group
28  grpCombustionSolvers
29 
30 Description
31  Solver for compressible premixed/partially-premixed combustion with
32  turbulence modelling.
33 
34  Combusting RANS code using the b-Xi two-equation model.
35  Xi may be obtained by either the solution of the Xi transport
36  equation or from an algebraic exression. Both approaches are
37  based on Gulder's flame speed correlation which has been shown
38  to be appropriate by comparison with the results from the
39  spectral model.
40 
41  Strain effects are incorporated directly into the Xi equation
42  but not in the algebraic approximation. Further work need to be
43  done on this issue, particularly regarding the enhanced removal rate
44  caused by flame compression. Analysis using results of the spectral
45  model will be required.
46 
47  For cases involving very lean Propane flames or other flames which are
48  very strain-sensitive, a transport equation for the laminar flame
49  speed is present. This equation is derived using heuristic arguments
50  involving the strain time scale and the strain-rate at extinction.
51  the transport velocity is the same as that for the Xi equation.
52 
53  For large flames e.g. explosions additional modelling for the flame
54  wrinkling due to surface instabilities may be applied.
55 
56  PDR (porosity/distributed resistance) modelling is included to handle
57  regions containing blockages which cannot be resolved by the mesh.
58 
59  The fields used by this solver are:
60  \plaintable
61  betav | Volume porosity
62  Lobs | Average diameter of obstacle in cell (m)
63  Aw | Obstacle surface area per unit volume (1/m)
64  CR | Drag tensor (1/m)
65  CT | Turbulence generation parameter (1/m)
66  Nv | Number of obstacles in cell per unit volume (m^-2)
67  nsv | Tensor whose diagonal indicates the number to substract from
68  | Nv to get the number of obstacles crossing the flow in each
69  | direction.
70  \endplaintable
71 
72 \*---------------------------------------------------------------------------*/
73 
74 #include "fvCFD.H"
75 #include "psiuReactionThermo.H"
77 #include "laminarFlameSpeed.H"
78 #include "XiModel.H"
79 #include "PDRDragModel.H"
80 #include "ignition.H"
81 #include "Switch.H"
82 #include "bound.H"
83 #include "pimpleControl.H"
84 #include "fvOptions.H"
85 
86 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87 
88 int main(int argc, char *argv[])
89 {
90  #include "setRootCase.H"
91 
92  #include "createTime.H"
93  #include "createMesh.H"
94 
95  pimpleControl pimple(mesh);
96 
97  #include "readCombustionProperties.H"
98  #include "readGravitationalAcceleration.H"
99  #include "createFields.H"
100  #include "createMRF.H"
101  #include "createFvOptions.H"
102  #include "initContinuityErrs.H"
103  #include "createTimeControls.H"
104  #include "compressibleCourantNo.H"
105  #include "setInitialDeltaT.H"
106 
107  turbulence->validate();
108  scalar StCoNum = 0.0;
109 
110  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112  Info<< "\nStarting time loop\n" << endl;
113 
114  while (runTime.run())
115  {
116  #include "createTimeControls.H"
117  #include "compressibleCourantNo.H"
118  #include "setDeltaT.H"
119 
120  runTime++;
121  Info<< "\n\nTime = " << runTime.timeName() << endl;
122 
123  #include "rhoEqn.H"
124 
125  // --- Pressure-velocity PIMPLE corrector loop
126  while (pimple.loop())
127  {
128  #include "UEqn.H"
129 
130  // --- Pressure corrector loop
131  while (pimple.correct())
132  {
133  #include "bEqn.H"
134  #include "ftEqn.H"
135  #include "EauEqn.H"
136  #include "EaEqn.H"
137 
138  if (!ign.ignited())
139  {
140  thermo.heu() == thermo.he();
141  }
142 
143  #include "pEqn.H"
144  }
145 
146  if (pimple.turbCorr())
147  {
148  turbulence->correct();
149  }
150  }
151 
152  runTime.write();
153 
154  Info<< "\nExecutionTime = "
155  << runTime.elapsedCpuTime()
156  << " s\n" << endl;
157  }
158 
159  Info<< "\n end\n";
160 
161  return 0;
162 }
163 
164 
165 // ************************************************************************* //
psiuReactionThermo.H
fvOptions.H
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
laminarFlameSpeed.H
pimpleControl.H
createFvOptions.H
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
Foam::Info
messageStream Info
bound.H
Bound the given scalar field if it has gone unbounded.
ignition.H
Switch.H
main
int main(int argc, char *argv[])
Definition: postCalc.C:54
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
XiModel.H
setRootCase.H
createTimeControls.H
Read the control parameters used by setDeltaT.
createMesh.H
createTime.H
fvCFD.H
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
PDRDragModel.H
turbulentFluidThermoModel.H