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 thermophysical properties\n" << endl;
00002 
00003     autoPtr<basicRhoThermo> pThermo
00004     (
00005         basicRhoThermo::New(mesh)
00006     );
00007     basicRhoThermo& thermo = pThermo();
00008 
00009     volScalarField rho
00010     (
00011         IOobject
00012         (
00013             "rho",
00014             runTime.timeName(),
00015             mesh,
00016             IOobject::NO_READ,
00017             IOobject::NO_WRITE
00018         ),
00019         thermo.rho()
00020     );
00021 
00022     volScalarField& p = thermo.p();
00023     volScalarField& h = thermo.h();
00024     const volScalarField& psi = thermo.psi();
00025 
00026 
00027     Info<< "Reading field U\n" << endl;
00028     volVectorField U
00029     (
00030         IOobject
00031         (
00032             "U",
00033             runTime.timeName(),
00034             mesh,
00035             IOobject::MUST_READ,
00036             IOobject::AUTO_WRITE
00037         ),
00038         mesh
00039     );
00040 
00041     #include <finiteVolume/compressibleCreatePhi.H>
00042 
00043 
00044     Info<< "Creating turbulence model\n" << endl;
00045     autoPtr<compressible::turbulenceModel> turbulence
00046     (
00047         compressible::turbulenceModel::New
00048         (
00049             rho,
00050             U,
00051             phi,
00052             thermo
00053         )
00054     );
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     Info<< "Reading field p_rgh\n" << endl;
00061     volScalarField p_rgh
00062     (
00063         IOobject
00064         (
00065             "p_rgh",
00066             runTime.timeName(),
00067             mesh,
00068             IOobject::MUST_READ,
00069             IOobject::AUTO_WRITE
00070         ),
00071         mesh
00072     );
00073 
00074     // Force p_rgh to be consistent with p
00075     p_rgh = p - rho*gh;
00076 
00077     Info<< "Creating field DpDt\n" << endl;
00078     volScalarField DpDt
00079     (
00080         "DpDt",
00081         fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
00082     );
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines