Backported heat transfer solvers and tutorials (vanilla OF 3.0.1) (in chtMultiRegionF...
[foam-extend-4.0.git] / applications / solvers / heatTransfer / buoyantSimpleFoam / createFields.H
bloba428c20eeaf1fc83e1922a2aad66cdf0eef014be
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::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::RASModel> turbulence
46     (
47         compressible::RASModel::New
48         (
49             rho,
50             U,
51             phi,
52             thermo
53         )
54     );
56     thermo.correct();
58     label pRefCell = 0;
59     scalar pRefValue = 0.0;
60     setRefCell
61     (
62         p,
63         mesh.solutionDict().subDict("SIMPLE"),
64         pRefCell,
65         pRefValue
66     );
69     dimensionedScalar initialMass = fvc::domainIntegrate(rho);
71     mesh.schemesDict().setFluxRequired(p.name());