Forward compatibility: flex
[foam-extend-3.2.git] / src / engine / derivedFvPatchFields / engineTimeVaryingUniformFixedValue / engineTimeVaryingUniformFixedValueFvPatchFields.C
blob65f6ec9cc57bc6febc7ef696c65677f08549df04
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "engineTimeVaryingUniformFixedValueFvPatchFields.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "volFields.H"
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 namespace Foam
35 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 makePatchFields(engineTimeVaryingUniformFixedValue);
39 // Update the coefficients associated with the patch field
40 template<>
41 void engineTimeVaryingUniformFixedValueFvPatchField<scalar>::updateCoeffs()
43     if (this->updated())
44     {
45         return;
46     }
48     checkTable();
50     this->operator==
51     (
52         interpolateXY
53         (
54 //            this->db().time().value(),
55             engineDB_.theta(),
56             timeDataPtr_().x(),
57             timeDataPtr_().y()
58         )
59     );
61     fixedValueFvPatchField<scalar>::updateCoeffs();
65 template<>
66 void engineTimeVaryingUniformFixedValueFvPatchField<vector>::updateCoeffs()
68     if (this->updated())
69     {
70         return;
71     }
73     checkTable();
75     this->operator==
76     (
77        -interpolateXY
78         (
79 //            this->db().time().value(),
80             engineDB_.theta(),
81             timeDataPtr_().x(),
82             timeDataPtr_().y()
83         )*patch().nf()
84     );
86     fixedValueFvPatchField<vector>::updateCoeffs();
90 template<>
91 void engineTimeVaryingUniformFixedValueFvPatchField<sphericalTensor>::updateCoeffs()
93     if (this->updated())
94     {
95         return;
96     }
98     checkTable();
100     this->operator==
101     (
102         interpolateXY
103         (
104 //            this->db().time().value(),
105             engineDB_.theta(),
106             timeDataPtr_().x(),
107             timeDataPtr_().y()
108         )*sphericalTensor::I
109     );
111     fixedValueFvPatchField<sphericalTensor>::updateCoeffs();
115 template<>
116 void engineTimeVaryingUniformFixedValueFvPatchField<symmTensor>::updateCoeffs()
118     if (this->updated())
119     {
120         return;
121     }
123     checkTable();
125     this->operator==
126     (
127         interpolateXY
128         (
129 //            this->db().time().value(),
130             engineDB_.theta(),
131             timeDataPtr_().x(),
132             timeDataPtr_().y()
133         )*sqr(patch().nf())
134     );
136     fixedValueFvPatchField<symmTensor>::updateCoeffs();
140 template<>
141 void engineTimeVaryingUniformFixedValueFvPatchField<symmTensor4thOrder>::updateCoeffs()
143     notImplemented
144     (
145         "engineTimeVaryingUniformFixedValueFvPatchField"
146         "<symmTensor4thOrder>::updateCoeffs()"
147     );
151 template<>
152 void engineTimeVaryingUniformFixedValueFvPatchField<diagTensor>::updateCoeffs()
154     notImplemented
155     (
156         "engineTimeVaryingUniformFixedValueFvPatchField"
157         "<diagTensor>::updateCoeffs()"
158     );
162 template<>
163 void engineTimeVaryingUniformFixedValueFvPatchField<tensor>::updateCoeffs()
165     if (this->updated())
166     {
167         return;
168     }
170     checkTable();
172     this->operator==
173     (
174         interpolateXY
175         (
176 //            this->db().time().value(),
177             engineDB_.theta(),
178             timeDataPtr_().x(),
179             timeDataPtr_().y()
180         )*(patch().nf()*patch().nf())
181     );
183     fixedValueFvPatchField<tensor>::updateCoeffs();
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 } // End namespace Foam
191 // ************************************************************************* //