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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::IsotropyModels::Stochastic
28
29Group
30 grpLagrangianIntermediateMPPICIsotropySubModels
31
32Description
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
51SourceFiles
52 Stochastic.C
53
54\*---------------------------------------------------------------------------*/
55
56#ifndef Stochastic_H
57#define Stochastic_H
58
59#include "IsotropyModel.H"
60
61// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62
63namespace Foam
64{
65namespace IsotropyModels
66{
67
68/*---------------------------------------------------------------------------*\
69 Class Stochastic Declaration
70\*---------------------------------------------------------------------------*/
71
72template<class CloudType>
73class Stochastic
74:
75 public IsotropyModel<CloudType>
76{
77private:
78
79 // Private Member Functions
80
81 //- Sample a gaussian distribution using the Box-Muller method
82 scalar sampleGauss();
83
84
85public:
86
87 //- Runtime type information
88 TypeName("stochastic");
89
90 // Constructors
91
92 //- Construct from components
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// ************************************************************************* //
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Base class for collisional return-to-isotropy models.
Definition: IsotropyModel.H:66
Stochastic return-to-isotropy model.
Definition: Stochastic.H:75
TypeName("stochastic")
Runtime type information.
virtual autoPtr< IsotropyModel< CloudType > > clone() const
Construct and return a clone.
Definition: Stochastic.H:98
virtual ~Stochastic()
Destructor.
Definition: Stochastic.C:57
virtual void calculate()
Member Functions.
Definition: Stochastic.C:100
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73