initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / solvers / heatTransfer / lesBuoyantFoam / createFields.H
blob7b63660f7e6c57460e2b1f3b73a06fb484443531
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& psi = thermo->psi();
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::LESModel> turbulence
45     (
46         compressible::LESModel::New(rho, U, phi, thermo())
47     );
50     Info<< "Creating field dpdt\n" << endl;
51     volScalarField dpdt = fvc::ddt(p);
53     Info<< "Calculating field g.h\n" << endl;
54     volScalarField gh("gh", g & mesh.C());
56     dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
58     Info<< "Creating field pd\n" << endl;
59     volScalarField pd
60     (
61         IOobject
62         (
63             "pd",
64             runTime.timeName(),
65             mesh,
66             IOobject::MUST_READ,
67             IOobject::AUTO_WRITE
68         ),
69         mesh
70     );
72     p = pd + rho*gh + pRef;
73     thermo->correct();
75     dimensionedScalar initialMass = fvc::domainIntegrate(rho);