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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::ParticleForceList
28
29Description
30 List of particle forces
31
32SourceFiles
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
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class ParticleForceList Declaration
51\*---------------------------------------------------------------------------*/
52
53template<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
76public:
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
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// ************************************************************************* //
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
List of particle forces.
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.
virtual scalar massEff(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar mass) const
Return the effective mass.
virtual void cacheFields(const bool store)
Cache fields.
void setCalcCoupled(bool flag)
Set the calcCoupled flag.
void setCalcNonCoupled(bool flag)
Set the calcNonCoupled flag.
const dictionary & dict() const
Return the forces dictionary.
const CloudType & owner() const
Return const access to the cloud owner.
virtual ~ParticleForceList()
Destructor.
const fvMesh & mesh() const
Return the mesh database.
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.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Class used to pass data into container.
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:67
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
volScalarField & p
Namespace for OpenFOAM.
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.