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-2023 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, internal field and dictionary
92  (
93  const fvPatch&,
95  const dictionary&
96  );
97 
98  //- Construct by mapping given fixedMeanFvPatchField
99  // onto a new patch
101  (
103  const fvPatch&,
105  const fvPatchFieldMapper&
106  );
107 
108  //- Disallow copy without setting internal field reference
110 
111  //- Copy constructor setting internal field reference
113  (
116  );
117 
118  //- Construct and return a clone setting internal field reference
120  (
122  ) const
123  {
124  return tmp<fvPatchField<Type>>
125  (
126  new fixedMeanFvPatchField<Type>(*this, iF)
127  );
128  }
129 
130 
131  // Member Functions
132 
133  //- Update the coefficients associated with the patch field
134  virtual void updateCoeffs();
135 
136  //- Write
137  virtual void write(Ostream&) const;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #ifdef NoRepository
148  #include "fixedMeanFvPatchField.C"
149 #endif
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
This boundary condition extrapolates field to the patch using the near-cell values and adjusts the di...
virtual void write(Ostream &) const
Write.
TypeName("fixedMean")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
fixedMeanFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
Foam::fvPatchFieldMapper.
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:203
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.