1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::rotatingPressureInletOutletVelocityFvPatchVectorField
29 Velocity inlet/outlet boundary condition in a rotating frame
30 for patches where the pressure is specified. zero-gradient is applied for
31 outflow (as defined by the flux) and for inflow the velocity is obtained
32 from the flux with a direction normal to the patch faces.
35 rotatingPressureInletOutletVelocityFvPatchVectorField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef rotatingPressureInletOutletVelocityFvPatchVectorField_H
40 #define rotatingPressureInletOutletVelocityFvPatchVectorField_H
42 #include "fvPatchFields.H"
43 #include "pressureInletOutletVelocityFvPatchVectorField.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class rotatingPressureInletOutletVelocityFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
54 class rotatingPressureInletOutletVelocityFvPatchVectorField
56 public pressureInletOutletVelocityFvPatchVectorField
60 //- Angular velocity of the frame
64 // Private member functions
66 //- Calculate the tangentialVelocity from omega
67 void calcTangentialVelocity();
72 //- Runtime type information
73 TypeName("rotatingPressureInletOutletVelocity");
78 //- Construct from patch and internal field
79 rotatingPressureInletOutletVelocityFvPatchVectorField
82 const DimensionedField<vector, volMesh>&
85 //- Construct from patch, internal field and dictionary
86 rotatingPressureInletOutletVelocityFvPatchVectorField
89 const DimensionedField<vector, volMesh>&,
93 //- Construct by mapping given
94 // rotatingPressureInletOutletVelocityFvPatchVectorField
96 rotatingPressureInletOutletVelocityFvPatchVectorField
98 const rotatingPressureInletOutletVelocityFvPatchVectorField&,
100 const DimensionedField<vector, volMesh>&,
101 const fvPatchFieldMapper&
104 //- Construct as copy
105 rotatingPressureInletOutletVelocityFvPatchVectorField
107 const rotatingPressureInletOutletVelocityFvPatchVectorField&
110 //- Construct and return a clone
111 virtual tmp<fvPatchVectorField> clone() const
113 return tmp<fvPatchVectorField>
115 new rotatingPressureInletOutletVelocityFvPatchVectorField(*this)
119 //- Construct as copy setting internal field reference
120 rotatingPressureInletOutletVelocityFvPatchVectorField
122 const rotatingPressureInletOutletVelocityFvPatchVectorField&,
123 const DimensionedField<vector, volMesh>&
126 //- Construct and return a clone setting internal field reference
127 virtual tmp<fvPatchVectorField> clone
129 const DimensionedField<vector, volMesh>& iF
132 return tmp<fvPatchVectorField>
134 new rotatingPressureInletOutletVelocityFvPatchVectorField
147 //- Return the angular velocity of rotation
148 const vector& omega() const
153 //- Reset the angular velocity of rotation
154 // and update the tangentialVelocity
155 void setOmega(const vector& omega)
158 calcTangentialVelocity();
163 virtual void write(Ostream&) const;
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 } // End namespace Foam
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 // ************************************************************************* //