fixedMeanFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2019 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 Description
28  This boundary condition extrapolates field to the patch using the near-cell
29  values and adjusts the distribution to match the specified, optionally
30  time-varying, mean value.
31 
32 Usage
33  \table
34  Property | Description | Required | Default value
35  meanValue | mean value Function1 | yes |
36  \endtable
37 
38  Example of the boundary condition specification:
39  \verbatim
40  <patchName>
41  {
42  type fixedMean;
43  meanValue 1.0;
44  }
45  \endverbatim
46 
47 See also
48  Foam::fixedValueFvPatchField
49  Foam::Function1Types
50 
51 SourceFiles
52  fixedMeanFvPatchField.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef fixedMeanFvPatchField_H
57 #define fixedMeanFvPatchField_H
58 
60 #include "Function1.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class fixedMeanFvPatchField Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 template<class Type>
72 class fixedMeanFvPatchField
73 :
74  public fixedValueFvPatchField<Type>
75 {
76  // Private Data
77 
78  //- MeanValue value the field is adjusted to maintain
79  autoPtr<Function1<Type>> meanValue_;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("fixedMean");
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 fixedMeanFvPatchField
106  // onto a new patch
108  (
110  const fvPatch&,
112  const fvPatchFieldMapper&
113  );
114 
115  //- Copy constructor
117  (
119  );
120 
121  //- Construct and return a clone
122  virtual tmp<fvPatchField<Type>> clone() const
123  {
124  return tmp<fvPatchField<Type>>
125  (
126  new fixedMeanFvPatchField<Type>(*this)
127  );
128  }
129 
130  //- Copy constructor setting internal field reference
132  (
135  );
136 
137  //- Construct and return a clone setting internal field reference
139  (
141  ) const
142  {
143  return tmp<fvPatchField<Type>>
144  (
145  new fixedMeanFvPatchField<Type>(*this, iF)
146  );
147  }
149 
150  // Member Functions
151 
152  //- Update the coefficients associated with the patch field
153  virtual void updateCoeffs();
154 
155  //- Write
156  virtual void write(Ostream&) const;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #ifdef NoRepository
167  #include "fixedMeanFvPatchField.C"
168 #endif
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
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.