ParticleForceList.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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
59  CloudType& owner_;
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  (
84  CloudType& owner,
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 references 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 typename CloudType::parcelType::trackingData& td,
131  const scalar dt,
132  const scalar mass,
133  const scalar Re,
134  const scalar muc
135  ) const;
136 
137  //- Calculate the non-coupled force
138  virtual forceSuSp calcNonCoupled
139  (
140  const typename CloudType::parcelType& p,
141  const typename CloudType::parcelType::trackingData& td,
142  const scalar dt,
143  const scalar mass,
144  const scalar Re,
145  const scalar muc
146  ) const;
147 
148  //- Return the effective mass
149  virtual scalar massEff
150  (
151  const typename CloudType::parcelType& p,
152  const typename CloudType::parcelType::trackingData& td,
153  const scalar mass
154  ) const;
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #include "ParticleForceListI.H"
165 
166 #ifdef NoRepository
167  #include "ParticleForceList.C"
168 #endif
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
virtual void cacheFields(const bool store)
Cache fields.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the specified type.
Definition: ReadFields.C:244
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
void setCalcNonCoupled(bool flag)
Set the calcNonCoupled flag.
ParticleForceList(CloudType &owner, const fvMesh &mesh)
Null constructor.
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:61
virtual scalar massEff(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar mass) const
Return the effective mass.
virtual forceSuSp calcCoupled(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar dt, const scalar mass, const scalar Re, const scalar muc) const
Calculate the coupled force.
const dictionary & dict() const
Return the forces dictionary.
virtual forceSuSp calcNonCoupled(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar dt, const scalar mass, const scalar Re, const scalar muc) const
Calculate the non-coupled force.
const CloudType & owner() const
Return const access to the cloud owner.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:221
void setCalcCoupled(bool flag)
Set the calcCoupled flag.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const fvMesh & mesh() const
Return the mesh database.
volScalarField & p
virtual ~ParticleForceList()
Destructor.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97
List of particle forces.
Namespace for OpenFOAM.