SRFWallVelocityFvPatchVectorField.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) 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 #include "SRFModel.H"
33 
34 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 
37 (
38  const fvPatch& p,
40 )
41 :
42  fixedValueFvPatchVectorField(p, iF)
43 {}
44 
45 
47 (
49  const fvPatch& p,
51  const fvPatchFieldMapper& mapper
52 )
53 :
54  fixedValueFvPatchVectorField(ptf, p, iF, mapper)
55 {}
56 
57 
59 (
60  const fvPatch& p,
62  const dictionary& dict
63 )
64 :
65  fixedValueFvPatchVectorField(p, iF, dict)
66 {}
67 
68 
70 (
72 )
73 :
74  fixedValueFvPatchVectorField(srfvpvf)
75 {}
76 
77 
79 (
80  const SRFWallVelocityFvPatchVectorField& srfvpvf,
82 )
83 :
84  fixedValueFvPatchVectorField(srfvpvf, iF)
85 {}
86 
87 
88 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89 
91 (
92  const fvPatchFieldMapper& m
93 )
94 {
95  vectorField::autoMap(m);
96 }
97 
98 
100 (
101  const fvPatchVectorField& ptf,
102  const labelList& addr
103 )
104 {
105  fixedValueFvPatchVectorField::rmap(ptf, addr);
106 }
107 
108 
110 {
111  if (updated())
112  {
113  return;
114  }
115 
116  // Get reference to the SRF model
117  const SRF::SRFModel& srf =
118  db().lookupObject<SRF::SRFModel>("SRFProperties");
119 
120  // Determine patch velocity due to SRF
121  const vectorField Up(-srf.velocity(patch().Cf()));
122 
123  // Remove the component of Up normal to the wall
124  // just in case it is not exactly circular
125  const vectorField n(patch().nf());
126  vectorField::operator=(Up - n*(n & Up));
127 
128  fixedValueFvPatchVectorField::updateCoeffs();
129 }
130 
131 
133 {
135  writeEntry("value", os);
136 }
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 namespace Foam
142 {
144  (
147  );
148 }
149 
150 // ************************************************************************* //
Foam::fvPatchField< vector >
volFields.H
Foam::fvPatchField< vector >::write
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:384
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::SRFWallVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: SRFWallVelocityFvPatchVectorField.C:109
Foam::SRFWallVelocityFvPatchVectorField
Wall-velocity condition to be used in conjunction with the single rotating frame (SRF) model (see: FO...
Definition: SRFWallVelocityFvPatchVectorField.H:93
Foam::SRF::SRFModel::velocity
vectorField velocity(const vectorField &positions) const
Return velocity vector from positions.
Definition: SRFModel.C:168
Foam::SRF::SRFModel
Top level model for single rotating frame.
Definition: SRFModel.H:64
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::Field< vector >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::SRFWallVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: SRFWallVelocityFvPatchVectorField.C:132
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:123
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Field< vector >::operator=
void operator=(const Field< vector > &)
Copy assignment.
Definition: Field.C:635
SRFModel.H
SRFWallVelocityFvPatchVectorField.H
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::SRFWallVelocityFvPatchVectorField::SRFWallVelocityFvPatchVectorField
SRFWallVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: SRFWallVelocityFvPatchVectorField.C:37
Foam::List< label >
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::SRFWallVelocityFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: SRFWallVelocityFvPatchVectorField.C:100
Foam::SRFWallVelocityFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: SRFWallVelocityFvPatchVectorField.C:91
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54