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 | Copyright (C) 2011-2013 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::freestreamFvPatchField
26 
27 Group
28  grpInletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31  This boundary condition provides a free-stream condition. It is a 'mixed'
32  condition derived from the \c inletOutlet condition, whereby the mode of
33  operation switches between fixed (free stream) value and zero gradient
34  based on the sign of the flux.
35 
36  \heading Patch usage
37 
38  \table
39  Property | Description | Required | Default value
40  freestreamValue | freestream velocity | yes |
41  phi | flux field name | no | phi
42  \endtable
43 
44  Example of the boundary condition specification:
45  \verbatim
46  myPatch
47  {
48  type freestream;
49  phi phi;
50  }
51  \endverbatim
52 
53 SeeAlso
54  Foam::mixedFvPatchField
55  Foam::inletOutletFvPatchField
56 
57 SourceFiles
58  freestreamFvPatchField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef freestreamFvPatchField_H
63 #define freestreamFvPatchField_H
64 
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class freestreamFvPatchField Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 template<class Type>
77 class freestreamFvPatchField
78 :
79  public inletOutletFvPatchField<Type>
80 {
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("freestream");
86 
87 
88  // Constructors
89 
90  //- Construct from patch and internal field
92  (
93  const fvPatch&,
95  );
96 
97  //- Construct from patch, internal field and dictionary
99  (
100  const fvPatch&,
102  const dictionary&
103  );
104 
105  //- Construct by mapping given freestreamFvPatchField onto a new patch
107  (
109  const fvPatch&,
111  const fvPatchFieldMapper&
112  );
113 
114  //- Construct as copy
116  (
118  );
119 
120  //- Construct and return a clone
121  virtual tmp<fvPatchField<Type> > clone() const
122  {
123  return tmp<fvPatchField<Type> >
124  (
126  );
127  }
128 
129  //- Construct as copy setting internal field reference
131  (
134  );
135 
136  //- Construct and return a clone setting internal field reference
137  virtual tmp<fvPatchField<Type> > clone
138  (
140  ) const
141  {
142  return tmp<fvPatchField<Type> >
143  (
144  new freestreamFvPatchField<Type>(*this, iF)
145  );
146  }
147 
148 
149  // Member functions
150 
151  // Return defining fields
152 
153  const Field<Type>& freestreamValue() const
154  {
155  return this->refValue();
156  }
157 
159  {
160  return this->refValue();
161  }
162 
163 
164  //- Write
165  virtual void write(Ostream&) const;
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #ifdef NoRepository
176 # include "freestreamFvPatchField.C"
177 #endif
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
Foam::freestreamFvPatchField::TypeName
TypeName("freestream")
Runtime type information.
Foam::freestreamFvPatchField::freestreamFvPatchField
freestreamFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: freestreamFvPatchField.C:37
Foam::freestreamFvPatchField::freestreamValue
const Field< Type > & freestreamValue() const
Definition: freestreamFvPatchField.H:167
Foam::mixedFvPatchField::refValue
virtual Field< Type > & refValue()
Definition: mixedFvPatchField.H:224
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
freestreamFvPatchField.C
Foam::freestreamFvPatchField
This boundary condition provides a free-stream condition. It is a 'mixed' condition derived from the ...
Definition: freestreamFvPatchField.H:91
Foam::Field< Type >
Foam::inletOutletFvPatchField
This boundary condition provides a generic outflow condition, with specified inflow for the case of r...
Definition: inletOutletFvPatchField.H:100
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::freestreamFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: freestreamFvPatchField.C:111
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
inletOutletFvPatchField.H
Foam::freestreamFvPatchField::freestreamValue
Field< Type > & freestreamValue()
Definition: freestreamFvPatchField.H:172
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::freestreamFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: freestreamFvPatchField.H:135
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51