uniformFixedGradientFvPatchField.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) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 2020 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::uniformFixedGradientFvPatchField
29 
30 Group
31  grpGenericBoundaryConditions
32 
33 Description
34  This boundary condition provides a uniform fixed gradient condition.
35 
36 Usage
37  \table
38  Property | Description | Required | Default
39  uniformGradient | uniform gradient | yes |
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 PatchFunction1 type,
53  able to describe time and spatial varying functions.
54  The example above gives the usage for supplying a constant value.
55 
56 See also
57  Foam::Function1Types
58  Foam::fixedGradientFvPatchField
59 
60 SourceFiles
61  uniformFixedGradientFvPatchField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef uniformFixedGradientFvPatchField_H
66 #define uniformFixedGradientFvPatchField_H
67 
69 #include "PatchFunction1.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class uniformFixedGradientFvPatchField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 template<class Type>
81 class uniformFixedGradientFvPatchField
82 :
83  public fixedGradientFvPatchField<Type>
84 {
85  // Private Data
86 
87  //- Gradient
88  autoPtr<PatchFunction1<Type>> uniformGradient_;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("uniformFixedGradient");
95 
96 
97  // Constructors
98 
99  //- Construct from patch and internal field
101  (
102  const fvPatch&,
104  );
105 
106  //- Construct from patch and internal field and patch field
108  (
109  const fvPatch&,
111  const Field<Type>& fld
112  );
113 
114  //- Construct from patch, internal field and dictionary
116  (
117  const fvPatch&,
119  const dictionary&
120  );
121 
122  //- Construct by mapping onto a new patch
124  (
126  const fvPatch&,
128  const fvPatchFieldMapper&
129  );
130 
131  //- Construct as copy
133  (
135  );
136 
137  //- Construct and return a clone
138  virtual tmp<fvPatchField<Type>> clone() const
139  {
140  return tmp<fvPatchField<Type>>
141  (
143  );
144  }
145 
146  //- Construct as copy setting internal field reference
148  (
151  );
152 
153  //- Construct and return a clone setting internal field reference
155  (
157  ) const
158  {
159  return tmp<fvPatchField<Type>>
160  (
162  );
163  }
164 
165 
166  // Member functions
167 
168  //- Update the coefficients associated with the patch field
169  virtual void updateCoeffs();
170 
171  //- Write
172  virtual void write(Ostream& os) const;
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #ifdef NoRepository
184 #endif
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
PatchFunction1.H
Foam::uniformFixedGradientFvPatchField::TypeName
TypeName("uniformFixedGradient")
Runtime type information.
Foam::Field
Generic templated field type.
Definition: Field.H:63
uniformFixedGradientFvPatchField.C
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
fld
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))
Definition: gmvOutputLagrangian.H:23
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fixedGradientFvPatchFields.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::uniformFixedGradientFvPatchField
This boundary condition provides a uniform fixed gradient condition.
Definition: uniformFixedGradientFvPatchField.H:90
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::fixedGradientFvPatchField
This boundary condition supplies a fixed gradient condition, such that the patch values are calculate...
Definition: fixedGradientFvPatchField.H:108
Foam::uniformFixedGradientFvPatchField::write
virtual void write(Ostream &os) const
Write.
Definition: uniformFixedGradientFvPatchField.C:138
Foam::uniformFixedGradientFvPatchField::uniformFixedGradientFvPatchField
uniformFixedGradientFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: uniformFixedGradientFvPatchField.C:35
Foam::uniformFixedGradientFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: uniformFixedGradientFvPatchField.C:123
Foam::uniformFixedGradientFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: uniformFixedGradientFvPatchField.H:147
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54