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<basicPsiThermo> pThermo
00004     (
00005         basicPsiThermo::New(mesh)
00006     );
00007     basicPsiThermo& 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     Info<< "Reading field U\n" << endl;
00027     volVectorField U
00028     (
00029         IOobject
00030         (
00031             "U",
00032             runTime.timeName(),
00033             mesh,
00034             IOobject::MUST_READ,
00035             IOobject::AUTO_WRITE
00036         ),
00037         mesh
00038     );
00039 
00040     #include <finiteVolume/compressibleCreatePhi.H>
00041 
00042     Info<< "Creating turbulence model\n" << endl;
00043     autoPtr<compressible::RASModel> turbulence
00044     (
00045         compressible::RASModel::New
00046         (
00047             rho,
00048             U,
00049             phi,
00050             thermo
00051         )
00052     );
00053 
00054 
00055     Info<< "Calculating field g.h\n" << endl;
00056     volScalarField gh("gh", g & mesh.C());
00057     surfaceScalarField ghf("ghf", g & mesh.Cf());
00058 
00059     Info<< "Reading field p_rgh\n" << endl;
00060     volScalarField p_rgh
00061     (
00062         IOobject
00063         (
00064             "p_rgh",
00065             runTime.timeName(),
00066             mesh,
00067             IOobject::MUST_READ,
00068             IOobject::AUTO_WRITE
00069         ),
00070         mesh
00071     );
00072 
00073     // Force p_rgh to be consistent with p
00074     p_rgh = p - rho*gh;
00075 
00076 
00077     label pRefCell = 0;
00078     scalar pRefValue = 0.0;
00079     setRefCell
00080     (
00081         p,
00082         p_rgh,
00083         mesh.solutionDict().subDict("SIMPLE"),
00084         pRefCell,
00085         pRefValue
00086     );
00087 
00088     dimensionedScalar initialMass = fvc::domainIntegrate(rho);
00089     dimensionedScalar totalVolume = sum(mesh.V());
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines