uniformFixedGradientFaPatchField.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::uniformFixedGradientFaPatchField
28 
29 Group
30  grpGenericBoundaryConditions
31 
32 Description
33  This boundary condition provides a uniform fixed gradient condition.
34 
35 Usage
36  \table
37  Property | Description | Required | Default
38  uniformGradient | uniform gradient | yes |
39  value | initial field value | optional |
40  \endtable
41 
42  Example of the boundary condition specification:
43  \verbatim
44  <patchName>
45  {
46  type uniformFixedGradient;
47  uniformGradient constant 0.2;
48  }
49  \endverbatim
50 
51 Note
52  The uniformGradient entry is a Function1 type.
53  The example above gives the usage for supplying a constant value.
54 
55  The \c value entry (optional) is used for the initial values.
56  Otherwise the \c uniformGradient is used for the evaluation.
57  In some cases (eg, coded or expression entries with references to other
58  fields) this can be problematic and the \c value entry will be needed.
59 
60 See also
61  Foam::Function1Types
62  Foam::fixedGradientFaPatchField
63 
64 SourceFiles
65  uniformFixedGradientFaPatchField.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef Foam_uniformFixedGradientFaPatchField_H
70 #define Foam_uniformFixedGradientFaPatchField_H
71 
73 #include "PatchFunction1.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class uniformFixedGradientFaPatchField Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 template<class Type>
85 class uniformFixedGradientFaPatchField
86 :
87  public fixedGradientFaPatchField<Type>
88 {
89  // Private Data
90 
91  //- Function providing the gradient
92  autoPtr<Function1<Type>> refGradFunc_;
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("uniformFixedGradient");
99 
100 
101  // Constructors
102 
103  //- Construct from patch and internal field
105  (
106  const faPatch&,
108  );
109 
110  //- Construct from patch and internal field and patch field
112  (
113  const faPatch&,
115  const Field<Type>& fld
116  );
117 
118  //- Construct from patch, internal field and dictionary
120  (
121  const faPatch&,
123  const dictionary&
124  );
125 
126  //- Construct by mapping onto a new patch
128  (
130  const faPatch&,
132  const faPatchFieldMapper&
133  );
134 
135  //- Construct as copy
137  (
139  );
140 
141  //- Construct and return a clone
142  virtual tmp<faPatchField<Type>> clone() const
143  {
144  return tmp<faPatchField<Type>>
145  (
147  );
148  }
149 
150  //- Construct as copy setting internal field reference
152  (
155  );
156 
157  //- Construct and return a clone setting internal field reference
159  (
161  ) const
162  {
163  return tmp<faPatchField<Type>>
164  (
166  );
167  }
169 
170  // Member functions
171 
172  //- Update the coefficients associated with the patch field
173  virtual void updateCoeffs();
174 
175  //- Write
176  virtual void write(Ostream& os) const;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #ifdef NoRepository
188 #endif
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< faPatchField< Type > > clone() const
Construct and return a clone.
uniformFixedGradientFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &os) const
Write.
Generic templated field type.
Definition: Field.H:62
TypeName("uniformFixedGradient")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
This boundary condition provides a uniform fixed gradient condition.
OBJstream os(runTime.globalPath()/outputName)
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:72
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))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A FieldMapper for finite-area patch fields.
Namespace for OpenFOAM.