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 Adds coolisions to kinematic clouds
34 \*---------------------------------------------------------------------------*/
36 #ifndef CollidingCloud_H
37 #define CollidingCloud_H
41 #include "IOdictionary.H"
44 #include "volFields.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 // Forward declaration of classes
53 template<class CloudType>
56 /*---------------------------------------------------------------------------*\
57 Class CollidingCloud Declaration
58 \*---------------------------------------------------------------------------*/
60 template<class CloudType>
69 //- Type of cloud this cloud was instantiated for
70 typedef CloudType cloudType;
72 //- Type of parcel the cloud was instantiated for
73 typedef typename CloudType::particleType parcelType;
75 //- Convenience typedef for this cloud type
76 typedef CollidingCloud<CloudType> collidingCloudType;
83 //- Cloud copy pointer
84 autoPtr<CollidingCloud<CloudType> > cloudCopyPtr_;
87 // Private Member Functions
89 //- Disallow default bitwise copy construct
90 CollidingCloud(const CollidingCloud&);
92 //- Disallow default bitwise assignment
93 void operator=(const CollidingCloud&);
100 // References to the cloud sub-models
103 autoPtr<CollisionModel<CollidingCloud<CloudType> > >
109 //- Set cloud sub-models
113 // Cloud evolution functions
115 //- Move-collide particles
116 template<class TrackData>
117 void moveCollide(TrackData& td, const scalar deltaT);
119 //- Reset state of cloud
120 void cloudReset(CollidingCloud<CloudType>& c);
127 //- Construct given carrier gas fields
130 const word& cloudName,
131 const volScalarField& rho,
132 const volVectorField& U,
133 const volScalarField& mu,
134 const dimensionedVector& g,
135 bool readFields = true
138 //- Copy constructor with new name
141 CollidingCloud<CloudType>& c,
145 //- Copy constructor with new name - creates bare cloud
150 const CollidingCloud<CloudType>& c
153 //- Construct and return clone based on (this) with new name
154 virtual autoPtr<Cloud<parcelType> > clone(const word& name)
156 return autoPtr<Cloud<parcelType> >
158 new CollidingCloud(*this, name)
162 //- Construct and return bare clone based on (this) with new name
163 virtual autoPtr<Cloud<parcelType> > cloneBare(const word& name) const
165 return autoPtr<Cloud<parcelType> >
167 new CollidingCloud(this->mesh(), name, *this)
173 virtual ~CollidingCloud();
180 //- Return a reference to the cloud copy
181 inline const CollidingCloud& cloudCopy() const;
183 //- If the collision model controls the wall interaction,
184 // then the wall impact distance should be zero.
185 // Otherwise, it should be allowed to be the value from
187 virtual bool hasWallImpactDistance() const;
192 //- Return const access to the collision model
193 inline const CollisionModel<CollidingCloud<CloudType> >&
196 //- Return reference to the collision model
197 inline CollisionModel<CollidingCloud<CloudType> >&
203 //- Store the current cloud state
206 //- Reset the current cloud to the previously stored state
213 template<class TrackData>
214 void motion(TrackData& td);
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 } // End namespace Foam
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 #include "CollidingCloudI.H"
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 # include "CollidingCloud.C"
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 // ************************************************************************* //