1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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::buoyantPressureFvPatchScalarField
29 Set the pressure gradient boundary condition appropriately for buoyant flow.
31 If the variable name is "pd" assume it is p - rho*g.h and set the gradient
32 appropriately. Otherwise assume the variable is the static pressure.
35 buoyantPressureFvPatchScalarField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef buoyantPressureFvPatchScalarFields_H
40 #define buoyantPressureFvPatchScalarFields_H
42 #include "fvPatchFields.H"
43 #include "fixedGradientFvPatchFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class buoyantPressureFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
54 class buoyantPressureFvPatchScalarField
56 public fixedGradientFvPatchScalarField
60 //- Name of the density field used to calculate the buoyancy force
66 //- Runtime type information
67 TypeName("buoyantPressure");
72 //- Construct from patch and internal field
73 buoyantPressureFvPatchScalarField
76 const DimensionedField<scalar, volMesh>&
79 //- Construct from patch, internal field and dictionary
80 buoyantPressureFvPatchScalarField
83 const DimensionedField<scalar, volMesh>&,
87 //- Construct by mapping given
88 // buoyantPressureFvPatchScalarField onto a new patch
89 buoyantPressureFvPatchScalarField
91 const buoyantPressureFvPatchScalarField&,
93 const DimensionedField<scalar, volMesh>&,
94 const fvPatchFieldMapper&
98 buoyantPressureFvPatchScalarField
100 const buoyantPressureFvPatchScalarField&
103 //- Construct and return a clone
104 virtual tmp<fvPatchScalarField> clone() const
106 return tmp<fvPatchScalarField>
108 new buoyantPressureFvPatchScalarField(*this)
112 //- Construct as copy setting internal field reference
113 buoyantPressureFvPatchScalarField
115 const buoyantPressureFvPatchScalarField&,
116 const DimensionedField<scalar, volMesh>&
119 //- Construct and return a clone setting internal field reference
120 virtual tmp<fvPatchScalarField> clone
122 const DimensionedField<scalar, volMesh>& iF
125 return tmp<fvPatchScalarField>
127 new buoyantPressureFvPatchScalarField(*this, iF)
134 //- Update the coefficients associated with the patch field
135 virtual void updateCoeffs();
138 virtual void write(Ostream&) const;
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 } // End namespace Foam
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 // ************************************************************************* //