pisoFoam.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  pisoFoam
26 
27 Group
28  grpIncompressibleSolvers
29 
30 Description
31  Transient solver for incompressible flow.
32 
33  \heading Solver details
34  The solver uses the PISO algorithm to solve the continuity equation:
35 
36  \f[
37  \div \vec{U} = 0
38  \f]
39 
40  and momentum equation:
41 
42  \f[
43  \ddt{\vec{U}} + \div \left( \vec{U} \vec{U} \right) - \div \gvec{R}
44  = - \grad p
45  \f]
46 
47  Where:
48  \vartable
49  \vec{U} | Velocity
50  p | Pressure
51  \vec{R} | Stress tensor
52  \endvartable
53 
54  Sub-models include:
55  - turbulence modelling, i.e. laminar, RAS or LES
56  - run-time selectable MRF and finite volume options, e.g. explicit porosity
57 
58  \heading Required fields
59  \plaintable
60  U | Velocity [m/s]
61  p | Kinematic pressure, p/rho [m2/s2]
62  <turbulence fields> | As required by user selection
63  \endplaintable
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #include "fvCFD.H"
70 #include "pisoControl.H"
71 #include "fvOptions.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 int main(int argc, char *argv[])
76 {
77  #include "setRootCase.H"
78  #include "createTime.H"
79  #include "createMesh.H"
80 
81  pisoControl piso(mesh);
82 
83  #include "createFields.H"
84  #include "createMRF.H"
85  #include "createFvOptions.H"
86  #include "initContinuityErrs.H"
87 
88  turbulence->validate();
89 
90  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92  Info<< "\nStarting time loop\n" << endl;
93 
94  while (runTime.loop())
95  {
96  Info<< "Time = " << runTime.timeName() << nl << endl;
97 
98  #include "CourantNo.H"
99 
100  // Pressure-velocity PISO corrector
101  {
102  #include "UEqn.H"
103 
104  // --- PISO loop
105  while (piso.correct())
106  {
107  #include "pEqn.H"
108  }
109  }
110 
111  laminarTransport.correct();
112  turbulence->correct();
113 
114  runTime.write();
115 
116  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
117  << " ClockTime = " << runTime.elapsedClockTime() << " s"
118  << nl << endl;
119  }
120 
121  Info<< "End\n" << endl;
122 
123  return 0;
124 }
125 
126 
127 // ************************************************************************* //
pisoControl.H
fvOptions.H
singlePhaseTransportModel.H
turbulentTransportModel.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
createFvOptions.H
turbulence
autoPtr< compressible::turbulenceModel > turbulence
Definition: createFields.H:23
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
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
setRootCase.H
laminarTransport
singlePhaseTransportModel laminarTransport(U, phi)
createMesh.H
createTime.H
fvCFD.H