1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "translatingWallVelocityFvPatchVectorField.H"
28 #include "addToRunTimeSelectionTable.H"
29 #include "volFields.H"
30 #include "surfaceFields.H"
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 translatingWallVelocityFvPatchVectorField::
40 translatingWallVelocityFvPatchVectorField
43 const DimensionedField<vector, volMesh>& iF
46 fixedValueFvPatchField<vector>(p, iF),
51 translatingWallVelocityFvPatchVectorField::
52 translatingWallVelocityFvPatchVectorField
54 const translatingWallVelocityFvPatchVectorField& ptf,
56 const DimensionedField<vector, volMesh>& iF,
57 const fvPatchFieldMapper& mapper
60 fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
65 translatingWallVelocityFvPatchVectorField::
66 translatingWallVelocityFvPatchVectorField
69 const DimensionedField<vector, volMesh>& iF,
70 const dictionary& dict
73 fixedValueFvPatchField<vector>(p, iF),
76 // Evaluate the wall velocity
81 translatingWallVelocityFvPatchVectorField::
82 translatingWallVelocityFvPatchVectorField
84 const translatingWallVelocityFvPatchVectorField& twvpvf
87 fixedValueFvPatchField<vector>(twvpvf),
92 translatingWallVelocityFvPatchVectorField::
93 translatingWallVelocityFvPatchVectorField
95 const translatingWallVelocityFvPatchVectorField& twvpvf,
96 const DimensionedField<vector, volMesh>& iF
99 fixedValueFvPatchField<vector>(twvpvf, iF),
104 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
106 void translatingWallVelocityFvPatchVectorField::updateCoeffs()
113 // Remove the component of U normal to the wall in case the wall is not flat
114 vectorField n = patch().nf();
115 vectorField::operator=(U_ - n*(n & U_));
117 fixedValueFvPatchVectorField::updateCoeffs();
121 void translatingWallVelocityFvPatchVectorField::write(Ostream& os) const
123 fvPatchVectorField::write(os);
124 os.writeKeyword("U") << U_ << token::END_STATEMENT << nl;
125 writeEntry("value", os);
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 translatingWallVelocityFvPatchVectorField
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 } // End namespace Foam
142 // ************************************************************************* //