twoPhaseEulerFoam.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  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"
36 #include "pimpleControl.H"
37 #include "fvOptions.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 int main(int argc, char *argv[])
43 {
44  #include "postProcess.H"
45 
46  #include "setRootCase.H"
47  #include "createTime.H"
48  #include "createMesh.H"
49  #include "createControl.H"
50  #include "createFields.H"
51  #include "createFieldRefs.H"
52  #include "createFvOptions.H"
53  #include "createTimeControls.H"
54  #include "CourantNos.H"
55  #include "setInitialDeltaT.H"
56 
57  Switch faceMomentum
58  (
59  pimple.dict().lookupOrDefault<Switch>("faceMomentum", false)
60  );
61 
62  Switch implicitPhasePressure
63  (
64  mesh.solverDict(alpha1.name()).lookupOrDefault<Switch>
65  (
66  "implicitPhasePressure", false
67  )
68  );
69 
70  #include "pUf/createDDtU.H"
71  #include "pU/createDDtU.H"
72 
73  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75  Info<< "\nStarting time loop\n" << endl;
76 
77  while (runTime.run())
78  {
79  #include "readTimeControls.H"
80  #include "CourantNos.H"
81  #include "setDeltaT.H"
82 
83  runTime++;
84  Info<< "Time = " << runTime.timeName() << nl << endl;
85 
86  // --- Pressure-velocity PIMPLE corrector loop
87  while (pimple.loop())
88  {
89  fluid.solve();
90  fluid.correct();
91 
92  #include "contErrs.H"
93 
94  if (faceMomentum)
95  {
96  #include "pUf/UEqns.H"
97  #include "EEqns.H"
98  #include "pUf/pEqn.H"
99  #include "pUf/DDtU.H"
100  }
101  else
102  {
103  #include "pU/UEqns.H"
104  #include "EEqns.H"
105  #include "pU/pEqn.H"
106  #include "pU/DDtU.H"
107  }
108 
109  if (pimple.turbCorr())
110  {
111  fluid.correctTurbulence();
112  }
113  }
114 
115  #include "write.H"
116 
117  Info<< "ExecutionTime = "
118  << runTime.elapsedCpuTime()
119  << " s\n\n" << endl;
120  }
121 
122  Info<< "End\n" << endl;
123 
124  return 0;
125 }
126 
127 
128 // ************************************************************************* //
multiphaseSystem & fluid
Definition: createFields.H:11
const dictionary & pimple
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
Read the control parameters used by setDeltaT.
dynamicFvMesh & mesh
static const char nl
Definition: Ostream.H:262
volScalarField & alpha1
messageStream Info
Execute application functionObjects to post-process existing results.
Read the control parameters used by setDeltaT.