BrownianMotionForce.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::BrownianMotionForce
28 
29 Description
30  Calculates particle Brownian motion force.
31 
32  Reference:
33  \verbatim
34  Li, A., & Ahmadi, G. (1992).
35  Dispersion and deposition of spherical particles from point sources
36  in a turbulent channel flow.
37  Aerosol science and technology,
38  16(4), 209-226.
39  \endverbatim
40 
41 SourceFiles
42  BrownianMotionForceI.H
43  BrownianMotionForce.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef BrownianMotionForce_H
48 #define BrownianMotionForce_H
49 
50 #include "ParticleForce.H"
51 #include "Random.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class BrownianMotionForce Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class CloudType>
64 :
65  public ParticleForce<CloudType>
66 {
67  // Private data
68 
69  //- Reference to the cloud random number generator
70  Random& rndGen_;
71 
72  //- Molecular free path length [m]
73  const scalar lambda_;
74 
75  //- Turbulence flag
76  bool turbulence_;
77 
78  //- Pointer to the turbulence kinetic energy field
79  const volScalarField* kPtr_;
80 
81  //- Flag that indicates ownership of turbulence k field
82  bool ownK_;
83 
84 
85  // Private Member Functions
86 
87  //- Inverse erf for Gaussian distribution
88  scalar erfInv(const scalar y) const;
89 
90  //- Return the k field from the turbulence model
91  tmp<volScalarField> kModel() const;
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("BrownianMotion");
98 
99 
100  // Constructors
101 
102  //- Construct from mesh
104  (
105  CloudType& owner,
106  const fvMesh& mesh,
107  const dictionary& dict
108  );
109 
110  //- Construct copy
112 
113  //- Construct and return a clone
114  virtual autoPtr<ParticleForce<CloudType>> clone() const
115  {
117  (
119  );
120  }
121 
122 
123  //- Destructor
124  virtual ~BrownianMotionForce();
125 
126 
127  // Member Functions
128 
129  // Access
130 
131  //- Return const access to the molecular free path length [m]
132  inline scalar lambda() const;
133 
134  //- Return const access to the turbulence flag
135  inline bool turbulence() const;
136 
137 
138  // Evaluation
139 
140  //- Cache fields
141  virtual void cacheFields(const bool store);
142 
143  //- Calculate the coupled force
144  virtual forceSuSp calcCoupled
145  (
146  const typename CloudType::parcelType& p,
147  const typename CloudType::parcelType::trackingData& td,
148  const scalar dt,
149  const scalar mass,
150  const scalar Re,
151  const scalar muc
152  ) const;
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #include "BrownianMotionForceI.H"
163 
164 #ifdef NoRepository
165  #include "BrownianMotionForce.C"
166 #endif
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
Foam::Random
Random number generator.
Definition: Random.H:59
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::ParticleForce::owner
const CloudType & owner() const
Return const access to the cloud owner.
Definition: ParticleForceI.H:31
Foam::BrownianMotionForce::BrownianMotionForce
BrownianMotionForce(CloudType &owner, const fvMesh &mesh, const dictionary &dict)
Construct from mesh.
Definition: BrownianMotionForce.C:89
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::BrownianMotionForce::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: BrownianMotionForce.C:161
Foam::BrownianMotionForce::~BrownianMotionForce
virtual ~BrownianMotionForce()
Destructor.
Definition: BrownianMotionForce.C:122
BrownianMotionForceI.H
Foam::BrownianMotionForce::cacheFields
virtual void cacheFields(const bool store)
Cache fields.
Definition: BrownianMotionForce.C:129
Foam::BrownianMotionForce::TypeName
TypeName("BrownianMotion")
Runtime type information.
Foam::BrownianMotionForce::turbulence
bool turbulence() const
Return const access to the turbulence flag.
Definition: BrownianMotionForceI.H:38
Foam::BrownianMotionForce::lambda
scalar lambda() const
Return const access to the molecular free path length [m].
Definition: BrownianMotionForceI.H:31
BrownianMotionForce.C
Foam::forceSuSp
Helper container for force Su and Sp terms.
Definition: forceSuSp.H:64
Foam::ParticleForce
Abstract base class for particle forces.
Definition: ParticleForce.H:59
ParticleForce.H
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::BrownianMotionForce::clone
virtual autoPtr< ParticleForce< CloudType > > clone() const
Construct and return a clone.
Definition: BrownianMotionForce.H:113
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::BrownianMotionForce
Calculates particle Brownian motion force.
Definition: BrownianMotionForce.H:62
Random.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::ParticleForce::mesh
const fvMesh & mesh() const
Return the mesh database.
Definition: ParticleForceI.H:45
Foam::GeometricField< scalar, fvPatchField, volMesh >
y
scalar y
Definition: LISASMDCalcMethod1.H:14