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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
30 #include "volFields.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
36 (
37  const fvPatch& p,
39 )
40 :
42  U_(nullptr)
43 {}
44 
45 
48 (
49  const fvPatch& p,
51  const dictionary& dict
52 )
53 :
56 {
57  // Evaluate the wall velocity
58  updateCoeffs();
59 }
60 
61 
64 (
66  const fvPatch& p,
68  const fvPatchFieldMapper& mapper
69 )
70 :
71  fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
72  U_(ptf.U_.clone())
73 {}
74 
75 
78 (
80 )
81 :
83  U_(twvpvf.U_.clone())
84 {}
85 
86 
89 (
92 )
93 :
95  U_(twvpvf.U_.clone())
96 {}
97 
98 
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 
102 {
103  if (updated())
104  {
105  return;
106  }
107 
108  const scalar t = this->db().time().timeOutputValue();
109  const vector U = U_->value(t);
110 
111  // Remove the component of U normal to the wall in case the wall is not flat
112  const vectorField n(patch().nf());
113  vectorField::operator=(U - n*(n & U));
114 
115  fixedValueFvPatchVectorField::updateCoeffs();
116 }
117 
118 
120 {
122  U_->writeData(os);
123  writeEntry("value", os);
124 }
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 namespace Foam
130 {
132  (
135  );
136 }
137 
138 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:50
volFields.H
Foam::fvPatchField< vector >::write
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:364
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::translatingWallVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: translatingWallVelocityFvPatchVectorField.C:101
Foam::translatingWallVelocityFvPatchVectorField::translatingWallVelocityFvPatchVectorField
translatingWallVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: translatingWallVelocityFvPatchVectorField.C:36
Foam::translatingWallVelocityFvPatchVectorField
This boundary condition provides a velocity condition for translational motion on walls.
Definition: translatingWallVelocityFvPatchVectorField.H:87
Foam::Function1
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: Function1.H:86
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
n
label n
Definition: TABSMDCalcMethod2.H:31
translatingWallVelocityFvPatchVectorField.H
Foam::Field< vector >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::translatingWallVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: translatingWallVelocityFvPatchVectorField.C:119
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Field< vector >::operator=
void operator=(const Field< vector > &)
Copy assignment.
Definition: Field.C:647
U
U
Definition: pEqn.H:72
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::Vector< scalar >
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::makePatchTypeField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54