initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / compressible / rhoSimpleFoam / createFields.H
blob690b53760d75b22618fc9cd0c1358c015d867854
1     Info<< "Reading thermophysical properties\n" << endl;
3     autoPtr<basicPsiThermo> pThermo
4     (
5         basicPsiThermo::New(mesh)
6     );
7     basicPsiThermo& thermo = pThermo();
9     volScalarField rho
10     (
11         IOobject
12         (
13             "rho",
14             runTime.timeName(),
15             mesh,
16             IOobject::READ_IF_PRESENT,
17             IOobject::AUTO_WRITE
18         ),
19         thermo.rho()
20     );
22     volScalarField& p = thermo.p();
23     volScalarField& h = thermo.h();
24     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     label pRefCell = 0;
44     scalar pRefValue = 0.0;
45     setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
47     dimensionedScalar pMin
48     (
49         mesh.solutionDict().subDict("SIMPLE").lookup("pMin")
50     );
52     Info<< "Creating turbulence model\n" << endl;
53     autoPtr<compressible::RASModel> turbulence
54     (
55         compressible::RASModel::New
56         (
57             rho,
58             U,
59             phi,
60             thermo
61         )
62     );
64     dimensionedScalar initialMass = fvc::domainIntegrate(rho);