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-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  twoPhaseEulerFoam
26 
27 Group
28  grpMultiphaseSolvers
29 
30 Description
31  Solver for a system of 2 compressible fluid phases with one phase
32  dispersed, e.g. gas bubbles in a liquid including heat-transfer.
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #include "fvCFD.H"
37 #include "twoPhaseSystem.H"
39 #include "pimpleControl.H"
40 #include "fvOptions.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 int main(int argc, char *argv[])
47 {
48  #include "setRootCase.H"
49 
50  #include "createTime.H"
51  #include "createMesh.H"
52 
53  pimpleControl pimple(mesh);
54 
55  #include "createFields.H"
56  #include "createMRF.H"
57  #include "createFvOptions.H"
58  #include "createTimeControls.H"
59  #include "CourantNos.H"
60  #include "setInitialDeltaT.H"
61 
62  Switch faceMomentum
63  (
64  pimple.dict().lookupOrDefault<Switch>("faceMomentum", false)
65  );
66 
67  Switch implicitPhasePressure
68  (
69  mesh.solverDict(alpha1.name()).lookupOrDefault<Switch>
70  (
71  "implicitPhasePressure", false
72  )
73  );
74 
75  #include "pUf/createDDtU.H"
76  #include "pU/createDDtU.H"
77 
78  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80  Info<< "\nStarting time loop\n" << endl;
81 
82  while (runTime.run())
83  {
84  #include "createTimeControls.H"
85  #include "CourantNos.H"
86  #include "setDeltaT.H"
87 
88  runTime++;
89  Info<< "Time = " << runTime.timeName() << nl << endl;
90 
91  // --- Pressure-velocity PIMPLE corrector loop
92  while (pimple.loop())
93  {
94  fluid.solve();
95  fluid.correct();
96 
97  #include "contErrs.H"
98 
99  if (faceMomentum)
100  {
101  #include "pUf/UEqns.H"
102  #include "EEqns.H"
103  #include "pUf/pEqn.H"
104  #include "pUf/DDtU.H"
105  }
106  else
107  {
108  #include "pU/UEqns.H"
109  #include "EEqns.H"
110  #include "pU/pEqn.H"
111  #include "pU/DDtU.H"
112  }
113 
114  if (pimple.turbCorr())
115  {
116  fluid.correctTurbulence();
117  }
118  }
119 
120  #include "write.H"
121 
122  Info<< "ExecutionTime = "
123  << runTime.elapsedCpuTime()
124  << " s\n\n" << endl;
125  }
126 
127  Info<< "End\n" << endl;
128 
129  return 0;
130 }
131 
132 
133 // ************************************************************************* //
fvOptions.H
DDtU.H
fluid
multiphaseSystem & fluid
Definition: createFields.H:10
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
PhaseCompressibleTurbulenceModel.H
pimpleControl.H
createFvOptions.H
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
createDDtU.H
main
int main(int argc, char *argv[])
Definition: postCalc.C:54
fixedValueFvsPatchFields.H
contErrs.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
alpha1
volScalarField & alpha1
Definition: createFields.H:15
setRootCase.H
createTimeControls.H
Read the control parameters used by setDeltaT.
createMesh.H
createTime.H
fvCFD.H
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
fixedFluxPressureFvPatchScalarField.H