1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
28 Abstract base class for particle forces
35 \*---------------------------------------------------------------------------*/
37 #ifndef ParticleForce_H
38 #define ParticleForce_H
40 #include "dictionary.H"
41 #include "forceSuSp.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class ParticleForce Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class CloudType>
58 //- Reference to the owner cloud
61 //- Reference to the mesh database
64 //- Force coefficients dictaionary
65 const dictionary coeffs_;
70 //- Runtime type information
71 TypeName("particleForce");
73 //- Declare runtime constructor selection table
74 declareRunTimeSelectionTable
82 const dictionary& dict
88 //- Convenience typedef for return type
89 typedef VectorSpace<Vector<vector>, vector, 2> returnType;
94 //- Construct from mesh
99 const dictionary& dict,
100 const word& forceType,
101 const bool readCoeffs
105 ParticleForce(const ParticleForce& pf);
107 //- Construct and return a clone
108 virtual autoPtr<ParticleForce<CloudType> > clone() const
110 return autoPtr<ParticleForce<CloudType> >
112 new ParticleForce<CloudType>(*this)
118 virtual ~ParticleForce();
122 static autoPtr<ParticleForce<CloudType> > New
126 const dictionary& dict,
127 const word& forceType
135 //- Return const access to the cloud owner
136 inline const CloudType& owner() const;
138 //- Return refernce to the cloud owner
139 inline CloudType& owner();
141 //- Return the mesh database
142 inline const fvMesh& mesh() const;
144 //- Return the force coefficients dictionary
145 inline const dictionary& coeffs() const;
151 virtual void cacheFields(const bool store);
153 //- Calculate the coupled force
154 virtual forceSuSp calcCoupled
156 const typename CloudType::parcelType& p,
163 //- Calculate the non-coupled force
164 virtual forceSuSp calcNonCoupled
166 const typename CloudType::parcelType& p,
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 } // End namespace Foam
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 #include "ParticleForceI.H"
184 #include "ParticleForce.C"
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 #define makeParticleForceModel(CloudType) \
191 typedef CloudType::kinematicCloudType kinematicCloudType; \
192 defineNamedTemplateTypeNameAndDebug(ParticleForce<kinematicCloudType>, 0);\
193 defineTemplateRunTimeSelectionTable \
195 ParticleForce<kinematicCloudType>, \
200 #define makeParticleForceModelType(SS, CloudType) \
202 typedef CloudType::kinematicCloudType kinematicCloudType; \
203 defineNamedTemplateTypeNameAndDebug(SS<kinematicCloudType>, 0); \
205 ParticleForce<kinematicCloudType>:: \
206 adddictionaryConstructorToTable<SS<kinematicCloudType> > \
207 add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 // ************************************************************************* //