simpleFoam.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  simpleFoam
26 
27 Group
28  grpIncompressibleSolvers
29 
30 Description
31  Steady-state solver for incompressible flows with turbulence modelling.
32 
33  \heading Solver details
34  The solver uses the SIMPLE 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  \div \left( \vec{U} \vec{U} \right) - \div \gvec{R}
44  = - \grad p + \vec{S}_U
45  \f]
46 
47  Where:
48  \vartable
49  \vec{U} | Velocity
50  p | Pressure
51  \vec{R} | Stress tensor
52  \vec{S}_U | Momentum source
53  \endvartable
54 
55  \heading Required fields
56  \plaintable
57  U | Velocity [m/s]
58  p | Kinematic pressure, p/rho [m2/s2]
59  <turbulence fields> | As required by user selection
60  \endplaintable
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #include "fvCFD.H"
67 #include "simpleControl.H"
68 #include "fvOptions.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 int main(int argc, char *argv[])
73 {
74  #include "setRootCase.H"
75  #include "createTime.H"
76  #include "createMesh.H"
77 
79 
80  #include "createFields.H"
81  #include "createMRF.H"
82  #include "createFvOptions.H"
83  #include "initContinuityErrs.H"
84 
85  turbulence->validate();
86 
87  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 
89  Info<< "\nStarting time loop\n" << endl;
90 
91  while (simple.loop())
92  {
93  Info<< "Time = " << runTime.timeName() << nl << endl;
94 
95  // --- Pressure-velocity SIMPLE corrector
96  {
97  #include "UEqn.H"
98  #include "pEqn.H"
99  }
100 
102  turbulence->correct();
103 
104  runTime.write();
105 
106  Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
107  << " ClockTime = " << runTime.elapsedClockTime() << " s"
108  << nl << endl;
109  }
110 
111  Info<< "End\n" << endl;
112 
113  return 0;
114 }
115 
116 
117 // ************************************************************************* //
createFields.H
fvOptions.H
Foam::simpleControl
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
Definition: simpleControl.H:46
UEqn.H
singlePhaseTransportModel.H
turbulentTransportModel.H
pEqn.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
simple
Simple relative velocity model.
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
simpleControl.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
setRootCase.H
laminarTransport
singlePhaseTransportModel laminarTransport(U, phi)
simple
const dictionary & simple
Definition: readFluidMultiRegionSIMPLEControls.H:1
createMesh.H
createTime.H
Foam::singlePhaseTransportModel::correct
virtual void correct()
Correct the laminar viscosity.
Definition: singlePhaseTransportModel.C:76
fvCFD.H
main
int main(int argc, char *argv[])
Definition: simpleFoam.C:100