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 functionObjects_eulerianParticle_H
41 #define 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 declaration of classes
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 
75 public:
76 
77  // Public data
78 
79  //- Index of face in faceZone that this particle hits. Also used to
80  // identify the index of the coarse face of the surface agglomeration
81  // Note: value of -1 used to indicate that the particle has not
82  // been initialised
83  label faceIHit;
84 
85  //- Volume multiplied by face centres [m4]
86  vector VC;
87 
88  //- Volume multiplied by velocity [m4/s]
89  vector VU;
90 
91  //- Volume [m3]
92  scalar V;
93 
94  //- Injection time - set at collection [s]
95  scalar time;
96 
97 
98  //- Constructor
100 
101 
102  // Public Member Functions
103 
104  //- Write to stream
105  void write(Ostream& os) const;
106 
107  //- Write to dictionary
108  Foam::dictionary writeDict() const;
109 
110 
111  // Operators
112 
113  friend bool operator==
114  (
115  const eulerianParticle& a,
116  const eulerianParticle& b
117  )
118  {
119  return
120  a.faceIHit == b.faceIHit
121  && a.VC == b.VC
122  && a.VU == b.VU
123  && a.V == b.V
124  && a.time == b.time;
125  }
126 
127  friend bool operator!=
128  (
129  const eulerianParticle& a,
130  const eulerianParticle& b
131  )
132  {
133  return !(a == b);
134  }
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace functionObjects
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #ifdef NoRepository
146  #include "eulerianParticleTemplates.C"
147 #endif
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #endif
152 
153 // ************************************************************************* //
Foam::functionObjects::eulerianParticle::VU
vector VU
Volume multiplied by velocity [m4/s].
Definition: eulerianParticle.H:88
Foam::functionObjects::eulerianParticle
Definition: eulerianParticle.H:71
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
Foam::functionObjects::eulerianParticle::V
scalar V
Volume [m3].
Definition: eulerianParticle.H:91
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::functionObjects::eulerianParticle::writeDict
Foam::dictionary writeDict() const
Write to dictionary.
Definition: eulerianParticle.C:94
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
scalar.H
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::eulerianParticle::VC
vector VC
Volume multiplied by face centres [m4].
Definition: eulerianParticle.H:85
Foam::functionObjects::eulerianParticle::time
scalar time
Injection time - set at collection [s].
Definition: eulerianParticle.H:94
Foam::Vector< scalar >
label.H
dictionary.H
eulerianParticle
Lightweight class to store particle data derived from VOF calculations, with special handling for inp...
eulerianParticleTemplates.C
Foam::functionObjects::eulerianParticle::write
void write(Ostream &os) const
Write to stream.
Definition: eulerianParticle.C:79
vector.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::functionObjects::eulerianParticle::faceIHit
label faceIHit
Index of face in faceZone that this particle hits. Also used to.
Definition: eulerianParticle.H:82
Foam::functionObjects::eulerianParticle::eulerianParticle
eulerianParticle()
Constructor.
Definition: eulerianParticle.C:35