postChannel.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2015 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Application
27 postChannel
28
29Group
30 grpPostProcessingUtilities
31
32Description
33 Post-process data from channel flow calculations.
34
35 For each time: calculate: txx, txy,tyy, txy,
36 eps, prod, vorticity, enstrophy and helicity. Assuming that the mesh
37 is periodic in the x and z directions, collapse Umeanx, Umeany, txx,
38 txy and tyy to a line and print them as standard output.
39
40\*---------------------------------------------------------------------------*/
41
42#include "fvCFD.H"
43#include "channelIndex.H"
44#include "makeGraph.H"
45
46#include "OSspecific.H"
47
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51int main(int argc, char *argv[])
52{
53 argList::addNote
54 (
55 "Post-process data from channel flow calculations"
56 );
57
58 argList::noParallel();
59 timeSelector::addOptions();
60
61 #include "setRootCase.H"
62 #include "createTime.H"
63
64 // Get times list
65 instantList timeDirs = timeSelector::select0(runTime, args);
66
67 #include "createNamedMesh.H"
68 #include "readTransportProperties.H"
69
70 const word& gFormat = runTime.graphFormat();
71
72 // Setup channel indexing for averaging over channel down to a line
73
74 IOdictionary channelDict
75 (
76 IOobject
77 (
78 "postChannelDict",
79 mesh.time().constant(),
80 mesh,
81 IOobject::MUST_READ_IF_MODIFIED,
82 IOobject::NO_WRITE
83 )
84 );
85 channelIndex channelIndexing(mesh, channelDict);
86
87
88 // For each time step read all fields
89 forAll(timeDirs, timeI)
90 {
91 runTime.setTime(timeDirs[timeI], timeI);
92 Info<< "Collapsing fields for time " << runTime.timeName() << endl;
93
94 #include "readFields.H"
95 #include "calculateFields.H"
96
97 // Average fields over channel down to a line
98 #include "collapse.H"
99 }
100
101 Info<< "\nEnd\n" << endl;
102
103 return 0;
104}
105
106
107// ************************************************************************* //
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
dynamicFvMesh & mesh
engineTime & runTime
Required Variables.
const word & gFormat
Definition: makeGraphs.H:16
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
List< instant > instantList
List of instants.
Definition: instantList.H:47
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333