createFields.H
Go to the documentation of this file.
1Info<< "Reading combustion properties\n" << endl;
2
3IOdictionary 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
15vector swirlAxis(engineGeometry.get<vector>("swirlAxis"));
16
17vector swirlCenter(engineGeometry.get<vector>("swirlCenter"));
18
19dimensionedScalar swirlRPMRatio("swirlRPMRatio", engineGeometry);
20
21dimensionedScalar swirlProfile("swirlProfile", engineGeometry);
22
23dimensionedScalar bore("bore", dimLength, engineGeometry);
24
25dimensionedScalar rpm("rpm", dimless/dimTime, engineGeometry);
26
27
28Info<< "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
42vector zT = swirlAxis;
43vector yT = vector(0, zT.z(), -zT.y());
44vector 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
52if (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.
59xT.normalise();
60yT.normalise();
61zT.normalise();
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
U
Definition: pEqn.H:72
dynamicFvMesh & mesh
engineTime & runTime
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:83
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)