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::uniformDensityHydrostaticPressureFvPatchScalarField
29 Hydrostatic pressure boundary condition calculated as
31 pRefValue + rho*g.(x - pRefPoint)
33 where rho is provided and assumed uniform.
36 uniformDensityHydrostaticPressureFvPatchScalarField.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef uniformDensityHydrostaticPressureFvPatchScalarField_H
41 #define uniformDensityHydrostaticPressureFvPatchScalarField_H
43 #include "fixedValueFvPatchFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class uniformDensityHydrostaticPressureFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
54 class uniformDensityHydrostaticPressureFvPatchScalarField
56 public fixedValueFvPatchScalarField
60 //- Constant density in the far-field
63 //- Reference pressure
66 //- Reference pressure location
72 //- Runtime type information
73 TypeName("uniformDensityHydrostaticPressure");
78 //- Construct from patch and internal field
79 uniformDensityHydrostaticPressureFvPatchScalarField
82 const DimensionedField<scalar, volMesh>&
85 //- Construct from patch, internal field and dictionary
86 uniformDensityHydrostaticPressureFvPatchScalarField
89 const DimensionedField<scalar, volMesh>&,
93 //- Construct by mapping given
94 // uniformDensityHydrostaticPressureFvPatchScalarField onto a new patch
95 uniformDensityHydrostaticPressureFvPatchScalarField
97 const uniformDensityHydrostaticPressureFvPatchScalarField&,
99 const DimensionedField<scalar, volMesh>&,
100 const fvPatchFieldMapper&
103 //- Construct as copy
104 uniformDensityHydrostaticPressureFvPatchScalarField
106 const uniformDensityHydrostaticPressureFvPatchScalarField&
109 //- Construct and return a clone
110 virtual tmp<fvPatchScalarField> clone() const
112 return tmp<fvPatchScalarField>
114 new uniformDensityHydrostaticPressureFvPatchScalarField(*this)
118 //- Construct as copy setting internal field reference
119 uniformDensityHydrostaticPressureFvPatchScalarField
121 const uniformDensityHydrostaticPressureFvPatchScalarField&,
122 const DimensionedField<scalar, volMesh>&
125 //- Construct and return a clone setting internal field reference
126 virtual tmp<fvPatchScalarField> clone
128 const DimensionedField<scalar, volMesh>& iF
131 return tmp<fvPatchScalarField>
133 new uniformDensityHydrostaticPressureFvPatchScalarField
146 //- Return the constant density in the far-field
152 //- Return reference to the constant density in the far-field
153 // to allow adjustment
159 //- Return the reference pressure
160 scalar pRefValue() const
165 //- Return reference to the reference pressure to allow adjustment
171 //- Return the pressure reference location
172 const vector& pRefPoint() const
177 //- Return reference to the pressure reference location
178 // to allow adjustment
185 // Evaluation functions
187 //- Update the coefficients associated with the patch field
188 virtual void updateCoeffs();
192 virtual void write(Ostream&) const;
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 } // End namespace Foam
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 // ************************************************************************* //