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 and return a clone
132  virtual tmp<fvPatchScalarField> clone() const
133  {
135  (
137  );
138  }
139 
140  //- Construct as copy setting internal field reference
142  (
145  );
146 
147  //- Construct and return a clone setting internal field reference
149  (
151  ) const
152  {
154  (
156  );
157  }
158 
159 
160  // Member functions
161 
162  const scalarField& freestreamValue() const
163  {
164  return refValue();
165  }
166 
168  {
169  return refValue();
170  }
171 
172 
173  // Evaluation functions
174 
175  //- Update the coefficients associated with the patch field
176  virtual void updateCoeffs();
177 
178 
179  //- Write
180  virtual void write(Ostream&) const;
181 };
182 
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 } // End namespace Foam
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::freestreamPressureFvPatchScalarField::freestreamValue
scalarField & freestreamValue()
Definition: freestreamPressureFvPatchScalarField.H:181
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::freestreamPressureFvPatchScalarField
This boundary condition provides a free-stream condition for pressure.
Definition: freestreamPressureFvPatchScalarField.H:96
Foam::freestreamPressureFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: freestreamPressureFvPatchScalarField.C:135
Foam::freestreamPressureFvPatchScalarField::TypeName
TypeName("freestreamPressure")
Runtime type information.
Foam::freestreamPressureFvPatchScalarField::freestreamValue
const scalarField & freestreamValue() const
Definition: freestreamPressureFvPatchScalarField.H:176
Foam::freestreamPressureFvPatchScalarField::freestreamPressureFvPatchScalarField
freestreamPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: freestreamPressureFvPatchScalarField.C:37
Foam::Field< scalar >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::freestreamPressureFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: freestreamPressureFvPatchScalarField.C:116
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedFvPatchFields.H
fvPatchFields.H
Foam::freestreamPressureFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: freestreamPressureFvPatchScalarField.H:146
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54