pPrime2.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 #include "fvCFD.H"
00035
00036
00037
00038
00039 int main(int argc, char *argv[])
00040 {
00041 timeSelector::addOptions();
00042
00043 # include "setRootCase.H"
00044 # include "createTime.H"
00045
00046 instantList timeDirs = timeSelector::select0(runTime, args);
00047
00048 # include "createMesh.H"
00049
00050 runTime.setTime(timeDirs[timeDirs.size()-1], timeDirs.size()-1);
00051
00052 volScalarField pMean
00053 (
00054 IOobject
00055 (
00056 "pMean",
00057 runTime.timeName(),
00058 mesh,
00059 IOobject::MUST_READ
00060 ),
00061 mesh
00062 );
00063
00064 forAll(timeDirs, timeI)
00065 {
00066 runTime.setTime(timeDirs[timeI], timeI);
00067
00068 Info<< "Time = " << runTime.timeName() << endl;
00069
00070 IOobject pheader
00071 (
00072 "p",
00073 runTime.timeName(),
00074 mesh,
00075 IOobject::MUST_READ
00076 );
00077
00078
00079 if (pheader.headerOk())
00080 {
00081 mesh.readUpdate();
00082
00083 Info<< " Reading p" << endl;
00084 volScalarField p(pheader, mesh);
00085
00086 Info<< " Calculating pPrime2" << endl;
00087 volScalarField pPrime2
00088 (
00089 IOobject
00090 (
00091 "pPrime2",
00092 runTime.timeName(),
00093 mesh,
00094 IOobject::NO_READ
00095 ),
00096 sqr(p - pMean)
00097 );
00098 pPrime2.write();
00099 }
00100 else
00101 {
00102 Info<< " No p" << endl;
00103 }
00104
00105 Info<< endl;
00106 }
00107
00108 return 0;
00109 }
00110
00111
00112
Copyright © 2000-2009 OpenCFD Ltd