sixDoFRigidBodyMotionSolver.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::sixDoFRigidBodyMotionSolver
26 
27 Description
28  6-DoF solid-body mesh motion solver for an fvMesh.
29 
30  Applies SLERP interpolation of movement as function of distance to
31  the object surface.
32 
33 SourceFiles
34  sixDoFRigidBodyMotionSolver.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef sixDoFRigidBodyMotionSolver_H
39 #define sixDoFRigidBodyMotionSolver_H
40 
42 #include "sixDoFRigidBodyMotion.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class sixDoFRigidBodyMotionSolver Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
57 {
58  // Private Data
59 
60  wordReList patches_;
61 
62  //- Patches to integrate forces
63  const labelHashSet patchSet_;
64 
65  //- Inner morphing distance (limit of solid-body region)
66  const scalar di_;
67 
68  //- Outer morphing distance (limit of linear interpolation region)
69  const scalar do_;
70 
71  //- Switch for test-mode in which only the
72  // gravitational body-force is applied
73  Switch test_;
74 
75  //- Reference density required by the forces object for
76  // incompressible calculations, required if rho == rhoInf
77  scalar rhoInf_;
78 
79  //- Name of density field, optional unless used for an
80  // incompressible simulation, when this needs to be specified
81  // as rhoInf
82  word rhoName_;
83 
84  //- Optional acceleration due to gravity
86 
87  //- Current interpolation scale (1 at patches, 0 at distance_)
88  pointScalarField scale_;
89 
90  //- Current time index (used for updating)
91  label curTimeIndex_;
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("sixDoFRigidBodyMotion");
98 
99 
100  // Constructors
101 
102  //- Construct from polyMesh and dictionary
104  (
105  const word& name,
106  const polyMesh&,
107  const dictionary& dict
108  );
109 
110  //- Disallow default bitwise copy construction
112  (
114  ) = delete;
115 
116 
117  //- Destructor
119 
120 
121  // Member Functions
122 
123  //- Return the six DoF motion object
124  const sixDoFRigidBodyMotion& motion() const;
125 
126  //- Return point location obtained from the current motion field
127  virtual tmp<pointField> curPoints() const;
128 
129  //- Solve for motion
130  virtual void solve();
131 
132  //- Write motion state information for restart
133  virtual bool write() const;
134 
135 
136  // Member Operators
137 
138  //- Disallow default bitwise assignment
139  void operator=(const sixDoFRigidBodyMotionSolver&) = delete;
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Virtual base class for displacement motion solver.
const word & name() const
Return name.
Definition: motionSolver.H:121
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
6-DoF solid-body mesh motion solver for an fvMesh.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
void operator=(const sixDoFRigidBodyMotionSolver &)=delete
Disallow default bitwise assignment.
sixDoFRigidBodyMotionSolver(const word &name, const polyMesh &, const dictionary &dict)
Construct from polyMesh and dictionary.
const sixDoFRigidBodyMotion & motion() const
Return the six DoF motion object.
TypeName("sixDoFRigidBodyMotion")
Runtime type information.
virtual bool write() const
Write motion state information for restart.
virtual void solve()
Solve for motion.
Six degree of freedom motion for a rigid body.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dictionary dict