scaledFixedValueFvPatchField.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) 2019 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::scaledFixedValueFvPatchField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 This condition applies a scalar multiplier to the value of another
34 boundary condition.
35
36Usage
37 \table
38 Property | Description | Required | Default value
39 scale | Time varying scale | yes |
40 patch | patchField providing the raw patch value | yes |
41 \endtable
42
43 Example of the boundary condition specification to scale a reference
44 velocity of (15 0 0) supplied as a fixedValue by a table of values
45 that ramps the scale from 0 to 1 over 1 second:
46 \verbatim
47 <patchName>
48 {
49 type scaledFixedValue;
50
51 scale table
52 (
53 ( 0 0)
54 ( 1.0 1.0)
55 (100.0 1.0)
56 );
57
58 refValue
59 {
60 type fixedValue;
61 value uniform (15 0 0);
62 }
63 }
64 \endverbatim
65
66SourceFiles
67 scaledFixedValueFvPatchField.C
68
69SeeAlso
70 Foam::PatchFunction1
71
72\*---------------------------------------------------------------------------*/
73
74#ifndef scaledFixedValueFvPatchField_H
75#define scaledFixedValueFvPatchField_H
76
78#include "PatchFunction1.H"
79
80// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81
82namespace Foam
83{
84
85/*---------------------------------------------------------------------------*\
86 Class scaledFixedValueFvPatchField Declaration
87\*---------------------------------------------------------------------------*/
88
89template<class Type>
90class scaledFixedValueFvPatchField
91:
92 public fixedValueFvPatchField<Type>
93{
94protected:
95
96 // Protected data
97
98 //- Scalar scale factor
99 autoPtr<PatchFunction1<scalar>> scalePtr_;
100
101 //- Condition to supply the reference value
102 tmp<fvPatchField<Type>> refValuePtr_;
103
105public:
106
107 //- Runtime type information
108 TypeName("scaledFixedValue");
109
110
111 // Constructors
112
113 //- Construct from patch and internal field
115 (
116 const fvPatch&,
118 );
119
120 //- Construct from patch, internal field and dictionary
123 const fvPatch&,
125 const dictionary&
126 );
127
128 //- Construct by mapping given a scaledFixedValueFvPatchField onto
129 //- a new patch
131 (
133 const fvPatch&,
135 const fvPatchFieldMapper&
136 );
137
138 //- Construct as copy
140
141 //- Construct and return a clone
142 virtual tmp<fvPatchField<Type>> clone() const
143 {
145 (
147 );
148 }
149
150 //- Construct as copy setting internal field reference
152 (
155 );
157 //- Construct and return a clone setting internal field reference
159 (
161 ) const
162 {
164 (
165 new scaledFixedValueFvPatchField(*this, iF)
166 );
167 }
168
169
170 // Member functions
171
172 // Access
173
174 //- Return the reference value condition
175 const fvPatchField<Type>& refValue() const
176 {
177 return refValuePtr_();
178 }
179
180
181 // Mapping functions
182
183 //- Map (and resize as needed) from self given a mapping object
184 virtual void autoMap(const fvPatchFieldMapper& m);
185
186 //- Reverse map the given fvPatchField onto this fvPatchField
187 virtual void rmap
188 (
190 const labelList& addr
191 );
192
193
194 //- Update the coefficients associated with the patch field
195 virtual void updateCoeffs();
196
197 //- Write
198 virtual void write(Ostream&) const;
199
200
201 // Force an assignment irrespective of form of patch
202
203 virtual void operator==(const fvPatchField<Type>& ptf);
204 virtual void operator==(const Field<Type>& tf);
205 virtual void operator==(const Type& t);
206};
207
208
209// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210
211} // End namespace Foam
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215#ifdef NoRepository
217#endif
218
219// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220
221#endif
222
223// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type.
Definition: Field.H:82
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This condition applies a scalar multiplier to the value of another boundary condition.
TypeName("scaledFixedValue")
Runtime type information.
tmp< fvPatchField< Type > > refValuePtr_
Condition to supply the reference value.
autoPtr< PatchFunction1< scalar > > scalePtr_
Scalar scale factor.
const fvPatchField< Type > & refValue() const
Return the reference value condition.
virtual void rmap(const fvPatchField< Type > &ptf, const labelList &addr)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void autoMap(const fvPatchFieldMapper &m)
Map (and resize as needed) from self given a mapping object.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
virtual void operator==(const fvPatchField< Type > &ptf)
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Construct and return a clone setting internal field reference.
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73