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& p = thermo.p();
00010 volScalarField& e = thermo.e();
00011 const volScalarField& T = thermo.T();
00012 const volScalarField& psi = thermo.psi();
00013 const volScalarField& mu = thermo.mu();
00014 
00015 bool inviscid(true);
00016 if (max(mu.internalField()) > 0.0)
00017 {
00018     inviscid = false;
00019 }
00020 
00021 Info<< "Reading field U\n" << endl;
00022 volVectorField U
00023 (
00024     IOobject
00025     (
00026         "U",
00027         runTime.timeName(),
00028         mesh,
00029         IOobject::MUST_READ,
00030         IOobject::AUTO_WRITE
00031     ),
00032     mesh
00033 );
00034 
00035 #include "../rhoBoundaryTypes.H"
00036 volScalarField rho
00037 (
00038     IOobject
00039     (
00040         "rho",
00041         runTime.timeName(),
00042         mesh,
00043         IOobject::NO_READ,
00044         IOobject::AUTO_WRITE
00045     ),
00046     thermo.rho(),
00047     rhoBoundaryTypes
00048 );
00049 
00050 volVectorField rhoU
00051 (
00052     IOobject
00053     (
00054         "rhoU",
00055         runTime.timeName(),
00056         mesh,
00057         IOobject::NO_READ,
00058         IOobject::NO_WRITE
00059     ),
00060     rho*U
00061 );
00062 
00063 volScalarField rhoE
00064 (
00065     IOobject
00066     (
00067         "rhoE",
00068         runTime.timeName(),
00069         mesh,
00070         IOobject::NO_READ,
00071         IOobject::NO_WRITE
00072     ),
00073     rho*(e + 0.5*magSqr(U))
00074 );
00075 
00076 surfaceScalarField pos
00077 (
00078     IOobject
00079     (
00080         "pos",
00081         runTime.timeName(),
00082         mesh
00083     ),
00084     mesh,
00085     dimensionedScalar("pos", dimless, 1.0)
00086 );
00087 
00088 surfaceScalarField neg
00089 (
00090     IOobject
00091     (
00092         "neg",
00093         runTime.timeName(),
00094         mesh
00095     ),
00096     mesh,
00097     dimensionedScalar("neg", dimless, -1.0)
00098 );
00099 
00100 
00101 surfaceScalarField phi("phi", mesh.Sf() & fvc::interpolate(rhoU));
00102 
00103 Info<< "Creating turbulence model\n" << endl;
00104 autoPtr<compressible::turbulenceModel> turbulence
00105 (
00106     compressible::turbulenceModel::New
00107     (
00108         rho,
00109         U,
00110         phi,
00111         thermo
00112     )
00113 );
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines