FreeFOAM The Cross-Platform CFD Toolkit
createFields.H
Go to the documentation of this file.
1  Info<< "Reading thermophysical properties\n" << endl;
2 
3  Info<< "Reading field T\n" << endl;
5  (
6  IOobject
7  (
8  "T",
9  runTime.timeName(),
10  mesh,
11  IOobject::MUST_READ,
12  IOobject::AUTO_WRITE
13  ),
14  mesh
15  );
16 
17  Info<< "Reading field p_rgh\n" << endl;
19  (
20  IOobject
21  (
22  "p_rgh",
23  runTime.timeName(),
24  mesh,
25  IOobject::MUST_READ,
26  IOobject::AUTO_WRITE
27  ),
28  mesh
29  );
30 
31  Info<< "Reading field U\n" << endl;
33  (
34  IOobject
35  (
36  "U",
37  runTime.timeName(),
38  mesh,
39  IOobject::MUST_READ,
40  IOobject::AUTO_WRITE
41  ),
42  mesh
43  );
44 
45  #include <finiteVolume/createPhi.H>
46 
47  #include "readTransportProperties.H"
48 
49  Info<< "Creating turbulence model\n" << endl;
50  autoPtr<incompressible::RASModel> turbulence
51  (
52  incompressible::RASModel::New(U, phi, laminarTransport)
53  );
54 
55  // Kinematic density for buoyancy force
57  (
58  IOobject
59  (
60  "rhok",
61  runTime.timeName(),
62  mesh
63  ),
64  1.0 - beta*(T - TRef)
65  );
66 
67  // kinematic turbulent thermal thermal conductivity m2/s
68  Info<< "Reading field kappat\n" << endl;
69  volScalarField kappat
70  (
71  IOobject
72  (
73  "kappat",
74  runTime.timeName(),
75  mesh,
76  IOobject::MUST_READ,
77  IOobject::AUTO_WRITE
78  ),
79  mesh
80  );
81 
82  Info<< "Calculating field g.h\n" << endl;
83  volScalarField gh("gh", g & mesh.C());
84  surfaceScalarField ghf("ghf", g & mesh.Cf());
85 
87  (
88  IOobject
89  (
90  "p",
91  runTime.timeName(),
92  mesh,
93  IOobject::NO_READ,
94  IOobject::AUTO_WRITE
95  ),
96  p_rgh + rhok*gh
97  );
98 
99  label pRefCell = 0;
100  scalar pRefValue = 0.0;
101  setRefCell
102  (
103  p,
104  p_rgh,
105  mesh.solutionDict().subDict("SIMPLE"),
106  pRefCell,
107  pRefValue
108  );
109 
110  if (p_rgh.needReference())
111  {
113  (
114  "p",
115  p.dimensions(),
116  pRefValue - getRefCellValue(p, pRefCell)
117  );
118  }