cavitatingFoam.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  cavitatingFoam
26 
27 Description
28  Transient cavitation code based on the homogeneous equilibrium model
29  from which the compressibility of the liquid/vapour "mixture" is obtained.
30 
31  Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #include "fvCFD.H"
39 #include "pimpleControl.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 int main(int argc, char *argv[])
44 {
45  #include "postProcess.H"
46 
47  #include "setRootCase.H"
48  #include "createTime.H"
49  #include "createMesh.H"
50  #include "createControl.H"
51  #include "createControls.H"
52  #include "createFields.H"
53  #include "CourantNo.H"
54  #include "setInitialDeltaT.H"
55 
56  turbulence->validate();
57 
58  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60  Info<< "\nStarting time loop\n" << endl;
61 
62  while (runTime.run())
63  {
64  #include "readControls.H"
65  #include "CourantNo.H"
66  #include "setDeltaT.H"
67 
68  runTime++;
69  Info<< "Time = " << runTime.timeName() << nl << endl;
70 
71  // --- Pressure-velocity PIMPLE corrector loop
72  while (pimple.loop())
73  {
74  #include "rhoEqn.H"
75  #include "alphavPsi.H"
76  #include "UEqn.H"
77 
78  // --- Pressure corrector loop
79  while (pimple.correct())
80  {
81  #include "pEqn.H"
82  }
83 
84  if (pimple.turbCorr())
85  {
86  turbulence->correct();
87  }
88  }
89 
90  runTime.write();
91 
92  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
93  << " ClockTime = " << runTime.elapsedClockTime() << " s"
94  << nl << endl;
95  }
96 
97  Info<< "End\n" << endl;
98 
99  return 0;
100 }
101 
102 
103 // ************************************************************************* //
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
const dictionary & pimple
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
static const char nl
Definition: Ostream.H:262
messageStream Info
Execute application functionObjects to post-process existing results.