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     Info<< "Reading field T\n" << endl;
00004     volScalarField T
00005     (
00006         IOobject
00007         (
00008             "T",
00009             runTime.timeName(),
00010             mesh,
00011             IOobject::MUST_READ,
00012             IOobject::AUTO_WRITE
00013         ),
00014         mesh
00015     );
00016 
00017     Info<< "Reading field p_rgh\n" << endl;
00018     volScalarField p_rgh
00019     (
00020         IOobject
00021         (
00022             "p_rgh",
00023             runTime.timeName(),
00024             mesh,
00025             IOobject::MUST_READ,
00026             IOobject::AUTO_WRITE
00027         ),
00028         mesh
00029     );
00030 
00031     Info<< "Reading field U\n" << endl;
00032     volVectorField U
00033     (
00034         IOobject
00035         (
00036             "U",
00037             runTime.timeName(),
00038             mesh,
00039             IOobject::MUST_READ,
00040             IOobject::AUTO_WRITE
00041         ),
00042         mesh
00043     );
00044 
00045     #include <finiteVolume/createPhi.H>
00046 
00047     #include "readTransportProperties.H"
00048 
00049     Info<< "Creating turbulence model\n" << endl;
00050     autoPtr<incompressible::RASModel> turbulence
00051     (
00052         incompressible::RASModel::New(U, phi, laminarTransport)
00053     );
00054 
00055     // Kinematic density for buoyancy force
00056     volScalarField rhok
00057     (
00058         IOobject
00059         (
00060             "rhok",
00061             runTime.timeName(),
00062             mesh
00063         ),
00064         1.0 - beta*(T - TRef)
00065     );
00066 
00067     // kinematic turbulent thermal thermal conductivity m2/s
00068     Info<< "Reading field kappat\n" << endl;
00069     volScalarField kappat
00070     (
00071         IOobject
00072         (
00073             "kappat",
00074             runTime.timeName(),
00075             mesh,
00076             IOobject::MUST_READ,
00077             IOobject::AUTO_WRITE
00078         ),
00079         mesh
00080     );
00081 
00082     Info<< "Calculating field g.h\n" << endl;
00083     volScalarField gh("gh", g & mesh.C());
00084     surfaceScalarField ghf("ghf", g & mesh.Cf());
00085 
00086     volScalarField p
00087     (
00088         IOobject
00089         (
00090             "p",
00091             runTime.timeName(),
00092             mesh,
00093             IOobject::NO_READ,
00094             IOobject::AUTO_WRITE
00095         ),
00096         p_rgh + rhok*gh
00097     );
00098 
00099     label pRefCell = 0;
00100     scalar pRefValue = 0.0;
00101     setRefCell
00102     (
00103         p,
00104         p_rgh,
00105         mesh.solutionDict().subDict("SIMPLE"),
00106         pRefCell,
00107         pRefValue
00108     );
00109 
00110     if (p_rgh.needReference())
00111     {
00112         p += dimensionedScalar
00113         (
00114             "p",
00115             p.dimensions(),
00116             pRefValue - getRefCellValue(p, pRefCell)
00117         );
00118     }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines