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 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  grpGenericBoundaryConditions
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 mean value.
33 
34  \heading Patch usage
35 
36  \table
37  Property | Description | Required | Default value
38  meanValue | mean value | yes |
39  \endtable
40 
41  Example of the boundary condition specification:
42  \verbatim
43  myPatch
44  {
45  type fixedMean;
46  meanValue 1.0;
47  }
48  \endverbatim
49 
50 SeeAlso
51  Foam::fixedValueFvPatchField
52 
53 SourceFiles
54  fixedMeanFvPatchField.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef fixedMeanFvPatchField_H
59 #define fixedMeanFvPatchField_H
60 
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class fixedMeanFvPatchField Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 template<class Type>
73 class fixedMeanFvPatchField
74 :
75  public fixedValueFvPatchField<Type>
76 {
77 
78 protected:
79 
80  // Protected data
81 
82  //- MeanValue value the field is adjusted to maintain
83  Type meanValue_;
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("fixedMean");
90 
91 
92  // Constructors
93 
94  //- Construct from patch and internal field
96  (
97  const fvPatch&,
99  );
100 
101  //- Construct from patch, internal field and dictionary
103  (
104  const fvPatch&,
106  const dictionary&
107  );
108 
109  //- Construct by mapping given fixedMeanFvPatchField
110  // onto a new patch
112  (
114  const fvPatch&,
116  const fvPatchFieldMapper&
117  );
118 
119  //- Construct as copy
121  (
123  );
124 
125  //- Construct and return a clone
126  virtual tmp<fvPatchField<Type> > clone() const
127  {
128  return tmp<fvPatchField<Type> >
129  (
130  new fixedMeanFvPatchField<Type>(*this)
131  );
132  }
133 
134  //- Construct as copy setting internal field reference
136  (
139  );
140 
141  //- Construct and return a clone setting internal field reference
142  virtual tmp<fvPatchField<Type> > clone
143  (
145  ) const
146  {
147  return tmp<fvPatchField<Type> >
148  (
149  new fixedMeanFvPatchField<Type>(*this, iF)
150  );
151  }
152 
153 
154  // Member functions
155 
156  // Evaluation functions
157 
158  //- Update the coefficients associated with the patch field
159  virtual void updateCoeffs();
160 
161  //- Write
162  virtual void write(Ostream&) const;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #ifdef NoRepository
173 # include "fixedMeanFvPatchField.C"
174 #endif
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
Foam::fixedMeanFvPatchField::meanValue_
Type meanValue_
MeanValue value the field is adjusted to maintain.
Definition: fixedMeanFvPatchField.H:92
Foam::fixedMeanFvPatchField::fixedMeanFvPatchField
fixedMeanFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fixedMeanFvPatchField.C:33
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:79
Foam::fixedMeanFvPatchField::TypeName
TypeName("fixedMean")
Runtime type information.
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::fixedMeanFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: fixedMeanFvPatchField.C:125
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fixedMeanFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fixedMeanFvPatchField.C:96
Foam::fixedMeanFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fixedMeanFvPatchField.H:135
fixedValueFvPatchFields.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::fixedMeanFvPatchField
This boundary condition extrapolates field to the patch using the near-cell values and adjusts the di...
Definition: fixedMeanFvPatchField.H:82
fixedMeanFvPatchField.C
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51