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