coupledFreestreamFvPatchField.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::coupledFreestreamFvPatchField
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::freestreamFvPatchField
56 
57 SourceFiles
58  coupledFreestreamFvPatchField.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef coupledFreestreamFvPatchField_H
63 #define coupledFreestreamFvPatchField_H
64 
65 #include "freestreamFvPatchField.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class coupledFreestreamFvPatchField Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 template<class Type>
77 class coupledFreestreamFvPatchField
78 :
79  public freestreamFvPatchField<Type>
80 {
81  private:
82  label debug_ =1; //控制调试信息的输出的
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("coupledFreestream");
88 
89 
90  // Constructors
91 
92  //- Construct from patch and internal field
94  (
95  const fvPatch&,
97  );
98 
99  //- Construct from patch, internal field and dictionary
101  (
102  const fvPatch&,
104  const dictionary&
105  );
106 
107  //- Construct by mapping given coupledFreestreamFvPatchField onto a new patch
109  (
111  const fvPatch&,
113  const fvPatchFieldMapper&
114  );
115 
116  //- Construct as copy
118  (
120  );
121 
122  //- Construct and return a clone
123  virtual tmp<fvPatchField<Type> > clone() const
124  {
125  return tmp<fvPatchField<Type> >
126  (
128  );
129  }
130 
131  //- Construct as copy setting internal field reference
133  (
136  );
137 
138  //- Construct and return a clone setting internal field reference
139  virtual tmp<fvPatchField<Type> > clone
140  (
142  ) const
143  {
144  return tmp<fvPatchField<Type> >
145  (
147  );
148  }
149 
150 
151  // Member functions
152  //- Update the coefficients associated with the patch field
153  virtual void updateCoeffs();
154 
155  // Return defining fields
156 
157  const Field<Type>& freestreamValue() const
158  {
159  return this->refValue();
160  }
161 
163  {
164  return this->refValue();
165  }
166 
167 
168  //- Write
169  virtual void write(Ostream&) const;
170 };
171 
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 } // End namespace Foam
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #ifdef NoRepository
181 #endif
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
Foam::mixedFvPatchField::refValue
virtual Field< Type > & refValue()
Definition: mixedFvPatchField.H:224
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::coupledFreestreamFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: coupledFreestreamFvPatchField.H:137
Foam::coupledFreestreamFvPatchField::TypeName
TypeName("coupledFreestream")
Runtime type information.
coupledFreestreamFvPatchField.C
Foam::freestreamFvPatchField
This boundary condition provides a free-stream condition. It is a 'mixed' condition derived from the ...
Definition: freestreamFvPatchField.H:91
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Field< Type >
Foam::coupledFreestreamFvPatchField::freestreamValue
Field< Type > & freestreamValue()
Definition: coupledFreestreamFvPatchField.H:176
Foam::coupledFreestreamFvPatchField::freestreamValue
const Field< Type > & freestreamValue() const
Definition: coupledFreestreamFvPatchField.H:171
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::coupledFreestreamFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: coupledFreestreamFvPatchField.C:300
Foam::coupledFreestreamFvPatchField::debug_
label debug_
Definition: coupledFreestreamFvPatchField.H:96
Foam::coupledFreestreamFvPatchField
This boundary condition provides a free-stream condition. It is a 'mixed' condition derived from the ...
Definition: coupledFreestreamFvPatchField.H:91
Foam::coupledFreestreamFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: coupledFreestreamFvPatchField.C:112
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
Foam::coupledFreestreamFvPatchField::coupledFreestreamFvPatchField
coupledFreestreamFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: coupledFreestreamFvPatchField.C:39
freestreamFvPatchField.H
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::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51