All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2019 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 and internal field
107  (
108  const fvPatch&,
110  );
111 
112  //- Construct from patch, internal field and dictionary
114  (
115  const fvPatch&,
117  const dictionary&
118  );
119 
120  //- Construct by mapping given uniformInletOutletFvPatchField
121  // onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Copy constructor
132  (
134  );
135 
136  //- Construct and return a clone
137  virtual tmp<fvPatchField<Type>> clone() const
138  {
139  return tmp<fvPatchField<Type>>
140  (
142  );
143  }
144 
145  //- Copy constructor setting internal field reference
147  (
150  );
152  //- Construct and return a clone setting internal field reference
154  (
156  ) const
157  {
158  return tmp<fvPatchField<Type>>
159  (
161  );
162  }
163 
164 
165  // Member Functions
166 
167  // Attributes
169  //- Return true: this patch field is altered by assignment
170  virtual bool assignable() const
171  {
172  return true;
173  }
174 
175 
176  // Mapping functions
177 
178  //- Map (and resize as needed) from self given a mapping object
179  // Used to update fields following mesh topology change
180  virtual void autoMap(const fvPatchFieldMapper&);
181 
182  //- Reverse map the given fvPatchField onto this fvPatchField
183  // Used to reconstruct fields
184  virtual void rmap(const fvPatchField<Type>&, const labelList&);
185 
186 
187  //- Update the coefficients associated with the patch field
188  virtual void updateCoeffs();
189 
190  //- Write
191  virtual void write(Ostream&) const;
192 
193 
194  // Member Operators
195 
196  virtual void operator=(const fvPatchField<Type>& pvf);
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #ifdef NoRepository
208 #endif
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #endif
213 
214 // ************************************************************************* //
virtual void operator=(const fvPatchField< Type > &pvf)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
uniformInletOutletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
TypeName("uniformInletOutlet")
Runtime type information.
virtual bool assignable() const
Return true: this patch field is altered by assignment.
virtual void write(Ostream &) const
Write.
Variant of inletOutlet boundary condition with uniform inletValue.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
autoPtr< Function1< Type > > uniformInletValue_
Value.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.