engineSwirl.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "fvCFD.H"
00034 #include "mathematicalConstants.H"
00035
00036
00037
00038 int main(int argc, char *argv[])
00039 {
00040
00041 # include "setRootCase.H"
00042 # include "createTime.H"
00043 # include "createMesh.H"
00044 # include "createFields.H"
00045
00046
00047
00048 scalar Vphi = (mathematicalConstant::pi*swirlRPMRatio*rpm/30).value();
00049 scalar b1 = j1(swirlProfile).value();
00050 scalar b2 = 2.0*b1/swirlProfile.value() - j0(swirlProfile).value();
00051
00052 scalar omega = 0.125*(Vphi*bore*swirlProfile/b2).value();
00053
00054 scalar cylinderRadius = 0.5*bore.value();
00055
00056 scalar Umax = 0.0;
00057 forAll(mesh.C(), celli)
00058 {
00059 vector c = mesh.C()[celli] - swirlCenter;
00060 scalar r = ::pow(sqr(c & xT) + sqr(c & yT), 0.5);
00061
00062 if (r <= cylinderRadius)
00063 {
00064 scalar b = j1(swirlProfile*r/cylinderRadius).value();
00065 scalar vEff = omega*b;
00066 r = max(r, SMALL);
00067 U[celli] = ((vEff/r)*(c & yT))*xT + (-(vEff/r)*(c & xT))*yT;
00068 Umax = max(Umax, mag(U[celli]));
00069 }
00070 }
00071
00072 Info << "Umax = " << Umax << endl;
00073
00074 U.write();
00075
00076 Info << "\n end\n";
00077
00078 return 0;
00079 }
00080
00081
00082
Copyright © 2000-2009 OpenCFD Ltd