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
translatingWallVelocity
translatingWallVelocityFvPatchVectorField.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 "
translatingWallVelocityFvPatchVectorField.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
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37
38
translatingWallVelocityFvPatchVectorField::
39
translatingWallVelocityFvPatchVectorField
40
(
41
const
fvPatch
&
p
,
42
const
DimensionedField<vector, volMesh>
& iF
43
)
44
:
45
fixedValueFvPatchField<vector>
(
p
, iF),
46
U_(
vector::zero
)
47
{}
48
49
50
translatingWallVelocityFvPatchVectorField::
51
translatingWallVelocityFvPatchVectorField
52
(
53
const
translatingWallVelocityFvPatchVectorField
& ptf,
54
const
fvPatch
& p,
55
const
DimensionedField<vector, volMesh>
& iF,
56
const
fvPatchFieldMapper
& mapper
57
)
58
:
59
fixedValueFvPatchField<vector>
(ptf,
p
, iF, mapper),
60
U_(ptf.U_)
61
{}
62
63
64
translatingWallVelocityFvPatchVectorField::
65
translatingWallVelocityFvPatchVectorField
66
(
67
const
fvPatch
& p,
68
const
DimensionedField<vector, volMesh>
& iF,
69
const
dictionary
& dict
70
)
71
:
72
fixedValueFvPatchField<vector>
(
p
, iF),
73
U_(dict.
lookup
(
"U"
))
74
{
75
// Evaluate the wall velocity
76
updateCoeffs();
77
}
78
79
80
translatingWallVelocityFvPatchVectorField::
81
translatingWallVelocityFvPatchVectorField
82
(
83
const
translatingWallVelocityFvPatchVectorField
& twvpvf
84
)
85
:
86
fixedValueFvPatchField<vector>
(twvpvf),
87
U_(twvpvf.U_)
88
{}
89
90
91
translatingWallVelocityFvPatchVectorField::
92
translatingWallVelocityFvPatchVectorField
93
(
94
const
translatingWallVelocityFvPatchVectorField
& twvpvf,
95
const
DimensionedField<vector, volMesh>
& iF
96
)
97
:
98
fixedValueFvPatchField<vector>
(twvpvf, iF),
99
U_(twvpvf.U_)
100
{}
101
102
103
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
104
105
void
translatingWallVelocityFvPatchVectorField::updateCoeffs
()
106
{
107
if
(updated())
108
{
109
return
;
110
}
111
112
// Remove the component of U normal to the wall in case the wall is not flat
113
vectorField
n = patch().nf();
114
vectorField::operator=
(U_ - n*(n & U_));
115
116
fixedValueFvPatchVectorField::updateCoeffs
();
117
}
118
119
120
void
translatingWallVelocityFvPatchVectorField::write
(
Ostream
& os)
const
121
{
122
fvPatchVectorField::write
(os);
123
os.
writeKeyword
(
"U"
) << U_ <<
token::END_STATEMENT
<<
nl
;
124
writeEntry(
"value"
, os);
125
}
126
127
128
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130
makePatchTypeField
131
(
132
fvPatchVectorField
,
133
translatingWallVelocityFvPatchVectorField
134
);
135
136
137
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139
}
// End namespace Foam
140
141
// ************************ vim: set sw=4 sts=4 et: ************************ //