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

createFields.H

Go to the documentation of this file.
00001     Info<< "Reading field p_rgh\n" << endl;
00002     volScalarField p_rgh
00003     (
00004         IOobject
00005         (
00006             "p_rgh",
00007             runTime.timeName(),
00008             mesh,
00009             IOobject::MUST_READ,
00010             IOobject::AUTO_WRITE
00011         ),
00012         mesh
00013     );
00014 
00015     Info<< "Reading field U\n" << endl;
00016     volVectorField U
00017     (
00018         IOobject
00019         (
00020             "U",
00021             runTime.timeName(),
00022             mesh,
00023             IOobject::MUST_READ,
00024             IOobject::AUTO_WRITE
00025         ),
00026         mesh
00027     );
00028 
00029     #include <finiteVolume/createPhi.H>
00030 
00031     multiphaseMixture mixture(U, phi);
00032 
00033     // Need to store rho for ddt(rho, U)
00034     volScalarField rho
00035     (
00036         IOobject
00037         (
00038             "rho",
00039             runTime.timeName(),
00040             mesh,
00041             IOobject::READ_IF_PRESENT
00042         ),
00043         mixture.rho()
00044     );
00045     rho.oldTime();
00046 
00047 
00048     // Construct incompressible turbulence model
00049     autoPtr<incompressible::turbulenceModel> turbulence
00050     (
00051         incompressible::turbulenceModel::New(U, phi, mixture)
00052     );
00053 
00054     #include <finiteVolume/readGravitationalAcceleration.H>
00055 
00056     Info<< "Calculating field g.h\n" << endl;
00057     volScalarField gh("gh", g & mesh.C());
00058     surfaceScalarField ghf("ghf", g & mesh.Cf());
00059 
00060     volScalarField p
00061     (
00062         IOobject
00063         (
00064             "p",
00065             runTime.timeName(),
00066             mesh,
00067             IOobject::NO_READ,
00068             IOobject::AUTO_WRITE
00069         ),
00070         p_rgh + rho*gh
00071     );
00072 
00073     label pRefCell = 0;
00074     scalar pRefValue = 0.0;
00075     setRefCell
00076     (
00077         p,
00078         p_rgh,
00079         mesh.solutionDict().subDict("PISO"),
00080         pRefCell,
00081         pRefValue
00082     );
00083 
00084     if (p_rgh.needReference())
00085     {
00086         p += dimensionedScalar
00087         (
00088             "p",
00089             p.dimensions(),
00090             pRefValue - getRefCellValue(p, pRefCell)
00091         );
00092     }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines