coneVelocityLagrangianVectorFieldSource.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::coneVelocityLagrangianVectorFieldSource
26 
27 Description
28  This source condition provides a conical velocity profile, characterised by
29  a mean velocity and inner and outer cone angles. The mean velocity is a
30  Function1 and can vary with time. This is likely to be used in conjunction
31  with a point injection model.
32 
33 Usage
34  \table
35  Property | Description | Required? | Default
36  Umean | The velocity along the centreline | yes |
37  thetaInner | The inner cone angle | yes |
38  thetaOuter | The outer cone angle | yes |
39  \endtable
40 
41  Example specification:
42  \verbatim
43  <LagrangianModelName>
44  {
45  type coneVelocity;
46  Umean
47  {
48  type table;
49  values
50  (
51  (0 (0.1 0 0))
52  (0.5 (0.5 0 0))
53  );
54  }
55  thetaInner 15 [deg];
56  thetaOuter 22.5 [deg];
57  }
58  \endverbatim
59 
60 See also
61  Foam::Function1s
62 
63 SourceFiles
64  coneVelocityLagrangianVectorFieldSource.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef coneVelocityLagrangianVectorFieldSource_H
69 #define coneVelocityLagrangianVectorFieldSource_H
70 
71 #include "LagrangianFieldSources.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class coneVelocityLagrangianVectorFieldSource Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class coneVelocityLagrangianVectorFieldSource
85 :
86  public LagrangianVectorFieldSource,
87  private Function1LagrangianFieldSource<vector>
88 {
89 private:
90 
91  // Private Data
92 
93  //- Mean velocity
94  const autoPtr<Function1<vector>> Umean_;
95 
96  //- Inner half-cone angle
97  const autoPtr<Function1<scalar>> thetaInner_;
98 
99  //- Outer half-cone angle
100  const autoPtr<Function1<scalar>> thetaOuter_;
101 
102  //- A random number generator
103  mutable restartableRandomGenerator rndGen_;
104 
105  //- The time index
106  mutable label timeIndex_;
107 
108 
109  // Private Member Functions
110 
111  //- Use the base class' value method
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("coneVelocity");
119 
120 
121  // Constructors
122 
123  //- Construct from internal field and dictionary
125  (
126  const regIOobject&,
127  const dictionary& dict
128  );
129 
130  //- Copy constructor setting the internal field reference
132  (
134  const regIOobject&
135  );
136 
137  //- Construct and return a clone setting the internal field reference
139  (
140  const regIOobject& iIo
141  ) const
142  {
144  (
146  );
147  }
148 
149 
150  //- Destructor
152 
153 
154  // Member Functions
155 
156  //- Return the value for an instantaneous injection
158  (
159  const LagrangianInjection&,
160  const LagrangianSubMesh&
161  ) const;
162 
163  //- Write
164  virtual void write(Ostream&) const;
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
Mix-in for source conditions that provides functions for evaluating Function1s at variable times.
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
This source condition provides a conical velocity profile, characterised by a mean velocity and inner...
virtual tmp< LagrangianSubVectorField > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
virtual autoPtr< LagrangianVectorFieldSource > clone(const regIOobject &iIo) const
Construct and return a clone setting the internal field reference.
TypeName("coneVelocity")
Runtime type information.
coneVelocityLagrangianVectorFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
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
Random number generator with the additional ability to go back to an earlier stored state....
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