OpenFOAM: API Guide
v2112
The open source CFD toolbox
twoPhaseEulerFoam.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
twoPhaseEulerFoam
29
30
Group
31
grpMultiphaseSolvers
32
33
Description
34
Solver for a system of two compressible fluid phases with one dispersed
35
phase. Eg, gas bubbles in a liquid including heat-transfer.
36
37
\*---------------------------------------------------------------------------*/
38
39
#include "
fvCFD.H
"
40
#include "twoPhaseSystem.H"
41
#include "
PhaseCompressibleTurbulenceModel.H
"
42
#include "
pimpleControl.H
"
43
#include "
fvOptions.H
"
44
#include "
fixedValueFvsPatchFields.H
"
45
46
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48
int
main(
int
argc,
char
*argv[])
49
{
50
argList::addNote
51
(
52
"Solver for a system of two compressible fluid phases with one"
53
" dispersed phase.\n"
54
"Eg, gas bubbles in a liquid including heat-transfer."
55
);
56
57
#include "
postProcess.H
"
58
59
#include "
addCheckCaseOptions.H
"
60
#include "
setRootCaseLists.H
"
61
#include "
createTime.H
"
62
#include "
createMesh.H
"
63
#include "createControl.H"
64
#include "createFields.H"
65
#include "createFieldRefs.H"
66
#include "
createTimeControls.H
"
67
#include "CourantNos.H"
68
#include "setInitialDeltaT.H"
69
70
bool
faceMomentum
71
(
72
pimple
.dict().getOrDefault(
"faceMomentum"
,
false
)
73
);
74
75
bool
implicitPhasePressure
76
(
77
mesh
.solverDict(
alpha1
.name()).getOrDefault
78
(
79
"implicitPhasePressure"
,
false
80
)
81
);
82
83
#include "
pUf/createDDtU.H
"
84
#include "
pU/createDDtU.H
"
85
86
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87
88
Info
<<
"\nStarting time loop\n"
<<
endl
;
89
90
while
(
runTime
.run())
91
{
92
#include "
readTimeControls.H
"
93
#include "CourantNos.H"
94
#include "setDeltaT.H"
95
96
++
runTime
;
97
Info
<<
"Time = "
<<
runTime
.timeName() <<
nl
<<
endl
;
98
99
// --- Pressure-velocity PIMPLE corrector loop
100
while
(
pimple
.loop())
101
{
102
fluid
.solve();
103
fluid
.correct();
104
105
#include "
contErrs.H
"
106
107
if
(
faceMomentum
)
108
{
109
#include "pUf/UEqns.H"
110
#include "EEqns.H"
111
#include "pUf/pEqn.H"
112
#include "
pUf/DDtU.H
"
113
}
114
else
115
{
116
#include "pU/UEqns.H"
117
#include "EEqns.H"
118
#include "pU/pEqn.H"
119
#include "
pU/DDtU.H
"
120
}
121
122
if
(
pimple
.turbCorr())
123
{
124
fluid
.correctTurbulence();
125
}
126
}
127
128
#include "write.H"
129
130
runTime
.printExecutionTime(
Info
);
131
}
132
133
Info
<<
"End\n"
<<
endl
;
134
135
return
0;
136
}
137
138
139
// ************************************************************************* //
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
fvOptions.H
DDtU.H
DDtU.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:369
alpha1
const volScalarField & alpha1
Definition:
setRegionFluidFields.H:8
fluid
twoPhaseSystem & fluid
Definition:
setRegionFluidFields.H:3
PhaseCompressibleTurbulenceModel.H
pimpleControl.H
pimple
pimpleControl & pimple
Definition:
setRegionFluidFields.H:56
setRootCaseLists.H
addCheckCaseOptions.H
Required Classes.
faceMomentum
Switch faceMomentum(pimpleDict.getOrDefault< Switch >("faceMomentum", false))
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
createDDtU.H
fixedValueFvsPatchFields.H
contErrs.H
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
postProcess.H
Execute application functionObjects to post-process existing results.
Foam::nl
constexpr char nl
Definition:
Ostream.H:404
createTimeControls.H
Read the control parameters used by setDeltaT.
readTimeControls.H
Read the control parameters used by setDeltaT.
createMesh.H
Required Variables.
createTime.H
createDDtU.H
fvCFD.H
applications
solvers
multiphase
twoPhaseEulerFoam
twoPhaseEulerFoam.C
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.