Merge branch 'upstream/OpenFOAM' into pu
[freefoam.git] / applications / solvers / multiphase / bubbleFoam / createPhia.H
blobaabaa70a08da75f86e40f9791ab4ac9944ea3402
1     IOobject phiaHeader
2     (
3         "phia",
4         runTime.timeName(),
5         mesh,
6         IOobject::NO_READ
7     );
9     autoPtr<surfaceScalarField> phiaPtr(NULL);
11     if (phiaHeader.headerOk())
12     {
13         Info<< "Reading face flux field phia\n" << endl;
15         phiaPtr.reset
16         (
17             new surfaceScalarField
18             (
19                 IOobject
20                 (
21                     "phia",
22                     runTime.timeName(),
23                     mesh,
24                     IOobject::MUST_READ,
25                     IOobject::AUTO_WRITE
26                 ),
27                 mesh
28             )
29         );
30     }
31     else
32     {
33         Info<< "Calculating face flux field phia\n" << endl;
35         wordList phiTypes
36         (
37             Ua.boundaryField().size(),
38             calculatedFvPatchScalarField::typeName
39         );
41         forAll(Ua.boundaryField(), i)
42         {
43             if (isA<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
44             {
45                 phiTypes[i] = fixedValueFvPatchScalarField::typeName;
46             }
47         }
49         phiaPtr.reset
50         (
51             new surfaceScalarField
52             (
53                 IOobject
54                 (
55                     "phia",
56                     runTime.timeName(),
57                     mesh,
58                     IOobject::NO_READ,
59                     IOobject::AUTO_WRITE
60                 ),
61                 fvc::interpolate(Ua) & mesh.Sf(),
62                 phiTypes
63             )
64         );
65     }
67     surfaceScalarField& phia = phiaPtr();
69 // ************************ vim: set sw=4 sts=4 et: ************************ //