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 -------------------------------------------------------------------------------
12 License
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 
29 Class
30  Foam::displacementMethod
31 
32 Description
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 
36 SourceFiles
37  displacementMethod.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef displacementMethod_H
42 #define displacementMethod_H
43 
44 #include "fvm.H"
45 #include "fvc.H"
46 #include "runTimeSelectionTables.H"
48 
49 #include "motionSolver.H"
50 #include "volPointInterpolation.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class displacementMethod Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 {
62 protected:
63 
64  // Protected data
65 
66  fvMesh& mesh_;
67 
68  //- IDs of the patches to be moved
69  const labelList& patchIDs_;
70 
72 
73  scalar maxDisplacement_;
74 
75 
76 private:
77 
78  // Private Member Functions
79 
80  //- No copy construct
81  displacementMethod(const displacementMethod&) = delete;
82 
83  //- No copy assignment
84  void operator=(const displacementMethod&) = delete;
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("displacementMethod");
91 
92 
93  // Declare run-time constructor selection table
94 
96  (
97  autoPtr,
99  dictionary,
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 // ************************************************************************* //
Foam::displacementMethod::setControlField
virtual void setControlField(const vectorField &controlField)=0
Foam::displacementMethod::setMotionField
virtual void setMotionField(const pointVectorField &pointMovement)=0
Set motion filed related to model based on given motion.
motionSolver.H
Foam::displacementMethod
Abstract base class for displacement methods, which are a set or wrapper classes allowing to change t...
Definition: displacementMethod.H:59
Foam::displacementMethod::patchIDs_
const labelList & patchIDs_
IDs of the patches to be moved.
Definition: displacementMethod.H:68
Foam::displacementMethod::maxDisplacement_
scalar maxDisplacement_
Definition: displacementMethod.H:72
Foam::displacementMethod::boundControlField
virtual void boundControlField(vectorField &controlField)
Definition: displacementMethod.C:100
Foam::displacementMethod::getMaxDisplacement
scalar getMaxDisplacement() const
Get max displacement.
Definition: displacementMethod.C:112
Foam::Field< vector >
Foam::displacementMethod::getMotionSolver
autoPtr< motionSolver > & getMotionSolver()
Get access to motionSolver.
Definition: displacementMethod.C:106
Foam::displacementMethod::motionPtr_
autoPtr< motionSolver > motionPtr_
Definition: displacementMethod.H:70
fvm.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::displacementMethod::TypeName
TypeName("displacementMethod")
Runtime type information.
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
volPointInterpolation.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::displacementMethod::~displacementMethod
virtual ~displacementMethod()=default
Destructor.
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::displacementMethod::update
void update()
Update mesh.
Definition: displacementMethod.C:118
Foam::List< label >
fvc.H
Foam::displacementMethod::New
static autoPtr< displacementMethod > New(fvMesh &mesh, const labelList &patchIDs)
Return a reference to the selected turbulence model.
Definition: displacementMethod.C:59
Foam::displacementMethod::mesh_
fvMesh & mesh_
Definition: displacementMethod.H:65
Foam::GeometricField< vector, pointPatchField, pointMesh >
Foam::displacementMethod::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, displacementMethod, dictionary,(fvMesh &mesh, const labelList &patchIDs),(mesh, patchIDs))