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
fvMotionSolver
fvPatchFields
derived
cellMotion
cellMotionFvPatchField.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 "
cellMotionFvPatchField.H
"
27
#include <
finiteVolume/fvMesh.H
>
28
#include <
finiteVolume/volMesh.H
>
29
#include <
OpenFOAM/pointFields.H
>
30
31
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32
33
namespace
Foam
34
{
35
36
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
37
38
template
<
class
Type>
39
cellMotionFvPatchField<Type>::cellMotionFvPatchField
40
(
41
const
fvPatch
&
p
,
42
const
DimensionedField<Type, volMesh>
& iF
43
)
44
:
45
fixedValueFvPatchField<Type>
(
p
, iF)
46
{}
47
48
49
template
<
class
Type>
50
cellMotionFvPatchField<Type>::cellMotionFvPatchField
51
(
52
const
cellMotionFvPatchField<Type>
& ptf,
53
const
fvPatch
& p,
54
const
DimensionedField<Type, volMesh>
& iF,
55
const
fvPatchFieldMapper
& mapper
56
)
57
:
58
fixedValueFvPatchField<Type>
(ptf,
p
, iF, mapper)
59
{}
60
61
62
template
<
class
Type>
63
cellMotionFvPatchField<Type>::cellMotionFvPatchField
64
(
65
const
fvPatch
& p,
66
const
DimensionedField<Type, volMesh>
& iF,
67
const
dictionary
& dict
68
)
69
:
70
fixedValueFvPatchField<Type>
(
p
, iF)
71
{
72
fvPatchField<Type>::operator=
(
Field<Type>
(
"value"
, dict, p.
size
()));
73
}
74
75
76
template
<
class
Type>
77
cellMotionFvPatchField<Type>::cellMotionFvPatchField
78
(
79
const
cellMotionFvPatchField<Type>
& ptf
80
)
81
:
82
fixedValueFvPatchField<Type>
(ptf)
83
{}
84
85
86
template
<
class
Type>
87
cellMotionFvPatchField<Type>::cellMotionFvPatchField
88
(
89
const
cellMotionFvPatchField<Type>
& ptf,
90
const
DimensionedField<Type, volMesh>
& iF
91
)
92
:
93
fixedValueFvPatchField<Type>
(ptf, iF)
94
{}
95
96
97
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98
99
template
<
class
Type>
100
void
cellMotionFvPatchField<Type>::updateCoeffs
()
101
{
102
if
(this->updated())
103
{
104
return
;
105
}
106
107
const
fvPatch
& p = this->patch();
108
const
polyPatch
& pp = p.
patch
();
109
const
fvMesh
&
mesh
= this->dimensionedInternalField().mesh();
110
const
pointField
&
points
= mesh.
points
();
111
112
word
pfName = this->dimensionedInternalField().name();
113
pfName.
replace
(
"cell"
,
"point"
);
114
115
const
GeometricField<Type, pointPatchField, pointMesh>
& pointMotion =
116
this->db().objectRegistry:: lookupObject<
GeometricField<Type, pointPatchField, pointMesh>
>
117
(
118
pfName
119
);
120
121
forAll
(p, i)
122
{
123
this->operator[](i) = pp[i].average(points, pointMotion);
124
}
125
126
fixedValueFvPatchField<Type>::updateCoeffs
();
127
}
128
129
130
template
<
class
Type>
131
void
cellMotionFvPatchField<Type>::write
(
Ostream
& os)
const
132
{
133
fvPatchField<Type>::write
(os);
134
this->writeEntry(
"value"
, os);
135
}
136
137
138
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140
}
// End namespace Foam
141
142
// ************************ vim: set sw=4 sts=4 et: ************************ //
143