fixedValue.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-2016 OpenFOAM Foundation
9 Copyright (C) 2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::distributionModels::fixedValue
29
30Description
31 Particle-size distribution model wherein samples are given fixed values.
32
33Usage
34 Minimal example by using \c constant/<CloudProperties>:
35 \verbatim
36 subModels
37 {
38 injectionModels
39 {
40 <name>
41 {
42 ...
43
44 sizeDistribution
45 {
46 type fixedValue;
47 fixedValueDistribution
48 {
49 value <value>;
50 }
51 }
52 }
53 }
54 }
55 \endverbatim
56
57 where the entries mean:
58 \table
59 Property | Description | Type | Reqd | Deflt
60 type | Type name: fixedValue | word | yes | -
61 fixedValueDistribution | Distribution settings | dict | yes | -
62 value | Fixed value for size | scalar | yes | -
63 \endtable
64
65SourceFiles
66 fixedValue.C
67
68\*---------------------------------------------------------------------------*/
69
70#ifndef distributionModels_fixedValue_H
71#define distributionModels_fixedValue_H
72
73#include "distributionModel.H"
74
75// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76
77namespace Foam
78{
79namespace distributionModels
80{
81/*---------------------------------------------------------------------------*\
82 Class fixedValue Declaration
83\*---------------------------------------------------------------------------*/
84
85class fixedValue
86:
87 public distributionModel
88{
89 // Private Data
90
91 //- Fixed value for size
92 scalar value_;
93
94
95public:
96
97 //- Runtime type information
98 TypeName("fixedValue");
99
100
101 // Constructors
102
103 //- Construct from components
104 fixedValue(const dictionary& dict, Random& rndGen);
105
106 //- Copy construct
107 fixedValue(const fixedValue& p);
109 //- Construct and return a clone
110 virtual autoPtr<distributionModel> clone() const
111 {
112 return autoPtr<distributionModel>(new fixedValue(*this));
113 }
114
115 //- No copy assignment
116 void operator=(const fixedValue&) = delete;
117
118
119 //- Destructor
120 virtual ~fixedValue() = default;
122
123 // Member Functions
124
125 //- Sample the distribution
126 virtual scalar sample() const;
127
128 //- Return the minimum of the distribution
129 virtual scalar minValue() const;
130
131 //- Return the maximum of the distribution
132 virtual scalar maxValue() const;
134 //- Return the theoretical mean of the distribution
135 virtual scalar meanValue() const;
136};
137
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141} // End namespace distributionModels
142} // End namespace Foam
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146#endif
147
148// ************************************************************************* //
Random number generator.
Definition: Random.H:60
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
A library of runtime-selectable doubly-truncated probability distribution models. Returns random samp...
Particle-size distribution model wherein samples are given fixed values.
Definition: fixedValue.H:111
virtual scalar meanValue() const
Return the theoretical mean of the distribution.
Definition: fixedValue.C:91
virtual ~fixedValue()=default
Destructor.
virtual autoPtr< distributionModel > clone() const
Construct and return a clone.
Definition: fixedValue.H:133
TypeName("fixedValue")
Runtime type information.
virtual scalar sample() const
Sample the distribution.
Definition: fixedValue.C:73
virtual scalar maxValue() const
Return the maximum of the distribution.
Definition: fixedValue.C:85
fixedValue(const dictionary &dict, Random &rndGen)
Construct from components.
Definition: fixedValue.C:46
void operator=(const fixedValue &)=delete
No copy assignment.
virtual scalar minValue() const
Return the minimum of the distribution.
Definition: fixedValue.C:79
volScalarField & p
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73
Random rndGen
Definition: createFields.H:23