FreeFOAM The Cross-Platform CFD Toolkit
createFields.H
Go to the documentation of this file.
1  Info<< "Reading field p_rgh\n" << endl;
3  (
4  IOobject
5  (
6  "p_rgh",
7  runTime.timeName(),
8  mesh,
9  IOobject::MUST_READ,
10  IOobject::AUTO_WRITE
11  ),
12  mesh
13  );
14 
15  Info<< "Reading field U\n" << endl;
17  (
18  IOobject
19  (
20  "U",
21  runTime.timeName(),
22  mesh,
23  IOobject::MUST_READ,
24  IOobject::AUTO_WRITE
25  ),
26  mesh
27  );
28 
29  #include <finiteVolume/createPhi.H>
30 
31  multiphaseMixture mixture(U, phi);
32 
33  // Need to store rho for ddt(rho, U)
35  (
36  IOobject
37  (
38  "rho",
39  runTime.timeName(),
40  mesh,
41  IOobject::READ_IF_PRESENT
42  ),
43  mixture.rho()
44  );
45  rho.oldTime();
46 
47 
48  // Construct incompressible turbulence model
49  autoPtr<incompressible::turbulenceModel> turbulence
50  (
51  incompressible::turbulenceModel::New(U, phi, mixture)
52  );
53 
55 
56  Info<< "Calculating field g.h\n" << endl;
57  volScalarField gh("gh", g & mesh.C());
58  surfaceScalarField ghf("ghf", g & mesh.Cf());
59 
61  (
62  IOobject
63  (
64  "p",
65  runTime.timeName(),
66  mesh,
67  IOobject::NO_READ,
68  IOobject::AUTO_WRITE
69  ),
70  p_rgh + rho*gh
71  );
72 
73  label pRefCell = 0;
74  scalar pRefValue = 0.0;
76  (
77  p,
78  p_rgh,
79  mesh.solutionDict().subDict("PISO"),
80  pRefCell,
81  pRefValue
82  );
83 
84  if (p_rgh.needReference())
85  {
87  (
88  "p",
89  p.dimensions(),
90  pRefValue - getRefCellValue(p, pRefCell)
91  );
92  }