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  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
31 #include "volFields.H"
32 
33 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 
37 (
38  const fvPatch& p,
40 )
41 :
43  U_(nullptr)
44 {}
45 
46 
49 (
50  const fvPatch& p,
52  const dictionary& dict
53 )
54 :
55  fixedValueFvPatchField<vector>(p, iF, dict, false),
56  U_(Function1<vector>::New("U", dict, &db()))
57 {
58  // Evaluate the wall velocity
59  updateCoeffs();
60 }
61 
62 
65 (
67  const fvPatch& p,
69  const fvPatchFieldMapper& mapper
70 )
71 :
72  fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
73  U_(ptf.U_.clone())
74 {}
75 
76 
79 (
81 )
82 :
84  U_(twvpvf.U_.clone())
85 {}
86 
87 
90 (
93 )
94 :
96  U_(twvpvf.U_.clone())
97 {}
98 
99 
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 
103 {
104  if (updated())
105  {
106  return;
107  }
108 
109  const scalar t = this->db().time().timeOutputValue();
110  const vector U = U_->value(t);
111 
112  // Remove the component of U normal to the wall in case the wall is not flat
113  const vectorField n(patch().nf());
114  vectorField::operator=(U - n*(n & U));
115 
116  fixedValueFvPatchVectorField::updateCoeffs();
117 }
118 
119 
121 {
123  U_->writeData(os);
124  writeEntry("value", os);
125 }
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 namespace Foam
131 {
133  (
135  translatingWallVelocityFvPatchVectorField
136  );
137 }
138 
139 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:47
volFields.H
Foam::fvPatchField::write
virtual void write(Ostream &) const
Definition: fvPatchField.C:377
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::translatingWallVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Definition: translatingWallVelocityFvPatchVectorField.C:95
Foam::translatingWallVelocityFvPatchVectorField::translatingWallVelocityFvPatchVectorField
translatingWallVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Definition: translatingWallVelocityFvPatchVectorField.C:30
Foam::translatingWallVelocityFvPatchVectorField
This boundary condition provides a velocity condition for translational motion on walls.
Definition: translatingWallVelocityFvPatchVectorField.H:83
Foam::Function1
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: propellerInfo.H:287
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:76
n
label n
Definition: TABSMDCalcMethod2.H:31
translatingWallVelocityFvPatchVectorField.H
Foam::Field
Generic templated field type.
Definition: Field.H:59
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
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:119
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::translatingWallVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Definition: translatingWallVelocityFvPatchVectorField.C:113
Foam
Definition: atmBoundaryLayer.C:26
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:47
Foam::Field::operator=
void operator=(const Field< Type > &)
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Definition: DimensionedFieldReuseFunctions.H:100
Foam::fvPatchVectorField
fvPatchField< vector > fvPatchVectorField
Definition: fvPatchFieldsFwd.H:36
U
U
Definition: pEqn.H:72
Foam::foamVersion::patch
const std::string patch
Foam::Vector< scalar >
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:41
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:52
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:50