Loading...
Searching...
No Matches
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 refValue | 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>
91:
92 public fixedValueFvPatchField<Type>
93{
94protected:
95
96 // Protected data
97
98 //- Scalar scale factor
99 autoPtr<PatchFunction1<scalar>> scalePtr_;
101 //- Condition to supply the reference value
103
104
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
122 (
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 as copy setting internal field reference
143 (
146 );
147
148 //- Return a clone
149 virtual tmp<fvPatchField<Type>> clone() const
150 {
151 return fvPatchField<Type>::Clone(*this);
152 }
153
154 //- Clone with an internal field reference
156 (
158 ) const
159 {
160 return fvPatchField<Type>::Clone(*this, iF);
161 }
162
163
164 // Member functions
165
166 // Access
167
168 //- Return the reference value condition
169 const fvPatchField<Type>& refValue() const
170 {
171 return refValuePtr_();
172 }
173
174
175 // Mapping functions
176
177 //- Map (and resize as needed) from self given a mapping object
178 virtual void autoMap(const fvPatchFieldMapper& m);
179
180 //- Reverse map the given fvPatchField onto this fvPatchField
181 virtual void rmap
182 (
183 const fvPatchField<Type>& ptf,
184 const labelList& addr
185 );
186
187
188 //- Update the coefficients associated with the patch field
189 virtual void updateCoeffs();
190
191 //- Write
192 virtual void write(Ostream&) const;
193
194
195 // Member Operators
196
197 // Force an assignment, applying scaling to refValue
198
199 virtual void operator==(const fvPatchField<Type>&);
200 virtual void operator==(const Field<Type>&);
201 virtual void operator==(const Type&);
202
203 // Prevent automatic comparison rewriting (c++20)
204 bool operator!=(const fvPatchField<Type>&) const = delete;
205 bool operator!=(const Field<Type>&) const = delete;
206 bool operator!=(const Type&) const = delete;
207};
208
209
210// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211
212} // End namespace Foam
213
214// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215
216#ifdef NoRepository
218#endif
219
220// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221
222#endif
223
224// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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...
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
fvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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.
virtual void operator==(const fvPatchField< Type > &)
scaledFixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
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.
bool operator!=(const fvPatchField< Type > &) const =delete
bool operator!=(const Field< Type > &) const =delete
bool operator!=(const Type &) const =delete
virtual tmp< fvPatchField< Type > > clone() const
Return a clone.
virtual tmp< fvPatchField< Type > > clone(const DimensionedField< Type, volMesh > &iF) const
Clone with an internal field reference.
A class for managing temporary objects.
Definition tmp.H:75
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68