multiphaseEulerFoam.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-------------------------------------------------------------------------------
11License
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
27Application
28 multiphaseEulerFoam
29
30Group
31 grpMultiphaseSolvers
32
33Description
34 Solver for a system of many compressible fluid phases including
35 heat-transfer.
36
37\*---------------------------------------------------------------------------*/
38
39#include "fvCFD.H"
40#include "multiphaseSystem.H"
41#include "phaseModel.H"
42#include "dragModel.H"
43#include "heatTransferModel.H"
46#include "pimpleControl.H"
47#include "IOMRFZoneList.H"
48#include "CorrectPhi.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52int main(int argc, char *argv[])
53{
54 argList::addNote
55 (
56 "Solver for a system of many compressible fluid phases including"
57 " heat-transfer."
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 "createFields.H"
68 #include "initContinuityErrs.H"
69 #include "createTimeControls.H"
70 #include "correctPhi.H"
71 #include "CourantNo.H"
72 #include "setInitialDeltaT.H"
73
74 scalar slamDampCoeff
75 (
76 fluid.getOrDefault<scalar>("slamDampCoeff", 1)
77 );
78
79 dimensionedScalar maxSlamVelocity
80 (
81 "maxSlamVelocity",
82 dimVelocity,
83 GREAT,
84 fluid
85 );
86
87 turbulence->validate();
88
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90
91 Info<< "\nStarting time loop\n" << endl;
92
93 while (runTime.run())
94 {
95 #include "readTimeControls.H"
96 #include "CourantNo.H"
97 #include "setDeltaT.H"
98
99 ++runTime;
100 Info<< "Time = " << runTime.timeName() << nl << endl;
101
102 // --- Pressure-velocity PIMPLE corrector loop
103 while (pimple.loop())
104 {
105 turbulence->correct();
106 fluid.solve();
107 rho = fluid.rho();
108 #include "zonePhaseVolumes.H"
109
110 //#include "TEqns.H"
111 #include "UEqns.H"
112
113 // --- Pressure corrector loop
114 while (pimple.correct())
115 {
116 #include "pEqn.H"
117 }
118
119 #include "DDtU.H"
120 }
121
122 runTime.write();
123
124 runTime.printExecutionTime(Info);
125 }
126
127 Info<< "End\n" << endl;
128
129 return 0;
130}
131
132
133// ************************************************************************* //
Required Classes.
pimpleControl & pimple
twoPhaseSystem & fluid
engineTime & runTime
Required Variables.
Read the control parameters used by setDeltaT.
compressible::turbulenceModel & turbulence
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
Execute application functionObjects to post-process existing results.
Read the control parameters used by setDeltaT.