SRFFreestreamVelocityFvPatchVectorField.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-2018 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::SRFFreestreamVelocityFvPatchVectorField
26 
27 Description
28  Freestream velocity condition to be used in conjunction with the single
29  rotating frame (SRF) model (see: SRFModel class)
30 
31  Given the free stream velocity in the absolute frame, the condition
32  applies the appropriate rotation transformation in time and space to
33  determine the local velocity using:
34 
35  \f[
36  U_p = cos(\theta)*U_{Inf} + sin(theta) (n^UInf) - U_{p,srf}
37  \f]
38 
39  where
40  \vartable
41  U_p = patch velocity [m/s]
42  U_{Inf} = free stream velocity in the absolute frame [m/s]
43  theta = swept angle [rad]
44  n = axis direction of the SRF
45  U_{p,srf} = SRF velocity of the patch
46  \endvartable
47 
48 
49 Usage
50  \table
51  Property | Description | Required | Default value
52  UInf | freestream velocity | yes |
53  relative | UInf relative to the SRF? | no |
54  \endtable
55 
56  Example of the boundary condition specification:
57  \verbatim
58  <patchName>
59  {
60  type SRFFreestreamVelocity;
61  UInf uniform (0 0 0);
62  relative no;
63  value uniform (0 0 0); // initial value
64  }
65  \endverbatim
66 
67 See also
68  Foam::freestreamFvPatchField
69  Foam::SRFVelocityFvPatchVectorField
70 
71 SourceFiles
72  SRFFreestreamVelocityFvPatchVectorField.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef SRFFreestreamVelocityFvPatchVectorField_H
77 #define SRFFreestreamVelocityFvPatchVectorField_H
78 
80 #include "Switch.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 
87 /*---------------------------------------------------------------------------*\
88  Class SRFFreestreamVelocityFvPatchVectorField Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 class SRFFreestreamVelocityFvPatchVectorField
92 :
93  public inletOutletFvPatchVectorField
94 {
95  // Private data
96 
97  //- Is the supplied inlet value relative to the SRF
98  Switch relative_;
99 
100  //- Velocity of the free stream in the absolute frame [m/s]
101  vector UInf_;
102 
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("SRFFreestreamVelocity");
108 
109 
110  // Constructors
111 
112  //- Construct from patch and internal field
114  (
115  const fvPatch&,
116  const DimensionedField<vector, volMesh>&
117  );
118 
119  //- Construct from patch, internal field and dictionary
121  (
122  const fvPatch&,
124  const dictionary&
125  );
126 
127  //- Construct by mapping given SRFFreestreamVelocityFvPatchVectorField
128  // onto a new patch
130  (
132  const fvPatch&,
134  const fvPatchFieldMapper&
135  );
136 
137  //- Construct as copy
139  (
141  );
142 
143  //- Construct and return a clone
144  virtual tmp<fvPatchVectorField> clone() const
145  {
147  (
149  );
150  }
151 
152  //- Construct as copy setting internal field reference
154  (
157  );
158 
159  //- Construct and return a clone setting internal field reference
161  (
163  ) const
164  {
166  (
168  );
169  }
170 
171 
172  // Member functions
174  // Access
175 
176  //- Return the velocity at infinity
177  const vector& UInf() const
178  {
179  return UInf_;
180  }
181 
182  //- Return reference to the velocity at infinity to allow adjustment
183  vector& UInf()
184  {
185  return UInf_;
186  }
187 
188 
189  // Evaluation functions
191  //- Update the coefficients associated with the patch field
192  virtual void updateCoeffs();
193 
194 
195  //- Write
196  virtual void write(Ostream&) const;
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 #endif
207 
208 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
Foam::fvPatchFieldMapper.
SRFFreestreamVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Freestream velocity condition to be used in conjunction with the single rotating frame (SRF) model (s...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
A class for managing temporary objects.
Definition: PtrList.H:53
const vector & UInf() const
Return the velocity at infinity.
TypeName("SRFFreestreamVelocity")
Runtime type information.
Namespace for OpenFOAM.