Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / multiphase / bubbleFoam / createPhia.H
blob74d4678872d9d0127ba8e021f0c781c1ede59883
1     IOobject phiaHeader
2     (
3         "phia",
4         runTime.timeName(),
5         mesh,
6         IOobject::NO_READ
7     );
10     surfaceScalarField* phiaPtr;
12     if (phiaHeader.headerOk())
13     {
14         Info<< "Reading face flux field phia\n" << endl;
16         phiaPtr = new surfaceScalarField
17         (
18             IOobject
19             (
20                 "phia",
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 phia\n" << endl;
33         wordList phiTypes
34         (
35             Ua.boundaryField().size(),
36             calculatedFvPatchScalarField::typeName
37         );
39         for (label i=0; i<Ua.boundaryField().size(); i++)
40         {
41             if (isType<fixedValueFvPatchVectorField>(Ua.boundaryField()[i]))
42             {
43                 phiTypes[i] = fixedValueFvPatchScalarField::typeName;
44             }
45         }
47         phiaPtr = new surfaceScalarField
48         (
49             IOobject
50             (
51                 "phia",
52                 runTime.timeName(),
53                 mesh,
54                 IOobject::NO_READ,
55                 IOobject::AUTO_WRITE
56             ),
57             fvc::interpolate(Ua) & mesh.Sf(),
58             phiTypes
59         );
60     }
62     surfaceScalarField& phia = *phiaPtr;