Loading...
Searching...
No Matches
displacementMethod.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) 2007-2023 PCOpt/NTUA
9 Copyright (C) 2013-2023 FOSS GP
10 Copyright (C) 2019 OpenCFD Ltd.
11-------------------------------------------------------------------------------
12License
13 This file is part of OpenFOAM.
14
15 OpenFOAM is free software: you can redistribute it and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19
20 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27
28
29Class
30 Foam::displacementMethod
31
32Description
33 Abstract base class for displacement methods, which are a set or
34 wrapper classes allowing to change the driving force of mesh motion solvers
35
36SourceFiles
37 displacementMethod.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef displacementMethod_H
42#define displacementMethod_H
43
44#include "fvm.H"
45#include "fvc.H"
48
49#include "motionSolver.H"
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
56/*---------------------------------------------------------------------------*\
57 Class displacementMethod Declaration
58\*---------------------------------------------------------------------------*/
59
60class displacementMethod
62protected:
63
64 // Protected data
65
67
68 //- IDs of the patches to be moved
72
73 scalar maxDisplacement_;
74
75 //- Whether the motion solver prefers a point of a vol field as input
77
78
79private:
80
81 // Private Member Functions
82
83 //- No copy construct
84 displacementMethod(const displacementMethod&) = delete;
85
86 //- No copy assignment
87 void operator=(const displacementMethod&) = delete;
88
89
90public:
91
92 //- Runtime type information
93 TypeName("displacementMethod");
94
95
96 // Declare run-time constructor selection table
97
99 (
100 autoPtr,
101 displacementMethod,
104 fvMesh& mesh,
105 const labelList& patchIDs
106 ),
107 (mesh, patchIDs)
108 );
109
110
111 // Constructors
112
113 //- Construct from components
114 displacementMethod
115 (
116 fvMesh& mesh,
117 const labelList& patchIDs
118 );
119
120 // Selectors
121
122 //- Return a reference to the selected turbulence model
124 (
125 fvMesh& mesh,
126 const labelList& patchIDs
127 );
128
129
130 //- Destructor
131 virtual ~displacementMethod() = default;
132
133
134 // Member Functions
135
136 //- Whether the motion solver prefers a point of a vol field as input
137 virtual bool preferPointField() const;
138
139 //- Set motion filed related to model based on given motion
140 virtual void setMotionField(const pointVectorField& pointMovement) = 0;
141
142 //- Set motion filed related to model based on given motion
143 virtual void setMotionField(const volVectorField& cellMovement) = 0;
144
145 //- Set control field as a vectorField. For methods working with
146 //- parameters (RBF etc)
147 virtual void setControlField(const vectorField& controlField) = 0;
148
149 //- Set control field as a vectorField. For methods working with
150 //- parameters (RBF etc)
151 virtual void setControlField(const scalarField& controlField) = 0;
152
153 //- Bound control field in certain directions etc. For methods working
154 //- with parameters (RBF etc)
155 //- does nothing by default
156 virtual void boundControlField(vectorField& controlField);
157
158 //- Get access to motionSolver
161 //- Get max displacement
162 scalar getMaxDisplacement() const;
163
164 //- Set parametertised patch IDs
165 inline void setPatchIDs(const labelList& patchIDs)
168 }
169
170 //- Update mesh
171 void update();
173
174
175// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176
177} // End namespace Foam
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181#endif
182
183// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
labelList patchIDs
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
bool preferPointField_
Whether the motion solver prefers a point of a vol field as input.
autoPtr< motionSolver > motionPtr_
virtual void setMotionField(const pointVectorField &pointMovement)=0
Set motion filed related to model based on given motion.
virtual ~displacementMethod()=default
Destructor.
void setPatchIDs(const labelList &patchIDs)
Set parametertised patch IDs.
autoPtr< motionSolver > & getMotionSolver()
Get access to motionSolver.
virtual void boundControlField(vectorField &controlField)
Bound control field in certain directions etc. For methods working with parameters (RBF etc) does not...
virtual bool preferPointField() const
Whether the motion solver prefers a point of a vol field as input.
virtual void setMotionField(const volVectorField &cellMovement)=0
Set motion filed related to model based on given motion.
virtual void setControlField(const vectorField &controlField)=0
Set control field as a vectorField. For methods working with parameters (RBF etc).
static autoPtr< displacementMethod > New(fvMesh &mesh, const labelList &patchIDs)
Return a reference to the selected turbulence model.
scalar getMaxDisplacement() const
Get max displacement.
TypeName("displacementMethod")
Runtime type information.
virtual void setControlField(const scalarField &controlField)=0
Set control field as a vectorField. For methods working with parameters (RBF etc).
declareRunTimeSelectionTable(autoPtr, displacementMethod, dictionary,(fvMesh &mesh, const labelList &patchIDs),(mesh, patchIDs))
labelList patchIDs_
IDs of the patches to be moved.
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
dynamicFvMesh & mesh
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
List< label > labelList
A List of labels.
Definition List.H:62
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68