FreeFOAM The Cross-Platform CFD Toolkit
createPhib.H
Go to the documentation of this file.
1  IOobject phibHeader
2  (
3  "phib",
4  runTime.timeName(),
5  mesh,
6  IOobject::NO_READ
7  );
8 
9  autoPtr<surfaceScalarField> phibPtr(NULL);
10 
11  if (phibHeader.headerOk())
12  {
13  Info<< "Reading face flux field phib\n" << endl;
14 
15  phibPtr.reset
16  (
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;
34 
35  wordList phiTypes
36  (
37  Ub.boundaryField().size(),
38  calculatedFvPatchScalarField::typeName
39  );
40 
41  forAll(Ub.boundaryField(), i)
42  {
43  if (isA<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
44  {
45  phiTypes[i] = fixedValueFvPatchScalarField::typeName;
46  }
47  }
48 
49  phibPtr.reset
50  (
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  }
66 
68 
69 // ************************ vim: set sw=4 sts=4 et: ************************ //
70