wdot.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) 2011-2016 OpenFOAM Foundation
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  wdot
26 
27 Description
28  Calculates and writes wdot for each time.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #include "fvCFD.H"
33 
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 int main(int argc, char *argv[])
38 {
39  timeSelector::addOptions();
40 
41  #include "setRootCase.H"
42  #include "createTime.H"
43 
44  instantList timeDirs = timeSelector::select0(runTime, args);
45 
46  #include "createMesh.H"
47 
48  forAll(timeDirs, timeI)
49  {
50  runTime.setTime(timeDirs[timeI], timeI);
51 
52  mesh.readUpdate();
53 
54  volScalarField mgb
55  (
56  IOobject
57  (
58  "mgb",
59  runTime.timeName(),
60  mesh,
61  IOobject::MUST_READ
62  ),
63  mesh
64  );
65 
67  (
68  IOobject
69  (
70  "Su",
71  runTime.timeName(),
72  mesh,
73  IOobject::MUST_READ
74  ),
75  mesh
76  );
77 
79  (
80  IOobject
81  (
82  "Xi",
83  runTime.timeName(),
84  mesh,
85  IOobject::MUST_READ
86  ),
87  mesh
88  );
89 
91  (
92  IOobject
93  (
94  "St",
95  runTime.timeName(),
96  mesh,
97  IOobject::NO_READ
98  ),
99  Xi*Su
100  );
101 
102  St.write();
103 
104  volScalarField wdot
105  (
106  IOobject
107  (
108  "wdot",
109  runTime.timeName(),
110  mesh,
111  IOobject::NO_READ
112  ),
113  St*mgb
114  );
115 
116  wdot.write();
117  }
118 
119  return 0;
120 }
121 
122 
123 // ************************************************************************* //
List< instant > instantList
List of instants.
Definition: instantList.H:42
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dynamicFvMesh & mesh
tmp< GeometricField< Type, fvPatchField, volMesh > > Su(const GeometricField< Type, fvPatchField, volMesh > &su, const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvcSup.C:44
Foam::argList args(argc, argv)