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-2015 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  );
154 
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 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #ifdef NoRepository
207 #endif
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
Foam::fvPatchField< Type >
Foam::uniformInletOutletFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &pvf)
Definition: uniformInletOutletFvPatchField.C:206
Foam::uniformInletOutletFvPatchField::uniformInletValue_
autoPtr< DataEntry< Type > > uniformInletValue_
Value.
Definition: uniformInletOutletFvPatchField.H:111
Foam::uniformInletOutletFvPatchField::uniformInletOutletFvPatchField
uniformInletOutletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: uniformInletOutletFvPatchField.C:32
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::uniformInletOutletFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: uniformInletOutletFvPatchField.C:175
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
uniformInletOutletFvPatchField.C
mixedFvPatchField.H
Foam::uniformInletOutletFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: uniformInletOutletFvPatchField.C:159
DataEntry.H
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::uniformInletOutletFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: uniformInletOutletFvPatchField.H:154
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::mixedFvPatchField
This boundary condition provides a base class for 'mixed' type boundary conditions,...
Definition: mixedFvPatchField.H:126
Foam::uniformInletOutletFvPatchField::TypeName
TypeName("uniformInletOutlet")
Runtime type information.
Foam::uniformInletOutletFvPatchField
Variant of inletOutlet boundary condition with uniform inletValue.
Definition: uniformInletOutletFvPatchField.H:98
Foam::uniformInletOutletFvPatchField::phiName_
word phiName_
Name of flux field.
Definition: uniformInletOutletFvPatchField.H:108
Foam::uniformInletOutletFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: uniformInletOutletFvPatchField.C:189
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::uniformInletOutletFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: uniformInletOutletFvPatchField.C:135
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51