reactingMultiphaseEulerFoam.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 | Copyright (C) 2011-2015 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  reactingMultiphaseEulerFoam
26 
27 Description
28  Solver for a system of any number of compressible fluid phases with a
29  common pressure, but otherwise separate properties. The type of phase model
30  is run time selectable and can optionally represent multiple species and
31  in-phase reactions. The phase system is also run time selectable and can
32  optionally represent different types of momentun, heat and mass transfer.
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #include "fvCFD.H"
37 #include "multiphaseSystem.H"
39 #include "pimpleControl.H"
40 #include "localEulerDdtScheme.H"
41 #include "fvcSmooth.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 int main(int argc, char *argv[])
46 {
47  #include "setRootCase.H"
48 
49  #include "createTime.H"
50  #include "createMesh.H"
51 
52  pimpleControl pimple(mesh);
53 
54  #include "createTimeControls.H"
55  #include "createRDeltaT.H"
56  #include "createFields.H"
57 
58  if (!LTS)
59  {
60  #include "CourantNo.H"
61  #include "setInitialDeltaT.H"
62  }
63 
64  // Switch faceMomentum
65  // (
66  // pimple.dict().lookupOrDefault<Switch>("faceMomentum", false)
67  // );
68 
69  // Switch implicitPhasePressure
70  // (
71  // mesh.solverDict(alpha1.name()).lookupOrDefault<Switch>
72  // (
73  // "implicitPhasePressure", false
74  // )
75  // );
76 
77  //#include "pUf/createDDtU.H"
78 
79  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81  Info<< "\nStarting time loop\n" << endl;
82 
83  while (runTime.run())
84  {
85  #include "readTimeControls.H"
86 
87  if (LTS)
88  {
89  #include "setRDeltaT.H"
90  }
91  else
92  {
93  #include "CourantNo.H"
94  #include "setDeltaT.H"
95  }
96 
97  runTime++;
98  Info<< "Time = " << runTime.timeName() << nl << endl;
99 
100  // --- Pressure-velocity PIMPLE corrector loop
101  while (pimple.loop())
102  {
103  fluid.solve();
104  fluid.correct();
105 
106  #include "YEqns.H"
107 
108  // if (faceMomentum)
109  // {
110  // #include "pUf/UEqns.H"
111  // #include "EEqns.H"
112  // #include "pUf/pEqn.H"
113  // #include "pUf/DDtU.H"
114  // }
115  // else
116  {
117  #include "pU/UEqns.H"
118  #include "EEqns.H"
119  #include "pU/pEqn.H"
120  }
121 
122  fluid.correctKinematics();
123 
124  if (pimple.turbCorr())
125  {
126  fluid.correctTurbulence();
127  }
128  }
129 
130  runTime.write();
131 
132  Info<< "ExecutionTime = "
133  << runTime.elapsedCpuTime()
134  << " s\n\n" << endl;
135  }
136 
137  Info<< "End\n" << endl;
138 
139  return 0;
140 }
141 
142 
143 // ************************************************************************* //
multiphaseSystem & fluid
Definition: createFields.H:10
bool LTS
Definition: createRDeltaT.H:1
messageStream Info
dynamicFvMesh & mesh
const dictionary & pimple
static const char nl
Definition: Ostream.H:260
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Read the control parameters used by setDeltaT.
int main(int argc, char *argv[])
Definition: postCalc.C:54
Provides functions smooth spread and sweep which use the FaceCellWave algorithm to smooth and redistr...
Read the control parameters used by setDeltaT.