createFields.H
Go to the documentation of this file.
1 Info<< "Reading combustion properties\n" << endl;
2 
3 IOdictionary engineGeometry
4 (
5  IOobject
6  (
7  "engineGeometry",
8  runTime.constant(),
9  mesh,
10  IOobject::MUST_READ_IF_MODIFIED,
11  IOobject::NO_WRITE
12  )
13 );
14 
15 vector swirlAxis
16 (
17  engineGeometry.lookup("swirlAxis")
18 );
19 
20 vector swirlCenter
21 (
22  engineGeometry.lookup("swirlCenter")
23 );
24 
25 dimensionedScalar swirlRPMRatio
26 (
27  engineGeometry.lookup("swirlRPMRatio")
28 );
29 
30 dimensionedScalar swirlProfile
31 (
32  engineGeometry.lookup("swirlProfile")
33 );
34 
36 (
37  engineGeometry.lookup("bore")
38 );
39 
41 (
42  engineGeometry.lookup("rpm")
43 );
44 
45 
46 Info<< "Reading field U\n" << endl;
48 (
49  IOobject
50  (
51  "U",
52  runTime.timeName(),
53  mesh,
54  IOobject::MUST_READ,
55  IOobject::AUTO_WRITE
56  ),
57  mesh
58 );
59 
60 vector zT = swirlAxis;
61 vector yT = vector(0, zT.z(), -zT.y());
62 vector xT = vector
63 (
64  zT.y()*zT.y() + zT.z()*zT.z(),
65  -zT.x()*zT.y(),
66  -zT.x()*zT.z()
67 );
68 
69 // if swirl is around (1, 0, 0) we have to find another transformation
70 if (mag(yT) < small)
71 {
72  yT = vector(zT.y(), -zT.x(), 0);
73  xT = vector(-zT.x()*zT.z(), -zT.y()*zT.z(), zT.x()*zT.x() + zT.y()*zT.y());
74 }
75 
76 //swirlAxis doesn't have to be of unit length.
77 xT /= mag(xT);
78 yT /= mag(yT);
79 zT /= mag(zT);
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector("zero", dimVelocity, Zero))
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
dynamicFvMesh & mesh
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
messageStream Info
dimensioned< scalar > mag(const dimensioned< Type > &)