CFDEMcoupling  2.4
 All Classes
particleProbe.H
1 /*---------------------------------------------------------------------------*\
2  CFDEMcoupling - Open Source CFD-DEM coupling
3 
4  CFDEMcoupling is part of the CFDEMproject
5  www.cfdem.com
6  Christoph Goniva, christoph.goniva@cfdem.com
7  Copyright 2009-2012 JKU Linz
8  Copyright 2012- DCS Computing GmbH, Linz
9 -------------------------------------------------------------------------------
10 License
11  This file is part of CFDEMcoupling.
12 
13  CFDEMcoupling is free software; you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by the
15  Free Software Foundation; either version 3 of the License, or (at your
16  option) any later version.
17 
18  CFDEMcoupling 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 CFDEMcoupling; if not, write to the Free Software Foundation,
25  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 
27 Description
28  This code is designed to realize coupled CFD-DEM simulations using LIGGGHTS
29  and OpenFOAM(R). Note: this code is not part of OpenFOAM(R) (see DISCLAIMER).
30 
31 Class
32  particleProbe
33 
34 SourceFiles
35  particleProbe.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef particleProbe_H
40 #define particleProbe_H
41 
42 #include "probeModel.H"
43 #include "fvCFD.H"
44 #include "polyMesh.H"
45 #include "cfdemCloud.H"
46 #include "OFstream.H"
47 #include <vector>
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class particleProbe Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public probeModel
60 {
61 
62 private:
63 
64  dictionary propsDict_;
65 
66  mutable word name_;
67 
68  cfdemCloud& particleCloud_;
69 
70  bool verbose_;
71 
72  bool verboseToFile_;
73 
74  int writePrecision_;
75 
76  word dirName_;
77 
78  mutable int rank_;
79 
80  mutable OFstream* sPtr;
81 
82  int printEvery_;
83 
84  bool sampleAll_;
85 
86  bool probeDebug_;
87 
88  bool includePosition_;
89 
90  const labelList particleIDsToSample_;
91 
92  mutable wordList itemsToSample_;
93 
94  mutable List<OFstream*> sPtrList_;
95 
96  mutable int itemCounter_;
97 
98  mutable int currItemId_;
99 
100  mutable int printCounter_;
101 
102  mutable bool printNow_;
103 
104  mutable std::vector< std::vector<double> > sProbes_;
105 
106  mutable std::vector< std::vector<double*> > vProbes_;
107 
108  mutable std::vector<std::string> probeName_;
109 
110  mutable int probeIndex_;
111 
112 
113 public:
114 
115  //- Runtime type information
116  TypeName("particleProbe");
117 
118 
119  // Constructors
120 
121  //- Construct from components
123  (
124  const dictionary& dict,
125  cfdemCloud& sm,
126  word typeName,
127  char* logFileName
128  );
129 
130  // Destructor
131 
132  ~particleProbe();
133 
134  // Member Functions
135  void updateProbes(int index, Field<scalar> sValues, Field<vector> vValues) const;
136  void initialize(word typeName, word logFileName) const;
137  void setOutputFile() const;
138  void writeHeader() const;
139  void writeProbe(int index, Field<scalar> sValues, Field<vector> vValues) const;
140  bool checkIDForPrint(int) const;
141  void setCounter() const;
142  void clearProbes() const;
143  std::vector< std::vector<double*> >* getVprobe() { return &vProbes_; };
144  std::vector< std::vector<double> >* getSprobe() {return &sProbes_; };
145 
146 
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
Definition: particleProbe.H:57
Definition: cfdemCloud.H:81
Definition: probeModel.H:54