coldEngineFoam.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  engineFoam
26 
27 Description
28  Solver for cold-flow in internal combustion engines.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #include "fvCFD.H"
33 #include "engineTime.H"
34 #include "engineMesh.H"
35 #include "psiThermo.H"
37 #include "OFstream.H"
38 #include "fvIOoptionList.H"
39 #include "pimpleControl.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 int main(int argc, char *argv[])
44 {
45  #include "setRootCase.H"
46 
47  #include "createEngineTime.H"
48  #include "createEngineMesh.H"
49 
50  pimpleControl pimple(mesh);
51 
52  #include "createFields.H"
53  #include "createMRF.H"
54  #include "createFvOptions.H"
55  #include "createRhoUf.H"
56  #include "initContinuityErrs.H"
57  #include "readEngineTimeControls.H"
58  #include "compressibleCourantNo.H"
59  #include "setInitialDeltaT.H"
60  #include "startSummary.H"
61 
62  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64  Info<< "\nStarting time loop\n" << endl;
65 
66  while (runTime.run())
67  {
68  #include "readEngineTimeControls.H"
69  #include "compressibleCourantNo.H"
70  #include "setDeltaT.H"
71 
72  runTime++;
73 
74  Info<< "Crank angle = " << runTime.theta() << " CA-deg"
75  << endl;
76 
77  mesh.move();
78 
79  #include "rhoEqn.H"
80 
81  // --- Pressure-velocity PIMPLE corrector loop
82  while (pimple.loop())
83  {
84  #include "UEqn.H"
85 
86  // --- Pressure corrector loop
87  while (pimple.correct())
88  {
89  #include "EEqn.H"
90  #include "pEqn.H"
91  }
92 
93  if (pimple.turbCorr())
94  {
95  turbulence->correct();
96  }
97  }
98 
99  runTime.write();
100 
101  #include "logSummary.H"
102 
103  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
104  << " ClockTime = " << runTime.elapsedClockTime() << " s"
105  << nl << endl;
106  }
107 
108  Info<< "End\n" << endl;
109 
110  return 0;
111 }
112 
113 
114 // ************************************************************************* //
messageStream Info
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
dynamicFvMesh & mesh
const dictionary & pimple
static const char nl
Definition: Ostream.H:260
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
int main(int argc, char *argv[])
Definition: postCalc.C:54
Creates and initialises the velocity velocity field rhoUf.