Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / velocityField / Mach / thermodynamicMach.H
blob9ee57ae83062daa91e0bc9734ccca46ffaa2c913
1 #   include "readThermodynamicProperties.H"
3     for (label i=startTime; i<endTime; i++)
4     {
5         runTime.setTime(Times[i], i);
7         Info<< "Time = " << runTime.timeName() << endl;
9         IOobject Uheader
10         (
11             "U",
12             runTime.timeName(),
13             mesh,
14             IOobject::MUST_READ
15         );
17         IOobject Theader
18         (
19             "T",
20             runTime.timeName(),
21             mesh,
22             IOobject::MUST_READ
23         );
26         // Check U exists
27         if (Uheader.headerOk() && Theader.headerOk())
28         {
29             mesh.readUpdate();
31             volVectorField U(Uheader, mesh);
32             volScalarField T(Theader, mesh);
34             volScalarField Ma
35             (
36                 IOobject
37                 (
38                     "Ma",
39                     runTime.timeName(),
40                     mesh
41                 ),
42                 mag(U)/(sqrt(((Cv + R)/Cv)*R*T))
43             );
44             Ma.write();
45         }
46         else
47         {
48             Info<< "    No U or T" << endl;
49         }
50     }