initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / solvers / heatTransfer / buoyantSimpleRadiationFoam / createFields.H
blob76e3805bca6d10005cc5fe92e05e9ce2d1c15c5b
1     Info<< "Reading thermophysical properties\n" << endl;
3     autoPtr<basicThermo> thermo
4     (
5         basicThermo::New(mesh)
6     );
8     volScalarField rho
9     (
10         IOobject
11         (
12             "rho",
13             runTime.timeName(),
14             mesh,
15             IOobject::NO_READ,
16             IOobject::NO_WRITE
17         ),
18         thermo->rho()
19     );
21     volScalarField& p = thermo->p();
22     volScalarField& h = thermo->h();
23     const volScalarField& T = thermo->T();
26     Info<< "Reading field U\n" << endl;
27     volVectorField U
28     (
29         IOobject
30         (
31             "U",
32             runTime.timeName(),
33             mesh,
34             IOobject::MUST_READ,
35             IOobject::AUTO_WRITE
36         ),
37         mesh
38     );
40 #   include "compressibleCreatePhi.H"
43     Info<< "Creating turbulence model\n" << endl;
44     autoPtr<compressible::RASModel> turbulence
45     (
46         compressible::RASModel::New
47         (
48             rho,
49             U,
50             phi,
51             thermo()
52         )
53     );
55     Info<< "Calculating field g.h\n" << endl;
56     volScalarField gh("gh", g & mesh.C());
58     dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
60     Info<< "Creating field pd\n" << endl;
61     volScalarField pd
62     (
63         IOobject
64         (
65             "pd",
66             runTime.timeName(),
67             mesh,
68             IOobject::MUST_READ,
69             IOobject::AUTO_WRITE
70         ),
71         mesh
72     );
74     p = pd + rho*gh + pRef;
75     thermo->correct();
78     label pdRefCell = 0;
79     scalar pdRefValue = 0.0;
80     setRefCell
81     (
82         pd,
83         mesh.solutionDict().subDict("SIMPLE"),
84         pdRefCell,
85         pdRefValue
86     );
89     Info<< "Creating radiation model\n" << endl;
90     autoPtr<radiation::radiationModel> radiation
91     (
92         radiation::radiationModel::New(T)
93     );
96     dimensionedScalar initialMass = fvc::domainIntegrate(rho);