totalPressureConeVelocityLagrangianVectorFieldSource.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::totalPressureConeVelocityLagrangianVectorFieldSource
26 
27 Description
28  This source condition provides a conical velocity profile, characterised by
29  inner and outer cone angles, with a magnitude calculated from the
30  difference between a specified upstream pressure and the local interpolated
31  pressure.
32 
33 Usage
34  \table
35  Property | Description | Required? | Default
36  direction | The velocity direction | yes |
37  thetaInner | The inner cone angle | yes |
38  thetaOuter | The outer cone angle | yes |
39  p0 | The upstream total pressure | yes |
40  pc | The name of the carrier pressure field | no | p
41  \endtable
42 
43  Example specification:
44  \verbatim
45  <LagrangianModelName>
46  {
47  type totalPressureConeVelocity;
48  direction (1 0 0);
49  thetaInner 15 [deg];
50  thetaOuter 22.5 [deg];
51  p0 1 [bar];
52  }
53  \endverbatim
54 
55 See also
56  Foam::Function1s
57 
58 SourceFiles
59  totalPressureConeVelocityLagrangianVectorFieldSource.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef totalPressureConeVelocityLagrangianVectorFieldSource_H
64 #define totalPressureConeVelocityLagrangianVectorFieldSource_H
65 
66 #include "LagrangianFieldSources.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class totalPressureConeVelocityLagrangianVectorFieldSource Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 class totalPressureConeVelocityLagrangianVectorFieldSource
82 :
83  public LagrangianVectorFieldSource,
84  private cloudLagrangianFieldSource,
85  private Function1LagrangianFieldSource,
86  private totalPressureVelocityMagnitudeLagrangianScalarFieldSource,
87  private coneDirectionLagrangianVectorFieldSource
88 {
89  // Private Data
90 
91  //- Direction
92  const autoPtr<Function1<vector>> direction_;
93 
94 
95  // Private Member Functions
96 
97  //- Use the base class' value method
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("totalPressureConeVelocity");
105 
106 
107  // Constructors
108 
109  //- Construct from internal field and dictionary
111  (
112  const regIOobject&,
113  const dictionary& dict
114  );
115 
116  //- Copy constructor setting the internal field reference
118  (
120  const regIOobject&
121  );
122 
123  //- Construct and return a clone setting the internal field reference
125  (
126  const regIOobject& iIo
127  ) const
128  {
130  (
132  (
133  *this,
134  iIo
135  )
136  );
137  }
138 
139 
140  //- Destructor
142 
143 
144  // Member Functions
145 
146  //- Use the base class' value method
147  using LagrangianVectorFieldSource::value;
148 
149  //- Return the value for an instantaneous injection
151  (
152  const LagrangianInjection&,
154  ) const;
155 
156  //- Write
157  virtual void write(Ostream&) const;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
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
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
This source condition provides a conical velocity profile, characterised by inner and outer cone angl...
virtual tmp< LagrangianSubVectorField > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
totalPressureConeVelocityLagrangianVectorFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
virtual autoPtr< LagrangianVectorFieldSource > clone(const regIOobject &iIo) const
Construct and return a clone setting the internal field reference.
TypeName("totalPressureConeVelocity")
Runtime type information.
Namespace for OpenFOAM.
dictionary dict