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-2024 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  <patchName>
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  <patchName>
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
140  virtual tmp<Field<Type>> sourceValue(const fvSource&) const;
141 
142  //- Return the internal coefficient
143  virtual tmp<scalarField> internalCoeff(const fvSource&) const;
144 
145  //- Write
146  virtual void write(Ostream&) const;
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #ifdef NoRepository
158 #endif
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
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 keyword definitions, which are a keyword followed by any number of values (e....
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...
virtual tmp< scalarField > internalCoeff(const fvSource &) const
Return the internal coefficient.
virtual tmp< Field< Type > > sourceValue(const fvSource &) const
Return the source value.
TypeName("uniformInletOutlet")
Runtime type information.
uniformInletOutletFvFieldSource(const DimensionedField< Type, volMesh > &, const dictionary &dict)
Construct from internal field and dictionary.
Namespace for OpenFOAM.
dictionary dict