initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / heatTransfer / buoyantPisoFoam / createFields.H
blobb8ac5595e47cec77aa257c54a1710f91b08f20f7
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<< "Creating field DpDt\n" << endl;
57     volScalarField DpDt
58     (
59         "DpDt",
60         fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
61     );
63     thermo.correct();
65     dimensionedScalar initialMass = fvc::domainIntegrate(rho);
67     dimensionedScalar totalVolume = sum(mesh.V());