uniformFixedValueFvFieldSource.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 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::uniformFixedValueFvFieldSource
26 
27 Description
28  This source condition provides a uniform fixed value.
29 
30 Usage
31  \table
32  Property | Description | Required | Default value
33  uniformValue | uniform value | yes |
34  \endtable
35 
36  Example of the source condition specification with a constant value:
37  \verbatim
38  <patchName>
39  {
40  type uniformFixedValue;
41  uniformValue 0.1;
42  }
43  \endverbatim
44 
45  Example of the source condition specification with a time-varying value:
46  \verbatim
47  <patchName>
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  uniformFixedValueFvFieldSource.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef uniformFixedValueFvFieldSource_H
70 #define uniformFixedValueFvFieldSource_H
71 
72 #include "fvFieldSource.H"
73 #include "Function1.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class uniformFixedValueFvFieldSource Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 template<class Type>
85 class uniformFixedValueFvFieldSource
86 :
87  public fvFieldSource<Type>
88 {
89 private:
90 
91  // Private Data
92 
93  //- Uniform value
94  autoPtr<Function1<Type>> uniformValue_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("uniformFixedValue");
101 
102 
103  // Constructors
104 
105  //- Construct from internal field and dictionary
107  (
110  );
111 
112  //- Copy constructor setting internal field reference
114  (
117  );
118 
119  //- Construct and return a clone setting internal field reference
121  (
123  ) const
124  {
126  (
128  );
129  }
130 
131 
132  //- Destructor
134 
135 
136  // Member Functions
137 
138  //- Return the source value
139  virtual tmp<Field<Type>> sourceValue(const fvSource&) const;
140 
141  //- Return the internal coefficient
142  virtual tmp<scalarField> internalCoeff(const fvSource&) const;
143 
144  //- Write
145  virtual void write(Ostream&) const;
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #ifdef NoRepository
157 #endif
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
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.
virtual tmp< scalarField > internalCoeff(const fvSource &) const
Return the internal coefficient.
virtual void write(Ostream &) const
Write.
TypeName("uniformFixedValue")
Runtime type information.
uniformFixedValueFvFieldSource(const DimensionedField< Type, volMesh > &, const dictionary &dict)
Construct from internal field and dictionary.
virtual tmp< Field< Type > > sourceValue(const fvSource &) const
Return the source value.
Namespace for OpenFOAM.
dictionary dict