Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / applications / solvers / multiphase / bubbleFoam / createPhib.H
blob84db6492b649bc05ed5f03642093b0487890029b
1     IOobject phibHeader
2     (
3         "phib",
4         runTime.timeName(),
5         mesh,
6         IOobject::NO_READ
7     );
9     autoPtr<surfaceScalarField> phibPtr(NULL);
11     if (phibHeader.headerOk())
12     {
13         Info<< "Reading face flux field phib\n" << endl;
15         phibPtr.reset
16         (
17             new surfaceScalarField
18             (
19                 IOobject
20                 (
21                     "phib",
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 phib\n" << endl;
35         wordList phiTypes
36         (
37             Ub.boundaryField().size(),
38             calculatedFvPatchScalarField::typeName
39         );
41         forAll(Ub.boundaryField(), i)
42         {
43             if (isA<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
44             {
45                 phiTypes[i] = fixedValueFvPatchScalarField::typeName;
46             }
47         }
49         phibPtr.reset
50         (
51             new surfaceScalarField
52             (
53                 IOobject
54                 (
55                     "phib",
56                     runTime.timeName(),
57                     mesh,
58                     IOobject::NO_READ,
59                     IOobject::AUTO_WRITE
60                 ),
61                 fvc::interpolate(Ub) & mesh.Sf(),
62                 phiTypes
63             )
64         );
65     }
67     surfaceScalarField& phib = phibPtr();