CFDEMcoupling  2.4
 All Classes
averagingModel.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  averagingModel
33 
34 SourceFiles
35  averagingModel.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef averagingModel_H
40 #define averagingModel_H
41 
42 #include "fvCFD.H"
43 #include "cfdemCloud.H"
44 #include "dataExchangeModel.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class averagingModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56 
57 protected:
58 
59  // Protected data
60  const dictionary& dict_;
61 
62  cfdemCloud& particleCloud_;
63 
64  mutable volScalarField UsWeightField_;
65 
66  mutable volVectorField UsPrev_;
67 
68  mutable volVectorField UsNext_;
69 
70  // Protected member functions
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("averagingModel");
76 
77  // Declare runtime constructor selection table
78 
79  declareRunTimeSelectionTable
80  (
81  autoPtr,
83  dictionary,
84  (
85  const dictionary& dict,
86  cfdemCloud& sm
87  ),
88  (dict,sm)
89  );
90 
91 
92  // Constructors
93 
94  //- Construct from components
96  (
97  const dictionary& dict,
98  cfdemCloud& sm
99  );
100 
101 
102  // Destructor
103 
104  virtual ~averagingModel();
105 
106 
107  // Selector
108 
109  static autoPtr<averagingModel> New
110  (
111  const dictionary& dict,
112  cfdemCloud& sm
113  );
114 
115 
116  // Member Function
117  virtual void setScalarAverage
118  (
119  volScalarField& field,
120  double**& value,
121  double**& weight,
122  volScalarField& weightField,
123  double**const& mask
124  ) const = 0;
125 
126  virtual void setVectorAverage
127  (
128  volVectorField& field,
129  double**& value,
130  double**& weight,
131  volScalarField& weightField,
132  double**const& mask
133  ) const = 0;
134 
135  void undoVectorAverage
136  (
137  volVectorField& fieldPrev,
138  volVectorField& fieldNext,
139  volScalarField& weightField,
140  double** const& value,
141  double** const& weight,
142  double**const& mask,
143  bool single=false
144  ) const;
145 
146  void undoVectorSum
147  (
148  volVectorField& field,
149  double** const& value,
150  double** const& weight,
151  double**const& mask
152  ) const;
153 
154 
155  void setVectorSum
156  (
157  volVectorField& field,
158  double**& value,
159  double**& weight,
160  double**const& mask
161  ) const;
162 
163  void setVectorSumSimple
164  (
165  volVectorField& field,
166  double**& value,
167  double**& weight,
168  int np
169  ) const;
170 
171  void setScalarSum
172  (
173  volScalarField& field,
174  double**& value,
175  double**const& weight,
176  double**const& mask
177  ) const;
178 
179  void setDSauter
180  (
181  volScalarField& dSauter,
182  double**& weight,
183  volScalarField& weightField,
184  label myParticleType = 0 // can be evaluated for a special type
185  ) const;
186 
187  void resetVectorAverage(volVectorField& prev,volVectorField& next,bool single=false) const;
188 
189  void resetWeightFields() const;
190 
191  void undoWeightFields(double**const&) const;
192 
193  tmp<volVectorField> UsInterp() const;
194 
195  virtual void setParticleType(label type) const {};
196 
197  virtual bool checkParticleType(label) const {return true;}; //consider all particles by default
198 
199  // Access
200  inline volVectorField& UsPrev() const {return UsPrev_;};
201 
202  inline volVectorField& UsNext() const {return UsNext_;};
203 
204  inline volScalarField& UsWeightField() const {return UsWeightField_;};
205 
206 };
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 } // End namespace Foam
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #endif
216 
217 // ************************************************************************* //
Definition: averagingModel.H:54
Definition: cfdemCloud.H:81