OpenFOAM: API Guide
v2112
The open source CFD toolbox
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
-------------------------------------------------------------------------------
11
License
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
27
Application
28
engineFoam
29
30
Description
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
"
39
#include "
turbulentFluidThermoModel.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
50
int
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"
66
#include "
readEngineTimeControls.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
{
83
#include "
readEngineTimeControls.H
"
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
// ************************************************************************* //
CombustionModel.H
SLGThermo.H
basicSprayCloud.H
pimple
pimpleControl & pimple
Definition:
setRegionFluidFields.H:56
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
createEngineMesh.H
createEngineTime.H
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
createRhoUf.H
Creates and initialises the velocity velocity field rhoUf.
engineMesh.H
engineTime.H
turbulence
compressible::turbulenceModel & turbulence
Definition:
setRegionFluidFields.H:30
fvCFD.H
fvOptions.H
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:372
write
runTime write()
pimpleControl.H
postProcess.H
Execute application functionObjects to post-process existing results.
psiReactionThermo.H
radiationModel.H
readEngineTimeControls.H
rho
rho
Definition:
readInitialConditions.H:88
setRootCaseLists.H
combustion
Info<< "Creating combustion model\n"<< endl;autoPtr< CombustionModel< psiReactionThermo > > combustion(CombustionModel< psiReactionThermo >::New(thermo, turbulence()))
turbulentFluidThermoModel.H
applications
solvers
lagrangian
sprayFoam
engineFoam
engineFoam.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.