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(engineGeometry.get<vector>("swirlAxis"));
16 
17 vector swirlCenter(engineGeometry.get<vector>("swirlCenter"));
18 
19 dimensionedScalar swirlRPMRatio("swirlRPMRatio", engineGeometry);
20 
21 dimensionedScalar swirlProfile("swirlProfile", engineGeometry);
22 
23 dimensionedScalar bore("bore", dimLength, engineGeometry);
24 
25 dimensionedScalar rpm("rpm", dimless/dimTime, engineGeometry);
26 
27 
28 Info<< "Reading field U\n" << endl;
30 (
31  IOobject
32  (
33  "U",
34  runTime.timeName(),
35  mesh,
36  IOobject::MUST_READ,
37  IOobject::AUTO_WRITE
38  ),
39  mesh
40 );
41 
42 vector zT = swirlAxis;
43 vector yT = vector(0, zT.z(), -zT.y());
44 vector xT = vector
45 (
46  zT.y()*zT.y() + zT.z()*zT.z(),
47  -zT.x()*zT.y(),
48  -zT.x()*zT.z()
49 );
50 
51 // if swirl is around (1, 0, 0) we have to find another transformation
52 if (mag(yT) < SMALL)
53 {
54  yT = vector(zT.y(), -zT.x(), 0);
55  xT = vector(-zT.x()*zT.z(), -zT.y()*zT.z(), zT.x()*zT.x() + zT.y()*zT.y());
56 }
57 
58 //swirlAxis doesn't have to be of unit length.
59 xT.normalise();
60 yT.normalise();
61 zT.normalise();
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
Vector< Cmpt > & normalise(const scalar tol=ROOTVSMALL)
Inplace normalise the vector by its magnitude.
Definition: VectorI.H:114
const dimensionSet dimless
Dimensionless.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
dynamicFvMesh & mesh
Vector< scalar > vector
Definition: vector.H:57
volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedVector(dimVelocity, Zero))
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
messageStream Info
Information stream (stdout output on master, null elsewhere)