From 316c16a7cda8318061508cd4822037bf4685033c Mon Sep 17 00:00:00 2001 From: henry Date: Mon, 23 Mar 2009 13:27:53 +0000 Subject: [PATCH] Applied update submitted by Niklas Nordin. --- .../engineCompRatio/engineCompRatio.C | 47 +++++++++------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/applications/utilities/postProcessing/miscellaneous/engineCompRatio/engineCompRatio.C b/applications/utilities/postProcessing/miscellaneous/engineCompRatio/engineCompRatio.C index 8371cd9..65356b3 100644 --- a/applications/utilities/postProcessing/miscellaneous/engineCompRatio/engineCompRatio.C +++ b/applications/utilities/postProcessing/miscellaneous/engineCompRatio/engineCompRatio.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,59 +40,52 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" + #include "createEngineTime.H" + #include "createEngineMesh.H" -# include "setRootCase.H" -# include "createEngineTime.H" -# include "createEngineMesh.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // scalar eps = 1.0e-10; scalar fullCycle = 360.0; scalar ca0 = -180.0; scalar ca1 = 0.0; - scalar ca = runTime.theta(); - while (ca > ca0) + while (runTime.theta() > ca0) { ca0 += fullCycle; ca1 += fullCycle; } - if (mag(ca - ca0) > eps) + while (mag(runTime.theta() - ca0) > eps) { - while(mag(ca - ca0) > eps) - { - ca = runTime.theta(); - scalar t0 = runTime.userTimeToTime(ca0 - ca); - runTime.setDeltaT(t0); - runTime++; - Info << "CA = " << ca << endl; - mesh.move(); - } + scalar t0 = runTime.userTimeToTime(ca0 - runTime.theta()); + runTime.setDeltaT(t0); + runTime++; + Info<< "CA = " << runTime.theta() << endl; + mesh.move(); } scalar Vmax = sum(mesh.V().field()); - while(mag(ca-ca1) > eps) + while (mag(runTime.theta()-ca1) > eps) { - ca = runTime.theta(); - scalar t1 = runTime.userTimeToTime(ca1-ca); + scalar t1 = runTime.userTimeToTime(ca1-runTime.theta()); runTime.setDeltaT(t1); runTime++; - Info << "CA = " << runTime.theta() << endl; + Info<< "CA = " << runTime.theta() << endl; mesh.move(); } scalar Vmin = sum(mesh.V().field()); - Info << "\nVmax = " << Vmax; - Info << ", Vmin = " << Vmin << endl; - Info << "Vmax/Vmin = " << Vmax/Vmin << endl; - Info << "\n end\n"; + Info<< "\nVmax = " << Vmax; + Info<< ", Vmin = " << Vmin << endl; + Info<< "Vmax/Vmin = " << Vmax/Vmin << endl; + Info<< "\nEnd" << endl; - return(0); + return 0; } -- 2.11.4.GIT