CFDEMcoupling  2.4
 All Classes
forceSubModel.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  forceSubModel
33 
34 SourceFiles
35  forceSubModel.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef forceSubModel_H
40 #define forceSubModel_H
41 
42 #include "fvCFD.H"
43 #include "cfdemCloud.H"
44 #include "probeModel.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class forceSubModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56 
57 protected:
58 
59  // Protected data
60  const dictionary& dict_;
61 
62  cfdemCloud& particleCloud_;
63 
64  forceModel& forceModel_;
65 
66  label nrDefaultSwitches_; // nr of switches defined in mother class
67 
68  wordList switchesNameList_; // names of switches available
69 
70  mutable List<Switch> switchesList_; // switches which are requested in dict
71 
72  mutable List<Switch> switches_;
73 
74  mutable volScalarField nu_;
75 
76  mutable volVectorField divTau_;
77 
78  mutable volVectorField IBDragPerV_;
79 
80  word densityFieldName_;
81 
82  const volScalarField& rho_;
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("forceSubModel");
88 
89  // Declare runtime constructor selection table
90 
91  declareRunTimeSelectionTable
92  (
93  autoPtr,
95  dictionary,
96  (
97  const dictionary& dict,
98  cfdemCloud& sm,
99  forceModel& fm
100  ),
101  (dict,sm,fm)
102  );
103 
104 
105  // Constructors
106 
107  //- Construct from components
109  (
110  const dictionary& dict,
111  cfdemCloud& sm,
112  forceModel& fm
113  );
114 
115 
116  // Destructor
117 
118  virtual ~forceSubModel();
119 
120 
121  // Selector
122 
123  static autoPtr<forceSubModel> New
124  (
125  const dictionary& dict,
126  cfdemCloud& sm,
127  forceModel& fm,
128  word forceType
129  );
130 
131 
132  // Member Functions
133  void partToArray(label&, vector&, const vector&, const vector& Ufluid=vector::zero, scalar Cd=scalar(0)) const;
134 
135  virtual void explicitCorr(vector&, vector&, scalar&, vector&, const vector&, vector&, const vector&, bool,label index=100) const;
136 
137  // Access
138 
139  inline bool verbose() const { return switches_[3]; };
140 
141  inline bool interpolation() const { return switches_[4]; };
142 
143  inline bool useFilteredDragModel() const { return switches_[5]; };
144 
145  inline bool useParcelSizeDependentFilteredDrag() const { return switches_[6]; };
146 
147  virtual word myType() const=0;
148 
149  inline forceModel& myForceM() const { return forceModel_;};
150 
151  inline const List<Switch>& switches() const { return switches_;};
152 
153  inline const wordList& switchesNameList() const { return switchesNameList_;};
154 
155  void setSwitchesList(label i, bool v) const { switchesList_[i] = label(v);};
156 
157  void setSwitches(label i, Switch v) const { switches_[i] = v;};
158 
159  virtual void readSwitches() const;
160 
161  const label& nrDefaultSwitches() const {return nrDefaultSwitches_;};
162 
163  const volScalarField& nuField() const;
164 
165  const volScalarField& muField() const;
166 
167  const volScalarField& rhoField() const;
168 
169  const volVectorField& divTauField(const volVectorField&) const;
170 
171  const volVectorField& IBDragPerV(const volVectorField&,const volScalarField&) const;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
Definition: forceSubModel.H:54
Definition: cfdemCloud.H:81
Definition: forceModel.H:55