rotatingPressureInletOutletVelocityFvPatchVectorField.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-2015 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 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
32 
35 {
36  const scalar t = this->db().time().timeOutputValue();
37  vector om = omega_->value(t);
38 
39  vector axisHat = om/mag(om);
41  (
42  (-om) ^ (patch().Cf() - axisHat*(axisHat & patch().Cf()))
43  );
44 
45  const vectorField n(patch().nf());
46  refValue() = tangentialVelocity - n*(n & tangentialVelocity);
47 }
48 
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
54 (
55  const fvPatch& p,
57 )
58 :
60  omega_()
61 {}
62 
63 
66 (
68  const fvPatch& p,
70  const fvPatchFieldMapper& mapper
71 )
72 :
74  omega_(ptf.omega_, false)
75 {
76  calcTangentialVelocity();
77 }
78 
79 
82 (
83  const fvPatch& p,
85  const dictionary& dict
86 )
87 :
89  omega_(DataEntry<vector>::New("omega", dict))
90 {
91  calcTangentialVelocity();
92 }
93 
94 
97 (
99 )
100 :
102  omega_(rppvf.omega_, false)
103 {
104  calcTangentialVelocity();
105 }
106 
107 
110 (
113 )
114 :
116  omega_(rppvf.omega_, false)
117 {
118  calcTangentialVelocity();
119 }
120 
121 
122 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
123 
125 (
126  Ostream& os
127 ) const
128 {
130  os.writeKeyword("phi") << phiName() << token::END_STATEMENT << nl;
131  omega_->writeData(os);
132  writeEntry("value", os);
133 }
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 namespace Foam
139 {
141  (
144  );
145 }
146 
147 // ************************************************************************* //
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::rotatingPressureInletOutletVelocityFvPatchVectorField::rotatingPressureInletOutletVelocityFvPatchVectorField
rotatingPressureInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.C:54
Foam::fvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fvPatchField.C:349
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::calcTangentialVelocity
void calcTangentialVelocity()
Calculate the tangentialVelocity from omega.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.C:34
Foam::token::END_STATEMENT
@ END_STATEMENT
Definition: token.H:99
rotatingPressureInletOutletVelocityFvPatchVectorField.H
p
p
Definition: pEqn.H:62
surfaceFields.H
Foam::surfaceFields.
Foam::pressureInletOutletVelocityFvPatchVectorField::tangentialVelocity
const vectorField & tangentialVelocity() const
Return the tangential velocity.
Definition: pressureInletOutletVelocityFvPatchVectorField.H:195
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::omega_
autoPtr< DataEntry< vector > > omega_
Angular velocity of the frame.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.H:115
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
n
label n
Definition: TABSMDCalcMethod2.H:31
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::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
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::makePatchTypeField
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
Foam::Vector< scalar >
Foam::Ostream::writeKeyword
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
Definition: Ostream.C:59
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to patches in a rotating frame where the pre...
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.H:108
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::DataEntry
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: DataEntry.H:52
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: rotatingPressureInletOutletVelocityFvPatchVectorField.C:125
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::pressureInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition is applied to pressure boundaries where the pressure is...
Definition: pressureInletOutletVelocityFvPatchVectorField.H:97