FreeFOAM The Cross-Platform CFD Toolkit
createFields.H
Go to the documentation of this file.
1  Info<< "Reading field alpha\n" << endl;
2  volScalarField alpha
3  (
4  IOobject
5  (
6  "alpha",
7  runTime.timeName(),
8  mesh,
9  IOobject::MUST_READ,
10  IOobject::AUTO_WRITE
11  ),
12  mesh
13  );
14 
16  (
17  IOobject
18  (
19  "beta",
20  runTime.timeName(),
21  mesh,
22  IOobject::NO_READ,
23  IOobject::NO_WRITE
24  ),
25  scalar(1) - alpha
26  //,alpha.boundaryField().types()
27  );
28 
29  Info<< "Reading field p\n" << endl;
31  (
32  IOobject
33  (
34  "p",
35  runTime.timeName(),
36  mesh,
37  IOobject::MUST_READ,
38  IOobject::AUTO_WRITE
39  ),
40  mesh
41  );
42 
43  Info<< "Reading field Ua\n" << endl;
45  (
46  IOobject
47  (
48  "Ua",
49  runTime.timeName(),
50  mesh,
51  IOobject::MUST_READ,
52  IOobject::AUTO_WRITE
53  ),
54  mesh
55  );
56 
57  Info<< "Reading field Ub\n" << endl;
59  (
60  IOobject
61  (
62  "Ub",
63  runTime.timeName(),
64  mesh,
65  IOobject::MUST_READ,
66  IOobject::AUTO_WRITE
67  ),
68  mesh
69  );
70 
72  (
73  IOobject
74  (
75  "U",
76  runTime.timeName(),
77  mesh,
78  IOobject::NO_READ,
79  IOobject::AUTO_WRITE
80  ),
81  alpha*Ua + beta*Ub
82  );
83 
84 
85  Info<< "Reading transportProperties\n" << endl;
86 
87  IOdictionary transportProperties
88  (
89  IOobject
90  (
91  "transportProperties",
92  runTime.constant(),
93  mesh,
94  IOobject::MUST_READ,
95  IOobject::NO_WRITE
96  )
97  );
98 
100  (
101  transportProperties.lookup("rhoa")
102  );
103 
105  (
106  transportProperties.lookup("rhob")
107  );
108 
110  (
111  transportProperties.lookup("nua")
112  );
113 
115  (
116  transportProperties.lookup("nub")
117  );
118 
120  (
121  transportProperties.lookup("da")
122  );
123 
125  (
126  transportProperties.lookup("db")
127  );
128 
130  (
131  transportProperties.lookup("Cvm")
132  );
133 
135  (
136  transportProperties.lookup("Cl")
137  );
138 
140  (
141  transportProperties.lookup("Ct")
142  );
143 
144  #include "createPhia.H"
145  #include "createPhib.H"
146 
148  (
149  IOobject
150  (
151  "phi",
152  runTime.timeName(),
153  mesh
154  ),
155  fvc::interpolate(alpha)*phia
157  );
158 
160  (
161  IOobject
162  (
163  "rho",
164  runTime.timeName(),
165  mesh
166  ),
167  alpha*rhoa + beta*rhob
168  );
169 
170  #include "createRASTurbulence.H"
171 
172  Info<< "Calculating field DDtUa and DDtUb\n" << endl;
173 
174  volVectorField DDtUa =
175  fvc::ddt(Ua)
176  + fvc::div(phia, Ua)
177  - fvc::div(phia)*Ua;
178 
179  volVectorField DDtUb =
180  fvc::ddt(Ub)
181  + fvc::div(phib, Ub)
182  - fvc::div(phib)*Ub;
183 
184 
185  Info<< "Calculating field g.h\n" << endl;
186  volScalarField gh("gh", g & mesh.C());
187 
188 
189  label pRefCell = 0;
190  scalar pRefValue = 0.0;
191  setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
192 
193 // ************************ vim: set sw=4 sts=4 et: ************************ //