inletOutletFaPatchField.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) 2016-2017 Wikki Ltd
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::inletOutletFaPatchField
29 
30 Group
31  grpOutletBoundaryConditions
32 
33 Description
34  This boundary condition provides a generic outflow condition, with
35  specified inflow for the case of return flow.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  phi | Flux field name | no | phi
41  inletValue | Inlet value for reverse flow | yes |
42  value | initial field value | optional |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  type inletOutlet;
50  phi phi;
51  inletValue uniform 0;
52  value uniform 0;
53  }
54  \endverbatim
55 
56  The mode of operation is determined by the sign of the flux across the
57  patch edges.
58 
59 Note
60  Sign conventions:
61  - Positive flux (out of domain): apply zero-gradient condition
62  - Negative flux (into domain): apply the "inletValue" fixed-value
63 
64 See also
65  Foam::mixedFaPatchField
66  Foam::zeroGradientFaPatchField
67  Foam::outletInletFaPatchField
68 
69 SourceFiles
70  inletOutletFaPatchField.C
71 
72 \*---------------------------------------------------------------------------*/
73 
74 #ifndef Foam_inletOutletFaPatchField_H
75 #define Foam_inletOutletFaPatchField_H
76 
77 #include "mixedFaPatchField.H"
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81 namespace Foam
82 {
83 
84 /*---------------------------------------------------------------------------*\
85  Class inletOutletFaPatchField Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 template<class Type>
89 class inletOutletFaPatchField
90 :
91  public mixedFaPatchField<Type>
92 {
93 protected:
94 
95  // Protected Data
96 
97  //- Name of flux field
98  word phiName_;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("inletOutlet");
105 
106 
107  // Constructors
108 
109  //- Construct from patch and internal field
111  (
112  const faPatch&,
114  );
116  //- Construct from patch, internal field and dictionary
118  (
119  const faPatch&,
121  const dictionary&
122  );
123 
124  //- Construct by mapping given inletOutletFaPatchField onto a new patch
126  (
128  const faPatch&,
130  const faPatchFieldMapper&
131  );
132 
133  //- Construct as copy
135  (
137  );
138 
139  //- Construct and return a clone
140  virtual tmp<faPatchField<Type>> clone() const
141  {
142  return tmp<faPatchField<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
157  (
159  ) const
160  {
161  return tmp<faPatchField<Type>>
162  (
163  new inletOutletFaPatchField<Type>(*this, iF)
164  );
165  }
166 
167 
168  //- Destructor
169  virtual ~inletOutletFaPatchField() = default;
170 
171 
172  // Member Functions
173 
174  //- Update the coefficients associated with the patch field
175  virtual void updateCoeffs();
176 
177  //- Write
178  virtual void write(Ostream&) const;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #ifdef NoRepository
189  #include "inletOutletFaPatchField.C"
190 #endif
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
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
This boundary condition provides a generic outflow condition, with specified inflow for the case of r...
virtual ~inletOutletFaPatchField()=default
Destructor.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("inletOutlet")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:72
virtual tmp< faPatchField< Type > > clone() const
Construct and return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
inletOutletFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A FieldMapper for finite-area patch fields.
Namespace for OpenFOAM.