freestreamVelocityFvPatchVectorField.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) 2018 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::freestreamVelocityFvPatchVectorField
28 
29 Group
30  grpInletBoundaryConditions grpOutletBoundaryConditions
31 
32 Description
33  This boundary condition provides a free-stream condition for velocity.
34 
35  It is an inlet-outlet condition that uses the velocity orientation to
36  continuously blend between fixed value for normal inlet and zero gradient
37  for normal outlet flow.
38 
39 Usage
40  \table
41  Property | Description | Required | Default value
42  freestreamValue | freestream velocity | yes |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  type freestreamVelocity;
50  freestreamValue uniform (300 0 0);
51  }
52  \endverbatim
53 
54 Note
55  This condition is designed to operate with the freestreamPressure condition
56 
57 See also
58  Foam::mixedFvPatchField
59  Foam::freestreamFvPatchField
60 
61 SourceFiles
62  freestreamVelocityFvPatchVectorField.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef freestreamVelocityFvPatchVectorField_H
67 #define freestreamVelocityFvPatchVectorField_H
68 
69 #include "fvPatchFields.H"
70 #include "mixedFvPatchFields.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 /*---------------------------------------------------------------------------*\
78  Class freestreamVelocityFvPatchVectorField Declaration
79 \*---------------------------------------------------------------------------*/
80 
81 class freestreamVelocityFvPatchVectorField
82 :
83  public mixedFvPatchVectorField
84 {
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("freestreamVelocity");
90 
91 
92  // Constructors
93 
94  //- Construct from patch and internal field
96  (
97  const fvPatch&,
99  );
100 
101  //- Construct from patch, internal field and dictionary
103  (
104  const fvPatch&,
106  const dictionary&
107  );
108 
109  //- Construct by mapping given freestreamVelocityFvPatchVectorField onto
110  // a new patch
112  (
114  const fvPatch&,
116  const fvPatchFieldMapper&
117  );
118 
119  //- Construct as copy
121  (
123  );
124 
125  //- Construct and return a clone
126  virtual tmp<fvPatchVectorField> clone() const
127  {
129  (
131  );
132  }
133 
134  //- Construct as copy setting internal field reference
136  (
139  );
140 
141  //- Construct and return a clone setting internal field reference
143  (
145  ) const
146  {
148  (
150  );
151  }
152 
153 
154  // Member Functions
155 
156  //- Same as refValue()
157  const vectorField& freestreamValue() const { return refValue(); }
158 
159  //- Same as refValue()
160  vectorField& freestreamValue() { return refValue(); }
161 
162 
163  //- Update the coefficients associated with the patch field
164  virtual void updateCoeffs();
166  //- Write
167  virtual void write(Ostream&) const;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const vectorField & freestreamValue() const
Same as refValue()
A FieldMapper for finite-volume patch fields.
This boundary condition provides a free-stream condition for velocity.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
TypeName("freestreamVelocity")
Runtime type information.
virtual tmp< fvPatchVectorField > 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
freestreamVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Field< vector > vectorField
Specialisation of Field<T> for vector.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.