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
96  word phiName_;
97 
98  //- Value
99  autoPtr<Function1<Type>> uniformInletValue_;
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 
169 
170  // Member functions
171 
172  // Attributes
173 
174  //- Return true: this patch field is altered by assignment
175  virtual bool assignable() const
176  {
177  return true;
178  }
179 
180 
181  // Mapping functions
182 
183  //- Map (and resize as needed) from self given a mapping object
184  virtual void autoMap
185  (
186  const fvPatchFieldMapper&
187  );
188 
189  //- Reverse map the given fvPatchField onto this fvPatchField
190  virtual void rmap
191  (
192  const fvPatchField<Type>&,
193  const labelList&
194  );
195 
196 
197  //- Update the coefficients associated with the patch field
198  virtual void updateCoeffs();
199 
200  //- Write
201  virtual void write(Ostream&) const;
202 
203 
204  // Member operators
205 
206  virtual void operator=(const fvPatchField<Type>& pvf);
207 };
208 
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #ifdef NoRepository
218 #endif
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #endif
223 
224 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:51
Foam::uniformInletOutletFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &pvf)
Definition: uniformInletOutletFvPatchField.C:210
Foam::uniformInletOutletFvPatchField::uniformInletOutletFvPatchField
uniformInletOutletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: uniformInletOutletFvPatchField.C:35
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::uniformInletOutletFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: uniformInletOutletFvPatchField.C:179
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
uniformInletOutletFvPatchField.C
Function1.H
mixedFvPatchField.H
Foam::uniformInletOutletFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: uniformInletOutletFvPatchField.C:166
Foam::uniformInletOutletFvPatchField::uniformInletValue_
autoPtr< Function1< Type > > uniformInletValue_
Value.
Definition: uniformInletOutletFvPatchField.H:113
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::uniformInletOutletFvPatchField::assignable
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Definition: uniformInletOutletFvPatchField.H:189
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::uniformInletOutletFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: uniformInletOutletFvPatchField.H:156
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::mixedFvPatchField
This boundary condition provides a base class for 'mixed' type boundary conditions,...
Definition: mixedFvPatchField.H:123
Foam::uniformInletOutletFvPatchField::TypeName
TypeName("uniformInletOutlet")
Runtime type information.
Foam::uniformInletOutletFvPatchField
Variant of inletOutlet boundary condition with uniform inletValue.
Definition: uniformInletOutletFvPatchField.H:100
Foam::uniformInletOutletFvPatchField::phiName_
word phiName_
Name of flux field.
Definition: uniformInletOutletFvPatchField.H:110
Foam::uniformInletOutletFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: uniformInletOutletFvPatchField.C:193
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< label >
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::uniformInletOutletFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: uniformInletOutletFvPatchField.C:142
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54