OpenFOAM
v2312
The open source CFD toolbox
reactingTwoPhaseEulerFoam.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-2016 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
reactingTwoPhaseEulerFoam
29
30
Group
31
grpMultiphaseSolvers
32
33
Description
34
Solver for a system of two compressible fluid phases with a common pressure,
35
but otherwise separate properties. The type of phase model is run time
36
selectable and can optionally represent multiple species and in-phase
37
reactions. The phase system is also run time selectable and can optionally
38
represent different types of momentum, heat and mass transfer.
39
40
\*---------------------------------------------------------------------------*/
41
42
#include "
fvCFD.H
"
43
#include "twoPhaseSystem.H"
44
#include "phaseCompressibleTurbulenceModel.H"
45
#include "
pimpleControl.H
"
46
#include "
localEulerDdtScheme.H
"
47
#include "
fvcSmooth.H
"
48
49
50
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52
int
main(
int
argc,
char
*argv[])
53
{
54
argList::addNote
55
(
56
"Solver for a system of two compressible fluid phases with a"
57
" common pressure, but otherwise separate properties."
58
);
59
60
#include "
postProcess.H
"
61
62
#include "
addCheckCaseOptions.H
"
63
#include "
setRootCaseLists.H
"
64
#include "
createTime.H
"
65
#include "
createMesh.H
"
66
#include "createControl.H"
67
#include "
createTimeControls.H
"
68
#include "createFields.H"
69
#include "createFieldRefs.H"
70
71
if
(!
LTS
)
72
{
73
#include "CourantNo.H"
74
#include "setInitialDeltaT.H"
75
}
76
77
bool
faceMomentum
78
(
79
pimple
.dict().getOrDefault(
"faceMomentum"
,
false
)
80
);
81
82
#include "
pUf/createRDeltaTf.H
"
83
84
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86
Info
<<
"\nStarting time loop\n"
<<
endl
;
87
88
while
(
runTime
.run())
89
{
90
#include "
readTimeControls.H
"
91
92
int
nEnergyCorrectors
93
(
94
pimple
.dict().getOrDefault<
int
>(
"nEnergyCorrectors"
, 1)
95
);
96
97
if
(
LTS
)
98
{
99
#include "setRDeltaT.H"
100
if
(
faceMomentum
)
101
{
102
#include "
setRDeltaTf.H
"
103
}
104
}
105
else
106
{
107
#include "CourantNos.H"
108
#include "setDeltaT.H"
109
}
110
111
++
runTime
;
112
Info
<<
"Time = "
<<
runTime
.timeName() <<
nl
<<
endl
;
113
114
// --- Pressure-velocity PIMPLE corrector loop
115
while
(
pimple
.loop())
116
{
117
fluid
.solve();
118
fluid
.correct();
119
120
#include "YEqns.H"
121
122
if
(
faceMomentum
)
123
{
124
#include "pUf/UEqns.H"
125
#include "EEqns.H"
126
#include "pUf/pEqn.H"
127
}
128
else
129
{
130
#include "pU/UEqns.H"
131
#include "EEqns.H"
132
#include "pU/pEqn.H"
133
}
134
135
fluid
.correctKinematics();
136
137
if
(
pimple
.turbCorr())
138
{
139
fluid
.correctTurbulence();
140
}
141
}
142
143
runTime
.write();
144
145
runTime
.printExecutionTime(
Info
);
146
}
147
148
Info
<<
"End\n"
<<
endl
;
149
150
return
0;
151
}
152
153
154
// ************************************************************************* //
fvCFD.H
fluid
twoPhaseSystem & fluid
Definition:
setRegionFluidFields.H:1
faceMomentum
Switch faceMomentum(pimpleDict.getOrDefault< Switch >("faceMomentum", false))
setRootCaseLists.H
Foam::nl
constexpr char nl
The newline '\n' character (0x0a)
Definition:
Ostream.H:50
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:531
readTimeControls.H
Read the control parameters used by setDeltaT.
createTime.H
nEnergyCorrectors
int nEnergyCorrectors(pimpleDict.getOrDefault< int >("nEnergyCorrectors", 1))
LTS
bool LTS
Definition:
createRDeltaT.H:1
pimple
pimpleControl & pimple
Definition:
setRegionFluidFields.H:54
setRDeltaTf.H
createMesh.H
Required Classes.
createRDeltaTf.H
pimpleControl.H
localEulerDdtScheme.H
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
postProcess.H
Execute application functionObjects to post-process existing results.
addCheckCaseOptions.H
Required Classes.
fvcSmooth.H
Provides functions smooth spread and sweep which use the FaceCellWave algorithm to smooth and redistr...
createTimeControls.H
Read the control parameters used by setDeltaT.
applications
solvers
multiphase
reactingTwoPhaseEulerFoam
reactingTwoPhaseEulerFoam.C
Generated by
1.8.14