1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
25 Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring
28 sixDoFRigidBodyMotionRestraints model. Axial angular spring with moment
29 values drawn from an interpolation table. Linear damping.
32 tabulatedAxialAngularSpring.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef tabulatedAxialAngularSpring_H
37 #define tabulatedAxialAngularSpring_H
39 #include "sixDoFRigidBodyMotionRestraint.H"
42 #include "interpolationTable.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace sixDoFRigidBodyMotionRestraints
52 /*---------------------------------------------------------------------------*\
53 Class tabulatedAxialAngularSpring Declaration
54 \*---------------------------------------------------------------------------*/
56 class tabulatedAxialAngularSpring
58 public sixDoFRigidBodyMotionRestraint
62 //- Reference orientation where there is no moment
65 //- Global unit axis around which the motion is sprung
68 //- Spring moment interpolation table, depending on angleFormat
69 interpolationTable<scalar> moment_;
71 //- Boolean stating whether the angle around the axis needs to
72 // be converted to degrees before asking the
73 // interpolationTable for a moment value
74 bool convertToDegrees_;
76 //- Damping coefficient (Nms/rad)
82 //- Runtime type information
83 TypeName("tabulatedAxialAngularSpring");
88 //- Construct from components
89 tabulatedAxialAngularSpring
91 const dictionary& sDoFRBMRDict
94 //- Construct and return a clone
95 virtual autoPtr<sixDoFRigidBodyMotionRestraint> clone() const
97 return autoPtr<sixDoFRigidBodyMotionRestraint>
99 new tabulatedAxialAngularSpring(*this)
105 virtual ~tabulatedAxialAngularSpring();
110 //- Calculate the restraint position, force and moment.
111 // Global reference frame vectors.
112 virtual void restrain
114 const sixDoFRigidBodyMotion& motion,
115 vector& restraintPosition,
116 vector& restraintForce,
117 vector& restraintMoment
120 //- Update properties from given dictionary
121 virtual bool read(const dictionary& sDoFRBMRCoeff);
124 virtual void write(Ostream&) const;
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 } // End namespace solidBodyMotionFunctions
131 } // End namespace Foam
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 // ************************************************************************* //