FreeFOAM The Cross-Platform CFD Toolkit
rotatingPressureInletOutletVelocityFvPatchVectorField.C
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) 1991-2010 OpenCFD Ltd.
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 \*---------------------------------------------------------------------------*/
25 
28 #include <finiteVolume/volFields.H>
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 
36 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
37 
38 void rotatingPressureInletOutletVelocityFvPatchVectorField::
39 calcTangentialVelocity()
40 {
41  vector axisHat = omega_/mag(omega_);
43  (-omega_) ^ (patch().Cf() - axisHat*(axisHat & patch().Cf()));
44 
45  vectorField n = patch().nf();
46  refValue() = tangentialVelocity - n*(n & tangentialVelocity);
47 }
48 
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
54 (
55  const fvPatch& p,
57 )
58 :
60  omega_(vector::zero)
61 {}
62 
63 
66 (
68  const fvPatch& p,
70  const fvPatchFieldMapper& mapper
71 )
72 :
74  omega_(ptf.omega_)
75 {
76  calcTangentialVelocity();
77 }
78 
79 
82 (
83  const fvPatch& p,
85  const dictionary& dict
86 )
87 :
89  omega_(dict.lookup("omega"))
90 {
91  calcTangentialVelocity();
92 }
93 
94 
97 (
99 )
100 :
102  omega_(pivpvf.omega_)
103 {
104  calcTangentialVelocity();
105 }
106 
107 
110 (
113 )
114 :
116  omega_(pivpvf.omega_)
117 {
118  calcTangentialVelocity();
119 }
120 
121 
122 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
123 
125 write(Ostream& os) const
126 {
128  os.writeKeyword("phi") << phiName() << token::END_STATEMENT << nl;
129  os.writeKeyword("omega")<< omega_ << token::END_STATEMENT << nl;
130  writeEntry("value", os);
131 }
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
137 (
140 );
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // ************************ vim: set sw=4 sts=4 et: ************************ //