OpenFOAM: API Guide
v2112
The open source CFD toolbox
reactingParcelFoam.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-2020 OpenFOAM Foundation
9
Copyright (C) 2018-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
reactingParcelFoam
29
30
Group
31
grpLagrangianSolvers
32
33
Description
34
Transient solver for compressible, turbulent flow with a reacting,
35
multiphase particle cloud, and surface film modelling.
36
37
\*---------------------------------------------------------------------------*/
38
39
#include "
fvCFD.H
"
40
#include "
dynamicFvMesh.H
"
41
#include "
turbulentFluidThermoModel.H
"
42
#include "
surfaceFilmModel.H
"
43
#include "
rhoReactionThermo.H
"
44
#include "
CombustionModel.H
"
45
#include "
radiationModel.H
"
46
#include "
SLGThermo.H
"
47
#include "
fvOptions.H
"
48
#include "
pimpleControl.H
"
49
#include "
pressureControl.H
"
50
#include "
CorrectPhi.H
"
51
#include "
localEulerDdtScheme.H
"
52
#include "
fvcSmooth.H
"
53
#include "
cloudMacros.H
"
54
55
#ifndef CLOUD_BASE_TYPE
56
#define CLOUD_BASE_TYPE ReactingMultiphase
57
#define CLOUD_BASE_TYPE_NAME "reacting"
58
#endif
59
60
#include CLOUD_INCLUDE_FILE(CLOUD_BASE_TYPE)
61
#define basicReactingTypeCloud CLOUD_TYPE(CLOUD_BASE_TYPE)
62
63
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64
65
int
main(
int
argc,
char
*argv[])
66
{
67
argList::addNote
68
(
69
"Transient solver for compressible, turbulent flow"
70
" with reacting, multiphase particle clouds"
71
" and surface film modelling."
72
);
73
74
#define CREATE_MESH createMeshesPostProcess.H
75
#include "
postProcess.H
"
76
77
#include "
addCheckCaseOptions.H
"
78
#include "
setRootCaseLists.H
"
79
#include "
createTime.H
"
80
#include "
createDynamicFvMesh.H
"
81
#include "createDyMControls.H"
82
#include "createFields.H"
83
#include "createFieldRefs.H"
84
#include "createRegionControls.H"
85
#include "initContinuityErrs.H"
86
#include "
createRhoUfIfPresent.H
"
87
88
turbulence
->validate();
89
90
if
(!
LTS
)
91
{
92
#include "compressibleCourantNo.H"
93
#include "setInitialDeltaT.H"
94
}
95
96
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
97
98
Info
<<
"\nStarting time loop\n"
<<
endl
;
99
100
while
(
runTime
.run())
101
{
102
#include "
readDyMControls.H
"
103
104
// Store divrhoU from the previous mesh
105
// so that it can be mapped and used in correctPhi
106
// to ensure the corrected phi has the same divergence
107
autoPtr<volScalarField> divrhoU;
108
if
(
solvePrimaryRegion
&&
correctPhi
)
109
{
110
divrhoU.reset
111
(
112
new
volScalarField
113
(
114
"divrhoU"
,
115
fvc::div(fvc::absolute(
phi
,
rho
,
U
))
116
)
117
);
118
}
119
120
if
(
LTS
)
121
{
122
#include "setRDeltaT.H"
123
}
124
else
125
{
126
#include "compressibleCourantNo.H"
127
#include "setMultiRegionDeltaT.H"
128
}
129
130
++
runTime
;
131
132
Info
<<
"Time = "
<<
runTime
.timeName() <<
nl
<<
endl
;
133
134
// Store momentum to set rhoUf for introduced faces.
135
autoPtr<volVectorField> rhoU;
136
if
(
solvePrimaryRegion
&&
rhoUf
.valid())
137
{
138
rhoU.reset(
new
volVectorField
(
"rhoU"
,
rho
*
U
));
139
}
140
141
// Store the particle positions
142
parcels.storeGlobalPositions();
143
144
// Do any mesh changes
145
mesh
.update();
146
147
if
(
solvePrimaryRegion
&&
mesh
.changing())
148
{
149
gh
= (
g
&
mesh
.C()) - ghRef;
150
ghf
= (
g
&
mesh
.Cf()) - ghRef;
151
152
MRF
.update();
153
154
if
(
correctPhi
)
155
{
156
// Calculate absolute flux
157
// from the mapped surface velocity
158
phi
=
mesh
.Sf() &
rhoUf
();
159
160
#include "../../compressible/rhoPimpleFoam/correctPhi.H"
161
162
// Make the fluxes relative to the mesh-motion
163
fvc::makeRelative(
phi
,
rho
,
U
);
164
}
165
166
if
(
checkMeshCourantNo
)
167
{
168
#include "
meshCourantNo.H
"
169
}
170
}
171
172
parcels.evolve();
173
surfaceFilm
.evolve();
174
175
if
(
solvePrimaryRegion
)
176
{
177
if
(
pimple
.nCorrPIMPLE() <= 1)
178
{
179
#include "rhoEqn.H"
180
}
181
182
// --- PIMPLE loop
183
while
(
pimple
.loop())
184
{
185
#include "UEqn.H"
186
#include "YEqn.H"
187
#include "EEqn.H"
188
189
// --- Pressure corrector loop
190
while
(
pimple
.correct())
191
{
192
#include "pEqn.H"
193
}
194
195
if
(
pimple
.turbCorr())
196
{
197
turbulence
->correct();
198
}
199
}
200
201
rho
=
thermo
.rho();
202
}
203
204
runTime
.write();
205
206
runTime
.printExecutionTime(Info);
207
}
208
209
Info
<<
"End\n"
<<
endl
;
210
211
return
0;
212
}
213
214
215
// ************************************************************************* //
CombustionModel.H
CorrectPhi.H
SLGThermo.H
solvePrimaryRegion
bool solvePrimaryRegion(pimpleDict.getOrDefault("solvePrimaryRegion", true))
addCheckCaseOptions.H
Required Classes.
g
const uniformDimensionedVectorField & g
Definition:
createFluidFields.H:26
phi
surfaceScalarField & phi
Definition:
setRegionFluidFields.H:8
ghf
const surfaceScalarField & ghf
Definition:
setRegionFluidFields.H:18
MRF
IOMRFZoneList & MRF
Definition:
setRegionFluidFields.H:22
gh
const volScalarField & gh
Definition:
setRegionFluidFields.H:17
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...
cloudMacros.H
C-preprocessor cloud macros.
U
U
Definition:
pEqn.H:72
surfaceFilm
regionModels::surfaceFilmModel & surfaceFilm
Definition:
createFieldRefs.H:3
createDynamicFvMesh.H
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
LTS
bool LTS
Definition:
createRDeltaT.H:1
createRhoUfIfPresent.H
Creates and initialises the velocity field rhoUf if required.
rhoUf
autoPtr< surfaceVectorField > rhoUf
Definition:
createRhoUfIfPresent.H:33
createTime.H
dynamicFvMesh.H
turbulence
compressible::turbulenceModel & turbulence
Definition:
setRegionFluidFields.H:30
fvCFD.H
fvOptions.H
fvcSmooth.H
Provides functions smooth spread and sweep which use the FaceCellWave algorithm to smooth and redistr...
localEulerDdtScheme.H
meshCourantNo.H
Calculates and outputs the mean and maximum Courant Numbers.
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition:
volFieldsFwd.H:83
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
Foam::nl
constexpr char nl
The newline '\n' character (0x0a)
Definition:
Ostream.H:53
pimpleControl.H
postProcess.H
Execute application functionObjects to post-process existing results.
pressureControl.H
radiationModel.H
readDyMControls.H
checkMeshCourantNo
checkMeshCourantNo
Definition:
readDyMControls.H:9
correctPhi
correctPhi
Definition:
readDyMControls.H:3
rho
rho
Definition:
readInitialConditions.H:88
rhoReactionThermo.H
setRootCaseLists.H
surfaceFilmModel.H
turbulentFluidThermoModel.H
applications
solvers
lagrangian
reactingParcelFoam
reactingParcelFoam.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.