Stochastic.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) 2013-2016 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::IsotropyModels::Stochastic
28 
29 Group
30  grpLagrangianIntermediateMPPICIsotropySubModels
31 
32 Description
33  Stochastic return-to-isotropy model.
34 
35  Particle velocities are modified by sampling a gaussian-plus-delta
36  distribution, which depends on a time-scale. This randomises some particle
37  velocities whilst leaving others unchanged. The lower the value of the
38  time-scale, the greater the proportion of particle velocities affected.
39 
40  A correction step is performed at the end to ensure that the model
41  conserves both momentum and granular temperature.
42 
43  Reference:
44  \verbatim
45  "Inclusion of collisional return-to-isotropy in the MP-PIC method"
46  P O'Rourke and D Snider
47  Chemical Engineering Science
48  Volume 80, Issue 0, Pages 39-54, December 2012
49  \endverbatim
50 
51 SourceFiles
52  Stochastic.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef Stochastic_H
57 #define Stochastic_H
58 
59 #include "IsotropyModel.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 namespace IsotropyModels
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class Stochastic Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 template<class CloudType>
73 class Stochastic
74 :
75  public IsotropyModel<CloudType>
76 {
77 private:
78 
79  // Private Member Functions
80 
81  //- Sample a gaussian distribution using the Box-Muller method
82  scalar sampleGauss();
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("stochastic");
89 
90  // Constructors
91 
92  //- Construct from components
93  Stochastic(const dictionary& dict, CloudType& owner);
94 
95  //- Construct copy
97 
98  //- Construct and return a clone
100  {
102  (
103  new Stochastic<CloudType>(*this)
104  );
105  }
106 
107 
108  //- Destructor
109  virtual ~Stochastic();
110 
111 
112  //- Member Functions
113 
114  //- Calculate velocities
115  virtual void calculate();
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace IsotropyModels
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #ifdef NoRepository
127  #include "Stochastic.C"
128 #endif
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #endif
133 
134 // ************************************************************************* //
IsotropyModel.H
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
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:123
Foam::IsotropyModels::Stochastic::TypeName
TypeName("stochastic")
Runtime type information.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Stochastic.C
Foam::IsotropyModels::Stochastic::clone
virtual autoPtr< IsotropyModel< CloudType > > clone() const
Construct and return a clone.
Definition: Stochastic.H:98
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::IsotropyModels::Stochastic::Stochastic
Stochastic(const dictionary &dict, CloudType &owner)
Construct from components.
Definition: Stochastic.C:35
Foam::IsotropyModels::Stochastic::calculate
virtual void calculate()
Member Functions.
Definition: Stochastic.C:100
Foam::IsotropyModel
Base class for collisional return-to-isotropy models.
Definition: KinematicCloud.H:104
Foam::IsotropyModels::Stochastic::~Stochastic
virtual ~Stochastic()
Destructor.
Definition: Stochastic.C:57
Foam::IsotropyModels::Stochastic
Stochastic return-to-isotropy model.
Definition: Stochastic.H:72