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-2020 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::Function1s
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  //- Disallow copy without setting internal field reference
117 
118  //- Copy constructor setting internal field reference
120  (
123  );
124 
125  //- Construct and return a clone setting internal field reference
127  (
129  ) const
130  {
131  return tmp<fvPatchField<Type>>
132  (
133  new fixedMeanFvPatchField<Type>(*this, iF)
134  );
135  }
137 
138  // Member Functions
139 
140  //- Update the coefficients associated with the patch field
141  virtual void updateCoeffs();
142 
143  //- Write
144  virtual void write(Ostream&) const;
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #ifdef NoRepository
155  #include "fixedMeanFvPatchField.C"
156 #endif
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
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:62
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:54
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
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
Namespace for OpenFOAM.