translatingWallVelocityFvPatchVectorField.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) 2011 OpenFOAM Foundation
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 
28 #include "volFields.H"
29 #include "surfaceFields.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
35 (
36  const fvPatch& p,
38 )
39 :
41  U_(vector::zero)
42 {}
43 
44 
47 (
49  const fvPatch& p,
51  const fvPatchFieldMapper& mapper
52 )
53 :
54  fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
55  U_(ptf.U_)
56 {}
57 
58 
61 (
62  const fvPatch& p,
64  const dictionary& dict
65 )
66 :
68  U_(dict.lookup("U"))
69 {
70  // Evaluate the wall velocity
71  updateCoeffs();
72 }
73 
74 
77 (
79 )
80 :
82  U_(twvpvf.U_)
83 {}
84 
85 
88 (
91 )
92 :
94  U_(twvpvf.U_)
95 {}
96 
97 
98 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
99 
101 {
102  if (updated())
103  {
104  return;
105  }
106 
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_));
110 
111  fixedValueFvPatchVectorField::updateCoeffs();
112 }
113 
114 
116 {
118  os.writeKeyword("U") << U_ << token::END_STATEMENT << nl;
119  writeEntry("value", os);
120 }
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 namespace Foam
126 {
128  (
131  );
132 }
133 
134 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
volFields.H
Foam::fvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:349
Foam::token::END_STATEMENT
@ END_STATEMENT
Definition: token.H:99
p
p
Definition: pEqn.H:62
Foam::translatingWallVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: translatingWallVelocityFvPatchVectorField.C:100
Foam::translatingWallVelocityFvPatchVectorField::translatingWallVelocityFvPatchVectorField
translatingWallVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: translatingWallVelocityFvPatchVectorField.C:35
Foam::translatingWallVelocityFvPatchVectorField
This boundary condition provides a velocity condition for translational motion on walls.
Definition: translatingWallVelocityFvPatchVectorField.H:82
surfaceFields.H
Foam::surfaceFields.
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:79
n
label n
Definition: TABSMDCalcMethod2.H:31
translatingWallVelocityFvPatchVectorField.H
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::translatingWallVelocityFvPatchVectorField::U_
vector U_
Translational velocity.
Definition: translatingWallVelocityFvPatchVectorField.H:89
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::translatingWallVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: translatingWallVelocityFvPatchVectorField.C:115
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::makePatchTypeField
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
Foam::Field::operator=
void operator=(const Field< Type > &)
Foam::Ostream::writeKeyword
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
Definition: Ostream.C:59
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51