FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Application
00025     postChannel
00026 
00027 Description
00028     Post-processes data from channel flow calculations
00029 
00030     For each time: calculate: txx, txy,tyy, txy,
00031     eps, prod, vorticity, enstrophy and helicity. Assuming that the mesh
00032     is periodic in the x and z directions, collapse Umeanx, Umeany, txx,
00033     txy and tyy to a line and print them as standard output.
00034 
00035 Usage
00036 
00037     - postChannel [OPTIONS]
00038 
00039     @param -noZero \n
00040     Ignore timestep 0.
00041 
00042     @param -constant \n
00043     Include the constant directory.
00044 
00045     @param -time <time>\n
00046     Apply only to specific time.
00047 
00048     @param -latestTime \n
00049     Only apply to latest time step.
00050 
00051     @param -case <dir>\n
00052     Case directory.
00053 
00054     @param -help \n
00055     Display help message.
00056 
00057     @param -doc \n
00058     Display Doxygen API documentation page for this application.
00059 
00060     @param -srcDoc \n
00061     Display Doxygen source documentation page for this application.
00062 
00063 \*---------------------------------------------------------------------------*/
00064 
00065 #include <finiteVolume/fvCFD.H>
00066 #include "channelIndex.H"
00067 #include <sampling/makeGraph.H>
00068 
00069 #include <OpenFOAM/OSspecific.H>
00070 
00071 
00072 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00073 //  Main program:
00074 
00075 int main(int argc, char *argv[])
00076 {
00077     argList::noParallel();
00078     timeSelector::addOptions();
00079 
00080 #   include <OpenFOAM/setRootCase.H>
00081 #   include <OpenFOAM/createTime.H>
00082 
00083     // Get times list
00084     instantList timeDirs = timeSelector::select0(runTime, args);
00085 
00086 #   include <OpenFOAM/createMesh.H>
00087 #   include "readTransportProperties.H"
00088 
00089     const word& gFormat = runTime.graphFormat();
00090 
00091     // Setup channel indexing for averaging over channel down to a line
00092 
00093     IOdictionary channelDict
00094     (
00095         IOobject
00096         (
00097             "postChannelDict",
00098             mesh.time().constant(),
00099             mesh,
00100             IOobject::MUST_READ,
00101             IOobject::NO_WRITE
00102         )
00103     );
00104     channelIndex channelIndexing(mesh, channelDict);
00105 
00106 
00107     // For each time step read all fields
00108     forAll(timeDirs, timeI)
00109     {
00110         runTime.setTime(timeDirs[timeI], timeI);
00111         Info<< "Collapsing fields for time " << runTime.timeName() << endl;
00112 
00113 #       include "readFields.H"
00114 #       include "calculateFields.H"
00115 
00116         // Average fields over channel down to a line
00117 #       include "collapse.H"
00118     }
00119 
00120     Info<< "\nEnd" << endl;
00121 
00122     return 0;
00123 }
00124 
00125 
00126 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines