edge grading
[OpenFOAM-1.5.x.git] / applications / solvers / heatTransfer / buoyantSimpleFoam / createFields.H
blob184242be81be2a08d118f4992a260c56bfffce38
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();
25     Info<< "Reading field U\n" << endl;
26     volVectorField U
27     (
28         IOobject
29         (
30             "U",
31             runTime.timeName(),
32             mesh,
33             IOobject::MUST_READ,
34             IOobject::AUTO_WRITE
35         ),
36         mesh
37     );
39 #   include "compressibleCreatePhi.H"
42     Info<< "Creating turbulence model\n" << endl;
43     autoPtr<compressible::RASModel> turbulence
44     (
45         compressible::RASModel::New
46         (
47             rho,
48             U,
49             phi,
50             thermo()
51         )
52     );
54     Info<< "Calculating field g.h\n" << endl;
55     volScalarField gh("gh", g & mesh.C());
57     dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
59     Info<< "Creating field pd\n" << endl;
60     volScalarField pd
61     (
62         IOobject
63         (
64             "pd",
65             runTime.timeName(),
66             mesh,
67             IOobject::MUST_READ,
68             IOobject::AUTO_WRITE
69         ),
70         mesh
71     );
73     p = pd + rho*gh + pRef;
74     thermo->correct();
77     label pdRefCell = 0;
78     scalar pdRefValue = 0.0;
79     setRefCell
80     (
81         pd,
82         mesh.solutionDict().subDict("SIMPLE"),
83         pdRefCell,
84         pdRefValue
85     );
88     dimensionedScalar initialMass = fvc::domainIntegrate(rho);