Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
finiteVolume
fields
fvPatchFields
derived
rotatingPressureInletOutletVelocity
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
26
#include "
rotatingPressureInletOutletVelocityFvPatchVectorField.H
"
27
#include <
OpenFOAM/addToRunTimeSelectionTable.H
>
28
#include <
finiteVolume/volFields.H
>
29
#include <
finiteVolume/surfaceFields.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_);
42
vectorField
tangentialVelocity
=
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
52
rotatingPressureInletOutletVelocityFvPatchVectorField::
53
rotatingPressureInletOutletVelocityFvPatchVectorField
54
(
55
const
fvPatch
&
p
,
56
const
DimensionedField<vector, volMesh>
& iF
57
)
58
:
59
pressureInletOutletVelocityFvPatchVectorField
(p, iF),
60
omega_(
vector::zero
)
61
{}
62
63
64
rotatingPressureInletOutletVelocityFvPatchVectorField::
65
rotatingPressureInletOutletVelocityFvPatchVectorField
66
(
67
const
rotatingPressureInletOutletVelocityFvPatchVectorField
& ptf,
68
const
fvPatch
& p,
69
const
DimensionedField<vector, volMesh>
& iF,
70
const
fvPatchFieldMapper
& mapper
71
)
72
:
73
pressureInletOutletVelocityFvPatchVectorField
(ptf, p, iF, mapper),
74
omega_(ptf.omega_)
75
{
76
calcTangentialVelocity();
77
}
78
79
80
rotatingPressureInletOutletVelocityFvPatchVectorField::
81
rotatingPressureInletOutletVelocityFvPatchVectorField
82
(
83
const
fvPatch
& p,
84
const
DimensionedField<vector, volMesh>
& iF,
85
const
dictionary
& dict
86
)
87
:
88
pressureInletOutletVelocityFvPatchVectorField
(p, iF, dict),
89
omega_(dict.
lookup
(
"omega"
))
90
{
91
calcTangentialVelocity();
92
}
93
94
95
rotatingPressureInletOutletVelocityFvPatchVectorField::
96
rotatingPressureInletOutletVelocityFvPatchVectorField
97
(
98
const
rotatingPressureInletOutletVelocityFvPatchVectorField
& pivpvf
99
)
100
:
101
pressureInletOutletVelocityFvPatchVectorField
(pivpvf),
102
omega_(pivpvf.omega_)
103
{
104
calcTangentialVelocity();
105
}
106
107
108
rotatingPressureInletOutletVelocityFvPatchVectorField::
109
rotatingPressureInletOutletVelocityFvPatchVectorField
110
(
111
const
rotatingPressureInletOutletVelocityFvPatchVectorField
& pivpvf,
112
const
DimensionedField<vector, volMesh>
& iF
113
)
114
:
115
pressureInletOutletVelocityFvPatchVectorField
(pivpvf, iF),
116
omega_(pivpvf.omega_)
117
{
118
calcTangentialVelocity();
119
}
120
121
122
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
123
124
void
rotatingPressureInletOutletVelocityFvPatchVectorField::
125
write
(
Ostream
& os)
const
126
{
127
fvPatchVectorField::write
(os);
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
136
makePatchTypeField
137
(
138
fvPatchVectorField
,
139
rotatingPressureInletOutletVelocityFvPatchVectorField
140
);
141
142
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144
}
// End namespace Foam
145
146
// ************************ vim: set sw=4 sts=4 et: ************************ //