axialAngularSpring.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) 2011-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::sixDoFRigidBodyMotionRestraints::axialAngularSpring
26 
27 Description
28  Axial angular spring with moment values obtained from a Function1 and
29  linear damping.
30 
31 SourceFiles
32  axialAngularSpring.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef axialAngularSpring_H
37 #define axialAngularSpring_H
38 
40 #include "point.H"
41 #include "tensor.H"
42 #include "Table.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 namespace sixDoFRigidBodyMotionRestraints
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class axialAngularSpring Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
59 {
60  // Private Data
61 
62  //- Reference orientation where there is no moment
63  tensor refQ_;
64 
65  //- Global unit axis around which the motion is sprung
66  vector axis_;
67 
68  //- Spring moment as a function of angle
70 
71  //- Damping coefficient (Nms/rad)
72  scalar damping_;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("axialAngularSpring");
79 
80 
81  // Constructors
82 
83  //- Construct from components
85  (
86  const word& name,
87  const dictionary& sDoFRBMRDict
88  );
89 
90  //- Construct and return a clone
92  {
94  (
95  new axialAngularSpring(*this)
96  );
97  }
98 
99 
100  //- Destructor
101  virtual ~axialAngularSpring();
102 
103 
104  // Member Functions
105 
106  //- Calculate the restraint position, force and moment.
107  // Global reference frame vectors.
108  virtual void restrain
109  (
110  const sixDoFRigidBodyMotion& motion,
111  vector& restraintPosition,
112  vector& restraintForce,
113  vector& restraintMoment
114  ) const;
115 
116  //- Update properties from given dictionary
117  virtual bool read(const dictionary& sDoFRBMRCoeff);
118 
119  //- Write
120  virtual void write(Ostream&) const;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace solidBodyMotionFunctions
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Base class for defining restraints for sixDoF motions.
const word & name() const
Return the name.
Axial angular spring with moment values obtained from a Function1 and linear damping.
TypeName("axialAngularSpring")
Runtime type information.
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const
Calculate the restraint position, force and moment.
virtual autoPtr< sixDoFRigidBodyMotionRestraint > clone() const
Construct and return a clone.
axialAngularSpring(const word &name, const dictionary &sDoFRBMRDict)
Construct from components.
virtual bool read(const dictionary &sDoFRBMRCoeff)
Update properties from given dictionary.
Six degree of freedom motion for a rigid body.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.