uniformFixedValueFvPatchField.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2018-2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::uniformFixedValueFvPatchField
29 
30 Group
31  grpGenericBoundaryConditions
32 
33 Description
34  This boundary condition provides a uniform fixed value condition.
35 
36 Usage
37  \table
38  Property | Description | Required | Default
39  uniformValue | uniform value | yes |
40  value | initial field value | optional |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  <patchName>
46  {
47  type uniformFixedValue;
48  uniformValue constant 0.2;
49  }
50  \endverbatim
51 
52 Note
53  The uniformValue entry is a PatchFunction1 type,
54  able to describe time and spatial varying functions.
55  The example above gives the usage for supplying a constant value.
56 
57  The \c value entry (optional) is used for the initial values.
58  Otherwise the \c uniformValue is evaluated.
59  In some cases (eg, coded or expression entries with references to other
60  fields) this can be problematic and the \c value entry will be needed.
61 
62 See also
63  Foam::Function1Types
64  Foam::fixedValueFvPatchField
65 
66 SourceFiles
67  uniformFixedValueFvPatchField.C
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef Foam_uniformFixedValueFvPatchField_H
72 #define Foam_uniformFixedValueFvPatchField_H
73 
75 #include "PatchFunction1.H"
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class uniformFixedValueFvPatchField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 template<class Type>
87 class uniformFixedValueFvPatchField
88 :
89  public fixedValueFvPatchField<Type>
90 {
91  // Private Data
92 
93  //- Function providing the value
94  autoPtr<PatchFunction1<Type>> refValueFunc_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("uniformFixedValue");
101 
102 
103  // Constructors
104 
105  //- Construct from patch and internal field
107  (
108  const fvPatch&,
110  );
111 
112  //- Construct from patch and internal field and patch field
114  (
115  const fvPatch&,
117  const Field<Type>& fld
118  );
119 
120  //- Construct from patch, internal field and dictionary
122  (
123  const fvPatch&,
125  const dictionary&
126  );
127 
128  //- Construct by mapping onto a new patch
130  (
132  const fvPatch&,
134  const fvPatchFieldMapper&
135  );
136 
137  //- Construct as copy
139  (
141  );
142 
143  //- Construct and return a clone
144  virtual tmp<fvPatchField<Type>> clone() const
145  {
146  return tmp<fvPatchField<Type>>
147  (
149  );
150  }
151 
152  //- Construct as copy setting internal field reference
154  (
157  );
158 
159  //- Construct and return a clone setting internal field reference
161  (
163  ) const
164  {
165  return tmp<fvPatchField<Type>>
166  (
168  );
169  }
171 
172  // Member Functions
173 
174  // Mapping functions
175 
176  //- Map (and resize as needed) from self given a mapping object
177  virtual void autoMap
178  (
179  const fvPatchFieldMapper&
180  );
181 
182  //- Reverse map the given fvPatchField onto this fvPatchField
183  virtual void rmap
184  (
185  const fvPatchField<Type>&,
186  const labelList&
187  );
188 
189 
190  //- Update the coefficients associated with the patch field
191  virtual void updateCoeffs();
192 
193  //- Write
194  virtual void write(Ostream& os) const;
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #ifdef NoRepository
206 #endif
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #endif
211 
212 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
This boundary condition provides a uniform fixed value condition.
Generic templated field type.
Definition: Field.H:62
A FieldMapper for finite-volume patch fields.
uniformFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual void write(Ostream &os) const
Write.
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
TypeName("uniformFixedValue")
Runtime type information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Namespace for OpenFOAM.