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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::ParticleForceList
28 
29 Description
30  List of particle forces
31 
32 SourceFiles
33  ParticleForceListI.H
34  ParticleForceList.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef ParticleForceList_H
39 #define ParticleForceList_H
40 
41 #include "ParticleForce.H"
42 #include "forceSuSp.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class ParticleForceList Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class CloudType>
55 :
56  public PtrList<ParticleForce<CloudType>>
57 {
58  // Private data
59 
60  //- Reference to the owner cloud
61  CloudType& owner_;
62 
63  //- Reference to the mesh database
64  const fvMesh& mesh_;
65 
66  //- Forces dictionary
67  const dictionary dict_;
68 
69  //- Calculate coupled forces flag
70  bool calcCoupled_;
71 
72  //- Calculate non-coupled forces flag
73  bool calcNonCoupled_;
74 
75 
76 public:
77 
78  // Constructors
79 
80  //- Null constructor
82 
83  //- Construct from mesh
85  (
87  const fvMesh& mesh,
88  const dictionary& dict,
89  const bool readFields
90  );
91 
92  //- Construct copy
94 
95 
96  //- Destructor
97  virtual ~ParticleForceList();
98 
99 
100  // Member Functions
101 
102  // Access
103 
104  //- Return const access to the cloud owner
105  inline const CloudType& owner() const;
106 
107  //- Return reference to the cloud owner
108  inline CloudType& owner();
109 
110  //- Return the mesh database
111  inline const fvMesh& mesh() const;
112 
113  //- Return the forces dictionary
114  inline const dictionary& dict() const;
115 
116  //- Set the calcCoupled flag
117  inline void setCalcCoupled(bool flag);
118 
119  //- Set the calcNonCoupled flag
120  inline void setCalcNonCoupled(bool flag);
121 
122 
123  // Evaluation
124 
125  //- Cache fields
126  virtual void cacheFields(const bool store);
127 
128  //- Calculate the coupled force
129  virtual forceSuSp calcCoupled
130  (
131  const typename CloudType::parcelType& p,
132  const typename CloudType::parcelType::trackingData& td,
133  const scalar dt,
134  const scalar mass,
135  const scalar Re,
136  const scalar muc
137  ) const;
138 
139  //- Calculate the non-coupled force
140  virtual forceSuSp calcNonCoupled
141  (
142  const typename CloudType::parcelType& p,
143  const typename CloudType::parcelType::trackingData& td,
144  const scalar dt,
145  const scalar mass,
146  const scalar Re,
147  const scalar muc
148  ) const;
149 
150  //- Return the effective mass
151  virtual scalar massEff
152  (
153  const typename CloudType::parcelType& p,
154  const typename CloudType::parcelType::trackingData& td,
155  const scalar mass
156  ) const;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #include "ParticleForceListI.H"
167 
168 #ifdef NoRepository
169  #include "ParticleForceList.C"
170 #endif
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::ParticleForceList::cacheFields
virtual void cacheFields(const bool store)
Cache fields.
Definition: ParticleForceList.C:138
Foam::ParticleForceList::calcNonCoupled
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.
Definition: ParticleForceList.C:174
Foam::ParticleForceList::setCalcCoupled
void setCalcCoupled(bool flag)
Set the calcCoupled flag.
Definition: ParticleForceListI.H:59
Foam::ParticleForceList::owner
const CloudType & owner() const
Return const access to the cloud owner.
Definition: ParticleForceListI.H:31
forceSuSp.H
Foam::ParticleForceList::~ParticleForceList
virtual ~ParticleForceList()
Destructor.
Definition: ParticleForceList.C:131
Foam::ParticleForceList::dict
const dictionary & dict() const
Return the forces dictionary.
Definition: ParticleForceListI.H:52
Foam::forceSuSp
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:64
ParticleForce.H
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::ParticleForceList::ParticleForceList
ParticleForceList(CloudType &owner, const fvMesh &mesh)
Null constructor.
Definition: ParticleForceList.C:36
ParticleForceListI.H
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
Foam::ParticleForceList::calcCoupled
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.
Definition: ParticleForceList.C:149
Foam::ParticleForceList::massEff
virtual scalar massEff(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar mass) const
Return the effective mass.
Definition: ParticleForceList.C:200
Foam::ParticleForceList::setCalcNonCoupled
void setCalcNonCoupled(bool flag)
Set the calcNonCoupled flag.
Definition: ParticleForceListI.H:66
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
ParticleForceList.C
Foam::ParticleForceList::mesh
const fvMesh & mesh() const
Return the mesh database.
Definition: ParticleForceListI.H:45
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::ParticleForceList
List of particle forces.
Definition: ParticleForceList.H:53