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<basicPsiThermo> pThermo
4  (
5  basicPsiThermo::New(mesh)
6  );
7  basicPsiThermo& thermo = pThermo();
8 
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  );
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  label pRefCell = 0;
45  scalar pRefValue = 0.0;
46  setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
47 
49  (
50  mesh.solutionDict().subDict("SIMPLE").lookup("pMin")
51  );
52 
53  Info<< "Creating turbulence model\n" << endl;
54  autoPtr<compressible::RASModel> turbulence
55  (
56  compressible::RASModel::New
57  (
58  rho,
59  U,
60  phi,
61  thermo
62  )
63  );
64 
66 
67  porousZones pZones(mesh);
68  Switch pressureImplicitPorosity(false);
69 
70  int nUCorr = 0;
71  if (pZones.size())
72  {
73  // nUCorrectors for pressureImplicitPorosity
74  if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
75  {
76  nUCorr = readInt
77  (
78  mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
79  );
80  }
81 
82  if (nUCorr > 0)
83  {
85  }
86  }
87