Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / postProcessing / miscellaneous / wdot / wdot.C
blobfd0a0444d6302ca53c92ed8207009070c5db4825
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  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 // ************************************************************************* //