fanVelocityLagrangianVectorFieldSource.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-2026 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::fanVelocityLagrangianVectorFieldSource
26 
27 Description
28  This source condition provides a fan velocity profile, characterised by a
29  centreline velocity, a normal, and inner and outer fan angles. The
30  centreline velocity and normal are Function1s and can vary with time. This
31  is likely to be used in conjunction with a point injection model.
32 
33 Usage
34  \table
35  Property | Description | Required? | Default
36  Ucentre | The velocity along the centreline | yes |
37  normal | Normal to the plane of the fan | yes |
38  thetaInner | The inner fan angle | yes |
39  thetaOuter | The outer fan angle | yes |
40  \endtable
41 
42  Example specification:
43  \verbatim
44  <LagrangianModelName>
45  {
46  type fanVelocity;
47  Ucentre
48  {
49  type table;
50  values
51  (
52  (0 (0.1 0 0))
53  (0.5 (0.5 0 0))
54  );
55  }
56  normal (0 0 1);
57  thetaInner 15 [deg];
58  thetaOuter 22.5 [deg];
59  }
60  \endverbatim
61 
62 See also
63  Foam::Function1s
64 
65 SourceFiles
66  fanVelocityLagrangianVectorFieldSource.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef fanVelocityLagrangianVectorFieldSource_H
71 #define fanVelocityLagrangianVectorFieldSource_H
72 
73 #include "LagrangianFieldSources.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class fanVelocityLagrangianVectorFieldSource Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class fanVelocityLagrangianVectorFieldSource
87 :
88  public LagrangianVectorFieldSource,
89  private Function1LagrangianFieldSource,
90  private fanDirectionLagrangianVectorFieldSource
91 {
92 private:
93 
94  // Private Data
95 
96  //- Centreline velocity
97  const autoPtr<Function1<vector>> Ucentre_;
98 
99 
100  // Private Member Functions
101 
102  //- Use the base class' value method
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("fanVelocity");
110 
111 
112  // Constructors
113 
114  //- Construct from internal field and dictionary
116  (
117  const regIOobject&,
118  const dictionary& dict
119  );
120 
121  //- Copy constructor setting the internal field reference
123  (
125  const regIOobject&
126  );
127 
128  //- Construct and return a clone setting the internal field reference
130  (
131  const regIOobject& iIo
132  ) const
133  {
135  (
137  );
138  }
139 
140 
141  //- Destructor
143 
144 
145  // Member Functions
146 
147  //- Use the base class' value method
148  using LagrangianVectorFieldSource::value;
149 
150  //- Return the value for an instantaneous injection
152  (
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 // ************************************************************************* //
tmp< LagrangianSubField< Type > > value(const LagrangianSubMesh &subMesh, const Function1< Type > &function) const
Return the source value.
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 a fan velocity profile, characterised by a centreline velocity,...
fanVelocityLagrangianVectorFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
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("fanVelocity")
Runtime type information.
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