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  const vectorField& freestreamValue() const
157  {
158  return refValue();
159  }
160 
162  {
163  return refValue();
164  }
165 
166 
167  // Evaluation functions
168 
169  //- Update the coefficients associated with the patch field
170  virtual void updateCoeffs();
171 
172 
173  //- Write
174  virtual void write(Ostream&) const;
175 };
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::freestreamVelocityFvPatchVectorField::freestreamValue
vectorField & freestreamValue()
Definition: freestreamVelocityFvPatchVectorField.H:170
Foam::freestreamVelocityFvPatchVectorField::TypeName
TypeName("freestreamVelocity")
Runtime type information.
Foam::freestreamVelocityFvPatchVectorField::freestreamVelocityFvPatchVectorField
freestreamVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: freestreamVelocityFvPatchVectorField.C:34
Foam::Field< vector >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::freestreamVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: freestreamVelocityFvPatchVectorField.H:135
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::freestreamVelocityFvPatchVectorField::freestreamValue
const vectorField & freestreamValue() const
Definition: freestreamVelocityFvPatchVectorField.H:165
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedFvPatchFields.H
Foam::freestreamVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: freestreamVelocityFvPatchVectorField.C:119
Foam::freestreamVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: freestreamVelocityFvPatchVectorField.C:104
fvPatchFields.H
Foam::freestreamVelocityFvPatchVectorField
This boundary condition provides a free-stream condition for velocity.
Definition: freestreamVelocityFvPatchVectorField.H:90
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54