uniformFixedValueFvPatchField.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2018-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::uniformFixedValueFvPatchField
29 
30 Group
31  grpGenericBoundaryConditions
32 
33 Description
34  This boundary condition provides a uniform fixed value condition.
35 
36 Usage
37  \table
38  Property | Description | Required | Default
39  uniformValue | uniform value | yes |
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 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::fixedValueFvPatchField
59 
60 SourceFiles
61  uniformFixedValueFvPatchField.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef uniformFixedValueFvPatchField_H
66 #define uniformFixedValueFvPatchField_H
67 
69 #include "PatchFunction1.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class uniformFixedValueFvPatchField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 template<class Type>
81 class uniformFixedValueFvPatchField
82 :
83  public fixedValueFvPatchField<Type>
84 {
85  // Private Data
86 
87  //- Value
88  autoPtr<PatchFunction1<Type>> uniformValue_;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("uniformFixedValue");
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  // Mapping functions
169 
170  //- Map (and resize as needed) from self given a mapping object
171  virtual void autoMap
172  (
173  const fvPatchFieldMapper&
174  );
175 
176  //- Reverse map the given fvPatchField onto this fvPatchField
177  virtual void rmap
178  (
179  const fvPatchField<Type>&,
180  const labelList&
181  );
182 
183 
184  //- Update the coefficients associated with the patch field
185  virtual void updateCoeffs();
186 
187  //- Write
188  virtual void write(Ostream& os) const;
189 };
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #ifdef NoRepository
200 #endif
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:51
Foam::uniformFixedValueFvPatchField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: uniformFixedValueFvPatchField.C:135
Foam::uniformFixedValueFvPatchField::rmap
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: uniformFixedValueFvPatchField.C:152
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::uniformFixedValueFvPatchField::uniformFixedValueFvPatchField
uniformFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: uniformFixedValueFvPatchField.C:35
PatchFunction1.H
uniformFixedValueFvPatchField.C
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
Foam::uniformFixedValueFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: uniformFixedValueFvPatchField.C:167
Foam::uniformFixedValueFvPatchField::write
virtual void write(Ostream &os) const
Write.
Definition: uniformFixedValueFvPatchField.C:181
Foam::uniformFixedValueFvPatchField::TypeName
TypeName("uniformFixedValue")
Runtime type information.
Foam::Field
Generic templated field type.
Definition: Field.H:63
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
Foam::uniformFixedValueFvPatchField
This boundary condition provides a uniform fixed value condition.
Definition: uniformFixedValueFvPatchField.H:90
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< label >
fixedValueFvPatchFields.H
Foam::uniformFixedValueFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: uniformFixedValueFvPatchField.H:147
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::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54