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-2015 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  Info<< "Time = " << runTime.timeName() << endl;
53 
54  mesh.readUpdate();
55 
56  volScalarField mgb
57  (
58  IOobject
59  (
60  "mgb",
61  runTime.timeName(),
62  mesh,
63  IOobject::MUST_READ
64  ),
65  mesh
66  );
67 
69  (
70  IOobject
71  (
72  "Su",
73  runTime.timeName(),
74  mesh,
75  IOobject::MUST_READ
76  ),
77  mesh
78  );
79 
81  (
82  IOobject
83  (
84  "Xi",
85  runTime.timeName(),
86  mesh,
87  IOobject::MUST_READ
88  ),
89  mesh
90  );
91 
93  (
94  IOobject
95  (
96  "St",
97  runTime.timeName(),
98  mesh,
99  IOobject::NO_READ
100  ),
101  Xi*Su
102  );
103 
104  St.write();
105 
106  volScalarField wdot
107  (
108  IOobject
109  (
110  "wdot",
111  runTime.timeName(),
112  mesh,
113  IOobject::NO_READ
114  ),
115  St*mgb
116  );
117 
118  wdot.write();
119 
120  Info<< endl;
121  }
122 
123  Info<< "End" << nl << endl;
124 
125  return 0;
126 }
127 
128 
129 // ************************************************************************* //
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::instantList
List< instant > instantList
List of instants.
Definition: instantList.H:42
Foam::fvc::Su
tmp< GeometricField< Type, fvPatchField, volMesh > > Su(const GeometricField< Type, fvPatchField, volMesh > &su, const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvcSup.C:44
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
main
int main(int argc, char *argv[])
Definition: postCalc.C:54
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
setRootCase.H
timeDirs
static instantList timeDirs
Definition: globalFoam.H:44
createMesh.H
createTime.H
fvCFD.H
args
Foam::argList args(argc, argv)