1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "translatingWallVelocityFvPatchVectorField.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "volFields.H"
29 #include "surfaceFields.H"
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 Foam::translatingWallVelocityFvPatchVectorField::
34 translatingWallVelocityFvPatchVectorField
37 const DimensionedField<vector, volMesh>& iF
40 fixedValueFvPatchField<vector>(p, iF),
45 Foam::translatingWallVelocityFvPatchVectorField::
46 translatingWallVelocityFvPatchVectorField
48 const translatingWallVelocityFvPatchVectorField& ptf,
50 const DimensionedField<vector, volMesh>& iF,
51 const fvPatchFieldMapper& mapper
54 fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
59 Foam::translatingWallVelocityFvPatchVectorField::
60 translatingWallVelocityFvPatchVectorField
63 const DimensionedField<vector, volMesh>& iF,
64 const dictionary& dict
67 fixedValueFvPatchField<vector>(p, iF),
70 // Evaluate the wall velocity
75 Foam::translatingWallVelocityFvPatchVectorField::
76 translatingWallVelocityFvPatchVectorField
78 const translatingWallVelocityFvPatchVectorField& twvpvf
81 fixedValueFvPatchField<vector>(twvpvf),
86 Foam::translatingWallVelocityFvPatchVectorField::
87 translatingWallVelocityFvPatchVectorField
89 const translatingWallVelocityFvPatchVectorField& twvpvf,
90 const DimensionedField<vector, volMesh>& iF
93 fixedValueFvPatchField<vector>(twvpvf, iF),
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 void Foam::translatingWallVelocityFvPatchVectorField::updateCoeffs()
107 // Remove the component of U normal to the wall in case the wall is not flat
108 const vectorField n(patch().nf());
109 vectorField::operator=(U_ - n*(n & U_));
111 fixedValueFvPatchVectorField::updateCoeffs();
115 void Foam::translatingWallVelocityFvPatchVectorField::write(Ostream& os) const
117 fvPatchVectorField::write(os);
118 os.writeKeyword("U") << U_ << token::END_STATEMENT << nl;
119 writeEntry("value", os);
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 translatingWallVelocityFvPatchVectorField
134 // ************************************************************************* //