sixDoFRigidBodyMotionSolver.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) 2013-2017 OpenFOAM Foundation
9  Copyright (C) 2019-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::sixDoFRigidBodyMotionSolver
29 
30 Group
31  grpMeshMotionSolvers
32 
33 Description
34  6-DoF solid-body mesh motion solver for an fvMesh.
35 
36  Applies SLERP interpolation of movement as function of distance to
37  the object surface.
38 
39 SourceFiles
40  sixDoFRigidBodyMotionSolver.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef sixDoFRigidBodyMotionSolver_H
45 #define sixDoFRigidBodyMotionSolver_H
46 
48 #include "sixDoFRigidBodyMotion.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class sixDoFRigidBodyMotionSolver Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 :
62 {
63  // Private data
64 
65  //- Six DoF motion object
66  sixDoFRigidBodyMotion motion_;
67 
68  wordRes patches_;
69 
70  //- Patches to integrate forces
71  const labelHashSet patchSet_;
72 
73  //- Inner morphing distance (limit of solid-body region)
74  const scalar di_;
75 
76  //- Outer morphing distance (limit of linear interpolation region)
77  const scalar do_;
78 
79  //- Test-mode in which only the gravitational body-force is applied
80  bool test_;
81 
82  //- Reference density required by the forces object for
83  // incompressible calculations, required if rho == rhoInf
84  scalar rhoInf_;
85 
86  //- Name of density field, optional unless used for an
87  // incompressible simulation, when this needs to be specified
88  // as rhoInf
89  word rhoName_;
90 
91  //- Current interpolation scale (1 at patches, 0 at distance_)
92  pointScalarField scale_;
93 
94  //- Current time index (used for updating)
95  label curTimeIndex_;
96 
97  //- Name of the uniformVectorField for CofG displacement
98  word cOfGdisplacement_;
99 
100 
101  // Private Member Functions
102 
103  //- No copy construct
105  (
107  ) = delete;
108 
109  //- No copy assignment
110  void operator=(const sixDoFRigidBodyMotionSolver&) = delete;
111 
112 
113 public:
114 
115  //- Runtime type information
116  TypeName("sixDoFRigidBodyMotion");
117 
118 
119  // Constructors
120 
121  //- Construct from polyMesh and IOdictionary
123  (
124  const polyMesh&,
125  const IOdictionary& dict
126  );
127 
128 
129  //- Destructor
130  ~sixDoFRigidBodyMotionSolver() = default;
131 
132 
133  // Member Functions
134 
135  //- Return the six DoF motion object
136  const sixDoFRigidBodyMotion& motion() const;
137 
138  //- Return point location obtained from the current motion field
139  virtual tmp<pointField> curPoints() const;
140 
141  //- Solve for motion
142  virtual void solve();
143 
144  //- Write state using stream options
145  virtual bool writeObject
146  (
147  IOstreamOption streamOpt,
148  const bool writeOnProc
149  ) const;
150 
151  //- Read dynamicMeshDict dictionary
152  virtual bool read();
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
Six degree of freedom motion for a rigid body.
dictionary dict
Virtual base class for displacement motion solver.
6-DoF solid-body mesh motion solver for an fvMesh.
A simple container for options an IOstream can normally have.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:50
A class for handling words, derived from Foam::string.
Definition: word.H:63
~sixDoFRigidBodyMotionSolver()=default
Destructor.
TypeName("sixDoFRigidBodyMotion")
Runtime type information.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:53
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write state using stream options.
virtual void solve()
Solve for motion.
virtual bool read()
Read dynamicMeshDict dictionary.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
A class for managing temporary objects.
Definition: HashPtrTable.H:50
const sixDoFRigidBodyMotion & motion() const
Return the six DoF motion object.
Namespace for OpenFOAM.