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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::uniformInletOutletFvPatchField
28 
29 Group
30  grpOutletBoundaryConditions
31 
32 Description
33  Variant of inletOutlet boundary condition with uniform inletValue.
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  phi | flux field name | no | phi
39  uniformInletValue | inlet value for reverse flow | yes |
40  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  <patchName>
45  {
46  type uniformInletOutlet;
47  phi phi;
48  uniformInletValue 0;
49  value uniform 0;
50  }
51  \endverbatim
52 
53  The mode of operation is determined by the sign of the flux across the
54  patch faces.
55 
56 Note
57  Sign conventions:
58  - positive flux (out of domain): apply zero-gradient condition
59  - negative flux (into of domain): apply the user-specified fixed value
60 
61 See also
62  Foam::inletOutletFvPatchField
63  Foam::Function1Types
64 
65 SourceFiles
66  uniformInletOutletFvPatchField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef uniformInletOutletFvPatchField_H
71 #define uniformInletOutletFvPatchField_H
72 
73 #include "mixedFvPatchField.H"
74 #include "Function1.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class uniformInletOutletFvPatchField Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 template<class Type>
86 class uniformInletOutletFvPatchField
87 :
88  public mixedFvPatchField<Type>
89 {
90 
91 protected:
92 
93  // Protected data
94 
95  //- Name of flux field
97 
98  //- Value
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("uniformInletOutlet");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const fvPatch&,
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given uniformInletOutletFvPatchField
126  // onto a new patch
128  (
130  const fvPatch&,
132  const fvPatchFieldMapper&
133  );
134 
135  //- Construct as copy
137  (
139  );
140 
141  //- Construct and return a clone
142  virtual tmp<fvPatchField<Type>> clone() const
143  {
144  return tmp<fvPatchField<Type>>
145  (
147  );
148  }
149 
150  //- Construct as copy setting internal field reference
152  (
155  );
156 
157  //- Construct and return a clone setting internal field reference
159  (
161  ) const
162  {
163  return tmp<fvPatchField<Type>>
164  (
166  );
167  }
168 
170  // Member functions
171 
172  //- True: this patch field is altered by assignment
173  virtual bool assignable() const { return true; }
174 
175 
176  // Mapping functions
177 
178  //- Map (and resize as needed) from self given a mapping object
179  virtual void autoMap
180  (
181  const fvPatchFieldMapper&
182  );
183 
184  //- Reverse map the given fvPatchField onto this fvPatchField
185  virtual void rmap
186  (
187  const fvPatchField<Type>&,
188  const labelList&
189  );
191 
192  //- Update the coefficients associated with the patch field
193  virtual void updateCoeffs();
194 
195  //- Write
196  virtual void write(Ostream&) const;
197 
198 
199  // Member operators
200 
201  virtual void operator=(const fvPatchField<Type>& pvf);
202 };
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #ifdef NoRepository
213 #endif
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
virtual void operator=(const fvPatchField< Type > &pvf)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
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:70
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
TypeName("uniformInletOutlet")
Runtime type information.
virtual bool assignable() const
True: this patch field is altered by assignment.
virtual void write(Ostream &) const
Write.
Variant of inletOutlet boundary condition with uniform inletValue.
A class for handling words, derived from Foam::string.
Definition: word.H:63
A FieldMapper for finite-volume patch fields.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
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...
Definition: areaFieldsFwd.H:42
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.