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-2016 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"
38 #include "pimpleControl.H"
39 #include "localEulerDdtScheme.H"
40 #include "fvcSmooth.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 int main(int argc, char *argv[])
45 {
46  #include "postProcess.H"
47 
48  #include "setRootCase.H"
49  #include "createTime.H"
50  #include "createMesh.H"
51  #include "createControl.H"
52  #include "createTimeControls.H"
53  #include "createRDeltaT.H"
54  #include "createFields.H"
55  #include "createFieldRefs.H"
56 
57  if (!LTS)
58  {
59  #include "CourantNo.H"
60  #include "setInitialDeltaT.H"
61  }
62 
63  // Switch faceMomentum
64  // (
65  // pimple.dict().lookupOrDefault<Switch>("faceMomentum", false)
66  // );
67 
68  // Switch implicitPhasePressure
69  // (
70  // mesh.solverDict(alpha1.name()).lookupOrDefault<Switch>
71  // (
72  // "implicitPhasePressure", false
73  // )
74  // );
75 
76  //#include "pUf/createDDtU.H"
77 
78  int nEnergyCorrectors
79  (
80  pimple.dict().lookupOrDefault<int>("nEnergyCorrectors", 1)
81  );
82 
83  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85  Info<< "\nStarting time loop\n" << endl;
86 
87  while (runTime.run())
88  {
89  #include "readTimeControls.H"
90 
91  if (LTS)
92  {
93  #include "setRDeltaT.H"
94  }
95  else
96  {
97  #include "CourantNo.H"
98  #include "setDeltaT.H"
99  }
100 
101  runTime++;
102  Info<< "Time = " << runTime.timeName() << nl << endl;
103 
104  // --- Pressure-velocity PIMPLE corrector loop
105  while (pimple.loop())
106  {
107  fluid.solve();
108  fluid.correct();
109 
110  #include "YEqns.H"
111 
112  // if (faceMomentum)
113  // {
114  // #include "pUf/UEqns.H"
115  // #include "EEqns.H"
116  // #include "pUf/pEqn.H"
117  // #include "pUf/DDtU.H"
118  // }
119  // else
120  {
121  #include "pU/UEqns.H"
122  #include "EEqns.H"
123  #include "pU/pEqn.H"
124  }
125 
126  fluid.correctKinematics();
127 
128  if (pimple.turbCorr())
129  {
130  fluid.correctTurbulence();
131  }
132  }
133 
134  runTime.write();
135 
136  Info<< "ExecutionTime = "
137  << runTime.elapsedCpuTime()
138  << " s\n\n" << endl;
139  }
140 
141  Info<< "End\n" << endl;
142 
143  return 0;
144 }
145 
146 
147 // ************************************************************************* //
multiphaseSystem & fluid
Definition: createFields.H:10
const dictionary & pimple
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
Read the control parameters used by setDeltaT.
static const char nl
Definition: Ostream.H:262
bool LTS
Definition: createRDeltaT.H:1
messageStream Info
Execute application functionObjects to post-process existing results.
Provides functions smooth spread and sweep which use the FaceCellWave algorithm to smooth and redistr...
Read the control parameters used by setDeltaT.