OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

createPhib.H

Go to the documentation of this file.
00001     IOobject phibHeader
00002     (
00003         "phib",
00004         runTime.timeName(),
00005         mesh,
00006         IOobject::NO_READ
00007     );
00008 
00009 
00010     surfaceScalarField* phibPtr;
00011 
00012     if (phibHeader.headerOk())
00013     {
00014         Info<< "Reading face flux field phib\n" << endl;
00015 
00016         phibPtr = new surfaceScalarField
00017         (
00018             IOobject
00019             (
00020                 "phib",
00021                 runTime.timeName(),
00022                 mesh,
00023                 IOobject::MUST_READ,
00024                 IOobject::AUTO_WRITE
00025             ),
00026             mesh
00027         );
00028     }
00029     else
00030     {
00031         Info<< "Calculating face flux field phib\n" << endl;
00032 
00033         wordList phiTypes
00034         (
00035             Ub.boundaryField().size(),
00036             calculatedFvPatchScalarField::typeName
00037         );
00038 
00039         for (label i=0; i<Ub.boundaryField().size(); i++)
00040         {
00041             if (isType<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
00042             {
00043                 phiTypes[i] = fixedValueFvPatchScalarField::typeName;
00044             }
00045         }
00046 
00047         phibPtr = new surfaceScalarField
00048         (
00049             IOobject
00050             (
00051                 "phib",
00052                 runTime.timeName(),
00053                 mesh,
00054                 IOobject::NO_READ,
00055                 IOobject::AUTO_WRITE
00056             ),
00057             fvc::interpolate(Ub) & mesh.Sf(),
00058             phiTypes
00059         );
00060     }
00061 
00062     surfaceScalarField& phib = *phibPtr;
Copyright © 2000-2009 OpenCFD Ltd