Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
applications
utilities
postProcessing
velocityField
vorticity
vorticity.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) 1991-2010 OpenCFD Ltd.
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
vorticity
26
27
Description
28
Calculates and writes the vorticity of velocity field U.
29
30
The -noWrite option just outputs the max/min values without writing
31
the field.
32
33
Usage
34
35
- vorticity [OPTIONS]
36
37
@param -noWrite \n
38
Suppress output to files.
39
40
@param -dict <dictionary name>\n
41
Use named dictionary instead of system/controlDict.
42
43
@param -noZero \n
44
Ignore timestep 0.
45
46
@param -constant \n
47
Include the constant directory.
48
49
@param -time <time>\n
50
Apply only to specific time.
51
52
@param -latestTime \n
53
Only apply to latest time step.
54
55
@param -case <dir>\n
56
Case directory.
57
58
@param -parallel \n
59
Run in parallel.
60
61
@param -help \n
62
Display help message.
63
64
@param -doc \n
65
Display Doxygen API documentation page for this application.
66
67
@param -srcDoc \n
68
Display Doxygen source documentation page for this application.
69
70
\*---------------------------------------------------------------------------*/
71
72
#include <
postCalc/calc.H
>
73
#include <
finiteVolume/fvc.H
>
74
75
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76
77
void
Foam::calc
(
const
argList&
args
,
const
Time& runTime,
const
fvMesh&
mesh
)
78
{
79
bool
writeResults = !args.optionFound(
"noWrite"
);
80
81
IOobject Uheader
82
(
83
"U"
,
84
runTime.timeName(),
85
mesh
,
86
IOobject::MUST_READ
87
);
88
89
if
(Uheader.headerOk())
90
{
91
Info
<<
" Reading U"
<<
endl
;
92
volVectorField
U
(Uheader, mesh);
93
94
Info
<<
" Calculating vorticity"
<<
endl
;
95
volVectorField
vorticity
96
(
97
IOobject
98
(
99
"vorticity"
,
100
runTime.timeName(),
101
mesh
,
102
IOobject::NO_READ
103
),
104
fvc::curl
(
U
)
105
);
106
107
volScalarField
magVorticity
108
(
109
IOobject
110
(
111
"magVorticity"
,
112
runTime.timeName(),
113
mesh
,
114
IOobject::NO_READ
115
),
116
mag
(vorticity)
117
);
118
119
Info
<<
"vorticity max/min : "
120
<<
max
(magVorticity).value() <<
" "
121
<<
min
(magVorticity).value() <<
endl
;
122
123
if
(writeResults)
124
{
125
vorticity.
write
();
126
magVorticity.
write
();
127
}
128
}
129
else
130
{
131
Info
<<
" No U"
<<
endl
;
132
}
133
134
Info
<<
"\nEnd\n"
<<
endl
;
135
}
136
137
138
// ************************ vim: set sw=4 sts=4 et: ************************ //