openfoam/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H
mattijs e424059208 ENH: glboal file handling: initial commit
Moved file path handling to regIOobject and made it type specific so
now every object can have its own rules. Examples:
- faceZones are now processor local (and don't search up anymore)
- timeStampMaster is now no longer hardcoded inside IOdictionary
  (e.g. uniformDimensionedFields support it as well)
- the distributedTriSurfaceMesh is properly processor-local; no need
  for fileModificationChecking manipulation.
2016-01-25 13:03:15 +00:00

46 lines
1019 B
C

for (label i=startTime; i<endTime; i++)
{
runTime.setTime(Times[i], i);
Info<< "Time = " << runTime.timeName() << endl;
mesh.readUpdate();
IOobject Uheader
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ
);
if (Uheader.typeHeaderOk<volVectorField>(true))
{
volVectorField U(Uheader, mesh);
autoPtr<fluidThermo> thermo
(
fluidThermo::New(mesh)
);
volScalarField Cp = thermo->Cp();
volScalarField Cv = thermo->Cv();
volScalarField Ma
(
IOobject
(
"Ma",
runTime.timeName(),
mesh
),
mag(U)/(sqrt((Cp/Cv)*(Cp - Cv)*thermo->T()))
);
Ma.write();
}
else
{
Info<< " No U" << endl;
}
}