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