Loading...
Searching...
No Matches
SRFFreestreamVelocityFvPatchVectorField.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2015 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::SRFFreestreamVelocityFvPatchVectorField
29
30Description
31 Freestream velocity condition to be used in conjunction with the single
32 rotating frame (SRF) model (see: SRFModel class)
33
34 Given the free stream velocity in the absolute frame, the condition
35 applies the appropriate rotation transformation in time and space to
36 determine the local velocity using:
37
38 \f[
39 U_p = cos(\theta) U_{Inf} + sin(\theta) (n \times U_{Inf}) - U_{p,srf}
40 \f]
41
42 where
43 \vartable
44 U_p | patch velocity [m/s]
45 U_{Inf} | free stream velocity in the absolute frame [m/s]
46 \theta | swept angle [rad]
47 n | axis direction of the SRF
48 U_{p,srf} | SRF velocity of the patch [m/s]
49 \endvartable
50
51
52Usage
53 \table
54 Property | Description | Required | Default value
55 UInf | freestream velocity | yes |
56 relative | UInf relative to the SRF? | no |
57 \endtable
58
59 Example of the boundary condition specification:
60 \verbatim
61 <patchName>
62 {
63 type SRFFreestreamVelocity;
64 UInf uniform (0 0 0);
65 relative no;
66 value uniform (0 0 0); // initial value
67 }
68 \endverbatim
69
70See also
71 Foam::freestreamFvPatchField
72 Foam::SRFVelocityFvPatchVectorField
73
74SourceFiles
75 SRFFreestreamVelocityFvPatchVectorField.C
76
77\*---------------------------------------------------------------------------*/
78
79#ifndef SRFFreestreamVelocityFvPatchVectorField_H
80#define SRFFreestreamVelocityFvPatchVectorField_H
81
83#include "Switch.H"
84
85// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86
87namespace Foam
88{
89
90/*---------------------------------------------------------------------------*\
91 Class SRFFreestreamVelocityFvPatchVectorField Declaration
92\*---------------------------------------------------------------------------*/
93
95:
96 public inletOutletFvPatchVectorField
97{
98 // Private data
99
100 //- Is the supplied inlet value relative to the SRF
101 Switch relative_;
102
103 //- Velocity of the free stream in the absolute frame [m/s]
104 vector UInf_;
105
106
107public:
108
109 //- Runtime type information
110 TypeName("SRFFreestreamVelocity");
111
112
113 // Constructors
114
115 //- Construct from patch and internal field
117 (
118 const fvPatch&,
119 const DimensionedField<vector, volMesh>&
120 );
121
122 //- Construct from patch, internal field and dictionary
125 const fvPatch&,
127 const dictionary&
128 );
129
130 //- Construct by mapping given SRFFreestreamVelocityFvPatchVectorField
131 // onto a new patch
133 (
135 const fvPatch&,
137 const fvPatchFieldMapper&
138 );
139
140 //- Construct as copy
142 (
144 );
145
146 //- Construct as copy setting internal field reference
148 (
151 );
152
153 //- Return a clone
154 virtual tmp<fvPatchField<vector>> clone() const
155 {
156 return fvPatchField<vector>::Clone(*this);
157 }
158
159 //- Clone with an internal field reference
161 (
163 ) const
164 {
165 return fvPatchField<vector>::Clone(*this, iF);
166 }
167
168
169 // Member functions
170
171 // Access
172
173 //- Return the velocity at infinity
174 const vector& UInf() const
175 {
176 return UInf_;
177 }
178
179 //- Return reference to the velocity at infinity to allow adjustment
180 vector& UInf()
181 {
182 return UInf_;
183 }
184
185
186 // Evaluation functions
187
188 //- Update the coefficients associated with the patch field
189 virtual void updateCoeffs();
190
191
192 //- Write
193 virtual void write(Ostream&) const;
194};
195
196
197// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198
199} // End namespace Foam
200
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203#endif
204
205// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Freestream velocity condition to be used in conjunction with the single rotating frame (SRF) model (s...
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
vector & UInf()
Return reference to the velocity at infinity to allow adjustment.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchField< vector > > clone(const DimensionedField< vector, volMesh > &iF) const
Clone with an internal field reference.
const vector & UInf() const
Return the velocity at infinity.
SRFFreestreamVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
TypeName("SRFFreestreamVelocity")
Runtime type information.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition Switch.H:81
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Namespace for OpenFOAM.
Vector< scalar > vector
Definition vector.H:57
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68