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 | Copyright (C) 2013-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::uniformFixedGradientFvPatchField
26 
27 Group
28  grpGenericBoundaryConditions
29 
30 Description
31  This boundary condition provides a uniform fixed gradient condition.
32 
33  \heading Patch usage
34 
35  \table
36  Property | Description | Required | Default value
37  uniformGradient | uniform gradient | yes |
38  \endtable
39 
40  Example of the boundary condition specification:
41  \verbatim
42  myPatch
43  {
44  type uniformFixedGradient;
45  uniformGradient constant 0.2;
46  }
47  \endverbatim
48 
49 Note
50  The uniformGradient entry is a DataEntry type, able to describe time
51  varying functions. The example above gives the usage for supplying a
52  constant value.
53 
54 SeeAlso
55  Foam::DataEntry
56  Foam::fixedGradientFvPatchField
57 
58 SourceFiles
59  uniformFixedGradientFvPatchField.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef uniformFixedGradientFvPatchField_H
64 #define uniformFixedGradientFvPatchField_H
65 
67 #include "DataEntry.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class uniformFixedGradientFvPatchField Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 template<class Type>
79 class uniformFixedGradientFvPatchField
80 :
81  public fixedGradientFvPatchField<Type>
82 {
83  // Private data
84 
85  //- Gradient
86  autoPtr<DataEntry<Type> > uniformGradient_;
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("uniformFixedGradient");
93 
94 
95  // Constructors
96 
97  //- Construct from patch and internal field
99  (
100  const fvPatch&,
102  );
103 
104  //- Construct from patch and internal field and patch field
106  (
107  const fvPatch&,
109  const Field<Type>& fld
110  );
111 
112  //- Construct from patch, internal field and dictionary
114  (
115  const fvPatch&,
117  const dictionary&
118  );
119 
120  //- Construct by mapping given uniformFixedGradientFvPatchField
121  // onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Construct as copy
132  (
134  );
135 
136  //- Construct and return a clone
137  virtual tmp<fvPatchField<Type> > clone() const
138  {
139  return tmp<fvPatchField<Type> >
140  (
142  );
143  }
144 
145  //- Construct as copy setting internal field reference
147  (
150  );
151 
152  //- Construct and return a clone setting internal field reference
153  virtual tmp<fvPatchField<Type> > clone
154  (
156  ) const
157  {
158  return tmp<fvPatchField<Type> >
159  (
161  );
162  }
163 
164 
165  // Member functions
166 
167  //- Update the coefficients associated with the patch field
168  virtual void updateCoeffs();
169 
170  //- Write
171  virtual void write(Ostream&) const;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::uniformFixedGradientFvPatchField::write
virtual void write(Ostream &) const
Write.
Definition: uniformFixedGradientFvPatchField.C:131
Foam::uniformFixedGradientFvPatchField::TypeName
TypeName("uniformFixedGradient")
Runtime type information.
DataEntry.H
Foam::Field< Type >
uniformFixedGradientFvPatchField.C
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::uniformFixedGradientFvPatchField::uniformGradient_
autoPtr< DataEntry< Type > > uniformGradient_
Gradient.
Definition: uniformFixedGradientFvPatchField.H:95
fld
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
fixedGradientFvPatchFields.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::uniformFixedGradientFvPatchField
This boundary condition provides a uniform fixed gradient condition.
Definition: uniformFixedGradientFvPatchField.H:88
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::fixedGradientFvPatchField
This boundary condition supplies a fixed gradient condition, such that the patch values are calculate...
Definition: fixedGradientFvPatchField.H:107
Foam::uniformFixedGradientFvPatchField::uniformFixedGradientFvPatchField
uniformFixedGradientFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: uniformFixedGradientFvPatchField.C:32
Foam::uniformFixedGradientFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: uniformFixedGradientFvPatchField.C:116
Foam::uniformFixedGradientFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: uniformFixedGradientFvPatchField.H:146
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51