CFDEMcoupling  2.4
 All Classes
voidFractionModel.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  Gaussian distributed particle voidfraction model
32  contribution from RQ
33 
34 Class
35  voidFractionModel
36 
37 SourceFiles
38  voidFractionModel.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef voidFractionModel_H
43 #define voidFractionModel_H
44 
45 #include "fvCFD.H"
46 #include "cfdemCloud.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class voidFractionModel Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58 
59 protected:
60 
61  // Protected data
62  const dictionary& dict_;
63 
64  cfdemCloud& particleCloud_;
65 
66  mutable volScalarField voidfractionPrev_;
67 
68  mutable volScalarField voidfractionNext_;
69 
70  mutable double ** cellsPerParticle_;
71 
72  int maxCellsPerParticle_;
73 
74  mutable scalar weight_;
75 
76  mutable scalar porosity_;
77 
78  // Protected member functions
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("voidFractionModel");
84 
85  // Declare runtime constructor selection table
86 
87  declareRunTimeSelectionTable
88  (
89  autoPtr,
91  dictionary,
92  (
93  const dictionary& dict,
94  cfdemCloud& sm
95  ),
96  (dict,sm)
97  );
98 
99 
100  // Constructors
101 
102  //- Construct from components
104  (
105  const dictionary& dict,
106  cfdemCloud& sm
107  );
108 
109 
110  // Destructor
111 
112  virtual ~voidFractionModel();
113 
114 
115  // Selector
116 
117  static autoPtr<voidFractionModel> New
118  (
119  const dictionary& dict,
120  cfdemCloud& sm
121  );
122 
123 
124  // public member functions
125  virtual void setvoidFraction(double** const&,double**&,double**&,double**&,double**&) const = 0;
126 
127  tmp<volScalarField> voidFractionInterp() const;
128 
129  inline volScalarField& voidFractionPrev()const { return voidfractionPrev_; }
130 
131  inline volScalarField& voidFractionNext()const { return voidfractionNext_; }
132 
133  inline scalar weight()const { return weight_; }
134 
135  inline scalar porosity()const { return porosity_; }
136 
137  inline void checkWeightNporosity(dictionary& propsDict) const
138  {
139  if (propsDict.found("weight")) weight_ = readScalar(propsDict.lookup("weight"));
140  if (propsDict.found("porosity")) porosity_ = readScalar(propsDict.lookup("porosity"));
141  };
142 
143  void resetVoidFractions() const;
144 
145  //void undoVoidFractions(double**const&) const;
146 
147  double** const& cellsPerParticle() const;
148 
149  int maxCellsPerParticle() const;
150 
151  void reAllocArrays() const;
152 
153  void reAllocArrays(int nP) const; //force number of particles during reallocation, for CFD offline-use
154 
155  virtual void setParticleType(label type) const {};
156 
157  virtual bool checkParticleType(label) const {return true;}; //consider all particles by default
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
Definition: cfdemCloud.H:81
Definition: voidFractionModel.H:56