distributionDiameterLagrangianScalarFieldSource.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::distributionDiameterLagrangianScalarFieldSource
26 
27 Description
28  This source condition provides values of diameter randomly sampled from a
29  given distribution.
30 
31  It is important to use this condition for diameter, rather than the generic
32  distribution source condition, as this condition will account for the
33  injection of parcels with differing numbers of particles when sampling the
34  distribution. If the generic distribution source condition is used when
35  injecting parcels of equal mass, for example, then the parcels containing
36  many small particles will be over-represented in the sampling. This
37  condition corrects for this and produces the correct distribution for
38  whatever uniform size the number condition creates.
39 
40  This condition must be used with parcel clouds and in conjunction with a
41  condition for the number field that specifies a uniform size, such as
42  flowRateNumber or totalNumber.
43 
44 Usage
45  \table
46  Property | Description | Required? | Default
47  distribution | The distribution | yes |
48  \endtable
49 
50  Example specification:
51  \verbatim
52  <LagrangianModelName>
53  {
54  type distributionDiameter;
55  distribution
56  {
57  type RosinRammler;
58  Q 0;
59  min 0.1 [mm];
60  max 1.5 [mm];
61  d 1.4 [mm];
62  n 2 [];
63  }
64  }
65  \endverbatim
66 
67 See also
68  Foam::distributions
69  Foam::flowRateNumberLagrangianScalarFieldSource
70  Foam::totalNumberLagrangianScalarFieldSource
71 
72 SourceFiles
73  distributionDiameterLagrangianScalarFieldSource.C
74 
75 \*---------------------------------------------------------------------------*/
76 
77 #ifndef distributionDiameterLagrangianScalarFieldSource_H
78 #define distributionDiameterLagrangianScalarFieldSource_H
79 
80 #include "LagrangianFieldSources.H"
81 #include "distribution.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class distributionDiameterLagrangianScalarFieldSource Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class distributionDiameterLagrangianScalarFieldSource
93 :
94  public LagrangianScalarFieldSource
95 {
96 private:
97 
98  // Private Data
99 
100  //- The distribution
101  mutable autoPtr<distribution> distribution_;
102 
103  //- The time index
104  mutable label timeIndex_;
105 
106  //- Name of the number field
107  const word numberName_;
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("distributionDiameter");
114 
115 
116  // Constructors
117 
118  //- Construct from internal field and dictionary
120  (
121  const regIOobject&,
123  );
124 
125  //- Copy constructor setting the internal field reference
127  (
129  const regIOobject&
130  );
131 
132  //- Construct and return a clone setting the internal field reference
134  (
135  const regIOobject& iIo
136  ) const
137  {
139  (
141  );
142  }
143 
144 
145  //- Destructor
147 
148 
149  // Member Functions
150 
151  //- Return the value for an instantaneous injection
153  (
154  const LagrangianInjection&,
155  const LagrangianSubMesh&
156  ) const;
157 
158  //- Write
159  virtual void write(Ostream&) const;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
This source condition provides values of diameter randomly sampled from a given distribution.
distributionDiameterLagrangianScalarFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
virtual tmp< LagrangianSubScalarField > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
TypeName("distributionDiameter")
Runtime type information.
virtual autoPtr< LagrangianScalarFieldSource > clone(const regIOobject &iIo) const
Construct and return a clone setting the internal field reference.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dictionary dict