freestreamFvPatchField.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) 2011-2016 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::freestreamFvPatchField
26 
27 Group
28  grpInletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31  This boundary condition provides a free-stream condition. It is a 'mixed'
32  condition derived from the \c inletOutlet condition, whereby the mode of
33  operation switches between fixed (free stream) value and zero gradient
34  based on the sign of the flux.
35 
36 Usage
37  \table
38  Property | Description | Required | Default value
39  freestreamValue | freestream velocity | yes |
40  phi | flux field name | no | phi
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type freestream;
48  phi phi;
49  }
50  \endverbatim
51 
52 See also
53  Foam::mixedFvPatchField
54  Foam::inletOutletFvPatchField
55 
56 SourceFiles
57  freestreamFvPatchField.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef freestreamFvPatchField_H
62 #define freestreamFvPatchField_H
63 
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class freestreamFvPatchField Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 template<class Type>
76 class freestreamFvPatchField
77 :
78  public inletOutletFvPatchField<Type>
79 {
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("freestream");
85 
86 
87  // Constructors
88 
89  //- Construct from patch and internal field
91  (
92  const fvPatch&,
94  );
95 
96  //- Construct from patch, internal field and dictionary
98  (
99  const fvPatch&,
101  const dictionary&
102  );
103 
104  //- Construct by mapping given freestreamFvPatchField onto a new patch
106  (
108  const fvPatch&,
110  const fvPatchFieldMapper&
111  );
112 
113  //- Construct as copy
115  (
117  );
118 
119  //- Construct and return a clone
120  virtual tmp<fvPatchField<Type>> clone() const
121  {
122  return tmp<fvPatchField<Type>>
123  (
125  );
126  }
127 
128  //- Construct as copy setting internal field reference
130  (
133  );
135  //- Construct and return a clone setting internal field reference
137  (
139  ) const
140  {
141  return tmp<fvPatchField<Type>>
142  (
143  new freestreamFvPatchField<Type>(*this, iF)
144  );
145  }
146 
147 
148  // Member functions
149 
150  // Return defining fields
152  const Field<Type>& freestreamValue() const
153  {
154  return this->refValue();
155  }
156 
158  {
159  return this->refValue();
160  }
161 
162 
163  //- Write
164  virtual void write(Ostream&) const;
165 };
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #ifdef NoRepository
175  #include "freestreamFvPatchField.C"
176 #endif
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
This boundary condition provides a free-stream condition. It is a &#39;mixed&#39; condition derived from the ...
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual void write(Ostream &) const
Write.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
freestreamFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
const Field< Type > & freestreamValue() const
virtual Field< Type > & refValue()
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
TypeName("freestream")
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: PtrList.H:53
Namespace for OpenFOAM.