OpenFOAM: API Guide
v2112
The open source CFD toolbox
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 | 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
pisoFoam
28
29
Group
30
grpIncompressibleSolvers
31
32
Description
33
Transient solver for incompressible, turbulent flow, using the PISO
34
algorithm.
35
36
\heading Solver details
37
The solver uses the PISO algorithm to solve the continuity equation:
38
39
\f[
40
\div \vec{U} = 0
41
\f]
42
43
and momentum equation:
44
45
\f[
46
\ddt{\vec{U}} + \div \left( \vec{U} \vec{U} \right) - \div \gvec{R}
47
= - \grad p
48
\f]
49
50
Where:
51
\vartable
52
\vec{U} | Velocity
53
p | Pressure
54
\vec{R} | Stress tensor
55
\endvartable
56
57
Sub-models include:
58
- turbulence modelling, i.e. laminar, RAS or LES
59
- run-time selectable MRF and finite volume options, e.g. explicit porosity
60
61
\heading Required fields
62
\plaintable
63
U | Velocity [m/s]
64
p | Kinematic pressure, p/rho [m2/s2]
65
<turbulence fields> | As required by user selection
66
\endplaintable
67
68
\*---------------------------------------------------------------------------*/
69
70
#include "
fvCFD.H
"
71
#include "
singlePhaseTransportModel.H
"
72
#include "
turbulentTransportModel.H
"
73
#include "
pisoControl.H
"
74
#include "
fvOptions.H
"
75
76
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77
78
int
main(
int
argc,
char
*argv[])
79
{
80
argList::addNote
81
(
82
"Transient solver for incompressible, turbulent flow,"
83
" using the PISO algorithm."
84
);
85
86
#include "
postProcess.H
"
87
88
#include "
addCheckCaseOptions.H
"
89
#include "
setRootCaseLists.H
"
90
#include "
createTime.H
"
91
#include "
createMesh.H
"
92
#include "createControl.H"
93
#include "createFields.H"
94
#include "initContinuityErrs.H"
95
96
turbulence
->validate();
97
98
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99
100
Info
<<
"\nStarting time loop\n"
<<
endl
;
101
102
while
(
runTime
.loop())
103
{
104
Info
<<
"Time = "
<<
runTime
.timeName() <<
nl
<<
endl
;
105
106
#include "CourantNo.H"
107
108
// Pressure-velocity PISO corrector
109
{
110
#include "UEqn.H"
111
112
// --- PISO loop
113
while
(
piso
.correct())
114
{
115
#include "pEqn.H"
116
}
117
}
118
119
laminarTransport
.correct();
120
turbulence
->correct();
121
122
runTime
.write();
123
124
runTime
.printExecutionTime(Info);
125
}
126
127
Info
<<
"End\n"
<<
endl
;
128
129
return
0;
130
}
131
132
133
// ************************************************************************* //
addCheckCaseOptions.H
Required Classes.
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
createMesh.H
Required Variables.
piso
pisoControl piso(mesh)
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
pisoControl.H
postProcess.H
Execute application functionObjects to post-process existing results.
setRootCaseLists.H
singlePhaseTransportModel.H
laminarTransport
singlePhaseTransportModel laminarTransport(U, phi)
turbulentTransportModel.H
applications
solvers
incompressible
pisoFoam
pisoFoam.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.