initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / derived / pressureDirectedInletOutletVelocity / pressureDirectedInletOutletVelocityFvPatchVectorField.H
blob5098956dd66df1478dd1f72b9c93e6c416b2a61a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
28 Description
29     Velocity inlet/outlet boundary condition for pressure boundary where the
30     pressure is specified.  zero-gradient is applied for outflow (as defined
31     by the flux) and for inflow the velocity is obtained from the flux with
32     the specified `inletDirection'.
34 SourceFiles
35     pressureDirectedInletOutletVelocityFvPatchVectorField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef pressureDirectedInletOutletVelocityFvPatchVectorField_H
40 #define pressureDirectedInletOutletVelocityFvPatchVectorField_H
42 #include "fvPatchFields.H"
43 #include "mixedFvPatchFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 /*---------------------------------------------------------------------------*\
51           Class pressureDirectedInletOutletVelocityFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
54 class pressureDirectedInletOutletVelocityFvPatchVectorField
56     public mixedFvPatchVectorField
58     // Private data
60         word phiName_;
61         word rhoName_;
62         vectorField inletDir_;
65 public:
67     //- Runtime type information
68     TypeName("pressureDirectedInletOutletVelocity");
71     // Constructors
73         //- Construct from patch and internal field
74         pressureDirectedInletOutletVelocityFvPatchVectorField
75         (
76             const fvPatch&,
77             const DimensionedField<vector, volMesh>&
78         );
80         //- Construct from patch, internal field and dictionary
81         pressureDirectedInletOutletVelocityFvPatchVectorField
82         (
83             const fvPatch&,
84             const DimensionedField<vector, volMesh>&,
85             const dictionary&
86         );
88         //- Construct by mapping given
89         //  pressureDirectedInletOutletVelocityFvPatchVectorField
90         //  onto a new patch
91         pressureDirectedInletOutletVelocityFvPatchVectorField
92         (
93             const pressureDirectedInletOutletVelocityFvPatchVectorField&,
94             const fvPatch&,
95             const DimensionedField<vector, volMesh>&,
96             const fvPatchFieldMapper&
97         );
99         //- Construct as copy
100         pressureDirectedInletOutletVelocityFvPatchVectorField
101         (
102             const pressureDirectedInletOutletVelocityFvPatchVectorField&
103         );
105         //- Construct and return a clone
106         virtual tmp<fvPatchVectorField> clone() const
107         {
108             return tmp<fvPatchVectorField>
109             (
110                 new pressureDirectedInletOutletVelocityFvPatchVectorField
111                 (
112                     *this
113                 )
114             );
115         }
117         //- Construct as copy setting internal field reference
118         pressureDirectedInletOutletVelocityFvPatchVectorField
119         (
120             const pressureDirectedInletOutletVelocityFvPatchVectorField&,
121             const DimensionedField<vector, volMesh>&
122         );
124         //- Construct and return a clone setting internal field reference
125         virtual tmp<fvPatchVectorField> clone
126         (
127             const DimensionedField<vector, volMesh>& iF
128         ) const
129         {
130             return tmp<fvPatchVectorField>
131             (
132                 new pressureDirectedInletOutletVelocityFvPatchVectorField
133                 (
134                     *this,
135                     iF
136                 )
137             );
138         }
141     // Member functions
143         // Access
145             //- Return the name of rho
146             const word& rhoName() const
147             {
148                 return rhoName_;
149             }
151             //- Return reference to the name of rho to allow adjustment
152             word& rhoName()
153             {
154                 return rhoName_;
155             }
157             //- Return the name of phi
158             const word& phiName() const
159             {
160                 return phiName_;
161             }
163             //- Return reference to the name of phi to allow adjustment
164             word& phiName()
165             {
166                 return phiName_;
167             }
170         // Mapping functions
172             //- Map (and resize as needed) from self given a mapping object
173             virtual void autoMap
174             (
175                 const fvPatchFieldMapper&
176             );
178             //- Reverse map the given fvPatchField onto this fvPatchField
179             virtual void rmap
180             (
181                 const fvPatchVectorField&,
182                 const labelList&
183             );
186         //- Update the coefficients associated with the patch field
187         virtual void updateCoeffs();
189         //- Write
190         virtual void write(Ostream&) const;
193     // Member operators
195         virtual void operator=(const fvPatchField<vector>& pvf);
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 } // End namespace Foam
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 #endif
207 // ************************************************************************* //