eulerianParticle.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) 2015-2016 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::eulerianParticle
28 
29 Description
30  Lightweight class to store particle data derived from VOF calculations,
31  with special handling for input, output and parallel reduction.
32 
33 SourceFiles
34  eulerianParticle.H
35  eulerianParticle.C
36  eulerianParticleTemplates.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef Foam_functionObjects_eulerianParticle_H
41 #define Foam_functionObjects_eulerianParticle_H
42 
43 #include "label.H"
44 #include "scalar.H"
45 #include "vector.H"
46 #include "dictionary.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace functionObjects
53 {
54  // Forward Declarations
55  class eulerianParticle;
56 }
57 
58 // Forward Declarations
59 Istream& operator>>(Istream&, functionObjects::eulerianParticle&);
60 Ostream& operator<<(Ostream&, const functionObjects::eulerianParticle&);
61 
62 namespace functionObjects
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class eulerianParticle Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 class eulerianParticle
70 {
71 public:
72 
73  // Public Data
74 
75  //- Index of face in faceZone that this particle hits. Also used to
76  // identify the index of the coarse face of the surface agglomeration
77  // Note: value of -1 used to indicate that the particle has not
78  // been initialised
79  label faceIHit;
80 
81  //- Volume multiplied by face centres [m4]
83 
84  //- Volume multiplied by velocity [m4/s]
85  vector VU;
86 
87  //- Volume [m3]
88  scalar V;
89 
90  //- Injection time - set at collection [s]
91  scalar time;
92 
93 
94  //- Default construct
96 
97 
98  // Public Member Functions
99 
100  //- Write to stream
101  void write(Ostream& os) const;
102 
103  //- Write to dictionary
104  Foam::dictionary writeDict() const;
105 
106 
107  // Operators
108 
109  friend bool operator==
110  (
111  const eulerianParticle& a,
112  const eulerianParticle& b
113  )
114  {
115  return
116  a.faceIHit == b.faceIHit
117  && a.VC == b.VC
118  && a.VU == b.VU
119  && a.V == b.V
120  && a.time == b.time;
121  }
123  friend bool operator!=
124  (
125  const eulerianParticle& a,
126  const eulerianParticle& b
127  )
128  {
129  return !(a == b);
130  }
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace functionObjects
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #ifdef NoRepository
142  #include "eulerianParticleTemplates.C"
143 #endif
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
vector VU
Volume multiplied by velocity [m4/s].
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
label faceIHit
Index of face in faceZone that this particle hits. Also used to.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Istream & operator>>(Istream &, directionInfo &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:77
scalar time
Injection time - set at collection [s].
vector VC
Volume multiplied by face centres [m4].
void write(Ostream &os) const
Write to stream.
Foam::dictionary writeDict() const
Write to dictionary.
Namespace for OpenFOAM.