ENH: directMappedFixedValue: use different tag
[OpenFOAM-2.0.x.git] / applications / solvers / compressible / rhoSimpleFoam / createFields.H
blobaa3de6d6fbfd9c462d57057451c9f723cede8221
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 rhoMax
48     (
49         mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax")
50     );
52     dimensionedScalar rhoMin
53     (
54         mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin")
55     );
57     Info<< "Creating turbulence model\n" << endl;
58     autoPtr<compressible::RASModel> turbulence
59     (
60         compressible::RASModel::New
61         (
62             rho,
63             U,
64             phi,
65             thermo
66         )
67     );
69     dimensionedScalar initialMass = fvc::domainIntegrate(rho);