OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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\n" << endl;
00018     volScalarField p
00019     (
00020         IOobject
00021         (
00022             "p",
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 "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     Info<< "Calculating field beta*(g.h)\n" << endl;
00056     surfaceScalarField betaghf("betagh", beta*(g & mesh.Cf()));
00057 
00058     label pRefCell = 0;
00059     scalar pRefValue = 0.0;
00060     setRefCell
00061     (
00062         p,
00063         mesh.solutionDict().subDict("SIMPLE"),
00064         pRefCell,
00065         pRefValue
00066     );
00067 
00068 
00069     // Kinematic density for buoyancy force
00070     volScalarField rhok
00071     (
00072         IOobject
00073         (
00074             "rhok",
00075             runTime.timeName(),
00076             mesh
00077         ),
00078         1.0 - beta*(T - TRef)
00079     );
Copyright © 2000-2009 OpenCFD Ltd