RosinRammler.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-2020 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::distributionModels::RosinRammler
28 
29 Description
30  Rosin-Rammler distributionModel
31 
32  \f[
33  CDF(x) =
34  (1 - exp(-(x/d)^n + (d_0/d)^n)
35  /(1 - exp(-(d_1/d)^n + (d_0/d)^n)
36  \f]
37 
38 SourceFiles
39  RosinRammler.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef RosinRammler_H
44 #define RosinRammler_H
45 
46 #include "distributionModel.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace distributionModels
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class RosinRammler Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class RosinRammler
60 :
61  public distributionModel
62 {
63  // Private Data
64 
65  //- Distribution minimum
66  scalar minValue_;
67 
68  //- Distribution maximum
69  scalar maxValue_;
70 
71  // Model coefficients
72 
73  //- Scale parameter
74  scalar d_;
75 
76  //- Shape parameter
77  scalar n_;
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("RosinRammler");
84 
85 
86  // Constructors
87 
88  //- Construct from components
90 
91  //- Construct copy
92  RosinRammler(const RosinRammler& p);
93 
94  //- Construct and return a clone
95  virtual autoPtr<distributionModel> clone() const
96  {
97  return autoPtr<distributionModel>(new RosinRammler(*this));
98  }
99 
100 
101  //- Destructor
102  virtual ~RosinRammler();
103 
104 
105  // Member Functions
106 
107  //- Sample the distributionModel
108  virtual scalar sample() const;
109 
110  //- Return the minimum value
111  virtual scalar minValue() const;
112 
113  //- Return the maximum value
114  virtual scalar maxValue() const;
115 
116  //- Return the mean value
117  virtual scalar meanValue() const;
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace distributionModels
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
Foam::Random
Random number generator.
Definition: Random.H:59
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::distributionModels::RosinRammler::meanValue
virtual scalar meanValue() const
Return the mean value.
Definition: RosinRammler.C:99
Foam::distributionModels::RosinRammler::TypeName
TypeName("RosinRammler")
Runtime type information.
Foam::distributionModels::RosinRammler::sample
virtual scalar sample() const
Sample the distributionModel.
Definition: RosinRammler.C:78
Foam::distributionModel
A library of runtime-selectable distribution models.
Definition: distributionModel.H:70
Foam::distributionModels::RosinRammler
Rosin-Rammler distributionModel.
Definition: RosinRammler.H:58
Foam::distributionModels::RosinRammler::RosinRammler
RosinRammler(const dictionary &dict, Random &rndGen)
Construct from components.
Definition: RosinRammler.C:45
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::distributionModels::RosinRammler::minValue
virtual scalar minValue() const
Return the minimum value.
Definition: RosinRammler.C:87
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::distributionModels::RosinRammler::clone
virtual autoPtr< distributionModel > clone() const
Construct and return a clone.
Definition: RosinRammler.H:94
Foam::distributionModels::RosinRammler::maxValue
virtual scalar maxValue() const
Return the maximum value.
Definition: RosinRammler.C:93
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
rndGen
Random rndGen
Definition: createFields.H:23
Foam::distributionModels::RosinRammler::~RosinRammler
virtual ~RosinRammler()
Destructor.
Definition: RosinRammler.C:72
distributionModel.H