1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::pressureInletOutletVelocityFvPatchVectorField
28 Velocity inlet/outlet boundary condition patches for where the pressure is
29 specified. zero-gradient is applied for outflow (as defined by the flux)
30 and for inflow the velocity is obtained from the patch-face normal
31 component of the internal-cell value.
34 pressureInletOutletVelocityFvPatchVectorField.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef pressureInletOutletVelocityFvPatchVectorField_H
39 #define pressureInletOutletVelocityFvPatchVectorField_H
41 #include "fvPatchFields.H"
42 #include "directionMixedFvPatchFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class pressureInletOutletVelocityFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
53 class pressureInletOutletVelocityFvPatchVectorField
55 public directionMixedFvPatchVectorField
61 //- Optional tangential velocity component
62 vectorField tangentialVelocity_;
67 //- Runtime type information
68 TypeName("pressureInletOutletVelocity");
73 //- Construct from patch and internal field
74 pressureInletOutletVelocityFvPatchVectorField
77 const DimensionedField<vector, volMesh>&
80 //- Construct from patch, internal field and dictionary
81 pressureInletOutletVelocityFvPatchVectorField
84 const DimensionedField<vector, volMesh>&,
88 //- Construct by mapping given
89 // pressureInletOutletVelocityFvPatchVectorField onto a new patch
90 pressureInletOutletVelocityFvPatchVectorField
92 const pressureInletOutletVelocityFvPatchVectorField&,
94 const DimensionedField<vector, volMesh>&,
95 const fvPatchFieldMapper&
99 pressureInletOutletVelocityFvPatchVectorField
101 const pressureInletOutletVelocityFvPatchVectorField&
104 //- Construct and return a clone
105 virtual tmp<fvPatchVectorField> clone() const
107 return tmp<fvPatchVectorField>
109 new pressureInletOutletVelocityFvPatchVectorField(*this)
113 //- Construct as copy setting internal field reference
114 pressureInletOutletVelocityFvPatchVectorField
116 const pressureInletOutletVelocityFvPatchVectorField&,
117 const DimensionedField<vector, volMesh>&
120 //- Construct and return a clone setting internal field reference
121 virtual tmp<fvPatchVectorField> clone
123 const DimensionedField<vector, volMesh>& iF
126 return tmp<fvPatchVectorField>
128 new pressureInletOutletVelocityFvPatchVectorField(*this, iF)
137 //- Return the name of phi
138 const word& phiName() const
143 //- Return reference to the name of phi to allow adjustment
149 //- Return the tangential velocity
150 const vectorField& tangentialVelocity() const
152 return tangentialVelocity_;
155 //- Reset the tangential velocity
156 void setTangentialVelocity(const vectorField& tangentialVelocity);
161 //- Map (and resize as needed) from self given a mapping object
164 const fvPatchFieldMapper&
167 //- Reverse map the given fvPatchField onto this fvPatchField
170 const fvPatchVectorField&,
175 //- Update the coefficients associated with the patch field
176 virtual void updateCoeffs();
179 virtual void write(Ostream&) const;
184 virtual void operator=(const fvPatchField<vector>& pvf);
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 } // End namespace Foam
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 // ************************************************************************* //