uniformSizeNumberLagrangianScalarFieldSource.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::uniformSizeNumberLagrangianScalarFieldSource
26 
27 Description
28  Base class for Lagrangian source conditions that calculate the number field
29  from a total (e.g., mass, volume or flowRate) and a uniform size of the
30  created parcels (e.g., mass, volume, surface area or number).
31 
32 SourceFiles
33  uniformSizeNumberLagrangianScalarFieldSource.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef uniformSizeNumberLagrangianScalarFieldSource_H
38 #define uniformSizeNumberLagrangianScalarFieldSource_H
39 
40 #include "LagrangianFieldSources.H"
42 #include "NamedEnum.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class uniformSizeNumberLagrangianScalarFieldSource Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public LagrangianScalarFieldSource,
56  private CloudLagrangianFieldSource<scalar>
57 {
58 public:
59 
60  // Public Enumerations
61 
62  //- Enumeration for the uniform size
63  enum class uniformSize
64  {
65  number,
67  volume,
68  mass
69  };
70 
71  //- Names of the uniform size
73 
74 
75 private:
76 
77  // Private Data
78 
79  //- The size uniform to all parcels
80  const uniformSize uniformSize_;
81 
82 
83 protected:
84 
85  // Protected Member Functions
86 
87  //- Calculate the necessary sizes
88  void calcSizes
89  (
90  const LagrangianInjection& injection,
91  const LagrangianSubMesh& subMesh,
93  const bool needv,
95  const bool needm,
97  ) const;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("uniformSizeNumber");
104 
105 
106  // Constructors
107 
108  //- Construct from internal field and dictionary
110  (
111  const regIOobject&,
112  const dictionary& dict
113  );
114 
115  //- Copy constructor setting the internal field reference
117  (
119  const regIOobject&
120  );
121 
122  //- Construct and return a clone setting the internal field reference
124  (
125  const regIOobject& iIo
126  ) const
127  {
129  (
131  );
132  }
133 
134 
135  //- Destructor
137 
138 
139  // Member Functions
140 
141  //- Return the sample size exponent
142  label sampleQ() const;
143 
144  //- Write
145  virtual void write(Ostream&) const;
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
Templated base class for source conditions that refer to a cloud. Not a source condition in itself....
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
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
Base class for Lagrangian source conditions that calculate the number field from a total (e....
TypeName("uniformSizeNumber")
Runtime type information.
void calcSizes(const LagrangianInjection &injection, const LagrangianSubMesh &subMesh, tmp< LagrangianSubScalarField > &size, const bool needv, tmp< LagrangianSubScalarField > &v, const bool needm, tmp< LagrangianSubScalarField > &m) const
Calculate the necessary sizes.
uniformSizeNumberLagrangianScalarFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
static const NamedEnum< uniformSize, 4 > uniformSizeNames_
Names of the uniform size.
virtual autoPtr< LagrangianScalarFieldSource > clone(const regIOobject &iIo) const
Construct and return a clone setting the internal field reference.
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