OpenFOAM
6
The OpenFOAM Foundation
applications
solvers
multiphase
twoPhaseEulerFoam
twoPhaseEulerFoam.C
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration | Website: https://openfoam.org
5
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
11
OpenFOAM is free software: you can redistribute it and/or modify it
12
under the terms of the GNU General Public License as published by
13
the Free Software Foundation, either version 3 of the License, or
14
(at your option) any later version.
15
16
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19
for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23
24
Application
25
twoPhaseEulerFoam
26
27
Description
28
Solver for a system of 2 compressible fluid phases with one phase
29
dispersed, e.g. gas bubbles in a liquid including heat-transfer.
30
31
\*---------------------------------------------------------------------------*/
32
33
#include "
fvCFD.H
"
34
#include "twoPhaseSystem.H"
35
#include "
PhaseCompressibleTurbulenceModel.H
"
36
#include "
pimpleControl.H
"
37
#include "
fvOptions.H
"
38
#include "
fixedValueFvsPatchFields.H
"
39
40
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41
42
int
main(
int
argc,
char
*argv[])
43
{
44
#include "
postProcess.H
"
45
46
#include "
setRootCaseLists.H
"
47
#include "
createTime.H
"
48
#include "
createMesh.H
"
49
#include "createControl.H"
50
#include "createFields.H"
51
#include "createFieldRefs.H"
52
#include "
createTimeControls.H
"
53
#include "CourantNos.H"
54
#include "setInitialDeltaT.H"
55
56
Switch faceMomentum
57
(
58
pimple
.dict().lookupOrDefault<Switch>(
"faceMomentum"
,
false
)
59
);
60
61
Switch implicitPhasePressure
62
(
63
mesh
.solverDict(
alpha1
.name()).lookupOrDefault<Switch>
64
(
65
"implicitPhasePressure"
,
false
66
)
67
);
68
69
#include "
pUf/createDDtU.H
"
70
#include "
pU/createDDtU.H
"
71
72
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73
74
Info
<<
"\nStarting time loop\n"
<<
endl
;
75
76
while
(
runTime
.run())
77
{
78
#include "
readTimeControls.H
"
79
#include "CourantNos.H"
80
#include "setDeltaT.H"
81
82
runTime
++;
83
Info
<<
"Time = "
<<
runTime
.timeName() <<
nl
<<
endl
;
84
85
// --- Pressure-velocity PIMPLE corrector loop
86
while
(
pimple
.loop())
87
{
88
fluid
.solve();
89
fluid
.correct();
90
91
#include "
contErrs.H
"
92
93
if
(faceMomentum)
94
{
95
#include "pUf/UEqns.H"
96
#include "EEqns.H"
97
#include "pUf/pEqn.H"
98
#include "
pUf/DDtU.H
"
99
}
100
else
101
{
102
#include "pU/UEqns.H"
103
#include "EEqns.H"
104
#include "pU/pEqn.H"
105
#include "
pU/DDtU.H
"
106
}
107
108
if
(
pimple
.turbCorr())
109
{
110
fluid
.correctTurbulence();
111
}
112
}
113
114
#include "write.H"
115
116
Info
<<
"ExecutionTime = "
117
<<
runTime
.elapsedCpuTime()
118
<<
" s\n\n"
<<
endl
;
119
}
120
121
Info
<<
"End\n"
<<
endl
;
122
123
return
0;
124
}
125
126
127
// ************************************************************************* //
fvCFD.H
DDtU.H
createDDtU.H
pimple
pimpleNoLoopControl & pimple
Definition:
setRegionFluidFields.H:60
fluid
multiphaseSystem & fluid
Definition:
createFields.H:11
setRootCaseLists.H
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:256
readTimeControls.H
Read the control parameters used by setDeltaT.
fixedValueFvsPatchFields.H
createTime.H
contErrs.H
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:18
alpha1
const volScalarField & alpha1
Definition:
createFieldRefs.H:4
Foam::nl
static const char nl
Definition:
Ostream.H:265
createDDtU.H
createMesh.H
DDtU.H
fvOptions.H
PhaseCompressibleTurbulenceModel.H
pimpleControl.H
Foam::Info
messageStream Info
postProcess.H
Execute application functionObjects to post-process existing results.
createTimeControls.H
Read the control parameters used by setDeltaT.
Generated by
1.8.13