Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / postProcessing / velocityField / Mach / thermodynamicMach.H
blob5acd10dde28e3b604cfd20ab1fbeeebfa0364cac
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             );
45             Info << "Max Mach number: " << max(Ma.internalField()) << endl;
46             Ma.write();
47         }
48         else
49         {
50             Info<< "    No U or T" << endl;
51         }
52     }