fixedMeanFvPatchField.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) 2012-2016 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::fixedMeanFvPatchField
26 
27 Group
28  grpInletBoundaryConditions
29 
30 Description
31  This boundary condition extrapolates field to the patch using the near-cell
32  values and adjusts the distribution to match the specified, optionally
33  time-varying, mean value.
34 
35 Usage
36  \table
37  Property | Description | Required | Default value
38  meanValue | mean value Function1 | yes |
39  \endtable
40 
41  Example of the boundary condition specification:
42  \verbatim
43  <patchName>
44  {
45  type fixedMean;
46  meanValue 1.0;
47  }
48  \endverbatim
49 
50 See also
51  Foam::fixedValueFvPatchField
52  Foam::Function1Types
53 
54 SourceFiles
55  fixedMeanFvPatchField.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef fixedMeanFvPatchField_H
60 #define fixedMeanFvPatchField_H
61 
63 #include "Function1.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class fixedMeanFvPatchField Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 template<class Type>
75 class fixedMeanFvPatchField
76 :
77  public fixedValueFvPatchField<Type>
78 {
79  // Private data
80 
81  //- MeanValue value the field is adjusted to maintain
82  autoPtr<Function1<Type>> meanValue_;
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("fixedMean");
89 
90 
91  // Constructors
92 
93  //- Construct from patch and internal field
95  (
96  const fvPatch&,
98  );
99 
100  //- Construct from patch, internal field and dictionary
102  (
103  const fvPatch&,
105  const dictionary&
106  );
107 
108  //- Construct by mapping given fixedMeanFvPatchField
109  // onto a new patch
111  (
113  const fvPatch&,
115  const fvPatchFieldMapper&
116  );
117 
118  //- Construct as copy
120  (
122  );
123 
124  //- Construct and return a clone
125  virtual tmp<fvPatchField<Type>> clone() const
126  {
127  return tmp<fvPatchField<Type>>
128  (
129  new fixedMeanFvPatchField<Type>(*this)
130  );
131  }
132 
133  //- Construct as copy setting internal field reference
135  (
138  );
139 
140  //- Construct and return a clone setting internal field reference
142  (
144  ) const
145  {
146  return tmp<fvPatchField<Type>>
147  (
148  new fixedMeanFvPatchField<Type>(*this, iF)
149  );
150  }
152 
153  // Member functions
154 
155  //- Update the coefficients associated with the patch field
156  virtual void updateCoeffs();
157 
158  //- Write
159  virtual void write(Ostream&) const;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #ifdef NoRepository
170  #include "fixedMeanFvPatchField.C"
171 #endif
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
This boundary condition extrapolates field to the patch using the near-cell values and adjusts the di...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
TypeName("fixedMean")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
virtual void write(Ostream &) const
Write.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
fixedMeanFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.