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-2020 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  //- Disallow copy without setting internal field reference
112  (
114  ) = delete;
115 
116  //- Copy constructor setting internal field reference
118  (
121  );
122 
123  //- Construct and return a clone setting internal field reference
125  (
127  ) const
128  {
129  return tmp<fvPatchField<Type>>
130  (
131  new freestreamFvPatchField<Type>(*this, iF)
132  );
133  }
134 
135 
136  // Member Functions
137 
138  // Return defining fields
140  const Field<Type>& freestreamValue() const
141  {
142  return this->refValue();
143  }
144 
146  {
147  return this->refValue();
148  }
149 
150 
151  //- Write
152  virtual void write(Ostream&) const;
153 };
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #ifdef NoRepository
163  #include "freestreamFvPatchField.C"
164 #endif
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
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:156
virtual void write(Ostream &) const
Write.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
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
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
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
Namespace for OpenFOAM.