OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

postChannel.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Application
00026     postChannel
00027 
00028 Description
00029     Post-processes data from channel flow calculations
00030 
00031     For each time: calculate: txx, txy,tyy, txy,
00032     eps, prod, vorticity, enstrophy and helicity. Assuming that the mesh
00033     is periodic in the x and z directions, collapse Umeanx, Umeany, txx,
00034     txy and tyy to a line and print them as standard output.
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #include "fvCFD.H"
00039 #include "channelIndex.H"
00040 #include "makeGraph.H"
00041 
00042 #include "OSspecific.H"
00043 
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 //  Main program:
00047 
00048 int main(int argc, char *argv[])
00049 {
00050     argList::noParallel();
00051     timeSelector::addOptions();
00052 
00053 #   include "setRootCase.H"
00054 #   include "createTime.H"
00055 
00056     // Get times list
00057     instantList timeDirs = timeSelector::select0(runTime, args);
00058 
00059 #   include "createMesh.H"
00060 #   include "readTransportProperties.H"
00061 
00062     const word& gFormat = runTime.graphFormat();
00063 
00064     // Setup channel indexing for averaging over channel down to a line
00065 
00066     IOdictionary channelDict
00067     (
00068         IOobject
00069         (
00070             "postChannelDict",
00071             mesh.time().constant(),
00072             mesh,
00073             IOobject::MUST_READ,
00074             IOobject::NO_WRITE
00075         )
00076     );
00077     channelIndex channelIndexing(mesh, channelDict);
00078 
00079 
00080     // For each time step read all fields
00081     forAll(timeDirs, timeI)
00082     {
00083         runTime.setTime(timeDirs[timeI], timeI);
00084         Info<< "Collapsing fields for time " << runTime.timeName() << endl;
00085 
00086 #       include "readFields.H"
00087 #       include "calculateFields.H"
00088 
00089         // Average fields over channel down to a line
00090 #       include "collapse.H"
00091     }
00092 
00093     Info<< "\nEnd" << endl;
00094 
00095     return 0;
00096 }
00097 
00098 
00099 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd