FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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     autoPtr<surfaceScalarField> phibPtr(NULL);
00010 
00011     if (phibHeader.headerOk())
00012     {
00013         Info<< "Reading face flux field phib\n" << endl;
00014 
00015         phibPtr.reset
00016         (
00017             new surfaceScalarField
00018             (
00019                 IOobject
00020                 (
00021                     "phib",
00022                     runTime.timeName(),
00023                     mesh,
00024                     IOobject::MUST_READ,
00025                     IOobject::AUTO_WRITE
00026                 ),
00027                 mesh
00028             )
00029         );
00030     }
00031     else
00032     {
00033         Info<< "Calculating face flux field phib\n" << endl;
00034 
00035         wordList phiTypes
00036         (
00037             Ub.boundaryField().size(),
00038             calculatedFvPatchScalarField::typeName
00039         );
00040 
00041         forAll(Ub.boundaryField(), i)
00042         {
00043             if (isA<fixedValueFvPatchVectorField>(Ub.boundaryField()[i]))
00044             {
00045                 phiTypes[i] = fixedValueFvPatchScalarField::typeName;
00046             }
00047         }
00048 
00049         phibPtr.reset
00050         (
00051             new surfaceScalarField
00052             (
00053                 IOobject
00054                 (
00055                     "phib",
00056                     runTime.timeName(),
00057                     mesh,
00058                     IOobject::NO_READ,
00059                     IOobject::AUTO_WRITE
00060                 ),
00061                 fvc::interpolate(Ub) & mesh.Sf(),
00062                 phiTypes
00063             )
00064         );
00065     }
00066 
00067     surfaceScalarField& phib = phibPtr();
00068 
00069 // ************************ vim: set sw=4 sts=4 et: ************************ //
00070 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines