uniformInletOutletFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2013-2016 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 Group
28  grpOutletBoundaryConditions
29 
30 Description
31  Variant of inletOutlet boundary condition with uniform inletValue.
32 
33 Usage
34  \table
35  Property | Description | Required | Default value
36  phi | flux field name | no | phi
37  uniformInletValue | inlet value for reverse flow | yes |
38  \endtable
39 
40  Example of the boundary condition specification:
41  \verbatim
42  <patchName>
43  {
44  type uniformInletOutlet;
45  phi phi;
46  uniformInletValue 0;
47  value uniform 0;
48  }
49  \endverbatim
50 
51  The mode of operation is determined by the sign of the flux across the
52  patch faces.
53 
54 Note
55  Sign conventions:
56  - positive flux (out of domain): apply zero-gradient condition
57  - negative flux (into of domain): apply the user-specified fixed value
58 
59 See also
60  Foam::inletOutletFvPatchField
61  Foam::Function1Types
62 
63 SourceFiles
64  uniformInletOutletFvPatchField.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef uniformInletOutletFvPatchField_H
69 #define uniformInletOutletFvPatchField_H
70 
71 #include "mixedFvPatchField.H"
72 #include "Function1.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class uniformInletOutletFvPatchField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 template<class Type>
84 class uniformInletOutletFvPatchField
85 :
86  public mixedFvPatchField<Type>
87 {
88 
89 protected:
90 
91  // Protected data
92 
93  //- Name of flux field
94  word phiName_;
95 
96  //- Value
97  autoPtr<Function1<Type>> uniformInletValue_;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("uniformInletOutlet");
104 
105 
106  // Constructors
107 
108  //- Construct from patch and internal field
110  (
111  const fvPatch&,
113  );
114 
115  //- Construct from patch, internal field and dictionary
117  (
118  const fvPatch&,
120  const dictionary&
121  );
122 
123  //- Construct by mapping given uniformInletOutletFvPatchField
124  // onto a new patch
126  (
128  const fvPatch&,
130  const fvPatchFieldMapper&
131  );
132 
133  //- Construct as copy
135  (
137  );
138 
139  //- Construct and return a clone
140  virtual tmp<fvPatchField<Type>> clone() const
141  {
142  return tmp<fvPatchField<Type>>
143  (
145  );
146  }
147 
148  //- Construct as copy setting internal field reference
150  (
153  );
155  //- Construct and return a clone setting internal field reference
157  (
159  ) const
160  {
161  return tmp<fvPatchField<Type>>
162  (
164  );
165  }
166 
167 
168  // Member functions
169 
170  // Attributes
172  //- Return true: this patch field is altered by assignment
173  virtual bool assignable() const
174  {
175  return true;
176  }
177 
178 
179  // Mapping functions
180 
181  //- Map (and resize as needed) from self given a mapping object
182  virtual void autoMap
183  (
184  const fvPatchFieldMapper&
185  );
186 
187  //- Reverse map the given fvPatchField onto this fvPatchField
188  virtual void rmap
189  (
190  const fvPatchField<Type>&,
191  const labelList&
192  );
193 
194 
195  //- Update the coefficients associated with the patch field
196  virtual void updateCoeffs();
197 
198  //- Write
199  virtual void write(Ostream&) const;
200 
201 
202  // Member operators
203 
204  virtual void operator=(const fvPatchField<Type>& pvf);
205 };
206 
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 } // End namespace Foam
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #ifdef NoRepository
216 #endif
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 #endif
221 
222 // ************************************************************************* //
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:137
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:65
TypeName("uniformInletOutlet")
Runtime type information.
virtual bool assignable() const
Return true: this patch field is altered by assignment.
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:53
autoPtr< Function1< Type > > uniformInletValue_
Value.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
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.
virtual void write(Ostream &) const
Write.
A class for managing temporary objects.
Definition: PtrList.H:54
Namespace for OpenFOAM.