1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2009-2011 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::uniformDensityHydrostaticPressureFvPatchScalarField
28 Hydrostatic pressure boundary condition calculated as
30 pRefValue + rho*g.(x - pRefPoint)
32 where rho is provided and assumed uniform.
35 uniformDensityHydrostaticPressureFvPatchScalarField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef uniformDensityHydrostaticPressureFvPatchScalarField_H
40 #define uniformDensityHydrostaticPressureFvPatchScalarField_H
42 #include "fixedValueFvPatchFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class uniformDensityHydrostaticPressureFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
53 class uniformDensityHydrostaticPressureFvPatchScalarField
55 public fixedValueFvPatchScalarField
59 //- Constant density in the far-field
62 //- Reference pressure
65 //- Reference pressure location
71 //- Runtime type information
72 TypeName("uniformDensityHydrostaticPressure");
77 //- Construct from patch and internal field
78 uniformDensityHydrostaticPressureFvPatchScalarField
81 const DimensionedField<scalar, volMesh>&
84 //- Construct from patch, internal field and dictionary
85 uniformDensityHydrostaticPressureFvPatchScalarField
88 const DimensionedField<scalar, volMesh>&,
92 //- Construct by mapping given
93 // uniformDensityHydrostaticPressureFvPatchScalarField onto a new patch
94 uniformDensityHydrostaticPressureFvPatchScalarField
96 const uniformDensityHydrostaticPressureFvPatchScalarField&,
98 const DimensionedField<scalar, volMesh>&,
99 const fvPatchFieldMapper&
102 //- Construct as copy
103 uniformDensityHydrostaticPressureFvPatchScalarField
105 const uniformDensityHydrostaticPressureFvPatchScalarField&
108 //- Construct and return a clone
109 virtual tmp<fvPatchScalarField> clone() const
111 return tmp<fvPatchScalarField>
113 new uniformDensityHydrostaticPressureFvPatchScalarField(*this)
117 //- Construct as copy setting internal field reference
118 uniformDensityHydrostaticPressureFvPatchScalarField
120 const uniformDensityHydrostaticPressureFvPatchScalarField&,
121 const DimensionedField<scalar, volMesh>&
124 //- Construct and return a clone setting internal field reference
125 virtual tmp<fvPatchScalarField> clone
127 const DimensionedField<scalar, volMesh>& iF
130 return tmp<fvPatchScalarField>
132 new uniformDensityHydrostaticPressureFvPatchScalarField
145 //- Return the constant density in the far-field
151 //- Return reference to the constant density in the far-field
152 // to allow adjustment
158 //- Return the reference pressure
159 scalar pRefValue() const
164 //- Return reference to the reference pressure to allow adjustment
170 //- Return the pressure reference location
171 const vector& pRefPoint() const
176 //- Return reference to the pressure reference location
177 // to allow adjustment
184 // Evaluation functions
186 //- Update the coefficients associated with the patch field
187 virtual void updateCoeffs();
191 virtual void write(Ostream&) const;
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 } // End namespace Foam
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 // ************************************************************************* //