1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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::pressureDirectedInletOutletVelocityFvPatchVectorField
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'.
35 pressureDirectedInletOutletVelocityFvPatchVectorField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef pressureDirectedInletOutletVelocityFvPatchVectorField_H
40 #define pressureDirectedInletOutletVelocityFvPatchVectorField_H
42 #include "fvPatchFields.H"
43 #include "mixedFvPatchFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class pressureDirectedInletOutletVelocityFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
54 class pressureDirectedInletOutletVelocityFvPatchVectorField
56 public mixedFvPatchVectorField
62 vectorField inletDir_;
67 //- Runtime type information
68 TypeName("pressureDirectedInletOutletVelocity");
73 //- Construct from patch and internal field
74 pressureDirectedInletOutletVelocityFvPatchVectorField
77 const DimensionedField<vector, volMesh>&
80 //- Construct from patch, internal field and dictionary
81 pressureDirectedInletOutletVelocityFvPatchVectorField
84 const DimensionedField<vector, volMesh>&,
88 //- Construct by mapping given
89 // pressureDirectedInletOutletVelocityFvPatchVectorField
91 pressureDirectedInletOutletVelocityFvPatchVectorField
93 const pressureDirectedInletOutletVelocityFvPatchVectorField&,
95 const DimensionedField<vector, volMesh>&,
96 const fvPatchFieldMapper&
100 pressureDirectedInletOutletVelocityFvPatchVectorField
102 const pressureDirectedInletOutletVelocityFvPatchVectorField&
105 //- Construct and return a clone
106 virtual tmp<fvPatchVectorField> clone() const
108 return tmp<fvPatchVectorField>
110 new pressureDirectedInletOutletVelocityFvPatchVectorField
117 //- Construct as copy setting internal field reference
118 pressureDirectedInletOutletVelocityFvPatchVectorField
120 const pressureDirectedInletOutletVelocityFvPatchVectorField&,
121 const DimensionedField<vector, volMesh>&
124 //- Construct and return a clone setting internal field reference
125 virtual tmp<fvPatchVectorField> clone
127 const DimensionedField<vector, volMesh>& iF
130 return tmp<fvPatchVectorField>
132 new pressureDirectedInletOutletVelocityFvPatchVectorField
145 //- Return the name of rho
146 const word& rhoName() const
151 //- Return reference to the name of rho to allow adjustment
157 //- Return the name of phi
158 const word& phiName() const
163 //- Return reference to the name of phi to allow adjustment
172 //- Map (and resize as needed) from self given a mapping object
175 const fvPatchFieldMapper&
178 //- Reverse map the given fvPatchField onto this fvPatchField
181 const fvPatchVectorField&,
186 //- Update the coefficients associated with the patch field
187 virtual void updateCoeffs();
190 virtual void write(Ostream&) const;
195 virtual void operator=(const fvPatchField<vector>& pvf);
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 } // End namespace Foam
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 // ************************************************************************* //