Loading...
Searching...
No Matches
fieldCoordinateSystemTransform.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-2017 OpenFOAM Foundation
9 Copyright (C) 2015-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::functionObjects::fieldCoordinateSystemTransform
29
30Group
31 grpFieldFunctionObjects
32
33Description
34 Transforms a user-specified selection of fields from global Cartesian
35 coordinates to a local user-specified coordinate system.
36
37 Operands:
38 \table
39 Operand | Type | Location
40 input | {vol,surface}<Type>Field(s) | <time>/inputFields
41 output file | - | -
42 output field | {vol,surface}<Type>Field(s) | <time>/outputFields
43 \endtable
44
45 where \c Type can be one of:
46 \c Scalar, \c Vector, \c SphericalTensor, \c SymmTensor, or \c Tensor.
47
48Usage
49 Minimal example by using \c system/controlDict.functions:
50 \verbatim
51 fieldCoordinateSystemTransformFO
52 {
53 // Mandatory entries
54 type fieldCoordinateSystemTransform;
55 libs (fieldFunctionObjects);
56 fields (<wordList>); // ( U UMean UPrime2Mean );
57 coordinateSystem
58 {
59 origin (0.001 0 0);
60 rotation
61 {
62 type axes;
63 e1 (1 0.15 0);
64 e3 (0 0 -1);
65 }
66 }
67
68 // Inherited entries
69 ...
70 }
71 \endverbatim
72
73 where the entries mean:
74 \table
75 Property | Description | Type | Reqd | Deflt
76 type | Type name: fieldCoordinateSystemTransform | word | yes | -
77 libs | Library name: fieldFunctionObjects | word | yes | -
78 fields | Names of the operand fields | wordList | yes | -
79 coordinateSystem | Local coordinate system | dict | yes | -
80
81 The inherited entries are elaborated in:
82 - \link functionObject.H \endlink
83 - \link coordinateSystem.H \endlink
84
85SourceFiles
86 fieldCoordinateSystemTransform.C
87 fieldCoordinateSystemTransformTemplates.C
88
89\*---------------------------------------------------------------------------*/
90
91#ifndef Foam_functionObjects_fieldCoordinateSystemTransform_H
92#define Foam_functionObjects_fieldCoordinateSystemTransform_H
93
95#include "coordinateSystem.H"
96#include "volFieldSelection.H"
97
98// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99
100namespace Foam
101{
102namespace functionObjects
103{
104
105/*---------------------------------------------------------------------------*\
106 Class fieldCoordinateSystemTransform Declaration
107\*---------------------------------------------------------------------------*/
108
109class fieldCoordinateSystemTransform
110:
112{
113protected:
114
115 // Protected Data
116
117 //- Fields to transform
118 volFieldSelection fieldSet_;
119
120 //- Coordinate system to transform to
121 autoPtr<coordinateSystem> csysPtr_;
122
123 //- Demand-driven non-uniform rotation field (surface fields)
124 // Eg, for cylindrical coordinates
125 mutable autoPtr<surfaceTensorField> rotTensorSurface_;
126
127 //- Demand-driven non-uniform rotation field (volume fields)
128 // Eg, for cylindrical coordinates
129 mutable autoPtr<volTensorField> rotTensorVolume_;
130
131
132 // Protected Member Functions
133
134 //- Return the name of the transformed field
135 word transformFieldName(const word& fieldName) const;
136
137 //- Demand-driven non-uniform rotation field for surface fields
138 const surfaceTensorField& srotTensor() const;
139
140 //- Demand-driven non-uniform rotation field for volume fields
141 const volTensorField& vrotTensor() const;
142
143
144 //- Transform the given field
145 template<class FieldType>
146 void transformField(const FieldType& field);
147
148 //- Transform the given field
149 template<class FieldType, class RotationFieldType>
150 void transformField
151 (
152 const RotationFieldType& rot,
153 const FieldType& field
154 );
155
156 //- Transform the given field if has the specified element type
157 template<class Type>
158 void transform(const word& fieldName);
159
160
161public:
162
163 //- Runtime type information
164 TypeName("fieldCoordinateSystemTransform");
165
166
167 // Constructors
168
169 //- Construct from name, Time and dictionary
170 fieldCoordinateSystemTransform
171 (
172 const word& name,
173 const Time& runTime,
174 const dictionary& dict
175 );
176
177 //- No copy construct
178 fieldCoordinateSystemTransform(const fieldCoordinateSystemTransform&)
179 = delete;
180
181 //- No copy assignment
182 void operator=(const fieldCoordinateSystemTransform&) = delete;
183
184
185 //- Destructor
186 virtual ~fieldCoordinateSystemTransform() = default;
187
188
189 // Member Functions
190
191 //- Read the function-object dictionary
192 virtual bool read(const dictionary& dict);
193
194 //- Execute the function-object operations
195 virtual bool execute();
196
197 //- Write the function-object results
198 virtual bool write();
199};
200
201
202// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203
204} // End namespace functionObjects
205} // End namespace Foam
206
207// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208
209#ifdef NoRepository
211#endif
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215#endif
216
217// ************************************************************************* //
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
rDeltaTY field()
engineTime & runTime
auto & name
void read(Istream &, label &val, const dictionary &)
In-place read with dictionary lookup.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
GeometricField< tensor, fvsPatchField, surfaceMesh > surfaceTensorField
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68