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 | Copyright (C) 2011-2013 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::SRFVelocityFvPatchVectorField
26 
27 Group
28  grpInletBoundaryConditions grpWallBoundaryConditions
29 
30 Description
31  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.
37 
38  The optional \c relative flag switches the behaviour of the patch
39  such that:
40 
41  - relative = yes: inlet velocity applied 'as is':
42 
43  \f[
44  U_p = U_{in}
45  \f]
46 
47  - relative = no : SRF velocity is subtracted from the inlet velocity:
48 
49  \f[
50  U_p = U_{in} - U_{p,srf}
51  \f]
52 
53  where
54  \vartable
55  U_p | patch velocity [m/s]
56  U_{in} | user-specified inlet velocity
57  U_{p,srf} | SRF velocity
58  \endvartable
59 
60 
61  \heading Patch usage
62 
63  \table
64  Property | Description | Required | Default value
65  inletValue | inlet velocity | yes |
66  relative | inletValue relative motion to the SRF? | yes |
67  \endtable
68 
69  Example of the boundary condition specification:
70  \verbatim
71  myPatch
72  {
73  type SRFVelocity;
74  inletValue uniform (0 0 0);
75  relative yes;
76  value uniform (0 0 0); // initial value
77  }
78  \endverbatim
79 
80 SeeAlso
81  Foam::fixedValueFvPatchField
82 
83 SourceFiles
84  SRFVelocityFvPatchVectorField.C
85 
86 \*---------------------------------------------------------------------------*/
87 
88 #ifndef SRFVelocityFvPatchVectorField_H
89 #define SRFVelocityFvPatchVectorField_H
90 
91 #include "fvPatchFields.H"
93 #include "Switch.H"
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 namespace Foam
98 {
99 
100 /*---------------------------------------------------------------------------*\
101  Class SRFVelocityFvPatchVectorField Declaration
102 \*---------------------------------------------------------------------------*/
103 
104 class SRFVelocityFvPatchVectorField
105 :
106  public fixedValueFvPatchVectorField
107 {
108  // Private data
109 
110  //- Is the supplied inlet value relative to the SRF
111  Switch relative_;
112 
113  //- Inlet value [m/s]
115 
116 
117 public:
118 
119  //- Runtime type information
120  TypeName("SRFVelocity");
121 
122 
123  // Constructors
124 
125  //- Construct from patch and internal field
127  (
128  const fvPatch&,
129  const DimensionedField<vector, volMesh>&
130  );
131 
132  //- Construct from patch, internal field and dictionary
134  (
135  const fvPatch&,
137  const dictionary&
138  );
139 
140  //- Construct by mapping given SRFVelocityFvPatchVectorField
141  // onto a new patch
143  (
145  const fvPatch&,
147  const fvPatchFieldMapper&
148  );
149 
150  //- Construct as copy
152  (
154  );
155 
156  //- Construct and return a clone
157  virtual tmp<fvPatchVectorField> clone() const
158  {
160  (
162  );
163  }
164 
165  //- Construct as copy setting internal field reference
167  (
170  );
171 
172  //- Construct and return a clone setting internal field reference
174  (
176  ) const
177  {
179  (
180  new SRFVelocityFvPatchVectorField(*this, iF)
181  );
182  }
183 
184 
185  // Member functions
186 
187  // Access
188 
189  //- Return const access to the relative flag
190  const Switch& relative() const
191  {
192  return relative_;
193  }
194 
195 
196  // Mapping functions
197 
198  //- Map (and resize as needed) from self given a mapping object
199  virtual void autoMap
200  (
201  const fvPatchFieldMapper&
202  );
203 
204  //- Reverse map the given fvPatchField onto this fvPatchField
205  virtual void rmap
206  (
207  const fvPatchVectorField&,
208  const labelList&
209  );
210 
211 
212  // Evaluation functions
213 
214  //- Update the coefficients associated with the patch field
215  virtual void updateCoeffs();
216 
217 
218  // I-O
219 
220  //- Write
221  virtual void write(Ostream&) const;
222 };
223 
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 } // End namespace Foam
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #endif
232 
233 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField
SRFVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: SRFVelocityFvPatchVectorField.C:35
Foam::SRFVelocityFvPatchVectorField::TypeName
TypeName("SRFVelocity")
Runtime type information.
Foam::SRFVelocityFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: SRFVelocityFvPatchVectorField.C:111
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::SRFVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: SRFVelocityFvPatchVectorField.C:125
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:49
Foam::SRFVelocityFvPatchVectorField::inletValue_
vectorField inletValue_
Inlet value [m/s].
Definition: SRFVelocityFvPatchVectorField.H:140
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::SRFVelocityFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: SRFVelocityFvPatchVectorField.C:101
Switch.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::SRFVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: SRFVelocityFvPatchVectorField.H:183
fvPatchFields.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::SRFVelocityFvPatchVectorField::relative_
Switch relative_
Is the supplied inlet value relative to the SRF.
Definition: SRFVelocityFvPatchVectorField.H:137
Foam::SRFVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: SRFVelocityFvPatchVectorField.C:155
fixedValueFvPatchFields.H
Foam::SRFVelocityFvPatchVectorField
Velocity condition to be used in conjunction with the single rotating frame (SRF) model (see: SRFMode...
Definition: SRFVelocityFvPatchVectorField.H:130
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::SRFVelocityFvPatchVectorField::relative
const Switch & relative() const
Return const access to the relative flag.
Definition: SRFVelocityFvPatchVectorField.H:216