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 and return a clone
143  virtual tmp<faPatchField<Type>> clone() const
144  {
145  return tmp<faPatchField<Type>>
146  (
148  );
149  }
150 
151  //- Construct as copy setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
164  return tmp<faPatchField<Type>>
165  (
167  );
168  }
170 
171  // Member Functions
172 
173  //- Update the coefficients associated with the patch field
174  virtual void updateCoeffs();
175 
176  //- Write
177  virtual void write(Ostream& os) const;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #ifdef NoRepository
189 #endif
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
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
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
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.
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...
Definition: areaFieldsFwd.H:42
virtual tmp< faPatchField< Type > > clone() const
Construct and return a clone.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A FieldMapper for finite-area patch fields.
Namespace for OpenFOAM.