Loading...
Searching...
No Matches
SRFVelocityFvPatchVectorField.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) 2020 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::SRFVelocityFvPatchVectorField
29
30Group
31 grpInletBoundaryConditions grpWallBoundaryConditions
32
33Description
34 Velocity condition to be used in conjunction with the single
35 rotating frame (SRF) model (see: SRFModel class)
36
37 Given the free stream velocity in the absolute frame, the condition
38 applies the appropriate rotation transformation in time and space to
39 determine the local velocity.
40
41 The optional \c relative flag switches the behaviour of the patch
42 such that:
43
44 - relative = yes: inlet velocity applied 'as is':
45
46 \f[
47 U_p = U_{in}
48 \f]
49
50 - relative = no : SRF velocity is subtracted from the inlet velocity:
51
52 \f[
53 U_p = U_{in} - U_{p,srf}
54 \f]
55
56 where
57 \vartable
58 U_p | patch velocity [m/s]
59 U_{in} | user-specified inlet velocity
60 U_{p,srf} | SRF velocity
61 \endvartable
62
63Usage
64 \table
65 Property | Description | Required | Default value
66 inletValue | inlet velocity | yes |
67 relative | inletValue relative motion to the SRF? | yes |
68 \endtable
69
70 Example of the boundary condition specification:
71 \verbatim
72 <patchName>
73 {
74 type SRFVelocity;
75 inletValue uniform (0 0 0);
76 relative yes;
77 value uniform (0 0 0); // initial value
78 }
79 \endverbatim
80
81See also
82 Foam::fixedValueFvPatchField
83
84SourceFiles
85 SRFVelocityFvPatchVectorField.C
86
87\*---------------------------------------------------------------------------*/
88
89#ifndef SRFVelocityFvPatchVectorField_H
90#define SRFVelocityFvPatchVectorField_H
91
92#include "fvPatchFields.H"
94#include "Switch.H"
95
96// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
97
98namespace Foam
99{
100
101/*---------------------------------------------------------------------------*\
102 Class SRFVelocityFvPatchVectorField Declaration
103\*---------------------------------------------------------------------------*/
104
106:
107 public fixedValueFvPatchVectorField
108{
109 // Private data
110
111 //- Is the supplied inlet value relative to the SRF
112 Switch relative_;
113
114 //- Inlet value [m/s]
115 vectorField inletValue_;
116
117
118public:
119
120 //- Runtime type information
121 TypeName("SRFVelocity");
122
123
124 // Constructors
125
126 //- Construct from patch and internal field
128 (
129 const fvPatch&,
131 );
132
133 //- Construct from patch, internal field and dictionary
135 (
136 const fvPatch&,
138 const dictionary&
139 );
140
141 //- Construct by mapping given SRFVelocityFvPatchVectorField
142 // onto a new patch
144 (
146 const fvPatch&,
148 const fvPatchFieldMapper&
149 );
150
151 //- Construct as copy
153 (
155 );
156
157 //- Construct as copy setting internal field reference
159 (
162 );
163
164 //- Return a clone
165 virtual tmp<fvPatchField<vector>> clone() const
166 {
167 return fvPatchField<vector>::Clone(*this);
168 }
169
170 //- Clone with an internal field reference
172 (
174 ) const
175 {
176 return fvPatchField<vector>::Clone(*this, iF);
177 }
178
179
180 // Member functions
181
182 // Access
183
184 //- Is supplied inlet value relative to the SRF?
185 bool relative() const
186 {
187 return relative_;
188 }
189
190
191 // Mapping functions
192
193 //- Map (and resize as needed) from self given a mapping object
194 virtual void autoMap
195 (
196 const fvPatchFieldMapper&
197 );
198
199 //- Reverse map the given fvPatchField onto this fvPatchField
200 virtual void rmap
201 (
202 const fvPatchVectorField&,
203 const labelList&
204 );
205
207 // Evaluation functions
208
209 //- Update the coefficients associated with the patch field
210 virtual void updateCoeffs();
211
212
213 // I-O
215 //- Write
216 virtual void write(Ostream&) const;
217};
218
219
220// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221
222} // End namespace Foam
223
224// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225
226#endif
227
228// ************************************************************************* //
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
Velocity condition to be used in conjunction with the single rotating frame (SRF) model (see: SRFMode...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
SRFVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("SRFVelocity")
Runtime type information.
virtual tmp< fvPatchField< vector > > clone(const DimensionedField< vector, volMesh > &iF) const
Clone with an internal field reference.
bool relative() const
Is supplied inlet value relative to the SRF?
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
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Field< vector > vectorField
Specialisation of Field<T> for vector.
fvPatchField< vector > fvPatchVectorField
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68