initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / solvers / multiphase / bubbleFoam / createPhib.H
blobb1807e48ada6ece8d17c41578461e1375e9be6c7
1     IOobject phibHeader
2     (
3         "phib",
4         runTime.timeName(),
5         mesh,
6         IOobject::NO_READ
7     );
10     surfaceScalarField* phibPtr;
12     if (phibHeader.headerOk())
13     {
14         Info<< "Reading face flux field phib\n" << endl;
16         phibPtr = new surfaceScalarField
17         (
18             IOobject
19             (
20                 "phib",
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 phib\n" << endl;
33         wordList phiTypes
34         (
35             Ub.boundaryField().size(),
36             calculatedFvPatchScalarField::typeName
37         );
39         for (label i=0; i<Ub.boundaryField().size(); i++)
40         {
41             if (isType<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
42             {
43                 phiTypes[i] = fixedValueFvPatchScalarField::typeName;
44             }
45         }
47         phibPtr = new surfaceScalarField
48         (
49             IOobject
50             (
51                 "phib",
52                 runTime.timeName(),
53                 mesh,
54                 IOobject::NO_READ,
55                 IOobject::AUTO_WRITE
56             ),
57             fvc::interpolate(Ub) & mesh.Sf(),
58             phiTypes
59         );
60     }
62     surfaceScalarField& phib = *phibPtr;