uniformFixedValueLagrangianFieldSource.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::uniformFixedValueLagrangianFieldSource
26 
27 Description
28  This source condition provides a uniform fixed value.
29 
30 Usage
31  \table
32  Property | Description | Required? | Default
33  uniformValue | The uniform value | yes |
34  \endtable
35 
36  Example specification for a constant value:
37  \verbatim
38  <LagrangianModelName>
39  {
40  type uniformFixedValue;
41  uniformValue 0.1;
42  }
43  \endverbatim
44 
45  Example specification for a time-varying value:
46  \verbatim
47  <LagrangianModelName>
48  {
49  type uniformFixedValue;
50  uniformValue
51  {
52  type table;
53  values
54  (
55  (0 0)
56  (1 0.1)
57  (9 0.1)
58  (10 0)
59  );
60  }
61  }
62  \endverbatim
63 
64 SourceFiles
65  uniformFixedValueLagrangianFieldSource.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef uniformFixedValueLagrangianFieldSource_H
70 #define uniformFixedValueLagrangianFieldSource_H
71 
72 #include "LagrangianFieldSource.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class uniformFixedValueLagrangianFieldSource Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 template<class Type>
85 class uniformFixedValueLagrangianFieldSource
86 :
87  public LagrangianFieldSource<Type>,
88  private Function1LagrangianFieldSource<Type>
89 {
90 private:
91 
92  // Private Data
93 
94  //- Uniform value
95  autoPtr<Function1<Type>> uniformValue_;
96 
97 
98  // Private Member Functions
99 
100  //- Use the base class' value method
102 
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("uniformFixedValue");
108 
109 
110  // Constructors
111 
112  //- Construct from internal field and dictionary
114  (
115  const regIOobject&,
117  );
118 
119  //- Copy constructor setting the internal field reference
121  (
123  const regIOobject&
124  );
125 
126  //- Construct and return a clone setting the internal field reference
128  (
129  const regIOobject& iIo
130  ) const
131  {
133  (
135  );
136  }
137 
138 
139  //- Destructor
141 
142 
143  // Member Functions
144 
145  //- Return the source value
147  (
148  const LagrangianSource&,
149  const LagrangianSubMesh&
150  ) const;
151 
152  //- Return the internal coefficient
154  (
155  const LagrangianSource&,
156  const LagrangianSubMesh&
157  ) const;
158 
159  //- Return the value for an instantaneous injection
161  (
162  const LagrangianInjection&,
163  const LagrangianSubMesh&
164  ) const;
165 
166  //- Write
167  virtual void write(Ostream&) const;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #ifdef NoRepository
179 #endif
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
Mix-in for source conditions that provides functions for evaluating Function1s at variable times.
autoPtr< LagrangianFieldSource< Type > > clone() const
Disallow clone without setting the internal field reference.
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Base class for Lagrangian sources. Minimal wrapper over LagrangianModel that provides an interface to...
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 uniform fixed value.
TypeName("uniformFixedValue")
Runtime type information.
uniformFixedValueLagrangianFieldSource(const regIOobject &, const dictionary &dict)
Construct from internal field and dictionary.
virtual tmp< LagrangianSubField< Type > > value(const LagrangianInjection &, const LagrangianSubMesh &) const
Return the value for an instantaneous injection.
virtual tmp< LagrangianSubField< Type > > sourceValue(const LagrangianSource &, const LagrangianSubMesh &) const
Return the source value.
virtual tmp< LagrangianSubScalarField > internalCoeff(const LagrangianSource &, const LagrangianSubMesh &) const
Return the internal coefficient.
Namespace for OpenFOAM.
dictionary dict