ParticleForceList.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 | Copyright (C) 2011-2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::ParticleForceList
26 
27 Description
28  List of particle forces
29 
30 SourceFiles
31  ParticleForceListI.H
32  ParticleForceList.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef ParticleForceList_H
37 #define ParticleForceList_H
38 
39 #include "ParticleForce.H"
40 #include "forceSuSp.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class ParticleForceList Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class CloudType>
53 :
54  public PtrList<ParticleForce<CloudType> >
55 {
56  // Private data
57 
58  //- Reference to the owner cloud
60 
61  //- Reference to the mesh database
62  const fvMesh& mesh_;
63 
64  //- Forces dictionary
65  const dictionary dict_;
66 
67  //- Calculate coupled forces flag
68  bool calcCoupled_;
69 
70  //- Calculate non-coupled forces flag
71  bool calcNonCoupled_;
72 
73 
74 public:
75 
76  // Constructors
77 
78  //- Null constructor
80 
81  //- Construct from mesh
83  (
85  const fvMesh& mesh,
86  const dictionary& dict,
87  const bool readFields
88  );
89 
90  //- Construct copy
92 
93 
94  //- Destructor
95  virtual ~ParticleForceList();
96 
97 
98  // Member Functions
99 
100  // Access
101 
102  //- Return const access to the cloud owner
103  inline const CloudType& owner() const;
104 
105  //- Return refernce to the cloud owner
106  inline CloudType& owner();
107 
108  //- Return the mesh database
109  inline const fvMesh& mesh() const;
110 
111  //- Return the forces dictionary
112  inline const dictionary& dict() const;
113 
114  //- Set the calcCoupled flag
115  inline void setCalcCoupled(bool flag);
116 
117  //- Set the calcNonCoupled flag
118  inline void setCalcNonCoupled(bool flag);
119 
120 
121  // Evaluation
122 
123  //- Cache fields
124  virtual void cacheFields(const bool store);
125 
126  //- Calculate the coupled force
127  virtual forceSuSp calcCoupled
128  (
129  const typename CloudType::parcelType& p,
130  const scalar dt,
131  const scalar mass,
132  const scalar Re,
133  const scalar muc
134  ) const;
135 
136  //- Calculate the non-coupled force
137  virtual forceSuSp calcNonCoupled
138  (
139  const typename CloudType::parcelType& p,
140  const scalar dt,
141  const scalar mass,
142  const scalar Re,
143  const scalar muc
144  ) const;
145 
146  //- Return the effective mass
147  virtual scalar massEff
148  (
149  const typename CloudType::parcelType& p,
150  const scalar mass
151  ) const;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #include "ParticleForceListI.H"
162 
163 #ifdef NoRepository
164  #include "ParticleForceList.C"
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
Foam::ParticleForceList::cacheFields
virtual void cacheFields(const bool store)
Cache fields.
Definition: ParticleForceList.C:138
p
p
Definition: pEqn.H:62
Foam::ParticleForceList::massEff
virtual scalar massEff(const typename CloudType::parcelType &p, const scalar mass) const
Return the effective mass.
Definition: ParticleForceList.C:197
Foam::Re
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97
Foam::ParticleForceList::setCalcCoupled
void setCalcCoupled(bool flag)
Set the calcCoupled flag.
Definition: ParticleForceListI.H:57
forceSuSp.H
Foam::ParticleForceList::~ParticleForceList
virtual ~ParticleForceList()
Destructor.
Definition: ParticleForceList.C:131
Foam::readFields
This function object reads fields from the time directories and adds them to the mesh database for fu...
Definition: readFields.H:104
Foam::ParticleForceList::dict_
const dictionary dict_
Forces dictionary.
Definition: ParticleForceList.H:64
Foam::ParticleForceList::calcNonCoupled_
bool calcNonCoupled_
Calculate non-coupled forces flag.
Definition: ParticleForceList.H:70
Foam::ParticleForceList::dict
const dictionary & dict() const
Return the forces dictionary.
Definition: ParticleForceListI.H:50
Foam::forceSuSp
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:58
Foam::ParticleForceList::calcCoupled_
bool calcCoupled_
Calculate coupled forces flag.
Definition: ParticleForceList.H:67
ParticleForce.H
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::ParticleForceList::calcNonCoupled
virtual forceSuSp calcNonCoupled(const typename CloudType::parcelType &p, const scalar dt, const scalar mass, const scalar Re, const scalar muc) const
Calculate the non-coupled force.
Definition: ParticleForceList.C:173
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::ParticleForceList::ParticleForceList
ParticleForceList(CloudType &owner, const fvMesh &mesh)
Null constructor.
Definition: ParticleForceList.C:33
ParticleForceListI.H
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::ParticleForceList::mesh_
const fvMesh & mesh_
Reference to the mesh database.
Definition: ParticleForceList.H:61
Foam::ParticleForceList::setCalcNonCoupled
void setCalcNonCoupled(bool flag)
Set the calcNonCoupled flag.
Definition: ParticleForceListI.H:64
Foam::ParticleForceList::owner
const CloudType & owner() const
Return const access to the cloud owner.
Definition: ParticleForceListI.H:29
ParticleForceList.C
Foam::ParticleForceList::mesh
const fvMesh & mesh() const
Return the mesh database.
Definition: ParticleForceListI.H:43
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::ParticleForceList::owner_
CloudType & owner_
Reference to the owner cloud.
Definition: ParticleForceList.H:58
Foam::ParticleForceList::calcCoupled
virtual forceSuSp calcCoupled(const typename CloudType::parcelType &p, const scalar dt, const scalar mass, const scalar Re, const scalar muc) const
Calculate the coupled force.
Definition: ParticleForceList.C:149
Foam::ParticleForceList
List of particle forces.
Definition: ParticleForceList.H:51