flowRateNumberLagrangianScalarFieldSource.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::flowRateNumberLagrangianScalarFieldSource
26 
27 Description
28  This source condition sets the values of the number field to recover a
29  specified volumetric or mass flow-rate. It should be used in conjunction
30  with a continuous injection model.
31 
32  This condition requires a uniform size to be specified. All injected
33  parcels will have the same value of this size. The size can be \c number,
34  \c surfaceArea, \c volume or \c mass. This choice relates to the desired
35  discretisation of the Lagrangian material. Broadly, the uniform size chosen
36  should be that against which the dominant effect of the Lagrangian model
37  scales.
38 
39  So, if the particles are primarily evaporating droplets of fuel, then the
40  effect of each will be primarily a function of the mass of fuel that
41  evaporates into the system. The \c uniformSize should therefore be set to
42  \c mass.
43 
44  But, if the model is purely dynamic, and the dominant effect is viscous
45  drag, then each particle will exert a force in proportion with a reference
46  area. In this case \c surfaceArea would be a better choice.
47 
48  If a distribution of sizes is injected then the choice of uniform size
49  interacts with how the distribution is to be sampled. For that reason, it
50  is important to use a diameter source condition such as \c
51  distributionDiameter which accounts for this, rather than the general \c
52  distribution condition.
53 
54 Usage
55  \table
56  Property | Description | Required? | Default
57  uniformSize | The size kept uniform \
58  across all parcels | yes |
59  volumetricFlowRate | The volumetric flow rate | if massFlowRate \
60  is not specified |
61  massFlowRate | The mass flow rate | if volumetricFlowRate \
62  is not specified |
63  \endtable
64 
65  Example specification:
66  \verbatim
67  <LagrangianModelName>
68  {
69  type flowRateNumber;
70  uniformSize volume; // number, surfaceArea, mass
71  volumetricFlowRate 1 [g/s];
72  }
73  \endverbatim
74 
75 See also
76  Foam::distributionDiameterLagrangianScalarFieldSource
77 
78 SourceFiles
79  flowRateNumberLagrangianScalarFieldSource.C
80 
81 \*---------------------------------------------------------------------------*/
82 
83 #ifndef flowRateNumberLagrangianScalarFieldSource_H
84 #define flowRateNumberLagrangianScalarFieldSource_H
85 
87 #include "Function1.H"
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 namespace Foam
92 {
93 
94 /*---------------------------------------------------------------------------*\
95  Class flowRateNumberLagrangianScalarFieldSource Declaration
96 \*---------------------------------------------------------------------------*/
97 
98 class flowRateNumberLagrangianScalarFieldSource
99 :
100  public uniformSizeNumberLagrangianScalarFieldSource
101 {
102 private:
103 
104  // Private Data
105 
106  //- The volumetric flow rate
107  autoPtr<Function1<scalar>> volumetricFlowRate_;
108 
109  //- The mass flow rate
110  autoPtr<Function1<scalar>> massFlowRate_;
111 
112 
113 public:
114 
115  //- Runtime type information
116  TypeName("flowRateNumber");
117 
118 
119  // Constructors
120 
121  //- Construct from internal field and dictionary
123  (
124  const regIOobject&,
125  const dictionary& dict
126  );
127 
128  //- Copy constructor setting the internal field reference
130  (
132  const regIOobject&
133  );
134 
135  //- Construct and return a clone setting the internal field reference
137  (
138  const regIOobject& iIo
139  ) const
140  {
142  (
144  );
145  }
146 
147 
148  //- Destructor
150 
151 
152  // Member Functions
153 
154  //- Return the value for an instantaneous injection
156  (
157  const LagrangianInjection&,
158  const LagrangianSubMesh&
159  ) const;
160 
161  //- Write
162  virtual void write(Ostream&) const;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
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 sets the values of the number field to recover a specified volumetric or mass f...
TypeName("flowRateNumber")
Runtime type information.
virtual tmp< LagrangianSubScalarField > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
flowRateNumberLagrangianScalarFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
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.
dictionary dict