uniformFixedValueFaPatchField.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) 2023 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::uniformFixedValueFaPatchField
28 
29 Group
30  grpGenericBoundaryConditions
31 
32 Description
33  This boundary condition provides a uniform fixed value condition.
34 
35 Usage
36  \table
37  Property | Description | Required | Default
38  uniformValue | uniform value | yes |
39  value | initial field value | optional |
40  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  <patchName>
45  {
46  type uniformFixedValue;
47  uniformValue constant 0.2;
48  }
49  \endverbatim
50 
51 Note
52  The uniformValue entry is a Function1 type,
53  able to describe time varying functions.
54  The example above gives the usage for supplying a constant value.
55 
56  The \c value entry (optional) is used for the initial values.
57  Otherwise the \c uniformValue is evaluated.
58  In some cases (eg, coded or expression entries with references to other
59  fields) this can be problematic and the \c value entry will be needed.
60 
61 See also
62  Foam::Function1Types
63  Foam::fixedValueFaPatchField
64 
65 SourceFiles
66  uniformFixedValueFaPatchField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef Foam_uniformFixedValueFaPatchField_H
71 #define Foam_uniformFixedValueFaPatchField_H
72 
73 #include "fixedValueFaPatchField.H"
74 #include "Function1.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class uniformFixedValueFaPatchField Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 template<class Type>
86 class uniformFixedValueFaPatchField
87 :
88  public fixedValueFaPatchField<Type>
89 {
90  // Private Data
91 
92  //- Function providing the value
93  autoPtr<Function1<Type>> refValueFunc_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("uniformFixedValue");
100 
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const faPatch&,
109  );
110 
111  //- Construct from patch and internal field and patch field
113  (
114  const faPatch&,
116  const Field<Type>& fld
117  );
118 
119  //- Construct from patch, internal field and dictionary
121  (
122  const faPatch&,
124  const dictionary&
125  );
126 
127  //- Construct by mapping onto a new patch
129  (
131  const faPatch&,
133  const faPatchFieldMapper&
134  );
135 
136  //- Construct as copy
138  (
140  );
141 
142  //- Construct as copy setting internal field reference
144  (
147  );
148 
149  //- Return clone
150  virtual tmp<faPatchField<Type>> clone() const
151  {
152  return faPatchField<Type>::Clone(*this);
153  }
154 
155  //- Clone with an internal field reference
157  (
159  ) const
160  {
161  return faPatchField<Type>::Clone(*this, iF);
162  }
163 
164 
165  // Member Functions
166 
167  //- Update the coefficients associated with the patch field
168  virtual void updateCoeffs();
169 
170  //- Write includes "value" entry
171  virtual void write(Ostream& os) const;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
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
uniformFixedValueFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
Generic templated field type.
Definition: Field.H:62
static tmp< faPatchField< Type > > Clone(const DerivedPatchField &pf)
Clone a patch field with its own internal field reference.
Definition: faPatchField.H:513
OBJstream os(runTime.globalPath()/outputName)
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:72
virtual void write(Ostream &os) const
Write includes "value" entry.
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))
This boundary condition provides a uniform fixed value condition.
TypeName("uniformFixedValue")
Runtime type information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual tmp< faPatchField< Type > > clone() const
Return clone.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A FieldMapper for finite-area patch fields.
Namespace for OpenFOAM.