uniformInletOutletFvPatchField.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) 2013-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::uniformInletOutletFvPatchField
26 
27 Description
28  Variant of inletOutlet boundary condition with uniform inletValue.
29 
30 Usage
31  \table
32  Property | Description | Required | Default value
33  phi | flux field name | no | phi
34  uniformInletValue | inlet value for reverse flow | yes |
35  \endtable
36 
37  Example of the boundary condition specification:
38  \verbatim
39  <patchName>
40  {
41  type uniformInletOutlet;
42  phi phi;
43  uniformInletValue 0;
44  value uniform 0;
45  }
46  \endverbatim
47 
48  The mode of operation is determined by the sign of the flux across the
49  patch faces.
50 
51  Note:
52  Sign conventions:
53  - positive flux (out of domain): apply zero-gradient condition
54  - negative flux (into of domain): apply the user-specified fixed value
55 
56 See also
57  Foam::inletOutletFvPatchField
58  Foam::Function1s
59 
60 SourceFiles
61  uniformInletOutletFvPatchField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef uniformInletOutletFvPatchField_H
66 #define uniformInletOutletFvPatchField_H
67 
68 #include "mixedFvPatchField.H"
69 #include "Function1.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class uniformInletOutletFvPatchField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 template<class Type>
81 class uniformInletOutletFvPatchField
82 :
83  public mixedFvPatchField<Type>
84 {
85 
86 protected:
87 
88  // Protected data
89 
90  //- Name of flux field
91  word phiName_;
92 
93  //- Value
94  autoPtr<Function1<Type>> uniformInletValue_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("uniformInletOutlet");
101 
102 
103  // Constructors
104 
105  //- Construct from patch, internal field and dictionary
107  (
108  const fvPatch&,
110  const dictionary&
111  );
112 
113  //- Construct by mapping given uniformInletOutletFvPatchField
114  // onto a new patch
116  (
118  const fvPatch&,
120  const fvPatchFieldMapper&
121  );
122 
123  //- Disallow copy without setting internal field reference
125  (
127  ) = delete;
128 
129  //- Copy constructor setting internal field reference
131  (
134  );
135 
136  //- Construct and return a clone setting internal field reference
138  (
140  ) const
141  {
142  return tmp<fvPatchField<Type>>
143  (
145  );
146  }
147 
148 
149  // Member Functions
150 
151  // Attributes
152 
153  //- Return true: this patch field is altered by assignment
154  virtual bool assignable() const
155  {
156  return true;
157  }
158 
159 
160  // Mapping functions
161 
162  //- Map the given fvPatchField onto this fvPatchField
163  virtual void map
164  (
165  const fvPatchField<Type>&,
166  const fvPatchFieldMapper&
167  );
168 
169  //- Reset the fvPatchField to the given fvPatchField
170  // Used for mesh to mesh mapping
171  virtual void reset(const fvPatchField<Type>&);
172 
173 
174  //- Update the coefficients associated with the patch field
175  virtual void updateCoeffs();
176 
177  //- Write
178  virtual void write(Ostream&) const;
179 
180 
181  // Member Operators
182 
183  virtual void operator=(const fvPatchField<Type>& pvf);
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #ifdef NoRepository
195 #endif
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
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
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:203
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Variant of inletOutlet boundary condition with uniform inletValue.
virtual void write(Ostream &) const
Write.
virtual void operator=(const fvPatchField< Type > &pvf)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void reset(const fvPatchField< Type > &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchField< Type > &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
uniformInletOutletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
TypeName("uniformInletOutlet")
Runtime type information.
virtual bool assignable() const
Return true: this patch field is altered by assignment.
autoPtr< Function1< Type > > uniformInletValue_
Value.
Namespace for OpenFOAM.