engineFoam.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Application
28 engineFoam
29
30Description
31 Transient solver for compressible, turbulent engine flow with a spray
32 particle cloud.
33
34\*---------------------------------------------------------------------------*/
35
36#include "fvCFD.H"
37#include "engineTime.H"
38#include "engineMesh.H"
40#include "basicSprayCloud.H"
41#include "psiReactionThermo.H"
42#include "CombustionModel.H"
43#include "radiationModel.H"
44#include "SLGThermo.H"
45#include "pimpleControl.H"
46#include "fvOptions.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50int main(int argc, char *argv[])
51{
52 argList::addNote
53 (
54 "Transient solver for compressible, turbulent engine flow"
55 " with a spray particle cloud."
56 );
57
58 #define CREATE_TIME createEngineTime.H
59 #define CREATE_MESH createEngineMesh.H
60 #include "postProcess.H"
61
62 #include "setRootCaseLists.H"
63 #include "createEngineTime.H"
64 #include "createEngineMesh.H"
65 #include "createControl.H"
67 #include "createFields.H"
68 #include "createFieldRefs.H"
69 #include "createRhoUf.H"
70 #include "compressibleCourantNo.H"
71 #include "setInitialDeltaT.H"
72 #include "initContinuityErrs.H"
73 #include "startSummary.H"
74
75 turbulence->validate();
76
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78
79 Info<< "\nStarting time loop\n" << endl;
80
81 while (runTime.run())
82 {
84 #include "compressibleCourantNo.H"
85 #include "setDeltaT.H"
86
87 ++runTime;
88
89 Info<< "Engine time = " << runTime.theta() << runTime.unit() << endl;
90
91 mesh.move();
92
93 parcels.evolve();
94
95 #include "rhoEqn.H"
96
97 // --- Pressure-velocity PIMPLE corrector loop
98 while (pimple.loop())
99 {
100 #include "UEqn.H"
101 #include "YEqn.H"
102 #include "EEqn.H"
103
104 // --- Pressure corrector loop
105 while (pimple.correct())
106 {
107 #include "pEqn.H"
108 }
109
110 if (pimple.turbCorr())
111 {
112 turbulence->correct();
113 }
114 }
115
116 #include "logSummary.H"
117
118 rho = thermo.rho();
119
120 if (runTime.write())
121 {
122 combustion->Qdot()().write();
123 }
124
125 runTime.printExecutionTime(Info);
126 }
127
128 Info<< "End\n" << endl;
129
130 return 0;
131}
132
133
134// ************************************************************************* //
pimpleControl & pimple
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
dynamicFvMesh & mesh
engineTime & runTime
Creates and initialises the velocity velocity field rhoUf.
compressible::turbulenceModel & turbulence
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
runTime write()
Execute application functionObjects to post-process existing results.
Info<< "Creating combustion model\n"<< endl;autoPtr< CombustionModel< psiReactionThermo > > combustion(CombustionModel< psiReactionThermo >::New(thermo, turbulence()))