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  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type inletOutlet;
48  phi phi;
49  inletValue uniform 0;
50  value uniform 0;
51  }
52  \endverbatim
53 
54  The mode of operation is determined by the sign of the flux across the
55  patch faces.
56 
57 Note
58  Sign conventions:
59  - Positive flux (out of domain): apply zero-gradient condition
60  - Negative flux (into of domain): apply the "inletValue" fixed-value
61 
62 See also
63  Foam::mixedFvPatchField
64  Foam::zeroGradientFvPatchField
65  Foam::outletInletFvPatchField
66 
67 SourceFiles
68  inletOutletFvPatchField.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef inletOutletFvPatchField_H
73 #define inletOutletFvPatchField_H
74 
75 #include "mixedFvPatchField.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class inletOutletFvPatchField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 template<class Type>
87 class inletOutletFvPatchField
88 :
89  public mixedFvPatchField<Type>
90 {
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  );
114 
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 and return a clone
139  virtual tmp<fvPatchField<Type>> clone() const
140  {
141  return tmp<fvPatchField<Type>>
142  (
144  );
145  }
146 
147  //- Construct as copy setting internal field reference
149  (
152  );
153 
154  //- Construct and return a clone setting internal field reference
156  (
158  ) const
159  {
160  return tmp<fvPatchField<Type>>
161  (
162  new inletOutletFvPatchField<Type>(*this, iF)
163  );
164  }
165 
166 
167  // Member functions
168 
169  // Attributes
170 
171  //- Return true: this patch field is altered by assignment
172  virtual bool assignable() const
173  {
174  return true;
175  }
176 
177 
178  //- Update the coefficients associated with the patch field
179  virtual void updateCoeffs();
180 
181  //- Write
182  virtual void write(Ostream&) const;
183 
184 
185  // Member operators
186 
187  virtual void operator=(const fvPatchField<Type>& pvf);
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #ifdef NoRepository
198  #include "inletOutletFvPatchField.C"
199 #endif
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
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::inletOutletFvPatchField::assignable
virtual bool assignable() const
Return true: this patch field is altered by assignment.
Definition: inletOutletFvPatchField.H:186
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::inletOutletFvPatchField::operator=
virtual void operator=(const fvPatchField< Type > &pvf)
Definition: inletOutletFvPatchField.C:154
Foam::inletOutletFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: inletOutletFvPatchField.H:153
mixedFvPatchField.H
Foam::inletOutletFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: inletOutletFvPatchField.C:141
inletOutletFvPatchField.C
Foam::inletOutletFvPatchField::phiName_
word phiName_
Name of flux field.
Definition: inletOutletFvPatchField.H:111
Foam::inletOutletFvPatchField
This boundary condition provides a generic outflow condition, with specified inflow for the case of r...
Definition: inletOutletFvPatchField.H:101
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
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::inletOutletFvPatchField::inletOutletFvPatchField
inletOutletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: inletOutletFvPatchField.C:35
Foam::inletOutletFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: inletOutletFvPatchField.C:121
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::inletOutletFvPatchField::TypeName
TypeName("inletOutlet")
Runtime type information.
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54