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 -------------------------------------------------------------------------------
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::uniformFixedGradientFvPatchField
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 value
38  uniformGradient | uniform gradient | yes |
39  \endtable
40 
41  Example of the boundary condition specification:
42  \verbatim
43  <patchName>
44  {
45  type uniformFixedGradient;
46  uniformGradient constant 0.2;
47  }
48  \endverbatim
49 
50 Note
51  The uniformGradient entry is a Function1 type, able to describe time
52  varying functions. The example above gives the usage for supplying a
53  constant value.
54 
55 See also
56  Foam::Function1Types
57  Foam::fixedGradientFvPatchField
58 
59 SourceFiles
60  uniformFixedGradientFvPatchField.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef uniformFixedGradientFvPatchField_H
65 #define uniformFixedGradientFvPatchField_H
66 
68 #include "Function1.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class uniformFixedGradientFvPatchField Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 template<class Type>
80 class uniformFixedGradientFvPatchField
81 :
82  public fixedGradientFvPatchField<Type>
83 {
84  // Private data
85 
86  //- Gradient
87  autoPtr<Function1<Type>> uniformGradient_;
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("uniformFixedGradient");
94 
95 
96  // Constructors
97 
98  //- Construct from patch and internal field
100  (
101  const fvPatch&,
103  );
104 
105  //- Construct from patch and internal field and patch field
107  (
108  const fvPatch&,
110  const Field<Type>& fld
111  );
112 
113  //- Construct from patch, internal field and dictionary
115  (
116  const fvPatch&,
118  const dictionary&
119  );
120 
121  //- Construct by mapping given uniformFixedGradientFvPatchField
122  // 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&) 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:59
Function1.H
Foam::uniformFixedGradientFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: uniformFixedGradientFvPatchField.C:135
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:63
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:121
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:89
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::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:120
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