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 // Forward Declarations
53 class Istream;
54 class Ostream;
55 
56 namespace functionObjects
57 {
58  class eulerianParticle;
59 }
60 
61 // Forward declaration of friend functions and operators
62 Istream& operator>>(Istream&, functionObjects::eulerianParticle&);
63 Ostream& operator<<(Ostream&, const functionObjects::eulerianParticle&);
64 
65 namespace functionObjects
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class eulerianParticle Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 class eulerianParticle
73 {
74 public:
75 
76  // Public Data
77 
78  //- Index of face in faceZone that this particle hits. Also used to
79  // identify the index of the coarse face of the surface agglomeration
80  // Note: value of -1 used to indicate that the particle has not
81  // been initialised
82  label faceIHit;
83 
84  //- Volume multiplied by face centres [m4]
86 
87  //- Volume multiplied by velocity [m4/s]
88  vector VU;
89 
90  //- Volume [m3]
91  scalar V;
92 
93  //- Injection time - set at collection [s]
94  scalar time;
95 
96 
97  //- Default construct
99 
101  // Public Member Functions
102 
103  //- Write to stream
104  void write(Ostream& os) const;
105 
106  //- Write to dictionary
107  Foam::dictionary writeDict() const;
108 
109 
110  // Operators
111 
112  friend bool operator==
113  (
114  const eulerianParticle& a,
115  const eulerianParticle& b
116  )
117  {
118  return
119  a.faceIHit == b.faceIHit
120  && a.VC == b.VC
121  && a.VU == b.VU
122  && a.V == b.V
123  && a.time == b.time;
124  }
126  friend bool operator!=
127  (
128  const eulerianParticle& a,
129  const eulerianParticle& b
130  )
131  {
132  return !(a == b);
133  }
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace functionObjects
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #ifdef NoRepository
145  #include "eulerianParticleTemplates.C"
146 #endif
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
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:120
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:55
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:76
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.