uniformInletOutletFvFieldSource.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) 2023-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::uniformInletOutletFvFieldSource
26 
27 Description
28  This source condition provides a uniform fixed value when the source is
29  positive, and the internal value when it is negative (i.e., a sink)
30 
31 Usage
32  \table
33  Property | Description | Required | Default value
34  uniformInletValue | uniform inlet value | yes |
35  \endtable
36 
37  Example of the source condition specification with a constant value:
38  \verbatim
39  <sourceName>
40  {
41  type uniformInletOutlet;
42  uniformInletValue 0.1;
43  }
44  \endverbatim
45 
46  Example of the source condition specification with a time-varying value:
47  \verbatim
48  <sourceName>
49  {
50  type uniformInletOutlet;
51  uniformInletValue
52  {
53  type table;
54  values
55  (
56  (0 0)
57  (1 0.1)
58  (9 0.1)
59  (10 0)
60  );
61  }
62  }
63  \endverbatim
64 
65 SourceFiles
66  uniformInletOutletFvFieldSource.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef uniformInletOutletFvFieldSource_H
71 #define uniformInletOutletFvFieldSource_H
72 
73 #include "fvFieldSource.H"
74 #include "Function1.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class uniformInletOutletFvFieldSource Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 template<class Type>
86 class uniformInletOutletFvFieldSource
87 :
88  public fvFieldSource<Type>
89 {
90 private:
91 
92  // Private Data
93 
94  //- Uniform inlet value
95  autoPtr<Function1<Type>> uniformInletValue_;
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("uniformInletOutlet");
102 
103 
104  // Constructors
105 
106  //- Construct from internal field and dictionary
108  (
111  );
112 
113  //- Copy constructor setting internal field reference
115  (
118  );
119 
120  //- Construct and return a clone setting internal field reference
122  (
124  ) const
125  {
127  (
129  );
130  }
131 
132 
133  //- Destructor
135 
136 
137  // Member Functions
138 
139  //- Return the source value
141  (
142  const fvSource& model,
144  ) const;
145 
146  //- Return the source value
148  (
149  const fvSource& model,
150  const scalarField& source,
151  const labelUList& cells
152  ) const;
153 
154  //- Return the source value
156  (
157  const fvSource& model,
159  ) const;
160 
161  //- Return the internal coefficient
163  (
164  const fvSource& model,
165  const scalarField& source,
166  const labelUList& cells
167  ) const;
168 
169  //- Write
170  virtual void write(Ostream&) const;
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace Foam
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #ifdef NoRepository
182 #endif
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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
autoPtr< fvFieldSource< Type > > clone() const
Disallow clone without setting internal field reference.
Base class for finite volume sources.
Definition: fvSource.H:52
A class for managing temporary objects.
Definition: tmp.H:55
This source condition provides a uniform fixed value when the source is positive, and the internal va...
TypeName("uniformInletOutlet")
Runtime type information.
uniformInletOutletFvFieldSource(const DimensionedField< Type, volMesh > &, const dictionary &dict)
Construct from internal field and dictionary.
virtual tmp< DimensionedField< Type, volMesh > > sourceValue(const fvSource &model, const DimensionedField< scalar, volMesh > &source) const
Return the source value.
virtual tmp< DimensionedField< scalar, volMesh > > internalCoeff(const fvSource &model, const DimensionedField< scalar, volMesh > &source) const
Return the source value.
const cellShapeList & cells
Namespace for OpenFOAM.
dictionary dict