FreeFOAM The Cross-Platform CFD Toolkit
createFields.H
Go to the documentation of this file.
1  Info<< "Reading thermophysical properties\n" << endl;
2 
3  autoPtr<basicRhoThermo> pThermo
4  (
5  basicRhoThermo::New(mesh)
6  );
7  basicRhoThermo& thermo = pThermo();
8 
10  (
11  IOobject
12  (
13  "rho",
14  runTime.timeName(),
15  mesh,
16  IOobject::NO_READ,
17  IOobject::NO_WRITE
18  ),
19  thermo.rho()
20  );
21 
22  volScalarField& p = thermo.p();
23  volScalarField& h = thermo.h();
24  const volScalarField& psi = thermo.psi();
25 
26 
27  Info<< "Reading field U\n" << endl;
29  (
30  IOobject
31  (
32  "U",
33  runTime.timeName(),
34  mesh,
35  IOobject::MUST_READ,
36  IOobject::AUTO_WRITE
37  ),
38  mesh
39  );
40 
42 
43 
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  );
55 
56  Info<< "Calculating field g.h\n" << endl;
57  volScalarField gh("gh", g & mesh.C());
58  surfaceScalarField ghf("ghf", g & mesh.Cf());
59 
60  Info<< "Reading field p_rgh\n" << endl;
62  (
63  IOobject
64  (
65  "p_rgh",
66  runTime.timeName(),
67  mesh,
68  IOobject::MUST_READ,
69  IOobject::AUTO_WRITE
70  ),
71  mesh
72  );
73 
74  // Force p_rgh to be consistent with p
75  p_rgh = p - rho*gh;
76 
77  Info<< "Creating field DpDt\n" << endl;
79  (
80  "DpDt",
82  );