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"
82 #include "distribution.H"
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 namespace Foam
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class distributionDiameterLagrangianScalarFieldSource Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class distributionDiameterLagrangianScalarFieldSource
94 :
95  public LagrangianScalarFieldSource,
96  private cloudLagrangianFieldSource
97 {
98 private:
99 
100  // Private Data
101 
102  //- The distribution
103  mutable autoPtr<distribution> distribution_;
104 
105  //- The time index
106  mutable label timeIndex_;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("distributionDiameter");
113 
114 
115  // Constructors
116 
117  //- Construct from internal field and dictionary
119  (
120  const regIOobject&,
122  );
123 
124  //- Copy constructor setting the internal field reference
126  (
128  const regIOobject&
129  );
130 
131  //- Construct and return a clone setting the internal field reference
133  (
134  const regIOobject& iIo
135  ) const
136  {
138  (
140  );
141  }
142 
143 
144  //- Destructor
146 
147 
148  // Member Functions
149 
150  //- Return the value for an instantaneous injection
152  (
153  const LagrangianInjection&,
154  const LagrangianSubMesh&
155  ) const;
156 
157  //- Write
158  virtual void write(Ostream&) const;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
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
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