inletOutletFvPatchField.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) 2011-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::inletOutletFvPatchField
28 
29 Group
30  grpOutletBoundaryConditions
31 
32 Description
33  This boundary condition provides a generic outflow condition, with
34  specified inflow for the case of return flow.
35 
36 Usage
37  \table
38  Property | Description | Required | Default value
39  phi | Flux field name | no | phi
40  inletValue | Inlet value for reverse flow | yes |
41  value | initial field value | optional |
42  \endtable
43 
44  Example of the boundary condition specification:
45  \verbatim
46  <patchName>
47  {
48  type inletOutlet;
49  phi phi;
50  inletValue uniform 0;
51  value uniform 0;
52  }
53  \endverbatim
54 
55  The mode of operation is determined by the sign of the flux across the
56  patch faces.
57 
58 Note
59  Sign conventions:
60  - Positive flux (out of domain): apply zero-gradient condition
61  - Negative flux (into domain): apply the "inletValue" fixed-value
62 
63 See also
64  Foam::mixedFvPatchField
65  Foam::zeroGradientFvPatchField
66  Foam::outletInletFvPatchField
67 
68 SourceFiles
69  inletOutletFvPatchField.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef Foam_inletOutletFvPatchField_H
74 #define Foam_inletOutletFvPatchField_H
75 
76 #include "mixedFvPatchField.H"
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class inletOutletFvPatchField Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 template<class Type>
88 class inletOutletFvPatchField
89 :
90  public mixedFvPatchField<Type>
91 {
92 protected:
93 
94  // Protected Data
95 
96  //- Name of flux field
97  word phiName_;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("inletOutlet");
104 
105 
106  // Constructors
107 
108  //- Construct from patch and internal field
110  (
111  const fvPatch&,
113  );
115  //- Construct from patch, internal field and dictionary
117  (
118  const fvPatch&,
120  const dictionary&
121  );
122 
123  //- Construct by mapping given inletOutletFvPatchField onto a new patch
125  (
127  const fvPatch&,
129  const fvPatchFieldMapper&
130  );
131 
132  //- Construct as copy
134  (
136  );
137 
138  //- Construct as copy setting internal field reference
140  (
143  );
144 
145  //- Return a clone
146  virtual tmp<fvPatchField<Type>> clone() const
147  {
148  return fvPatchField<Type>::Clone(*this);
149  }
150 
151  //- Clone with an internal field reference
153  (
155  ) const
156  {
157  return fvPatchField<Type>::Clone(*this, iF);
158  }
159 
160 
161  // Member functions
162 
163  //- True: this patch field is altered by assignment.
164  virtual bool assignable() const { return true; }
165 
166 
167  //- Update the coefficients associated with the patch field
168  virtual void updateCoeffs();
169 
170  //- Write
171  virtual void write(Ostream&) const;
172 
173 
174  // Member operators
175 
176  virtual void operator=(const fvPatchField<Type>& pvf);
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #ifdef NoRepository
187  #include "inletOutletFvPatchField.C"
188 #endif
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
virtual void write(Ostream &) const
Write.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual bool assignable() const
True: this patch field is altered by assignment.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual void operator=(const fvPatchField< Type > &pvf)
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A FieldMapper for finite-volume patch fields.
TypeName("inletOutlet")
Runtime type information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
inletOutletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.
This boundary condition provides a generic outflow condition, with specified inflow for the case of r...