initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / derived / pressureNormalInletOutletVelocity / pressureNormalInletOutletVelocityFvPatchVectorField.H
blobd1f3e69ae0903d25ae9c137e5491106abed4faa1
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::pressureNormalInletOutletVelocityFvPatchVectorField
28 Description
29     Velocity inlet/outlet boundary condition for patches 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 flux with a direction
32     normal to the patch faces.
34 SourceFiles
35     pressureNormalInletOutletVelocityFvPatchVectorField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef pressureNormalInletOutletVelocityFvPatchVectorField_H
40 #define pressureNormalInletOutletVelocityFvPatchVectorField_H
42 #include "fvPatchFields.H"
43 #include "mixedFvPatchFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 /*---------------------------------------------------------------------------*\
51           Class pressureNormalInletOutletVelocityFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
54 class pressureNormalInletOutletVelocityFvPatchVectorField
56     public mixedFvPatchVectorField
58     // Private data
60         word phiName_;
61         word rhoName_;
64 public:
66     //- Runtime type information
67     TypeName("pressureNormalInletOutletVelocity");
70     // Constructors
72         //- Construct from patch and internal field
73         pressureNormalInletOutletVelocityFvPatchVectorField
74         (
75             const fvPatch&,
76             const DimensionedField<vector, volMesh>&
77         );
79         //- Construct from patch, internal field and dictionary
80         pressureNormalInletOutletVelocityFvPatchVectorField
81         (
82             const fvPatch&,
83             const DimensionedField<vector, volMesh>&,
84             const dictionary&
85         );
87         //- Construct by mapping given
88         //  pressureNormalInletOutletVelocityFvPatchVectorField
89         //  onto a new patch
90         pressureNormalInletOutletVelocityFvPatchVectorField
91         (
92             const pressureNormalInletOutletVelocityFvPatchVectorField&,
93             const fvPatch&,
94             const DimensionedField<vector, volMesh>&,
95             const fvPatchFieldMapper&
96         );
98         //- Construct as copy
99         pressureNormalInletOutletVelocityFvPatchVectorField
100         (
101             const pressureNormalInletOutletVelocityFvPatchVectorField&
102         );
104         //- Construct and return a clone
105         virtual tmp<fvPatchVectorField> clone() const
106         {
107             return tmp<fvPatchVectorField>
108             (
109                 new pressureNormalInletOutletVelocityFvPatchVectorField
110                 (
111                     *this
112                 )
113             );
114         }
116         //- Construct as copy setting internal field reference
117         pressureNormalInletOutletVelocityFvPatchVectorField
118         (
119             const pressureNormalInletOutletVelocityFvPatchVectorField&,
120             const DimensionedField<vector, volMesh>&
121         );
123         //- Construct and return a clone setting internal field reference
124         virtual tmp<fvPatchVectorField> clone
125         (
126             const DimensionedField<vector, volMesh>& iF
127         ) const
128         {
129             return tmp<fvPatchVectorField>
130             (
131                 new pressureNormalInletOutletVelocityFvPatchVectorField
132                 (
133                     *this,
134                     iF
135                 )
136             );
137         }
140     // Member functions
142         // Access
144             //- Return the name of rho
145             const word& rhoName() const
146             {
147                 return rhoName_;
148             }
150             //- Return reference to the name of rho to allow adjustment
151             word& rhoName()
152             {
153                 return rhoName_;
154             }
156             //- Return the name of phi
157             const word& phiName() const
158             {
159                 return phiName_;
160             }
163             //- Return reference to the name of phi to allow adjustment
164             word& phiName()
165             {
166                 return phiName_;
167             }
170         //- Update the coefficients associated with the patch field
171         virtual void updateCoeffs();
173         //- Write
174         virtual void write(Ostream&) const;
177     // Member operators
179         virtual void operator=(const fvPatchField<vector>& pvf);
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 } // End namespace Foam
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 #endif
191 // ************************************************************************* //