1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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 "cellMotionFvPatchField.H"
29 #include "pointFields.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 cellMotionFvPatchField<Type>::cellMotionFvPatchField
42 const DimensionedField<Type, volMesh>& iF
45 fixedValueFvPatchField<Type>(p, iF)
50 cellMotionFvPatchField<Type>::cellMotionFvPatchField
52 const cellMotionFvPatchField<Type>& ptf,
54 const DimensionedField<Type, volMesh>& iF,
55 const fvPatchFieldMapper& mapper
58 fixedValueFvPatchField<Type>(ptf, p, iF, mapper)
63 cellMotionFvPatchField<Type>::cellMotionFvPatchField
66 const DimensionedField<Type, volMesh>& iF,
67 const dictionary& dict
70 fixedValueFvPatchField<Type>(p, iF)
72 fvPatchField<Type>::operator=(Field<Type>("value", dict, p.size()));
77 cellMotionFvPatchField<Type>::cellMotionFvPatchField
79 const cellMotionFvPatchField<Type>& ptf
82 fixedValueFvPatchField<Type>(ptf)
87 cellMotionFvPatchField<Type>::cellMotionFvPatchField
89 const cellMotionFvPatchField<Type>& ptf,
90 const DimensionedField<Type, volMesh>& iF
93 fixedValueFvPatchField<Type>(ptf, iF)
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 void cellMotionFvPatchField<Type>::updateCoeffs()
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();
112 word pfName = this->dimensionedInternalField().name();
113 pfName.replace("cell", "point");
115 const GeometricField<Type, pointPatchField, pointMesh>& pointMotion =
116 this->db().objectRegistry::template
117 lookupObject<GeometricField<Type, pointPatchField, pointMesh> >
124 this->operator[](i) = pp[i].average(points, pointMotion);
127 fixedValueFvPatchField<Type>::updateCoeffs();
132 void cellMotionFvPatchField<Type>::write(Ostream& os) const
134 fvPatchField<Type>::write(os);
135 this->writeEntry("value", os);
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 } // End namespace Foam
143 // ************************************************************************* //