SRFWallVelocityFvPatchVectorField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2022 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 
30 #include "SRFModel.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
35 (
36  const fvPatch& p,
38 )
39 :
40  fixedValueFvPatchVectorField(p, iF)
41 {}
42 
43 
45 (
46  const fvPatch& p,
48  const dictionary& dict
49 )
50 :
51  fixedValueFvPatchVectorField(p, iF, dict)
52 {}
53 
54 
56 (
58  const fvPatch& p,
60  const fvPatchFieldMapper& mapper
61 )
62 :
63  fixedValueFvPatchVectorField(ptf, p, iF, mapper)
64 {}
65 
66 
68 (
69  const SRFWallVelocityFvPatchVectorField& srfvpvf,
71 )
72 :
73  fixedValueFvPatchVectorField(srfvpvf, iF)
74 {}
75 
76 
77 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
78 
80 (
81  const fvPatchFieldMapper& m
82 )
83 {
84  m(*this, *this);
85 }
86 
87 
89 (
90  const fvPatchVectorField& ptf,
91  const labelList& addr
92 )
93 {
94  fixedValueFvPatchVectorField::rmap(ptf, addr);
95 }
96 
97 
99 (
100  const fvPatchVectorField& ptf
101 )
102 {
103  fixedValueFvPatchVectorField::reset(ptf);
104 }
105 
106 
108 {
109  if (updated())
110  {
111  return;
112  }
113 
114  // Get reference to the SRF model
115  const SRF::SRFModel& srf =
116  db().lookupObject<SRF::SRFModel>("SRFProperties");
117 
118  // Determine patch velocity due to SRF
119  const vectorField Up(-srf.velocity(patch().Cf()));
120 
121  // Remove the component of Up normal to the wall
122  // just in case it is not exactly circular
123  const vectorField n(patch().nf());
124  vectorField::operator=(Up - n*(n & Up));
125 
126  fixedValueFvPatchVectorField::updateCoeffs();
127 }
128 
129 
131 {
133  writeEntry(os, "value", *this);
134 }
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 namespace Foam
140 {
142  (
145  );
146 }
147 
148 // ************************************************************************* //
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:243
Macros for easy insertion into run-time selection tables.
Foam::fvPatchFieldMapper.
Wall-velocity condition to be used in conjunction with the single rotating frame (SRF) model (see: FO...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
SRFWallVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
void operator=(const Field< vector > &)
Definition: Field.C:526
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
label n
virtual void reset(const fvPatchVectorField &)
Reset the fvPatchField to the given fvPatchField.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Top level model for single rotating frame.
Definition: SRFModel.H:62
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
vectorField velocity(const vectorField &positions) const
Return velocity vector from positions.
Definition: SRFModel.C:151
Namespace for OpenFOAM.