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 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  \heading Patch usage
34 
35  \table
36  Property | Description | Required | Default value
37  phi | flux field name | no | phi
38  uniformInletValue | inlet value for reverse flow | yes |
39  \endtable
40 
41  Example of the boundary condition specification:
42  \verbatim
43  myPatch
44  {
45  type uniformInletOutlet;
46  phi phi;
47  uniformInletValue 0;
48  value uniform 0;
49  }
50  \endverbatim
51 
52  The mode of operation is determined by the sign of the flux across the
53  patch faces.
54 
55 Note
56  Sign conventions:
57  - positive flux (out of domain): apply zero-gradient condition
58  - negative flux (into of domain): apply the user-specified fixed value
59 
60 SeeAlso
61  Foam::inletOutletFvPatchField
62 
63 SourceFiles
64  uniformInletOutletFvPatchField.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef uniformInletOutletFvPatchField_H
69 #define uniformInletOutletFvPatchField_H
70 
71 #include "mixedFvPatchField.H"
72 #include "DataEntry.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<DataEntry<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
156  virtual tmp<fvPatchField<Type> > clone
157  (
159  ) const
160  {
161  return tmp<fvPatchField<Type> >
162  (
164  );
165  }
166 
167 
168  // Mapping functions
169 
170  //- Map (and resize as needed) from self given a mapping object
171  virtual void autoMap
172  (
173  const fvPatchFieldMapper&
174  );
175 
176  //- Reverse map the given fvPatchField onto this fvPatchField
177  virtual void rmap
178  (
179  const fvPatchField<Type>&,
180  const labelList&
181  );
182 
183 
184  // Member functions
185 
186  //- Update the coefficients associated with the patch field
187  virtual void updateCoeffs();
188 
189  //- Write
190  virtual void write(Ostream&) const;
191 
192 
193  // Member operators
194 
195  virtual void operator=(const fvPatchField<Type>& pvf);
196 
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 autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Variant of inletOutlet boundary condition with uniform inletValue.
autoPtr< DataEntry< Type > > uniformInletValue_
Value.
virtual void write(Ostream &) const
Write.
virtual void operator=(const fvPatchField< Type > &pvf)
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Namespace for OpenFOAM.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
TypeName("uniformInletOutlet")
Runtime type information.
A class for managing temporary objects.
Definition: PtrList.H:118
uniformInletOutletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.