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::READ_IF_PRESENT,
00017             IOobject::AUTO_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     label pRefCell = 0;
00045     scalar pRefValue = 0.0;
00046     setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
00047 
00048     dimensionedScalar pMin
00049     (
00050         mesh.solutionDict().subDict("SIMPLE").lookup("pMin")
00051     );
00052 
00053     Info<< "Creating turbulence model\n" << endl;
00054     autoPtr<compressible::RASModel> turbulence
00055     (
00056         compressible::RASModel::New
00057         (
00058             rho,
00059             U,
00060             phi,
00061             thermo
00062         )
00063     );
00064 
00065     dimensionedScalar initialMass = fvc::domainIntegrate(rho);
00066 
00067     porousZones pZones(mesh);
00068     Switch pressureImplicitPorosity(false);
00069 
00070     int nUCorr = 0;
00071     if (pZones.size())
00072     {
00073         // nUCorrectors for pressureImplicitPorosity
00074         if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
00075         {
00076             nUCorr = readInt
00077             (
00078                 mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
00079             );
00080         }
00081 
00082         if (nUCorr > 0)
00083         {
00084             pressureImplicitPorosity = true;
00085         }
00086     }
00087 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines