cloudInfo.H
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) 2012-2016 OpenFOAM Foundation
9  Copyright (C) 2015-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::cloudInfo
29 
30 Group
31  grpLagrangianFunctionObjects
32 
33 Description
34  Outputs Lagrangian cloud information to a file.
35 
36  The current outputs include:
37  - total current number of parcels
38  - total current mass of parcels
39 
40 Usage
41  Example of function object specification:
42  \verbatim
43  cloudInfo1
44  {
45  type cloudInfo;
46  libs (lagrangianFunctionObjects);
47  ...
48  clouds
49  (
50  kinematicCloud1
51  thermoCloud1
52  );
53  }
54  \endverbatim
55 
56  Where the entries comprise:
57  \table
58  Property | Description | Required | Default
59  type | type name: cloudInfo | yes |
60  clouds | list of clouds names to process | yes |
61  \endtable
62 
63  The output data of each cloud is written to a file named <cloudName>.dat
64 
65 See also
66  Foam::functionObject
67  Foam::functionObjects::regionFunctionObject
68  Foam::functionObjects::logFiles
69 
70 SourceFiles
71  cloudInfo.C
72 
73 \*---------------------------------------------------------------------------*/
74 
75 #ifndef functionObjects_cloudInfo_H
76 #define functionObjects_cloudInfo_H
77 
78 #include "regionFunctionObject.H"
79 #include "logFiles.H"
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 namespace functionObjects
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class cloudInfo Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class cloudInfo
93 :
94  public regionFunctionObject,
95  public logFiles
96 {
97 protected:
98 
99  //- Switch to send output to Info as well
100  Switch log_;
101 
102  //- List of cloud names
104 
105  //- Output file per cloud
107 
108  // Protected Member Functions
109 
110  //- File header information
111  virtual void writeFileHeader(Ostream& os) const;
112 
113 
114  //- No copy construct
115  cloudInfo(const cloudInfo&) = delete;
116 
117  //- No copy assignment
118  void operator=(const cloudInfo&) = delete;
119 
120 
121 public:
122 
123  //- Runtime type information
124  TypeName("cloudInfo");
125 
126 
127  // Constructors
128 
129  //- Construct from Time and dictionary
130  cloudInfo
131  (
132  const word& name,
133  const Time& runTime,
134  const dictionary&
135  );
136 
137 
138  //- Destructor
139  virtual ~cloudInfo() = default;
140 
141 
142  // Member Functions
143 
144  //- Read the controls
145  virtual bool read(const dictionary& dict);
146 
147  //- Execute, currently does nothing
148  virtual bool execute();
149 
150  //- Write
151  virtual bool write();
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace functionObjects
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::functionObjects::cloudInfo::cloudNames_
wordList cloudNames_
List of cloud names.
Definition: cloudInfo.H:117
Foam::functionObjects::cloudInfo::~cloudInfo
virtual ~cloudInfo()=default
Destructor.
Foam::functionObjects::cloudInfo::execute
virtual bool execute()
Execute, currently does nothing.
Definition: cloudInfo.C:113
Foam::functionObjects::cloudInfo::operator=
void operator=(const cloudInfo &)=delete
No copy assignment.
Foam::functionObjects::cloudInfo::filePtrs_
PtrList< OFstream > filePtrs_
Output file per cloud.
Definition: cloudInfo.H:120
Foam::functionObjects::cloudInfo::TypeName
TypeName("cloudInfo")
Runtime type information.
Foam::functionObjects::cloudInfo::writeFileHeader
virtual void writeFileHeader(Ostream &os) const
File header information.
Definition: cloudInfo.C:55
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:59
Foam::functionObjects::cloudInfo::cloudInfo
cloudInfo(const cloudInfo &)=delete
No copy construct.
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
regionFunctionObject.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::logFiles
functionObject base class for creating, maintaining and writing log files e.g. integrated or averaged...
Definition: logFiles.H:59
logFiles.H
Foam::functionObjects::cloudInfo::read
virtual bool read(const dictionary &dict)
Read the controls.
Definition: cloudInfo.C:86
Foam::functionObject::name
const word & name() const
Return the name of this functionObject.
Definition: functionObject.C:131
Foam::List< word >
Foam::functionObjects::cloudInfo::write
virtual bool write()
Write.
Definition: cloudInfo.C:119
Foam::functionObjects::cloudInfo
Outputs Lagrangian cloud information to a file.
Definition: cloudInfo.H:106
Foam::functionObjects::regionFunctionObject
Specialization of Foam::functionObject for a region and providing a reference to the region Foam::obj...
Definition: regionFunctionObject.H:90
Foam::functionObjects::cloudInfo::log_
Switch log_
Switch to send output to Info as well.
Definition: cloudInfo.H:114
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56