All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
freestreamFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 Description
28  This boundary condition provides a free-stream condition. It is a 'mixed'
29  condition derived from the \c inletOutlet condition, whereby the mode of
30  operation switches between fixed (free stream) value and zero gradient
31  based on the sign of the flux.
32 
33 Usage
34  \table
35  Property | Description | Required | Default value
36  freestreamValue | freestream velocity | yes |
37  phi | flux field name | no | phi
38  \endtable
39 
40  Example of the boundary condition specification:
41  \verbatim
42  <patchName>
43  {
44  type freestream;
45  freestreamValue uniform (300 0 0);
46  }
47  \endverbatim
48 
49 See also
50  Foam::mixedFvPatchField
51  Foam::inletOutletFvPatchField
52 
53 SourceFiles
54  freestreamFvPatchField.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef freestreamFvPatchField_H
59 #define freestreamFvPatchField_H
60 
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class freestreamFvPatchField Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 template<class Type>
73 class freestreamFvPatchField
74 :
75  public inletOutletFvPatchField<Type>
76 {
77 
78 public:
79 
80  //- Runtime type information
81  TypeName("freestream");
82 
83 
84  // Constructors
85 
86  //- Construct from patch and internal field
88  (
89  const fvPatch&,
91  );
92 
93  //- Construct from patch, internal field and dictionary
95  (
96  const fvPatch&,
98  const dictionary&
99  );
100 
101  //- Construct by mapping given freestreamFvPatchField onto a new patch
103  (
105  const fvPatch&,
107  const fvPatchFieldMapper&
108  );
109 
110  //- Copy constructor
112  (
114  );
115 
116  //- Construct and return a clone
117  virtual tmp<fvPatchField<Type>> clone() const
118  {
119  return tmp<fvPatchField<Type>>
120  (
122  );
123  }
124 
125  //- Copy constructor setting internal field reference
127  (
130  );
132  //- Construct and return a clone setting internal field reference
134  (
136  ) const
137  {
138  return tmp<fvPatchField<Type>>
139  (
140  new freestreamFvPatchField<Type>(*this, iF)
141  );
142  }
143 
144 
145  // Member Functions
146 
147  // Return defining fields
149  const Field<Type>& freestreamValue() const
150  {
151  return this->refValue();
152  }
153 
155  {
156  return this->refValue();
157  }
158 
159 
160  //- Write
161  virtual void write(Ostream&) const;
162 };
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #ifdef NoRepository
172  #include "freestreamFvPatchField.C"
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
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:158
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:56
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
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.