Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / solvers / heatTransfer / buoyantPimpleFoam / createFields.H
blobe39d0bb80333b1cb16731cb0d63356c100aaf093
1     Info<< "Reading thermophysical properties\n" << endl;
3     autoPtr<basicRhoThermo> pThermo
4     (
5         basicRhoThermo::New(mesh)
6     );
7     basicRhoThermo& thermo = pThermo();
9     volScalarField rho
10     (
11         IOobject
12         (
13             "rho",
14             runTime.timeName(),
15             mesh,
16             IOobject::NO_READ,
17             IOobject::NO_WRITE
18         ),
19         thermo.rho()
20     );
22     volScalarField& p = thermo.p();
23     volScalarField& h = thermo.h();
24     const volScalarField& psi = thermo.psi();
27     Info<< "Reading field U\n" << endl;
28     volVectorField U
29     (
30         IOobject
31         (
32             "U",
33             runTime.timeName(),
34             mesh,
35             IOobject::MUST_READ,
36             IOobject::AUTO_WRITE
37         ),
38         mesh
39     );
41     #include "compressibleCreatePhi.H"
44     Info<< "Creating turbulence model\n" << endl;
45     autoPtr<compressible::turbulenceModel> turbulence
46     (
47         compressible::turbulenceModel::New
48         (
49             rho,
50             U,
51             phi,
52             thermo
53         )
54     );
56     Info<< "Calculating field g.h\n" << endl;
57     volScalarField gh("gh", g & mesh.C());
58     surfaceScalarField ghf("ghf", g & mesh.Cf());
60     Info<< "Reading field p_rgh\n" << endl;
61     volScalarField p_rgh
62     (
63         IOobject
64         (
65             "p_rgh",
66             runTime.timeName(),
67             mesh,
68             IOobject::MUST_READ,
69             IOobject::AUTO_WRITE
70         ),
71         mesh
72     );
74     // Force p_rgh to be consistent with p
75     p_rgh = p - rho*gh;
77     Info<< "Creating field DpDt\n" << endl;
78     volScalarField DpDt
79     (
80         "DpDt",
81         fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
82     );