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::pressureInletOutletVelocityFvPatchVectorField
29 Velocity inlet/outlet boundary condition patches for where the pressure is
30 specified. zero-gradient is applied for outflow (as defined by the flux)
31 and for inflow the velocity is obtained from the patch-face normal
32 component of the internal-cell value.
35 pressureInletOutletVelocityFvPatchVectorField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef pressureInletOutletVelocityFvPatchVectorField_H
40 #define pressureInletOutletVelocityFvPatchVectorField_H
42 #include "fvPatchFields.H"
43 #include "directionMixedFvPatchFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class pressureInletOutletVelocityFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
54 class pressureInletOutletVelocityFvPatchVectorField
56 public directionMixedFvPatchVectorField
60 //- Name of flux field
63 //- Optional tangential velocity component
64 vectorField tangentialVelocity_;
69 //- Runtime type information
70 TypeName("pressureInletOutletVelocity");
75 //- Construct from patch and internal field
76 pressureInletOutletVelocityFvPatchVectorField
79 const DimensionedField<vector, volMesh>&
82 //- Construct from patch, internal field and dictionary
83 pressureInletOutletVelocityFvPatchVectorField
86 const DimensionedField<vector, volMesh>&,
90 //- Construct by mapping given
91 // pressureInletOutletVelocityFvPatchVectorField onto a new patch
92 pressureInletOutletVelocityFvPatchVectorField
94 const pressureInletOutletVelocityFvPatchVectorField&,
96 const DimensionedField<vector, volMesh>&,
97 const fvPatchFieldMapper&
100 //- Construct as copy
101 pressureInletOutletVelocityFvPatchVectorField
103 const pressureInletOutletVelocityFvPatchVectorField&
106 //- Construct and return a clone
107 virtual tmp<fvPatchVectorField> clone() const
109 return tmp<fvPatchVectorField>
111 new pressureInletOutletVelocityFvPatchVectorField(*this)
115 //- Construct as copy setting internal field reference
116 pressureInletOutletVelocityFvPatchVectorField
118 const pressureInletOutletVelocityFvPatchVectorField&,
119 const DimensionedField<vector, volMesh>&
122 //- Construct and return a clone setting internal field reference
123 virtual tmp<fvPatchVectorField> clone
125 const DimensionedField<vector, volMesh>& iF
128 return tmp<fvPatchVectorField>
130 new pressureInletOutletVelocityFvPatchVectorField(*this, iF)
139 //- Return the name of phi
140 const word& phiName() const
145 //- Return reference to the name of phi to allow adjustment
151 //- Return the tangential velocity
152 const vectorField& tangentialVelocity() const
154 return tangentialVelocity_;
157 //- Reset the tangential velocity
158 void setTangentialVelocity(const vectorField& tangentialVelocity);
163 //- Map (and resize as needed) from self given a mapping object
166 const fvPatchFieldMapper&
169 //- Reverse map the given fvPatchField onto this fvPatchField
172 const fvPatchVectorField&,
177 //- Update the coefficients associated with the patch field
178 virtual void updateCoeffs();
181 virtual void write(Ostream&) const;
186 virtual void operator=(const fvPatchField<vector>& pvf);
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace Foam
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 // ************************************************************************* //