Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / miscellaneous / wdot / wdot.C
blobfab74491626ca2b65c13b6ee5fd129f4a6404055
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Application
25     wdot
27 Description
28     Calculates and writes wdot for each time.
30 \*---------------------------------------------------------------------------*/
32 #include "fvCFD.H"
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 int main(int argc, char *argv[])
39     timeSelector::addOptions();
41 #   include "setRootCase.H"
42 #   include "createTime.H"
44     instantList timeDirs = timeSelector::select0(runTime, args);
46 #   include "createMesh.H"
48     forAll(timeDirs, timeI)
49     {
50         runTime.setTime(timeDirs[timeI], timeI);
52         mesh.readUpdate();
54         volScalarField mgb
55         (
56             IOobject
57             (
58                 "mgb",
59                 runTime.timeName(),
60                 mesh,
61                 IOobject::MUST_READ
62             ),
63             mesh
64         );
66         volScalarField Su
67         (
68             IOobject
69             (
70                 "Su",
71                 runTime.timeName(),
72                 mesh,
73                 IOobject::MUST_READ
74             ),
75             mesh
76         );
78         volScalarField Xi
79         (
80             IOobject
81             (
82                 "Xi",
83                 runTime.timeName(),
84                 mesh,
85                 IOobject::MUST_READ
86             ),
87             mesh
88         );
90         volScalarField St
91         (
92             IOobject
93             (
94                 "St",
95                 runTime.timeName(),
96                 mesh,
97                 IOobject::NO_READ
98             ),
99             Xi*Su
100         );
102         St.write();
104         volScalarField wdot
105         (
106             IOobject
107             (
108                 "wdot",
109                 runTime.timeName(),
110                 mesh,
111                 IOobject::NO_READ
112             ),
113            St*mgb
114         );
116         wdot.write();
117     }
119     return 0;
123 // ************************************************************************* //