engineCompRatio.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
00034
00035 #include "fvCFD.H"
00036 #include "engineTime.H"
00037 #include "engineMesh.H"
00038
00039
00040
00041 int main(int argc, char *argv[])
00042 {
00043 #include "setRootCase.H"
00044 #include "createEngineTime.H"
00045 #include "createEngineMesh.H"
00046
00047
00048
00049 scalar eps = 1.0e-10;
00050 scalar fullCycle = 360.0;
00051
00052 scalar ca0 = -180.0;
00053 scalar ca1 = 0.0;
00054
00055 while (runTime.theta() > ca0)
00056 {
00057 ca0 += fullCycle;
00058 ca1 += fullCycle;
00059 }
00060
00061 while (mag(runTime.theta() - ca0) > eps)
00062 {
00063 scalar t0 = runTime.userTimeToTime(ca0 - runTime.theta());
00064 runTime.setDeltaT(t0);
00065 runTime++;
00066 Info<< "CA = " << runTime.theta() << endl;
00067 mesh.move();
00068 }
00069
00070 scalar Vmax = sum(mesh.V().field());
00071
00072 while (mag(runTime.theta()-ca1) > eps)
00073 {
00074 scalar t1 = runTime.userTimeToTime(ca1-runTime.theta());
00075 runTime.setDeltaT(t1);
00076 runTime++;
00077 Info<< "CA = " << runTime.theta() << endl;
00078 mesh.move();
00079 }
00080
00081 scalar Vmin = sum(mesh.V().field());
00082
00083 Info<< "\nVmax = " << Vmax;
00084 Info<< ", Vmin = " << Vmin << endl;
00085 Info<< "Vmax/Vmin = " << Vmax/Vmin << endl;
00086 Info<< "\nEnd" << endl;
00087
00088 return 0;
00089 }
00090
00091
00092
Copyright © 2000-2009 OpenCFD Ltd