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::fluxCorrectedVelocityFvPatchVectorField
29 Velocity outlet boundary condition for patches where the pressure is
30 specified. The outflow velocity is obtained by "zeroGradient" and then
31 corrected from the flux. If reverse flow is possible or expected use
32 the "pressureInletOutletVelocityFvPatchVectorField" BC instead.
35 fluxCorrectedVelocityFvPatchVectorField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef fluxCorrectedVelocityFvPatchVectorField_H
40 #define fluxCorrectedVelocityFvPatchVectorField_H
42 #include "fvPatchFields.H"
43 #include "zeroGradientFvPatchFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class fluxCorrectedVelocityFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
54 class fluxCorrectedVelocityFvPatchVectorField
56 public zeroGradientFvPatchVectorField
66 //- Runtime type information
67 TypeName("fluxCorrectedVelocity");
72 //- Construct from patch and internal field
73 fluxCorrectedVelocityFvPatchVectorField
76 const DimensionedField<vector, volMesh>&
79 //- Construct from patch, internal field and dictionary
80 fluxCorrectedVelocityFvPatchVectorField
83 const DimensionedField<vector, volMesh>&,
87 //- Construct by mapping given fluxCorrectedVelocityFvPatchVectorField
89 fluxCorrectedVelocityFvPatchVectorField
91 const fluxCorrectedVelocityFvPatchVectorField&,
93 const DimensionedField<vector, volMesh>&,
94 const fvPatchFieldMapper&
97 //- Construct and return a clone
98 virtual tmp<fvPatchVectorField> clone() const
100 return tmp<fvPatchVectorField>
102 new fluxCorrectedVelocityFvPatchVectorField(*this)
106 //- Construct as copy setting internal field reference
107 fluxCorrectedVelocityFvPatchVectorField
109 const fluxCorrectedVelocityFvPatchVectorField&,
110 const DimensionedField<vector, volMesh>&
113 //- Construct and return a clone setting internal field reference
114 virtual tmp<fvPatchVectorField> clone
116 const DimensionedField<vector, volMesh>& iF
119 return tmp<fvPatchVectorField>
121 new fluxCorrectedVelocityFvPatchVectorField(*this, iF)
128 // Evaluation functions
130 //- Evaluate the patch field
131 virtual void evaluate
133 const Pstream::commsTypes commsType=Pstream::blocking
138 virtual void write(Ostream&) const;
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 } // End namespace Foam
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 // ************************************************************************* //