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 as copy setting internal field reference
127  (
130  );
131 
132  //- Return a clone
133  virtual tmp<fvPatchField<vector>> clone() const
134  {
135  return fvPatchField<vector>::Clone(*this);
136  }
137 
138  //- Clone with an internal field reference
140  (
142  ) const
143  {
144  return fvPatchField<vector>::Clone(*this, iF);
145  }
146 
147 
148  // Member Functions
149 
150  //- Same as refValue()
151  const vectorField& freestreamValue() const { return refValue(); }
152 
153  //- Same as refValue()
154  vectorField& freestreamValue() { return refValue(); }
155 
156 
157  //- Update the coefficients associated with the patch field
158  virtual void updateCoeffs();
159 
160  //- Write
161  virtual void write(Ostream&) const;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
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()
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
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.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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.
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.