initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / compressible / rhopSonicFoam / compressibleCreatePhi.H
blob262ceebc05225a6b123767bc321934df34b1b101
1     IOobject phiHeader
2     (
3         "phi",
4         runTime.timeName(),
5         mesh,
6         IOobject::NO_READ
7     );
10     surfaceScalarField* phiPtr;
12     if (phiHeader.headerOk())
13     {
14         Info<< "Reading face flux field phi\n" << endl;
16         phiPtr = new surfaceScalarField
17         (
18             IOobject
19             (
20                 "phi",
21                 runTime.timeName(),
22                 mesh,
23                 IOobject::MUST_READ,
24                 IOobject::AUTO_WRITE
25             ),
26             mesh
27         );
28     }
29     else
30     {
31         Info<< "Calculating face flux field phi\n" << endl;
33         wordList phiTypes
34         (
35             rhoU.boundaryField().size(),
36             calculatedFvPatchScalarField::typeName
37         );
39         phiPtr = new surfaceScalarField
40         (
41             IOobject
42             (
43                 "phi",
44                 runTime.timeName(),
45                 mesh,
46                 IOobject::NO_READ,
47                 IOobject::AUTO_WRITE
48             ),
49             linearInterpolate(rhoU) & mesh.Sf(),
50             phiTypes
51         );
52     }
54     surfaceScalarField& phi = *phiPtr;