initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / utilities / postProcessing / miscellaneous / wdot / wdot.C
blob2e5d164703c477db0ab6f488839588038427dce3
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Application
26     wdot
28 Description
29     Calculates and writes wdot for each time.
31 \*---------------------------------------------------------------------------*/
33 #include "fvCFD.H"
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 int main(int argc, char *argv[])
41 #   include "addTimeOptions.H"
42 #   include "setRootCase.H"
44 #   include "createTime.H"
46     // Get times list
47     instantList Times = runTime.times();
49     // set startTime and endTime depending on -time and -latestTime options
50 #   include "checkTimeOptions.H"
52     runTime.setTime(Times[startTime], startTime);
54 #   include "createMesh.H"
56     for (label i=startTime; i<endTime; i++)
57     {
58         runTime.setTime(Times[i], i);
60         mesh.readUpdate();
62         volScalarField mgb
63         (
64             IOobject
65             (
66                 "mgb",
67                 runTime.timeName(),
68                 mesh,
69                 IOobject::MUST_READ
70             ),
71             mesh
72         );
74         volScalarField Su
75         (
76             IOobject
77             (
78                 "Su",
79                 runTime.timeName(),
80                 mesh,
81                 IOobject::MUST_READ
82             ),
83             mesh
84         );
86         volScalarField Xi
87         (
88             IOobject
89             (
90                 "Xi",
91                 runTime.timeName(),
92                 mesh,
93                 IOobject::MUST_READ
94             ),
95             mesh
96         );
98         volScalarField St
99         (
100             IOobject
101             (
102                 "St",
103                 runTime.timeName(),
104                 mesh,
105                 IOobject::NO_READ
106             ),
107             Xi*Su
108         );
110         St.write();
112         volScalarField wdot
113         (
114             IOobject
115             (
116                 "wdot",
117                 runTime.timeName(),
118                 mesh,
119                 IOobject::NO_READ
120             ),
121            St*mgb
122         );
124         wdot.write();
125     }
127     return(0);
131 // ************************************************************************* //