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-2019 PCOpt/NTUA
9 Copyright (C) 2013-2019 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{
55
56/*---------------------------------------------------------------------------*\
57 Class displacementMethod Declaration
58\*---------------------------------------------------------------------------*/
61{
62protected:
63
64 // Protected data
67
68 //- IDs of the patches to be moved
69 const labelList& patchIDs_;
73 scalar maxDisplacement_;
74
75
76private:
77
78 // Private Member Functions
79
80 //- No copy construct
82
83 //- No copy assignment
84 void operator=(const displacementMethod&) = delete;
85
86
87public:
88
89 //- Runtime type information
90 TypeName("displacementMethod");
91
92
93 // Declare run-time constructor selection table
96 (
97 autoPtr,
100 (
101 fvMesh& mesh,
102 const labelList& patchIDs
103 ),
104 (mesh, patchIDs)
105 );
106
107
108 // Constructors
109
110 //- Construct from components
112 (
113 fvMesh& mesh,
114 const labelList& patchIDs
115 );
116
117 // Selectors
118
119 //- Return a reference to the selected turbulence model
121 (
122 fvMesh& mesh,
123 const labelList& patchIDs
124 );
125
126
127 //- Destructor
128 virtual ~displacementMethod() = default;
129
130
131 // Member Functions
132
133 //- Set motion filed related to model based on given motion
134 virtual void setMotionField(const pointVectorField& pointMovement) = 0;
135
136 //- Set motion filed related to model based on given motion
137 virtual void setMotionField(const volVectorField& cellMovement) = 0;
138
139 //- Set control field as a vectorField. For methods working with
140 //- parameters (RBF etc)
141 virtual void setControlField(const vectorField& controlField) = 0;
142
143 //- Set control field as a vectorField. For methods working with
144 //- parameters (RBF etc)
145 virtual void setControlField(const scalarField& controlField) = 0;
146
147 //- Bound control field in certain directions etc. For methods working
148 //- with parameters (RBF etc)
149 //- does nothing by default
150 virtual void boundControlField(vectorField& controlField);
151
152 //- Get access to motionSolver
154
155 //- Get max displacement
156 scalar getMaxDisplacement() const;
157
158 //- Update mesh
159 void update();
160};
161
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165} // End namespace Foam
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169#endif
170
171// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
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
Abstract base class for displacement methods, which are a set or wrapper classes allowing to change t...
autoPtr< motionSolver > motionPtr_
virtual void setMotionField(const pointVectorField &pointMovement)=0
Set motion filed related to model based on given motion.
virtual ~displacementMethod()=default
Destructor.
autoPtr< motionSolver > & getMotionSolver()
Get access to motionSolver.
virtual void boundControlField(vectorField &controlField)
virtual void setMotionField(const volVectorField &cellMovement)=0
Set motion filed related to model based on given motion.
virtual void setControlField(const vectorField &controlField)=0
const labelList & patchIDs_
IDs of the patches to be moved.
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
declareRunTimeSelectionTable(autoPtr, displacementMethod, dictionary,(fvMesh &mesh, const labelList &patchIDs),(mesh, patchIDs))
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
dynamicFvMesh & mesh
Namespace for OpenFOAM.
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:73