FreeFOAM The Cross-Platform CFD Toolkit
coupledFvPatchField.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 
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 
33 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
34 
35 template<class Type>
37 (
38  const fvPatch& p,
40 )
41 :
42  lduInterfaceField(refCast<const lduInterface>(p)),
44 {}
45 
46 
47 template<class Type>
49 (
50  const fvPatch& p,
52  const Field<Type>& f
53 )
54 :
55  lduInterfaceField(refCast<const lduInterface>(p)),
56  fvPatchField<Type>(p, iF, f)
57 {}
58 
59 
60 template<class Type>
62 (
63  const coupledFvPatchField<Type>& ptf,
64  const fvPatch& p,
66  const fvPatchFieldMapper& mapper
67 )
68 :
69  lduInterfaceField(refCast<const lduInterface>(p)),
70  fvPatchField<Type>(ptf, p, iF, mapper)
71 {}
72 
73 
74 template<class Type>
76 (
77  const fvPatch& p,
79  const dictionary& dict
80 )
81 :
82  lduInterfaceField(refCast<const lduInterface>(p)),
83  fvPatchField<Type>(p, iF, dict)
84 {}
85 
86 
87 template<class Type>
89 (
90  const coupledFvPatchField<Type>& ptf
91 )
92 :
93  lduInterfaceField(refCast<const lduInterface>(ptf.patch())),
95 {}
96 
97 
98 template<class Type>
100 (
101  const coupledFvPatchField<Type>& ptf,
103 )
104 :
105  lduInterfaceField(refCast<const lduInterface>(ptf.patch())),
106  fvPatchField<Type>(ptf, iF)
107 {}
108 
109 
110 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
111 
112 template<class Type>
114 {
115  return
116  (this->patchNeighbourField() - this->patchInternalField())
117  *this->patch().deltaCoeffs();
118 }
119 
120 
121 template<class Type>
123 {
124  if (!this->updated())
125  {
126  this->updateCoeffs();
127  }
128 }
129 
130 
131 template<class Type>
133 {
134  if (!this->updated())
135  {
136  this->updateCoeffs();
137  }
138 
140  (
141  this->patch().weights()*this->patchInternalField()
142  + (1.0 - this->patch().weights())*this->patchNeighbourField()
143  );
144 
146 }
147 
148 
149 template<class Type>
151 (
152  const tmp<scalarField>& w
153 ) const
154 {
155  return Type(pTraits<Type>::one)*w;
156 }
157 
158 template<class Type>
160 (
161  const tmp<scalarField>& w
162 ) const
163 {
164  return Type(pTraits<Type>::one)*(1.0 - w);
165 }
166 
167 template<class Type>
169 {
170  return -Type(pTraits<Type>::one)*this->patch().deltaCoeffs();
171 }
172 
173 
174 template<class Type>
176 {
177  return -this->gradientInternalCoeffs();
178 }
179 
180 
181 template<class Type>
183 {
185  this->writeEntry("value", os);
186 }
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // ************************ vim: set sw=4 sts=4 et: ************************ //