OpenFOAM: API Guide
v2112
The open source CFD toolbox
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 | www.openfoam.com
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
Copyright (C) 2011-2017 OpenFOAM Foundation
9
-------------------------------------------------------------------------------
10
License
11
This file is part of OpenFOAM.
12
13
OpenFOAM is free software: you can redistribute it and/or modify it
14
under the terms of the GNU General Public License as published by
15
the Free Software Foundation, either version 3 of the License, or
16
(at your option) any later version.
17
18
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21
for more details.
22
23
You should have received a copy of the GNU General Public License
24
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26
Application
27
simpleFoam
28
29
Group
30
grpIncompressibleSolvers
31
32
Description
33
Steady-state solver for incompressible, turbulent flows.
34
35
\heading Solver details
36
The solver uses the SIMPLE algorithm to solve the continuity equation:
37
38
\f[
39
\div \vec{U} = 0
40
\f]
41
42
and momentum equation:
43
44
\f[
45
\div \left( \vec{U} \vec{U} \right) - \div \gvec{R}
46
= - \grad p + \vec{S}_U
47
\f]
48
49
Where:
50
\vartable
51
\vec{U} | Velocity
52
p | Pressure
53
\vec{R} | Stress tensor
54
\vec{S}_U | Momentum source
55
\endvartable
56
57
\heading Required fields
58
\plaintable
59
U | Velocity [m/s]
60
p | Kinematic pressure, p/rho [m2/s2]
61
<turbulence fields> | As required by user selection
62
\endplaintable
63
64
\*---------------------------------------------------------------------------*/
65
66
#include "
fvCFD.H
"
67
#include "
singlePhaseTransportModel.H
"
68
#include "
turbulentTransportModel.H
"
69
#include "
simpleControl.H
"
70
#include "
fvOptions.H
"
71
72
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73
74
int
main(
int
argc,
char
*argv[])
75
{
76
argList::addNote
77
(
78
"Steady-state solver for incompressible, turbulent flows."
79
);
80
81
#include "
postProcess.H
"
82
83
#include "
addCheckCaseOptions.H
"
84
#include "
setRootCaseLists.H
"
85
#include "
createTime.H
"
86
#include "
createMesh.H
"
87
#include "createControl.H"
88
#include "createFields.H"
89
#include "initContinuityErrs.H"
90
91
turbulence
->validate();
92
93
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94
95
Info
<<
"\nStarting time loop\n"
<<
endl
;
96
97
while
(
simple
.loop())
98
{
99
Info
<<
"Time = "
<<
runTime
.timeName() <<
nl
<<
endl
;
100
101
// --- Pressure-velocity SIMPLE corrector
102
{
103
#include "UEqn.H"
104
#include "pEqn.H"
105
}
106
107
laminarTransport
.correct();
108
turbulence
->correct();
109
110
runTime
.write();
111
112
runTime
.printExecutionTime(Info);
113
}
114
115
Info
<<
"End\n"
<<
endl
;
116
117
return
0;
118
}
119
120
121
// ************************************************************************* //
addCheckCaseOptions.H
Required Classes.
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
createMesh.H
Required Variables.
createTime.H
turbulence
compressible::turbulenceModel & turbulence
Definition:
setRegionFluidFields.H:30
fvCFD.H
fvOptions.H
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition:
Ostream.H:372
Foam::nl
constexpr char nl
The newline '\n' character (0x0a)
Definition:
Ostream.H:53
postProcess.H
Execute application functionObjects to post-process existing results.
simple
const dictionary & simple
Definition:
readFluidMultiRegionSIMPLEControls.H:1
setRootCaseLists.H
simpleControl.H
singlePhaseTransportModel.H
laminarTransport
singlePhaseTransportModel laminarTransport(U, phi)
turbulentTransportModel.H
applications
solvers
incompressible
simpleFoam
simpleFoam.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.