freestreamPressureFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::freestreamPressureFvPatchScalarField
28 
29 Group
30  grpInletBoundaryConditions grpOutletBoundaryConditions
31 
32 Description
33  This boundary condition provides a free-stream condition for pressure.
34 
35  It is an outlet-inlet condition that uses the velocity orientation to
36  continuously blend between zero gradient for normal inlet and fixed value
37  for normal outlet flow.
38 
39 Usage
40  \table
41  Property | Description | Required | Default value
42  U | velocity field name | no | U
43  freestreamValue | freestream pressure | yes |
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  <patchName>
49  {
50  type freestreamPressure;
51  freestreamValue uniform 1e5;
52  }
53  \endverbatim
54 
55 Note
56  This condition is designed to operate with a freestreamVelocity condition
57 
58 See also
59  Foam::mixedFvPatchField
60  Foam::freestreamFvPatchField
61 
62 SourceFiles
63  freestreamPressureFvPatchScalarField.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef freestreamPressureFvPatchScalarField_H
68 #define freestreamPressureFvPatchScalarField_H
69 
70 #include "fvPatchFields.H"
71 #include "mixedFvPatchFields.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class freestreamPressureFvPatchScalarField Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class freestreamPressureFvPatchScalarField
83 :
84  public mixedFvPatchScalarField
85 {
86  // Private data
87 
88  //- Name of the velocity field
89  word UName_;
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("freestreamPressure");
96 
97 
98  // Constructors
99 
100  //- Construct from patch and internal field
102  (
103  const fvPatch&,
105  );
106 
107  //- Construct from patch, internal field and dictionary
109  (
110  const fvPatch&,
112  const dictionary&
113  );
114 
115  //- Construct by mapping given freestreamPressureFvPatchScalarField onto
116  // a new patch
118  (
120  const fvPatch&,
122  const fvPatchFieldMapper&
123  );
124 
125  //- Construct as copy
127  (
129  );
130 
131  //- Construct as copy setting internal field reference
133  (
136  );
137 
138  //- Return a clone
139  virtual tmp<fvPatchField<scalar>> clone() const
140  {
141  return fvPatchField<scalar>::Clone(*this);
142  }
143 
144  //- Clone with an internal field reference
146  (
148  ) const
149  {
150  return fvPatchField<scalar>::Clone(*this, iF);
151  }
152 
153 
154  // Member Functions
155 
156  //- Same as refValue()
157  const scalarField& freestreamValue() const { return refValue(); }
158 
159  //- Same as refValue()
160  scalarField& freestreamValue() { return refValue(); }
161 
162 
163  //- Update the coefficients associated with the patch field
164  virtual void updateCoeffs();
165 
166  //- Write
167  virtual void write(Ostream&) const;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("freestreamPressure")
Runtime type information.
freestreamPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: HashPtrTable.H:50
This boundary condition provides a free-stream condition for pressure.
const scalarField & freestreamValue() const
Same as refValue()
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
Namespace for OpenFOAM.