rigidBodyMeshMotionSolver.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) 2016-2017 OpenFOAM Foundation
9 Copyright (C) 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::rigidBodyMeshMotionSolver
29
30Description
31 Rigid-body mesh motion solver for fvMesh.
32
33 Applies septernion interpolation of movement as function of distance to the
34 object surface.
35
36SourceFiles
37 rigidBodyMeshMotionSolver.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef rigidBodyMeshMotionSolver_H
42#define rigidBodyMeshMotionSolver_H
43
45#include "rigidBodyMotion.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class rigidBodyMeshMotionSolver Declaration
54\*---------------------------------------------------------------------------*/
57:
58 public motionSolver
59{
60 //- Class containing the patches and point motion weighting for each body
61 class bodyMesh
62 {
63 //- Name of the body
64 const word name_;
65
66 //- ID of the body in the RBD::rigidBodyMotion
67 const label bodyID_;
68
69 //- List of mesh patches associated with this body
70 const wordRes patches_;
71
72 //- Patches to integrate forces
73 const labelHashSet patchSet_;
74
75
76 public:
77
78 friend class rigidBodyMeshMotionSolver;
79
80 bodyMesh
81 (
82 const polyMesh& mesh,
83 const word& name,
84 const label bodyID,
85 const dictionary& dict
86 );
87 };
88
89
90 // Private data
91
92 //- Rigid-body model
94
95 //- List of the bodyMeshes containing the patches and point motion
96 // weighting for each body
97 PtrList<bodyMesh> bodyMeshes_;
98
99 //- Test-mode in which only the gravitational body-force is applied
100 bool test_;
101
102 //- Reference density required by the forces object for
103 // incompressible calculations, required if rho == rhoInf
104 scalar rhoInf_;
105
106 //- Name of density field, optional unless used for an
107 // incompressible simulation, when this needs to be specified
108 // as rhoInf
109 word rhoName_;
110
111 //- Current time index (used for updating)
112 label curTimeIndex_;
113
114 autoPtr<motionSolver> meshSolverPtr_;
115
116 displacementMotionSolver& meshSolver_;
117
118
119 // Private Member Functions
120
121 //- No copy construct
123
124 //- No copy assignment
125 void operator=(const rigidBodyMeshMotionSolver&) = delete;
126
127
128public:
129
130 //- Runtime type information
131 TypeName("rigidBodyMotionSolver");
132
133
134 // Constructors
135
136 //- Construct from polyMesh and IOdictionary
138 (
139 const polyMesh&,
140 const IOdictionary& dict
141 );
142
143
144 //- Destructor
145 ~rigidBodyMeshMotionSolver() = default;
146
147
148 // Member Functions
149
150 //- Return point location obtained from the current motion field
151 virtual tmp<pointField> curPoints() const;
152
153 //- Solve for motion
154 virtual void solve();
155
156 //- Write state using stream options
157 virtual bool writeObject
158 (
159 IOstreamOption streamOpt,
160 const bool valid
161 ) const;
162
163 //- Read dynamicMeshDict dictionary
164 virtual bool read();
165
166 //- Update local data for geometry changes
167 virtual void movePoints(const pointField&);
168
169 //- Update local data for topology changes
170 virtual void updateMesh(const mapPolyMesh&);
171};
172
173
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
176} // End namespace Foam
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180#endif
181
182// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
The IOstreamOption is a simple container for options an IOstream can normally have.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Six degree of freedom motion for a rigid body.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
const word & name() const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Virtual base class for displacement motion solver.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Virtual base class for mesh motion solver.
Definition: motionSolver.H:61
const polyMesh & mesh() const
Return reference to mesh.
Definition: motionSolver.H:144
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Rigid-body mesh motion solver for fvMesh.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
TypeName("rigidBodyMotionSolver")
Runtime type information.
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write state using stream options.
~rigidBodyMeshMotionSolver()=default
Destructor.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
virtual void solve()
Solve for motion.
virtual bool read()
Read dynamicMeshDict dictionary.
A class for managing temporary objects.
Definition: tmp.H:65
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:54
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73