freestreamFvPatchField.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-2018 OpenFOAM Foundation
9 Copyright (C) 2018 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::freestreamFvPatchField
29
30Group
31 grpInletBoundaryConditions grpOutletBoundaryConditions
32
33Description
34 This boundary condition provides a free-stream condition. It is a 'mixed'
35 condition derived from the \c inletOutlet condition, whereby the mode of
36 operation switches between fixed (free stream) value and zero gradient
37 based on the sign of the flux.
38
39Usage
40 \table
41 Property | Description | Required | Default value
42 freestreamValue | freestream velocity | no |
43 freestreamBC | patchField providing the inlet field | no |
44 phi | flux field name | no | phi
45 \endtable
46
47 Example of the boundary condition specification using a fixed value
48 inlet condition:
49 \verbatim
50 <patchName>
51 {
52 type freestream;
53 freestreamValue uniform (300 0 0);
54 }
55 \endverbatim
56
57 Example of the boundary condition specification using a separate condition
58 to proveide the inlet condition:
59 \verbatim
60 <patchName>
61 {
62 type freestream;
63 freestreamBC
64 {
65 type atmBoundaryLayerInletVelocity;
66 flowDir (1 0 0);
67 zDir (0 0 1);
68 Uref 20;
69 Zref 20;
70 z0 uniform 0.1;
71 zGround uniform 935;
72 }
73 }
74 \endverbatim
75
76
77See also
78 Foam::mixedFvPatchField
79 Foam::inletOutletFvPatchField
80
81SourceFiles
82 freestreamFvPatchField.C
83
84\*---------------------------------------------------------------------------*/
85
86#ifndef freestreamFvPatchField_H
87#define freestreamFvPatchField_H
88
90
91// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92
93namespace Foam
94{
95
96/*---------------------------------------------------------------------------*\
97 Class freestreamFvPatchField Declaration
98\*---------------------------------------------------------------------------*/
99
100template<class Type>
101class freestreamFvPatchField
102:
103 public inletOutletFvPatchField<Type>
104{
105 // Private data
106
107 //- BC to supply the freestream value
108 tmp<fvPatchField<Type>> freestreamBCPtr_;
109
110
111public:
112
113 //- Runtime type information
114 TypeName("freestream");
115
116
117 // Constructors
118
119 //- Construct from patch and internal field
121 (
122 const fvPatch&,
124 );
125
126 //- Construct from patch, internal field and dictionary
128 (
129 const fvPatch&,
131 const dictionary&
132 );
134 //- Construct by mapping given freestreamFvPatchField onto a new patch
136 (
138 const fvPatch&,
140 const fvPatchFieldMapper&
141 );
142
143 //- Construct as copy
145 (
147 );
148
149 //- Construct and return a clone
150 virtual tmp<fvPatchField<Type>> clone() const
151 {
153 (
155 );
156 }
157
158 //- Construct as copy setting internal field reference
160 (
163 );
164
165 //- Construct and return a clone setting internal field reference
167 (
169 ) const
170 {
172 (
173 new freestreamFvPatchField<Type>(*this, iF)
174 );
175 }
176
177
178 // Member functions
179
180 // Mapping functions
181
182 //- Map (and resize as needed) from self given a mapping object
183 virtual void autoMap(const fvPatchFieldMapper& mapper);
184
185 //- Reverse map the given fvPatchField onto this fvPatchField
186 virtual void rmap
187 (
188 const fvPatchField<Type>& ptf,
189 const labelList& addr
190 );
191
192
193 //- Update the coefficients associated with the patch field
194 virtual void updateCoeffs();
195
196 // Return defining fields
197
198 const Field<Type>& freestreamValue() const
199 {
200 return this->refValue();
201 }
202
204 {
205 return this->refValue();
206 }
207
208
209 //- Write
210 virtual void write(Ostream&) const;
211};
212
213
214// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215
216} // End namespace Foam
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220#ifdef NoRepository
221 #include "freestreamFvPatchField.C"
222#endif
223
224// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225
226#endif
227
228// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type.
Definition: Field.H:82
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition provides a free-stream condition. It is a 'mixed' condition derived from the ...
const Field< Type > & freestreamValue() const
virtual void autoMap(const fvPatchFieldMapper &mapper)
Map (and resize as needed) from self given a mapping object.
virtual void rmap(const fvPatchField< Type > &ptf, const labelList &addr)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("freestream")
Runtime type information.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Construct and return a clone setting internal field reference.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This boundary condition provides a generic outflow condition, with specified inflow for the case of r...
virtual Field< Type > & refValue()
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73