1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. 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
59 //- Name of flux field
62 //- Optional tangential velocity component
63 vectorField tangentialVelocity_;
68 //- Runtime type information
69 TypeName("pressureInletOutletVelocity");
74 //- Construct from patch and internal field
75 pressureInletOutletVelocityFvPatchVectorField
78 const DimensionedField<vector, volMesh>&
81 //- Construct from patch, internal field and dictionary
82 pressureInletOutletVelocityFvPatchVectorField
85 const DimensionedField<vector, volMesh>&,
89 //- Construct by mapping given
90 // pressureInletOutletVelocityFvPatchVectorField onto a new patch
91 pressureInletOutletVelocityFvPatchVectorField
93 const pressureInletOutletVelocityFvPatchVectorField&,
95 const DimensionedField<vector, volMesh>&,
96 const fvPatchFieldMapper&
100 pressureInletOutletVelocityFvPatchVectorField
102 const pressureInletOutletVelocityFvPatchVectorField&
105 //- Construct and return a clone
106 virtual tmp<fvPatchVectorField> clone() const
108 return tmp<fvPatchVectorField>
110 new pressureInletOutletVelocityFvPatchVectorField(*this)
114 //- Construct as copy setting internal field reference
115 pressureInletOutletVelocityFvPatchVectorField
117 const pressureInletOutletVelocityFvPatchVectorField&,
118 const DimensionedField<vector, volMesh>&
121 //- Construct and return a clone setting internal field reference
122 virtual tmp<fvPatchVectorField> clone
124 const DimensionedField<vector, volMesh>& iF
127 return tmp<fvPatchVectorField>
129 new pressureInletOutletVelocityFvPatchVectorField(*this, iF)
138 //- Return the name of phi
139 const word& phiName() const
144 //- Return reference to the name of phi to allow adjustment
150 //- Return the tangential velocity
151 const vectorField& tangentialVelocity() const
153 return tangentialVelocity_;
156 //- Reset the tangential velocity
157 void setTangentialVelocity(const vectorField& tangentialVelocity);
162 //- Map (and resize as needed) from self given a mapping object
165 const fvPatchFieldMapper&
168 //- Reverse map the given fvPatchField onto this fvPatchField
171 const fvPatchVectorField&,
176 //- Update the coefficients associated with the patch field
177 virtual void updateCoeffs();
180 virtual void write(Ostream&) const;
185 virtual void operator=(const fvPatchField<vector>& pvf);
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 } // End namespace Foam
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 // ************************************************************************* //