1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
31 template<class ParcelType>
32 inline Foam::label Foam::KinematicCloud<ParcelType>::parcelTypeId() const
38 template<class ParcelType>
39 inline const Foam::fvMesh& Foam::KinematicCloud<ParcelType>::mesh() const
45 template<class ParcelType>
46 inline const Foam::IOdictionary&
47 Foam::KinematicCloud<ParcelType>::particleProperties() const
49 return particleProperties_;
53 template<class ParcelType>
54 inline const typename ParcelType::constantProperties&
55 Foam::KinematicCloud<ParcelType>::constProps() const
61 template<class ParcelType>
62 inline const Foam::Switch Foam::KinematicCloud<ParcelType>::active() const
68 template<class ParcelType>
69 inline const Foam::Switch Foam::KinematicCloud<ParcelType>::coupled() const
75 template <class ParcelType>
76 inline const Foam::Switch
77 Foam::KinematicCloud<ParcelType>::cellValueSourceCorrection() const
79 return cellValueSourceCorrection_;
83 template<class ParcelType>
84 inline const Foam::volScalarField&
85 Foam::KinematicCloud<ParcelType>::rho() const
91 template<class ParcelType>
92 inline const Foam::volVectorField& Foam::KinematicCloud<ParcelType>::U() const
98 template<class ParcelType>
99 inline const Foam::volScalarField& Foam::KinematicCloud<ParcelType>::mu() const
105 template<class ParcelType>
106 inline const Foam::dimensionedVector&
107 Foam::KinematicCloud<ParcelType>::g() const
113 template<class ParcelType>
114 inline const Foam::particleForces&
115 Foam::KinematicCloud<ParcelType>::forces() const
121 template<class ParcelType>
122 inline const Foam::dictionary&
123 Foam::KinematicCloud<ParcelType>::interpolationSchemes() const
125 return interpolationSchemes_;
129 template<class ParcelType>
130 inline const Foam::DispersionModel<Foam::KinematicCloud<ParcelType> >&
131 Foam::KinematicCloud<ParcelType>::dispersion() const
133 return dispersionModel_;
137 template<class ParcelType>
138 inline Foam::DispersionModel<Foam::KinematicCloud<ParcelType> >&
139 Foam::KinematicCloud<ParcelType>::dispersion()
141 return dispersionModel_();
145 template<class ParcelType>
146 inline const Foam::DragModel<Foam::KinematicCloud<ParcelType> >&
147 Foam::KinematicCloud<ParcelType>::drag() const
153 template<class ParcelType>
154 inline const Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >&
155 Foam::KinematicCloud<ParcelType>::injection() const
157 return injectionModel_;
161 template<class ParcelType>
162 inline const Foam::PatchInteractionModel<Foam::KinematicCloud<ParcelType> >&
163 Foam::KinematicCloud<ParcelType>::patchInteraction() const
165 return patchInteractionModel_;
169 template<class ParcelType>
170 inline Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >&
171 Foam::KinematicCloud<ParcelType>::injection()
173 return injectionModel_();
177 template<class ParcelType>
178 inline Foam::PostProcessingModel<Foam::KinematicCloud<ParcelType> >&
179 Foam::KinematicCloud<ParcelType>::postProcessing()
181 return postProcessingModel_();
185 template<class ParcelType>
186 inline const Foam::vectorIntegrationScheme&
187 Foam::KinematicCloud<ParcelType>::UIntegrator() const
193 template<class ParcelType>
194 inline Foam::scalar Foam::KinematicCloud<ParcelType>::massInSystem() const
196 scalar sysMass = 0.0;
197 forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter)
199 const ParcelType& p = iter();
200 sysMass += p.mass()*p.nParticle();
207 template<class ParcelType>
208 inline Foam::Random& Foam::KinematicCloud<ParcelType>::rndGen()
214 template<class ParcelType>
215 inline Foam::DimensionedField<Foam::vector, Foam::volMesh>&
216 Foam::KinematicCloud<ParcelType>::UTrans()
222 template<class ParcelType>
223 inline Foam::tmp<Foam::DimensionedField<Foam::vector, Foam::volMesh> >
224 Foam::KinematicCloud<ParcelType>::SU() const
226 tmp<DimensionedField<vector, volMesh> > tSU
228 new DimensionedField<vector, volMesh>
233 this->db().time().timeName(),
242 dimDensity*dimVelocity/dimTime,
248 vectorField& SU = tSU().field();
249 SU = UTrans_/(mesh_.V()*this->db().time().deltaT());
255 template<class ParcelType>
256 inline const Foam::tmp<Foam::volScalarField>
257 Foam::KinematicCloud<ParcelType>::theta() const
259 tmp<volScalarField> ttheta
265 this->name() + "Theta",
266 this->db().time().timeName(),
273 dimensionedScalar("zero", dimless, 0.0)
277 scalarField& theta = ttheta().internalField();
278 forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter)
280 const ParcelType& p = iter();
281 const label cellI = p.cell();
283 theta[cellI] += p.nParticle()*p.volume();
292 template<class ParcelType>
293 inline const Foam::tmp<Foam::volScalarField>
294 Foam::KinematicCloud<ParcelType>::alpha() const
296 tmp<volScalarField> talpha
302 this->name() + "Alpha",
303 this->db().time().timeName(),
310 dimensionedScalar("zero", dimless, 0.0)
314 scalarField& alpha = talpha().internalField();
315 forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter)
317 const ParcelType& p = iter();
318 const label cellI = p.cell();
320 alpha[cellI] += p.nParticle()*p.mass();
323 alpha /= (mesh().V()*rho_);
329 template<class ParcelType>
330 inline const Foam::tmp<Foam::volScalarField>
331 Foam::KinematicCloud<ParcelType>::rhoEff() const
333 tmp<volScalarField> trhoEff
339 this->name() + "RhoEff",
340 this->db().time().timeName(),
347 dimensionedScalar("zero", dimDensity, 0.0)
351 scalarField& rhoEff = trhoEff().internalField();
352 forAllConstIter(typename KinematicCloud<ParcelType>, *this, iter)
354 const ParcelType& p = iter();
355 const label cellI = p.cell();
357 rhoEff[cellI] += p.nParticle()*p.mass();
360 rhoEff /= mesh().V();
366 // ************************************************************************* //