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-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::functionObjects::cloudInfo
29
30Group
31 grpLagrangianFunctionObjects
32
33Description
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
40Usage
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 selection | Parcel selection control | no | empty-dict
62 sampleOnExecute| Sample/report (on execute) without writing | no | false
63 \endtable
64
65 The output data of each cloud is written to a file named <cloudName>.dat
66
67See also
68 Foam::functionObject
69 Foam::functionObjects::regionFunctionObject
70 Foam::functionObjects::logFiles
71
72SourceFiles
73 cloudInfo.C
74
75\*---------------------------------------------------------------------------*/
76
77#ifndef Foam_functionObjects_cloudInfo_H
78#define Foam_functionObjects_cloudInfo_H
79
81#include "logFiles.H"
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86namespace Foam
87{
88namespace functionObjects
89{
90
91/*---------------------------------------------------------------------------*\
92 Class cloudInfo Declaration
93\*---------------------------------------------------------------------------*/
94
95class cloudInfo
96:
97 public functionObjects::regionFunctionObject,
98 public functionObjects::logFiles,
100{
101protected:
102
103 // Data Types
104
105 //- Local control for sampling actions
106 enum sampleActionType : unsigned
107 {
108 ACTION_NONE = 0,
109 ACTION_WRITE = 0x1,
110 ACTION_STORE = 0x2,
111 ACTION_ALL = 0xF
112 };
113
114
115 // Protected Data
116
117 //- Additional verbosity
118 bool verbose_;
120 //- Perform sample actions on execute as well
121 bool onExecute_;
122
123 //- List of cloud names
125
126 //- Output file per cloud
128
129
130 // Protected Member Functions
131
132 //- File header information
133 virtual void writeFileHeader(Ostream& os) const;
135 //- Perform operation report/write
136 bool performAction(unsigned request);
137
138 //- No copy construct
139 cloudInfo(const cloudInfo&) = delete;
140
141 //- No copy assignment
142 void operator=(const cloudInfo&) = delete;
143
144
145public:
146
147 //- Runtime type information
148 TypeName("cloudInfo");
149
150
151 // Constructors
152
153 //- Construct from Time and dictionary
155 (
156 const word& name,
157 const Time& runTime,
158 const dictionary&
159 );
160
161
162 //- Destructor
163 virtual ~cloudInfo() = default;
164
165
166 // Member Functions
167
168 //- Read the controls
169 virtual bool read(const dictionary& dict);
170
171 //- Execute, currently does nothing
172 virtual bool execute();
173
174 //- Write
175 virtual bool write();
176};
177
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181} // End namespace functionObjects
182} // End namespace Foam
183
184// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185
186#endif
188// ************************************************************************* //
Selection of parcels based on their objectRegistry entries. Normally accessed via a dictionary entry.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const word & name() const noexcept
Return the name of this functionObject.
Outputs Lagrangian cloud information to a file.
Definition: cloudInfo.H:124
virtual ~cloudInfo()=default
Destructor.
bool performAction(unsigned request)
Perform operation report/write.
Definition: cloudInfo.C:134
PtrList< OFstream > filePtrs_
Output file per cloud.
Definition: cloudInfo.H:151
void operator=(const cloudInfo &)=delete
No copy assignment.
virtual bool read(const dictionary &dict)
Read the controls.
Definition: cloudInfo.C:90
bool verbose_
Additional verbosity.
Definition: cloudInfo.H:142
cloudInfo(const cloudInfo &)=delete
No copy construct.
virtual void writeFileHeader(Ostream &os) const
File header information.
Definition: cloudInfo.C:57
TypeName("cloudInfo")
Runtime type information.
bool onExecute_
Perform sample actions on execute as well.
Definition: cloudInfo.H:145
virtual bool execute()
Execute, currently does nothing.
Definition: cloudInfo.C:289
wordList cloudNames_
List of cloud names.
Definition: cloudInfo.H:148
virtual bool write()
Write.
Definition: cloudInfo.C:300
sampleActionType
Local control for sampling actions.
Definition: cloudInfo.H:131
functionObject base class for creating, maintaining and writing log files e.g. integrated or averaged...
Definition: logFiles.H:62
Specialization of Foam::functionObject for a region and providing a reference to the region Foam::obj...
A class for handling words, derived from Foam::string.
Definition: word.H:68
engineTime & runTime
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73