MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
MomFields.H
Go to the documentation of this file.
1 
15 IOdictionary PBEProperties
17 (
18  IOobject
19  (
20  "PBEProperties",
21  runTime.constant(),
22  mesh,
23  IOobject::MUST_READ,
24  IOobject::NO_WRITE
25  )
26 );
27 
28 Switch PBESwitch
29 (
30  PBEProperties.lookup("PBESwitch")
31 );
32 Switch bubbleGrowthSurrogateSwitch
33  (
34  PBEProperties.lookup("bubbleGrowthSurrogateSwitch")
35  );
36 word PBEMethod(PBEProperties.lookup("PBEMethod"));
37 if( !(PBEMethod == "QMOM") )
38 {
39  FatalErrorIn(args.executable())
40  << "Invalid PBE solution method " << PBEMethod
41  << exit(FatalError);
42 }
43 
44 word bubbleGrowthMode(PBEProperties.lookup("bubbleGrowthMode"));
45 if
46 (
47  !( bubbleGrowthMode == "twoNodes"
48  || bubbleGrowthMode == "meanRadius"
49  )
50 )
51 {
52  FatalErrorIn(args.executable())
53  << "Invalid bubble growth mode " << bubbleGrowthMode
54  << "\nValid modes are: "
55  << "\ntwoNodes,"
56  << "\nmeanRadius"
57  << exit(FatalError);
58 }
59 
60 scalar nNodes = readScalar(PBEProperties.lookup("nNodes"));
61 if
62 (
63  !(nNodes == 2
64  || nNodes == 3)
65 )
66 {
67  FatalErrorIn(args.executable())
68  << "Invalid number of quadrature nodes " << nNodes
69  << exit(FatalError);
70 }
71 
72 volScalarField cellvolume
73 (
74  IOobject
75  (
76  "cellvolume",
77  runTime.timeName(),
78  mesh,
79  IOobject::NO_READ,
80  IOobject::NO_WRITE
81  ),
82  mesh,
83  dimensionedScalar("zero", dimVolume, 0.0)
84 );
85 
86 volVectorField cellcentroid
87 (
88  IOobject
89  (
90  "cellcentroid",
91  runTime.timeName(),
92  mesh,
93  IOobject::NO_READ,
94  IOobject::NO_WRITE
95  ),
96  mesh,
97  dimensionedVector("zero", dimLength, vector::zero)
98 );
99 
100 Info<< "Reading field mZero \n" << endl;
101 volScalarField mZero
102 (
103  IOobject
104  (
105  "mZero",
106  runTime.timeName(),
107  mesh,
108  IOobject::MUST_READ,
109  IOobject::AUTO_WRITE
110  ),
111  mesh
112 );
113 
114 volScalarField::Internal mZeroSource
115 (
116  IOobject
117  (
118  "mZeroSource",
119  runTime.timeName(),
120  mesh
121  ),
122  mesh,
123  dimensionedScalar("mZeroSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
124 );
125 
126 surfaceScalarField phic(mag(phi/mesh.magSf()));
127 phic = min(interface.cAlpha()*phic, max(phic));
128 surfaceScalarField phir(phic*interface.nHatf());
129 
130 surfaceScalarField alpha1phir
131 (
132  fvc::interpolate(alpha1)*phir
133 );
134 
135 Info<< "Reading field mOne \n" << endl;
136 volScalarField mOne
137 (
138  IOobject
139  (
140  "mOne",
141  runTime.timeName(),
142  mesh,
143  IOobject::MUST_READ,
144  IOobject::AUTO_WRITE
145  ),
146  mesh
147 );
148 
149 volScalarField::Internal mOneSource
150 (
151  IOobject
152  (
153  "mOneSource",
154  runTime.timeName(),
155  mesh
156  ),
157  mesh,
158  dimensionedScalar("mOneSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
159 );
160 
161 Info<< "Reading field mTwo \n" << endl;
162 volScalarField mTwo
163 (
164  IOobject
165  (
166  "mTwo",
167  runTime.timeName(),
168  mesh,
169  IOobject::MUST_READ,
170  IOobject::AUTO_WRITE
171  ),
172  mesh
173 );
174 
175 volScalarField::Internal mTwoSource
176 (
177  IOobject
178  (
179  "mTwoSource",
180  runTime.timeName(),
181  mesh
182  ),
183  mesh,
184  dimensionedScalar("mTwoSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
185 );
186 
187 Info<< "Reading field mThree \n" << endl;
188 volScalarField mThree
189 (
190  IOobject
191  (
192  "mThree",
193  runTime.timeName(),
194  mesh,
195  IOobject::MUST_READ,
196  IOobject::AUTO_WRITE
197  ),
198  mesh
199 );
200 
201 volScalarField::Internal mThreeSource
202 (
203  IOobject
204  (
205  "mThreeSource",
206  runTime.timeName(),
207  mesh
208  ),
209  mesh,
210  dimensionedScalar("mThreeSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
211 );
212 
213 Info<< "Reading field mFour \n" << endl;
214 volScalarField mFour
215 (
216  IOobject
217  (
218  "mFour",
219  runTime.timeName(),
220  mesh,
221  IOobject::MUST_READ,
222  IOobject::AUTO_WRITE
223  ),
224  mesh
225 );
226 
227 volScalarField::Internal mFourSource
228 (
229  IOobject
230  (
231  "mFourSource",
232  runTime.timeName(),
233  mesh
234  ),
235  mesh,
236  dimensionedScalar("mFourSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
237 );
238 
239 Info<< "Reading field mFive \n" << endl;
240 volScalarField mFive
241 (
242  IOobject
243  (
244  "mFive",
245  runTime.timeName(),
246  mesh,
247  IOobject::MUST_READ,
248  IOobject::AUTO_WRITE
249  ),
250  mesh
251 );
252 
253 volScalarField::Internal mFiveSource
254 (
255  IOobject
256  (
257  "mFiveSource",
258  runTime.timeName(),
259  mesh
260  ),
261  mesh,
262  dimensionedScalar("mFiveSource", dimensionSet(0,0,-1,0,0,0,0), 0.0)
263 );
264 
265 Info<< "Reading field M0 \n" << endl;
266 volScalarField M0
267 (
268  IOobject
269  (
270  "M0",
271  runTime.timeName(),
272  mesh,
273  IOobject::MUST_READ,
274  IOobject::AUTO_WRITE
275  ),
276  mesh
277 );
278 
279 Info<< "Reading field M1 \n" << endl;
280 volScalarField M1
281 (
282  IOobject
283  (
284  "M1",
285  runTime.timeName(),
286  mesh,
287  IOobject::MUST_READ,
288  IOobject::AUTO_WRITE
289  ),
290  mesh
291 );
292 
293 Info<< "Reading field M2 \n" << endl;
294 volScalarField M2
295 (
296  IOobject
297  (
298  "M2",
299  runTime.timeName(),
300  mesh,
301  IOobject::MUST_READ,
302  IOobject::AUTO_WRITE
303  ),
304  mesh
305 );
306 
307 Info<< "Reading field M3 \n" << endl;
308 volScalarField M3
309 (
310  IOobject
311  (
312  "M3",
313  runTime.timeName(),
314  mesh,
315  IOobject::MUST_READ,
316  IOobject::AUTO_WRITE
317  ),
318  mesh
319 );
320 
321 Info<< "Reading field M4 \n" << endl;
322 volScalarField M4
323 (
324  IOobject
325  (
326  "M4",
327  runTime.timeName(),
328  mesh,
329  IOobject::MUST_READ,
330  IOobject::AUTO_WRITE
331  ),
332  mesh
333 );
334 
335 Info<< "Reading field M5 \n" << endl;
336 volScalarField M5
337 (
338  IOobject
339  (
340  "M5",
341  runTime.timeName(),
342  mesh,
343  IOobject::MUST_READ,
344  IOobject::AUTO_WRITE
345  ),
346  mesh
347 );
348 
349 Info<< "Reading fields weights and nodes \n" << endl;
350 volScalarField weight0
351 (
352  IOobject
353  (
354  "weight0",
355  runTime.timeName(),
356  mesh,
357  IOobject::MUST_READ,
358  IOobject::AUTO_WRITE
359  ),
360  mesh
361 
362 );
363 
364 volScalarField weight1
365 (
366  IOobject
367  (
368  "weight1",
369  runTime.timeName(),
370  mesh,
371  IOobject::MUST_READ,
372  IOobject::AUTO_WRITE
373  ),
374  mesh
375 );
376 
377 volScalarField node0
378 (
379  IOobject
380  (
381  "node0",
382  runTime.timeName(),
383  mesh,
384  IOobject::MUST_READ,
385  IOobject::AUTO_WRITE
386  ),
387  mesh
388 );
389 
390 volScalarField node1
391 (
392  IOobject
393  (
394  "node1",
395  runTime.timeName(),
396  mesh,
397  IOobject::MUST_READ,
398  IOobject::AUTO_WRITE
399  ),
400  mesh
401 );
402 
403 volScalarField weight2
404 (
405  IOobject
406  (
407  "weight2",
408  runTime.timeName(),
409  mesh,
410  IOobject::MUST_READ,
411  IOobject::AUTO_WRITE
412  ),
413  mesh
414 );
415 
416 volScalarField node2
417 (
418  IOobject
419  (
420  "node2",
421  runTime.timeName(),
422  mesh,
423  IOobject::MUST_READ,
424  IOobject::AUTO_WRITE
425  ),
426  mesh
427 );
428 Info<< "End of \"MomFields\"\n" << endl;
429 ///@endcond