tabulatedAxialAngularSpring.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) 2011-2013 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring
28 
29 Description
30  sixDoFRigidBodyMotionRestraints model. Axial angular spring with moment
31  values drawn from an interpolation table. Linear damping.
32 
33 SourceFiles
34  tabulatedAxialAngularSpring.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef tabulatedAxialAngularSpring_H
39 #define tabulatedAxialAngularSpring_H
40 
42 #include "point.H"
43 #include "tensor.H"
44 #include "interpolationTable.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 namespace sixDoFRigidBodyMotionRestraints
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class tabulatedAxialAngularSpring Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 :
61 {
62  // Private data
63 
64  //- Reference orientation where there is no moment
65  tensor refQ_;
66 
67  //- Global unit axis around which the motion is sprung
68  vector axis_;
69 
70  //- Spring moment interpolation table, depending on angleFormat
72 
73  //- Boolean stating whether the angle around the axis needs to
74  // be converted to degrees before asking the
75  // interpolationTable for a moment value
76  bool convertToDegrees_;
77 
78  //- Damping coefficient (Nms/rad)
79  scalar damping_;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("tabulatedAxialAngularSpring");
86 
87 
88  // Constructors
89 
90  //- Construct from components
92  (
93  const word& name,
94  const dictionary& sDoFRBMRDict
95  );
96 
97  //- Construct and return a clone
99  {
101  (
102  new tabulatedAxialAngularSpring(*this)
103  );
104  }
105 
106 
107  //- Destructor
109 
111  // Member Functions
112 
113  //- Calculate the restraint position, force and moment.
114  // Global reference frame vectors.
115  virtual void restrain
116  (
117  const sixDoFRigidBodyMotion& motion,
118  vector& restraintPosition,
119  vector& restraintForce,
120  vector& restraintMoment
121  ) const;
122 
123  //- Update properties from given dictionary
124  virtual bool read(const dictionary& sDoFRBMRCoeff);
125 
126  //- Write
127  virtual void write(Ostream&) const;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace solidBodyMotionFunctions
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
tabulatedAxialAngularSpring(const word &name, const dictionary &sDoFRBMRDict)
Construct from components.
Six degree of freedom motion for a rigid body.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Base class for defining restraints for sixDoF motions.
TypeName("tabulatedAxialAngularSpring")
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.
A class for handling words, derived from Foam::string.
Definition: word.H:63
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const word & name() const
Return the name.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual bool read(const dictionary &sDoFRBMRCoeff)
Update properties from given dictionary.
sixDoFRigidBodyMotionRestraints model. Axial angular spring with moment values drawn from an interpol...
Tensor of scalars, i.e. Tensor<scalar>.
Namespace for OpenFOAM.