reactingFoam.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  reactingFoam
26 
27 Group
28  grpCombustionSolvers
29 
30 Description
31  Solver for combustion with chemical reactions.
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #include "fvCFD.H"
37 #include "psiCombustionModel.H"
38 #include "multivariateScheme.H"
39 #include "pimpleControl.H"
40 #include "fvOptions.H"
41 #include "localEulerDdtScheme.H"
42 #include "fvcSmooth.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 int main(int argc, char *argv[])
47 {
48  #include "setRootCase.H"
49  #include "createTime.H"
50  #include "createMesh.H"
51 
52  pimpleControl pimple(mesh);
53 
54  #include "createTimeControls.H"
55  #include "createRDeltaT.H"
56  #include "initContinuityErrs.H"
57  #include "createFields.H"
58  #include "createMRF.H"
59  #include "createFvOptions.H"
60 
61  turbulence->validate();
62 
63  if (!LTS)
64  {
65  #include "compressibleCourantNo.H"
66  #include "setInitialDeltaT.H"
67  }
68 
69  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71  Info<< "\nStarting time loop\n" << endl;
72 
73  while (runTime.run())
74  {
75  #include "readTimeControls.H"
76 
77  if (LTS)
78  {
79  #include "setRDeltaT.H"
80  }
81  else
82  {
83  #include "compressibleCourantNo.H"
84  #include "setDeltaT.H"
85  }
86 
87  runTime++;
88 
89  Info<< "Time = " << runTime.timeName() << nl << endl;
90 
91  #include "rhoEqn.H"
92 
93  while (pimple.loop())
94  {
95  #include "UEqn.H"
96  #include "YEqn.H"
97  #include "EEqn.H"
98 
99  // --- Pressure corrector loop
100  while (pimple.correct())
101  {
102  if (pimple.consistent())
103  {
104  #include "pcEqn.H"
105  }
106  else
107  {
108  #include "pEqn.H"
109  }
110  }
111 
112  if (pimple.turbCorr())
113  {
114  turbulence->correct();
115  }
116  }
117 
118  runTime.write();
119 
120  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
121  << " ClockTime = " << runTime.elapsedClockTime() << " s"
122  << nl << endl;
123  }
124 
125  Info<< "End\n" << endl;
126 
127  return 0;
128 }
129 
130 
131 // ************************************************************************* //
fvOptions.H
multivariateScheme.H
createRDeltaT.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
pimpleControl.H
createFvOptions.H
localEulerDdtScheme.H
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
main
int main(int argc, char *argv[])
Definition: postCalc.C:54
LTS
bool LTS
Definition: createRDeltaT.H:1
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
setRootCase.H
createTimeControls.H
Read the control parameters used by setDeltaT.
readTimeControls.H
Read the control parameters used by setDeltaT.
createMesh.H
createTime.H
fvCFD.H
psiCombustionModel.H
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
turbulentFluidThermoModel.H
fvcSmooth.H
Provides functions smooth spread and sweep which use the FaceCellWave algorithm to smooth and redistr...